Bump for 3.6-28
[LibreOffice.git] / configure.in
blob18f449d2d500ef2e5670d623d67a43a9b161d99e
1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil -*-
2 dnl configure.in serves as input for the GNU autoconf package
3 dnl in order to create a configure script.
5 AC_INIT([LibreOffice],[3.6],[],[],[http://documentfoundation.org/])
6 AC_PREREQ([2.59])
8 save_CC=$CC
9 save_CXX=$CXX
11 BUILD_TYPE="LibO"
12 SCPDEFS=""
13 GIT_REPO_NAMES=""
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 if test -n "$SOLARENV" ; then
53     AC_MSG_ERROR([You have sourced config_host.mk in this shell.  This may lead to trouble, please run in a fresh (login) shell.])
56 echo "********************************************************************"
57 echo "*"
58 echo "*   Running ${PACKAGE_NAME} build configuration."
59 echo "*"
60 echo "********************************************************************"
61 echo ""
63 dnl ===================================================================
64 dnl checks build and host OSes
65 dnl do this before argument processing to allow for platform dependent defaults
66 dnl ===================================================================
67 AC_CANONICAL_HOST
69 if test "$cross_compiling" = "yes"; then
70     CROSS_COMPILING=YES
71 else
72     CROSS_COMPILING=
73     BUILD_TYPE="$BUILD_TYPE NATIVE"
75 AC_SUBST(CROSS_COMPILING)
77 AC_PROG_EGREP
78 # AC_PROG_EGREP doesn't set GREP on all systems as well
79 AC_PATH_PROG(GREP, grep)
81 if test "$build_os" = "cygwin"; then
82     EXEEXT_FOR_BUILD=.exe
83     SRC_ROOT=`pwd`
84     PathFormat "$SRC_ROOT"
85     SRC_ROOT="$formatted_path"
86     x_Cygwin=
87 else
88     EXEEXT_FOR_BUILD=
89     SRC_ROOT=`pwd`
90     x_Cygwin=[\#]
93 AC_SUBST(SRC_ROOT)
94 AC_SUBST(EXEEXT_FOR_BUILD)
95 AC_SUBST(x_Cygwin)
97 cat /dev/null > warn
99 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
100     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
103 # need sed in os checks...
104 AC_PATH_PROGS(SED, sed)
105 if test -z "$SED"; then
106     AC_MSG_ERROR([install sed to run this script])
109 dnl ===================================================================
110 dnl When building for Android the --with-android-ndk is mandatory
111 dnl ===================================================================
112 ANDROID_NDK_HOME=
113 if test -n "$with_android_ndk"; then
114    ANDROID_NDK_HOME=$with_android_ndk
115    # Set up a lot of pre-canned defaults
116    # What if the NDK at some point starts including several toolchains for different
117    # gcc versions (like some 3rd-party improved NDK builds already do)?
118    # Then the use of a wildcard below will break.
119    ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-linux*/prebuilt/*/bin`
121    test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-arm
122    test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ar
123    test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-nm
124    test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-objdump
125    test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ranlib
126    test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-strip
128    ANDROIDCFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8 --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-arm -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a"
130    test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-gcc $ANDROIDCFLAGS"
131    test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-g++ $ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include"
133 AC_SUBST(ANDROID_NDK_HOME)
135 dnl ===================================================================
136 dnl Also --with-android-sdk is mandatory
137 dnl ===================================================================
138 ANDROID_SDK_HOME=
139 if test -n "$with_android_sdk"; then
140    ANDROID_SDK_HOME=$with_android_sdk
141    PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
143 AC_SUBST(ANDROID_SDK_HOME)
145 dnl ===================================================================
146 dnl The following is a list of supported systems.
147 dnl Sequential to keep the logic very simple
148 dnl These values may be checked and reset later.
149 dnl ===================================================================
150 #defaults unless the os test overrides this:
151 test_randr=yes
152 test_xrender=yes
153 test_cups=yes
154 test_fontconfig=yes
155 test_cairo=yes
157 # Default values, as such probably valid just for Linux, set
158 # differently below just for Mac OS X,but at least better than
159 # hardcoding these as we used to do. Much of this is duplicated also
160 # in solenv for old build system and for gbuild, ideally we should
161 # perhaps define stuff like this only here in configure.in?
163 LINKFLAGSSHL="-shared"
164 PICSWITCH="-fpic"
165 DLLPOST=".so"
167 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
169 case "$host_os" in
171 solaris*)
172     test_gtk=yes
173     build_gstreamer=yes
174     test_tde=yes
175     test_kde=yes
176     test_freetype=yes
177     test_gstreamer=yes
178     _os=SunOS
180     dnl ===========================================================
181     dnl Check whether we're using Solaris 10 - SPARC or Intel.
182     dnl ===========================================================
183     AC_MSG_CHECKING([the Solaris operating system release])
184     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
185     if test "$_os_release" -lt "10"; then
186         AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
187     else
188         AC_MSG_RESULT([ok ($_os_release)])
189     fi
191     dnl Check whether we're using a SPARC or i386 processor
192     AC_MSG_CHECKING([the processor type])
193     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
194         AC_MSG_RESULT([ok ($host_cpu)])
195     else
196         AC_MSG_ERROR([only SPARC and i386 processors are supported])
197     fi
198     ;;
200 linux-gnu*|k*bsd*-gnu*)
201     test_gtk=yes
202     build_gstreamer=yes
203     test_tde=yes
204     test_kde=yes
205     test_kde4=yes
206     test_freetype=yes
207     test_unix_quickstarter=yes
208     _os=Linux
209     ;;
211 gnu)
212     test_randr=no
213     test_xrender=no
214     _os=GNU
215      ;;
217 cygwin*|interix*|mingw32*)
219     # When building on Windows normally with MSVC under Cygwin,
220     # configure thinks that the host platform (the platform the
221     # built code will run on) is Cygwin, even if it obviously is
222     # Windows, which in Autoconf terminology is called
223     # "mingw32". (Which is misleading as MinGW is the name of the
224     # tool-chain, not an operating system.)
226     # Somewhat confusing, yes. But this configure script doesn't
227     # look at $host etc that much, it mostly uses its own $_os
228     # variable, set here in this case statement.
230     # When cross-compiling to Windows from Unix, the host platform
231     # is "mingw32" (because in that case it is the MinGW
232     # tool-chain that is used).
234     test_cups=no
235     test_randr=no
236     test_xrender=no
237     test_freetype=no
238     test_fontconfig=no
239     _os=WINNT
240     use_shl_version="TRUE"
241     DYNAMIC_CRT="TRUE"
242     # If the host OS matches "mingw32*", that means we are using the
243     # MinGW cross-compiler, because we don't see the point in building
244     # LibreOffice using MinGW on Windows. If you want to build on
245     # Windows, use MSVC. If you want to use MinGW, surely you want to
246     # cross-compile (from Linux or some other Unix).
248     case "$host_os" in
249     mingw32*)
250         WITH_MINGW=yes
251         if test -z "$CC"; then
252             CC="$host_cpu-$host_vendor-$host_os-gcc"
253         fi
254         if test -z "$CXX"; then
255             CXX="$host_cpu-$host_vendor-$host_os-g++"
256         fi
257         ;;
258     esac
259     ;;
261 darwin*) # Mac OS X or iOS
262     test_gtk=yes
263     test_randr=no
264     test_xrender=no
265     test_freetype=no
266     test_fontconfig=no
267     if test "$host_cpu" = "arm"; then
268         _os=iOS
269         test_gtk=no
270         test_cups=no
271     else
272         _os=Darwin
273     fi
274     enable_systray=no
275     # See comment above the case "$host_os"
276     LINKFLAGSSHL="-dynamiclib -single_module"
278     # -fPIC is default
279     PICSWITCH=""
281     DLLPOST=".dylib"
283     # -undefined error is the default
284     LINKFLAGSNOUNDEFS=""
287 freebsd*)
288     test_gtk=yes
289     build_gstreamer=yes
290     test_tde=yes
291     test_kde=yes
292     test_kde4=yes
293     test_freetype=yes
294     AC_MSG_CHECKING([the FreeBSD operating system release])
295     if test -n "$with_os_version"; then
296         OSVERSION="$with_os_version"
297     else
298         OSVERSION=`/sbin/sysctl -n kern.osreldate`
299     fi
300     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
301     AC_MSG_CHECKING([which thread library to use])
302     if test "$OSVERSION" -lt "500016"; then
303         PTHREAD_CFLAGS="-D_THREAD_SAFE"
304         PTHREAD_LIBS="-pthread"
305     elif test "$OSVERSION" -lt "502102"; then
306         PTHREAD_CFLAGS="-D_THREAD_SAFE"
307         PTHREAD_LIBS="-lc_r"
308     else
309         PTHREAD_CFLAGS=""
310         PTHREAD_LIBS="-pthread"
311     fi
312     AC_MSG_RESULT([$PTHREAD_LIBS])
313     _os=FreeBSD
314     ;;
316 *netbsd*)
317     test_gtk=yes
318     build_gstreamer=yes
319     test_tde=no
320     test_kde=no
321     test_kde4=yes
322     test_freetype=yes
323     PTHREAD_LIBS="-pthread -lpthread"
324     _os=NetBSD
325     ;;
327 aix*)
328     test_randr=no
329     test_freetype=yes
330     PTHREAD_LIBS=-pthread
331     _os=AIX
332     ;;
334 openbsd*)
335     test_gtk=yes
336     test_tde=yes
337     test_kde=yes
338     test_freetype=yes
339     PTHREAD_CFLAGS="-D_THREAD_SAFE"
340     PTHREAD_LIBS="-pthread"
341     _os=OpenBSD
342     ;;
344 dragonfly*)
345     test_gtk=yes
346     build_gstreamer=yes
347     test_tde=yes
348     test_kde=yes
349     test_kde4=yes
350     test_freetype=yes
351     PTHREAD_LIBS="-pthread"
352     _os=DragonFly
353     ;;
355 linux-androideabi*)
356     build_gstreamer=no
357     test_cups=no
358     test_fontconfig=no
359     test_freetype=no
360     test_gtk=no
361     test_tde=no
362     test_kde=no
363     test_kde4=no
364     test_randr=no
365     test_xrender=no
366     test_unix_quickstarter=no
367     _os=Android
369     if test -z "$with_android_ndk"; then
370         AC_MSG_ERROR([the --with-android-ndk option is mandatory])
371     fi
373     if test -z "$with_android_sdk"; then
374         AC_MSG_ERROR([the --with-android-sdk option is mandatory])
375     fi
377     # Verify that the NDK and SDK options are proper
378     if test ! -f "$ANDROID_NDK_HOME/platforms/android-9/arch-arm/usr/lib/libc.a"; then
379         AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
380     fi
382     if test ! -f "$ANDROID_SDK_HOME/platforms/android-14/android.jar"; then
383         AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
384     fi
386     BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
387     FREETYPE_TARBALL=dbf2caca1d3afd410a29217a9809d397-freetype-2.4.8.tar.bz2
388     FONTCONFIG_TARBALL=77e15a92006ddc2adbb06f840d591c0e-fontconfig-2.8.0.tar.gz
389     ;;
392     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
393     ;;
394 esac
396 if test "$_os" = "AIX"; then
397     AC_PATH_PROG(GAWK, gawk)
398     if test -z "$GAWK"; then
399         AC_MSG_ERROR([gawk not found in \$PATH])
400     fi
403 AC_SUBST(use_shl_version)
404 AC_SUBST(DYNAMIC_CRT)
406 AC_SUBST(WITH_MINGW)
407 AC_SUBST(OSVERSION)
408 AC_SUBST(PTHREAD_CFLAGS)
409 AC_SUBST(PTHREAD_LIBS)
411 AC_SUBST(FREETYPE_TARBALL)
412 AC_SUBST(FONTCONFIG_TARBALL)
414 ###############################################################################
415 # Extensions switches --enable/--disable
416 ###############################################################################
417 # By default these should be enabled unless having extra dependencies.
418 # If there is extra dependency over configure options then the enable should
419 # be automagic based on wether the requiring feature is enabled or not.
420 # All this options change anything only with --enable-extension-integration.
422 # The name of this option and its help string makes it sound as if
423 # extensions are built anyway, just not integrated in the installer,
424 # if you use --disable-extension-integration. Is that really the
425 # case?
427 AC_ARG_ENABLE(extension-integration,
428     AS_HELP_STRING([--disable-extension-integration],
429         [Disable integration of the built extensions in the installer of the
430          product. Use this switch to disable the integration.])
433 AC_ARG_ENABLE(ext-barcode,
434     AS_HELP_STRING([--enable-ext-barcode],
435         [Enable the Barcode extension.])
438 AC_ARG_ENABLE(database-connectivity,
439     AS_HELP_STRING([--disable-database-connectivity],
440         [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
443 # This doesn't mean not building (or "integrating") extensions
444 # (although it probably should; i.e. it should imply
445 # --disable-extension-integration I guess), it means not supporting
446 # any extension mechanism at all
447 AC_ARG_ENABLE(extensions,
448     AS_HELP_STRING([--disable-extensions],
449         [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
452 AC_ARG_ENABLE(scripting,
453     AS_HELP_STRING([--disable-scripting],
454         [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
457 # This is mainly for iOS, but could potentially be used in some
458 # special case otherwise, too, so factored out as a separate setting
459 AC_ARG_ENABLE(dynamic-loading,
460     AS_HELP_STRING([--disable-dynamic-loading],
461         [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
464 AC_ARG_ENABLE(ext-diagram,
465     AS_HELP_STRING([--enable-ext-diagram],
466         [Enable the SmART Gallery (Diagram) extension.])
469 AC_ARG_ENABLE(ext-google-docs,
470     AS_HELP_STRING([--enable-ext-google-docs],
471         [Enable the Google Documents extension.])
474 AC_ARG_ENABLE(ext-hunart,
475     AS_HELP_STRING([--enable-ext-hunart],
476         [Enable the Hungarian Cross-reference Toolbar extension.])
479 AC_ARG_ENABLE(ext-languagetool,
480     AS_HELP_STRING([--enable-ext-languagetool],
481         [Enable the LanguageTool extension.])
484 AC_ARG_ENABLE(ext-mysql-connector,
485     AS_HELP_STRING([--enable-ext-mysql-connector],
486         [Enable the build of the MySQL Connector extension.])
489 AC_ARG_ENABLE(ext-nlpsolver,
490     AS_HELP_STRING([--enable-ext-nlpsolver],
491         [Enable the NLPSolver extension.])
494 AC_ARG_ENABLE(ext-ct2n,
495     AS_HELP_STRING([--enable-ext-ct2n],
496         [Enable the ConvertTextToNumber extension.])
499 AC_ARG_ENABLE(ext-numbertext,
500     AS_HELP_STRING([--enable-ext-numbertext],
501         [Enable the Numbertext extension.])
504 AC_ARG_ENABLE(ext-oooblogger,
505     AS_HELP_STRING([--enable-ext-oooblogger],
506         [Enable the OOo Blogger extension.])
509 AC_ARG_ENABLE(ext-pdfimport,
510     AS_HELP_STRING([--disable-ext-pdfimport],
511         [Disable the PDF Import extension.])
514 AC_ARG_ENABLE(ext-presenter-console,
515     AS_HELP_STRING([--disable-ext-presenter-console],
516         [Disable the Presenter Console extension.])
519 AC_ARG_ENABLE(ext-presenter-minimizer,
520     AS_HELP_STRING([--disable-ext-presenter-minimizer],
521         [Disable the Presentation Minimizer extension.])
524 AC_ARG_ENABLE(ext-report-builder,
525     AS_HELP_STRING([--disable-ext-report-builder],
526         [Disable the Report Builder extension.])
529 AC_ARG_ENABLE(ext-scripting-beanshell,
530     AS_HELP_STRING([--enable-ext-scripting-beanshell],
531         [Enable support for scripts in BeanShell.])
534 AC_ARG_ENABLE(ext-scripting-javascript,
535     AS_HELP_STRING([--enable-ext-scripting-javascript],
536         [Enable support for scripts in JavaScript.])
539 AC_ARG_ENABLE(ext-typo,
540     AS_HELP_STRING([--enable-ext-typo],
541         [Enable the Typography Toolbar extension.])
544 AC_ARG_ENABLE(ext-validator,
545     AS_HELP_STRING([--enable-ext-validator],
546         [Enable the Validator extension.])
549 AC_ARG_ENABLE(ext-watch-window,
550     AS_HELP_STRING([--enable-ext-watch-window],
551         [Enable the Watch Window extension to Calc.])
554 AC_ARG_ENABLE(ext-wiki-publisher,
555     AS_HELP_STRING([--enable-ext-wiki-publisher],
556         [Enable the Wiki Publisher extension.])
558 ###############################################################################
560 dnl ---------- *** ----------
562 AC_ARG_ENABLE(mergelibs,
563     AS_HELP_STRING([--enable-mergelibs],
564         [Enables linking of big, merged, library. Experimental feature tested
565         only on Linux and Android.])
568 AC_ARG_ENABLE(graphite,
569     AS_HELP_STRING([--enable-graphite],
570         [Enables the compilation of Graphite smart font rendering.])
573 AC_ARG_ENABLE(ldap,
574     AS_HELP_STRING([--disable-ldap],
575         [Disables the use of LDAP backend via Netscape/Mozilla or OpenLDAP LDAP SDK])
578 AC_ARG_ENABLE(fetch-external,
579     AS_HELP_STRING([--disable-fetch-external],
580         [Disables fetching external tarballs from web sources.])
583 AC_ARG_ENABLE(lockdown,
584     AS_HELP_STRING([--disable-lockdown],
585         [Disables the gconf integration work in LibreOffice.]),
588 AC_ARG_ENABLE(vba,
589     AS_HELP_STRING([--disable-vba],
590         [Disables the vba compatibility feature.])
593 AC_ARG_ENABLE(pch,
594     AS_HELP_STRING([--enable-pch],
595         [DEPRECATED : is ignored])
598 AC_ARG_ENABLE(mozilla,
599     AS_HELP_STRING([--disable-mozilla],
600         [LibreOffice usually includes a strangely hacked up Mozilla binary for your
601          platform, to build without this version, use this option.])
604 AC_ARG_ENABLE(epm,
605     AS_HELP_STRING([--enable-epm],
606         [LibreOffice includes self-packaging code, that requires epm, however epm is
607          useless for large scale package building.])
610 AC_ARG_ENABLE(odk,
611     AS_HELP_STRING([--disable-odk],
612         [LibreOffice includes an ODK, office development kit which some packagers may
613          wish to build without.])
616 AC_ARG_ENABLE(mathmldtd,
617     AS_HELP_STRING([--disable-mathmldtd],
618         [Disable mathmldtd (useful for distributions that want to avoid
619          packaging it).])
622 AC_ARG_ENABLE(evolution2,
623     AS_HELP_STRING([--enable-evolution2],
624         [Allows the built-in evolution 2 addressbook connectivity build to be
625          enabled.])
628 AC_ARG_ENABLE(directx,
629     AS_HELP_STRING([--disable-directx],
630         [Remove DirectX implementation for the new XCanvas interface.
631          The DirectX support requires more stuff installed on Windows to
632          compile. (DirectX SDK, GDI+ libs)])
635 AC_ARG_ENABLE(activex,
636     AS_HELP_STRING([--disable-activex],
637         [Disable the use of ActiveX for a Windows build.
638         This switch is mandatory when using VC++ 2008 Express.])
641 AC_ARG_ENABLE(atl,
642     AS_HELP_STRING([--disable-atl],
643         [Disable the use of ATL for a Windows build.])
644     [
645                           This switch is mandatory when using VC++ 2008 Express.
646     ],
649 AC_ARG_ENABLE(symbols,
650     AS_HELP_STRING([--enable-symbols],
651         [Include debugging symbols in output. WARNING - a complete build needs
652          a lot of space (roughly 10 GiB) and takes much longer (enables -g
653          compiler flag for GCC or equivalent).]),
656 AC_ARG_ENABLE(werror,
657     AS_HELP_STRING([--enable-werror],
658         [Turn warnings to errors. (Has no effect in modules where the treating
659          of warnings as errors is disabled explicitly.)]),
662 AC_ARG_ENABLE(debug,
663     AS_HELP_STRING([--enable-debug],
664         [Include debugging symbols like with --enable-symbols, disable compiler
665          optimization and inlining plus extra debugging code like assertions.
666          Extra large build! (enables -g compiler flag and dmake debug=true)
667          If you need even more verbose output, build a module with
668          "build -- debug=true dbglevel=2".
669          You can also use this switch as follows:
670          --enable-debug="all -sw/ -Library_sc" to enable symbols only for
671          the specified gbuild-build targets (all means everything, - prepended
672          means not to enable, / appended means everything in the directory,
673          there is no ordering, more specific overrides more general, and
674          disabling takes precedence).]))
676 AC_ARG_ENABLE(dbgutil,
677     AS_HELP_STRING([--enable-dbgutil],
678         [Include additional debugging utilities, such as assertions, object
679          counting, etc. Larger build. Independent from --enable-debug.
680          Note that this option makes the build ABI incompatible:
681          It is not possible to mix object files or libraries from a
682          --enable-dbgutil and a --disable-dbgutil build.]))
684 AC_ARG_ENABLE(linkoo,
685     AS_HELP_STRING([--disable-linkoo],
686         [Disable linkoo for the smoketest installation.]))
688 AC_ARG_ENABLE(lto,
689     AS_HELP_STRING([--enable-lto],
690         [Enable link-time optimization. Suitable for product builds.
691          Building takes longer but libraries are optimized for speed.
692          (possible only with gcc-4.5 or later,
693           better to use gcc-4.6 and 'gold' as linker)]))
695 AC_ARG_ENABLE(crashdump,
696     AS_HELP_STRING([--enable-crashdump],
697         [Enable the crashdump feature.]))
699 AC_ARG_ENABLE(python,
700     AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
701         [Enables or disables Python support at run-time and build-time.
702          Also specifies what Python to use. 'auto' is the
703          default. Note that Python can be disabled with
704          --disable-python or --enable-python=no only if no
705          translations are required.]))
707 AC_ARG_ENABLE(gtk,
708     AS_HELP_STRING([--disable-gtk],
709         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
710 ,enable_gtk=yes)
712 AC_ARG_ENABLE(gtk3,
713     AS_HELP_STRING([--disable-gtk3],
714         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
715 ,enable_gtk3=no)
717 AC_ARG_ENABLE(systray,
718     AS_HELP_STRING([--disable-systray],
719         [Determines whether to build the systray quickstarter.]),
720 ,enable_systray=yes)
722 AC_ARG_ENABLE(split-app-modules,
723     AS_HELP_STRING([--enable-split-app-modules],
724         [Split file lists for app modules, e.g. base, calc.
725          Has effect only with make distro-pack-install]),
728 AC_ARG_ENABLE(split-opt-features,
729     AS_HELP_STRING([--enable-split-opt-features],
730         [Split file lists for some optional features, .e.g. pyuno, testtool.
731          Has effect only with make distro-pack-install]),
734 AC_ARG_ENABLE(cairo-canvas,
735 [  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
736                           platforms where Cairo is available.
739 AC_ARG_ENABLE(librsvg,
740     AS_HELP_STRING([--enable-librsvg=<no/auto/system/internal/fully-internal>],
741         [Enables or disables use of librsvg to render SVG at run-time.
742          Also specificed what librsvg to use. 'auto' is the default.
743          'fully-internal' also forces internal versions of libraries (only)
744          librsvg depends on (currently GLib, gdk-pixbuf, libcroco, libgsf,
745          pango).]))
747 AC_ARG_ENABLE(opengl,
748     AS_HELP_STRING([--disable-opengl],
749         [Determines whether to build the OpenGL 3D slide transitions component.]),
750 ,enable_opengl=yes)
752 AC_ARG_ENABLE(dbus,
753     AS_HELP_STRING([--enable-dbus],
754         [Determines whether to enable presentation mode screensaver control
755          under GNOME via DBUS.]),
756 ,enable_dbus=no)
758 AC_ARG_ENABLE(gconf,
759     AS_HELP_STRING([--disable-gconf],
760         [Determines whether to use the GConf support.]),
761 ,enable_gconf=yes)
763 AC_ARG_ENABLE(gnome-vfs,
764     AS_HELP_STRING([--disable-gnome-vfs],
765         [Determines whether to use the Gnome Virtual Filing System on platforms
766          where that VFS is available.]),
767 ,enable_gnome_vfs=yes)
769 AC_ARG_ENABLE(gio,
770     AS_HELP_STRING([--enable-gio],
771         [Determines whether to use the GIO support.]),
772 ,enable_gio=no)
774 AC_ARG_ENABLE(build-mozilla,
775     AS_HELP_STRING([--disable-build-mozilla],
776         [Use this option if you do not want to build the Mozilla components from
777          the Mozilla source code but take precompiled zips.]),
780 AC_ARG_ENABLE(xmlsec,
781     AS_HELP_STRING([--disable-xmlsec],
782         [Whether to enable XMLsec for open document signing. Be warned,
783          building without XML Security will likely give you test failures.]),
786 AC_ARG_ENABLE(tde,
787     AS_HELP_STRING([--enable-tde],
788         [Determines whether to use TQt/TDE vclplug on platforms where TQt and
789          TDE are available.]),
792 AC_ARG_ENABLE(tdeab,
793     AS_HELP_STRING([--disable-tdeab],
794         [Disable the TDE address book support.]),
796     if test "$enable_tde" = "yes"; then
797         enable_tdeab=yes;
798     fi
801 AC_ARG_ENABLE(kde,
802     AS_HELP_STRING([--enable-kde],
803         [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
804          KDE3 are available.]),
807 AC_ARG_ENABLE(kdeab,
808     AS_HELP_STRING([--disable-kdeab],
809         [Disable the KDE3 address book support.]),
811     if test "$enable_kde" = "yes"; then
812         enable_kdeab=yes;
813     fi
816 AC_ARG_ENABLE(kde4,
817     AS_HELP_STRING([--enable-kde4],
818         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
819          KDE4 are available. May be used with --enable-kde if you want to support
820          both KDE3 and KDE4.]),
823 AC_ARG_ENABLE(headless,
824     AS_HELP_STRING([--enable-headless],
825         [Disable building of GUIs to reduce dependencies. Useful for
826         server usage. Work in progress, use only if you are hacking on
827         it. Not related to the --headless option.]), ,)
829 AC_ARG_ENABLE(unix-qstart-libpng,
830     AS_HELP_STRING([--disable-unix-qstart-libpng],
831         [On UNIX systems, we have a faster splash app, that can use libpng to
832          render its splash, if we can safely link to the system libpng then
833          enabling this is a good idea (ie. for Linux Distro packaging).]),
834 ,enable_unix_qstart_libpng=yes)
836 AC_ARG_ENABLE(binfilter,
837     AS_HELP_STRING([--enable-binfilter],
838         [Enable legacy binary file formats filters build.]),
839 ,enable_binfilter=no
842 AC_ARG_ENABLE(rpath,
843     AS_HELP_STRING([--disable-rpath],
844         [Disable the use of relative paths in shared libraries.]),
847 AC_ARG_ENABLE(randr,
848     AS_HELP_STRING([--disable-randr],
849         [Disable RandR support in the vcl project.]),
850 ,enable_randr=yes)
852 AC_ARG_ENABLE(randr-link,
853     AS_HELP_STRING([--disable-randr-link],
854         [Disable linking with libXrandr, instead dynamically open it at runtime.]),
855 ,enable_randr_link=yes)
857 AC_ARG_ENABLE(gstreamer,
858     AS_HELP_STRING([--disable-gstreamer],
859         [Disable building the gstreamer avmedia backend.]),
860 ,enable_gstreamer=yes)
862 AC_ARG_ENABLE(neon,
863     AS_HELP_STRING([--disable-neon],
864         [Disable neon and the compilation of webdav binding.]),
867 AC_ARG_ENABLE(build-unowinreg,
868     AS_HELP_STRING([--enable-build-unowinreg],
869         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
870          compiler is needed on Linux.])
871     [
872                           Usage:     --enable-build-unowinreg
873     ],
876 AC_ARG_ENABLE(verbose,
877     AS_HELP_STRING([--enable-verbose],
878         [Increase build verbosity.])[
879   --disable-verbose       Decrease build verbosity.],
882 AC_ARG_ENABLE(dependency-tracking,
883     AS_HELP_STRING([--enable-dependency-tracking],
884         [Do not reject slow dependency extractors.])[
885   --disable-dependency-tracking
886                           Disables generation of dependency information.
887                           Speed up one-time builds.],
890 AC_ARG_ENABLE(icecream,
891     AS_HELP_STRING([--enable-icecream],
892         [Use the 'icecream' distributed compiling tool to speedup the compilation.
893          It defaults to /opt/icecream for the location of the icecream gcc/g++
894          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
897 AC_ARG_ENABLE(zenity,
898     AS_HELP_STRING([--disable-zenity],
899         [Do not display a build icon in the notification area (on unix) during build.]),
900 ,enable_zenity=yes)
902 AC_ARG_ENABLE(nsplugin,
903     AS_HELP_STRING([--disable-nsplugin],
904         [Do not build nsplugin extension for browser embedding.])
907 AC_ARG_ENABLE(cups,
908     AS_HELP_STRING([--disable-cups],
909         [Do not build cups support.])
912 AC_ARG_ENABLE(ccache,
913     AS_HELP_STRING([--disable-ccache],
914         [Do not try to use ccache automatically.
915          By default, we will try to detect if ccache is available; in that case if
916          CC/CXX are not yet set, and --enable-icecream is not given, we
917          attempt to use ccache. --disable-ccache disables ccache completely.
921 AC_ARG_ENABLE(cl-x64,
922     AS_HELP_STRING([--enable-cl-x64],
923         [Build a 64-bit LibreOffice using the Microsoft C/C++ x64
924         compiler. Incomplete and doesn't work, use only if you are
925         hacking on it.]), ,)
927 AC_ARG_ENABLE(extra-gallery,
928     AS_HELP_STRING([--enable-extra-gallery],
929         [Add extra gallery content.]),
932 AC_ARG_ENABLE(extra-template,
933     AS_HELP_STRING([--enable-extra-template],
934         [Add extra template content.]),
937 AC_ARG_ENABLE(extra-sample,
938     AS_HELP_STRING([--enable-extra-sample],
939         [Add extra sample content.]),
942 AC_ARG_ENABLE(extra-font,
943     AS_HELP_STRING([--enable-extra-font],
944         [Add extra font content.]),
947 AC_ARG_ENABLE(oxygenoffice,
948     AS_HELP_STRING([--enable-oxygenoffice],
949         [Download OxygenOffice branding and set custom settings.]),
952 AC_ARG_ENABLE(lomenubar,
953     AS_HELP_STRING([--enable-lomenubar],
954         [Enable global menu support.]),
957 AC_ARG_ENABLE(online-update,
958     AS_HELP_STRING([--enable-online-update],
959         [Enable the online update service that will check for new versions of
960          LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
963 AC_ARG_ENABLE(release-build,
964     AS_HELP_STRING([--enable-release-build],
965         [Enable release build.
966          See http://wiki.documentfoundation.org/DevBuild]),
969 AC_ARG_ENABLE(silent-msi,
970     AS_HELP_STRING([--enable-silent-msi],
971         [Enable MSI with LIMITUI=1 (silent install).]),
974 AC_ARG_ENABLE(postgresql-sdbc,
975     AS_HELP_STRING([--disable-postgresql-sdbc],
976         [Disable the build of the PostgreSQL-SDBC driver.])
979 AC_ARG_ENABLE(mono,
980     AS_HELP_STRING([--enable-mono],
981         [Enables the compilation of the Mono bindings]),
984 dnl ===================================================================
985 dnl Optional Packages (--with/without-)
986 dnl ===================================================================
987 AC_ARG_WITH(android-ndk,
988     AS_HELP_STRING([--with-android-ndk],
989         [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
992 AC_ARG_WITH(android-sdk,
993     AS_HELP_STRING([--with-android-sdk],
994         [Specify location of the Android SDK. Mandatory when building for Android.]),
997 AC_ARG_WITH(gnu-patch,
998     AS_HELP_STRING([--with-gnu-patch],
999         [Specify location of GNU patch on Solaris or FreeBSD.]),
1002 AC_ARG_WITH(build-platform-configure-options,
1003         [Specify options for the configure script run for the *build* platform in a cross-compilation])
1005 AC_ARG_WITH(gnu-cp,
1006     AS_HELP_STRING([--with-gnu-cp],
1007         [Specify location of GNU cp on Solaris or FreeBSD.]),
1010 AC_ARG_WITH(external-tar,
1011     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
1012         [Specify path to tarfiles manually.]),
1013     TARFILE_LOCATION=$withval ,
1016 AC_ARG_WITH(solver-and-workdir-root,
1017     AS_HELP_STRING([--with-solver-and-workdir-root=<PATH>],
1018         [Specify path that contains SOLARVER and WORKDIR directories manually.])
1021 AC_ARG_WITH(linked-git,
1022     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
1023         [Specify another checkout's clonedir to re-use. This makes use of
1024                  git-new-workdir, and saves a lot of diskspace when having multiple
1025                  trees side-by-side.]),
1026     GIT_LINK_SRC=$withval ,
1029 AC_ARG_WITH(openldap,
1030     AS_HELP_STRING([--with-openldap],
1031         [Enables the use of the OpenLDAP LDAP SDK instead of the Netscape/Mozilla one.]),
1034 AC_ARG_WITH(vba-package-format,
1035     AS_HELP_STRING([--with-vba-package-format],
1036         [Specify package format for vba compatibility api. Specifying  "builtin"
1037          means the api component and associated type library are  part of the
1038          installation set. Specifying "extn" creates an uno extension that is
1039          part of the installation set (located in the program directory) that
1040          MUST be optionally registered using either the unopkg executeable or the
1041          extension manager gui.])
1042     [
1043                           Note: "builtin" is the default, "extn" can cause
1044                           problems.
1046                           Usage:     --with-vba-package-format="builtin" or
1047                                      --with-vba-package-format="extn"
1048     ],
1051 AC_ARG_WITH(theme,
1052     AS_HELP_STRING([--with-theme="theme1 theme2..."],
1053         [Choose which themes to include. By default those themes with an '*' are included.
1054          Possible choices: *crystal, *default (galaxy), *hicontrast, human, industrial, *oxygen, *tango.]),
1057 AC_ARG_WITH(helppack-integration,
1059   --without-helppack-integration      It will not integrate the helppacks to the installer
1060                           of the product.
1061                           Please use this switch to use the online help or separate help packages.],
1064 AC_ARG_WITH(fonts,
1065     AS_HELP_STRING([--without-fonts],
1066         [LibreOffice includes some third-party fonts to provide a reliable basis for
1067          help content, templates, samples, etc. When these fonts are already
1068          known to be available on the system then you should use this option.]),
1071 AC_ARG_WITH(ppds,
1072     AS_HELP_STRING([--without-ppds],
1073         [Removes Postscript Printer definition files from LibreOffice
1074          installation set, for people building for specific distributions where
1075          PPDs are known to be already available (every recent distro with CUPS backend).]),
1078 AC_ARG_WITH(afms,
1079     AS_HELP_STRING([--without-afms],
1080         [Removes bitmap font files from LibreOffice installation set, for people
1081          building for specific distributions where AFM files or TrueType Fonts
1082          are known to be available.]),
1085 AC_ARG_WITH(agfa-monotype-fonts,
1086      AS_HELP_STRING([--with-agfa-monotype-fonts],
1087           [This switch should only be enabled for those who have the right
1088            to use or distribute the proprietary Agfa Monotype
1089            fonts.])
1092 AC_ARG_WITH(epm,
1093     AS_HELP_STRING([--with-epm],
1094         [Decides which epm to use. Default is to use the one from the system if
1095          one is built. When either this is not there or you say =internal epm
1096          will be built.]),
1099 AC_ARG_WITH(package-format,
1100     AS_HELP_STRING([--with-package-format],
1101         [Specify package format(s) for LibreOffice installsets. Default is the
1102          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
1103          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
1104           installed, msi. Example: --with-package-format="deb dmg"]),
1107 AC_ARG_WITH(system-libs,
1108     AS_HELP_STRING([--with-system-libs],
1109         [Use libraries already on system -- enables all --with-system-* flags except
1110          mozilla.]),
1113 AC_ARG_WITH(system-headers,
1114     AS_HELP_STRING([--with-system-headers],
1115         [Use headers already on system -- enables all --with-system-* flags for
1116          external packages whose headers are the only entities used i.e.
1117          boost/vigra/odbc/sane-header(s).]),,
1118     [with_system_headers="$with_system_libs"])
1120 AC_ARG_WITH(system-jars,
1121     AS_HELP_STRING([--without-system-jars],
1122         [When building with --with-system-libs, also the needed jars are expected
1123          on the system. Use this to disable that]),,
1124     [with_system_jars="$with_system_libs"])
1126 AC_ARG_WITH(system-stdlibs,
1127     AS_HELP_STRING([--without-system-stdlibs],
1128         [Bundle the used libstdc++/libgcc_s into the installation set.]),,
1129     [with_system_stdlibs="$with_system_libs"])
1131 AC_ARG_WITH(system-cairo,
1132     AS_HELP_STRING([--with-system-cairo],
1133         [Use Cairo libraries already on system.]),,
1134     [with_system_cairo="$with_system_libs"])
1136 AC_ARG_WITH(system-graphite,
1137     AS_HELP_STRING([--with-system-graphite],
1138         [Use graphite library already installed on system.]),,
1139     [with_system_graphite="$with_system_libs"])
1141 AC_ARG_WITH(system-nss,
1142     AS_HELP_STRING([--with-system-nss],
1143         [Use NSS/nspr libraries already on system.]),,
1144     [with_system_nss="$with_system_libs"])
1146 AC_ARG_WITH(mozilla-version,
1147     AS_HELP_STRING([--with-mozilla-version],
1148         [Choose which version of Mozilla to use while building Mozilla.
1149          (default=1.7.5) Note that not all versions are supported.]),
1152 AC_ARG_WITH(mozilla-toolkit,
1153     AS_HELP_STRING([--with-mozilla-toolkit],
1154         [Choose which GUI toolkit to use while building Mozilla components. (default=gtk2)]),
1157 AC_ARG_WITH(myspell-dicts,
1158     AS_HELP_STRING([--without-myspell-dicts],
1159         [Removes myspell dictionaries from LibreOffice installation set, for
1160          people building for specific distributions where the myspell dictionaries
1161          are installed from other sources.]),
1164 AC_ARG_WITH(system-dicts,
1165     AS_HELP_STRING([--without-system-dicts],
1166         [Do not use dictionaries from system paths.]),
1169 AC_ARG_WITH(external-dict-dir,
1170     AS_HELP_STRING([--with-external-dict-dir],
1171         [Specify external dictionary dir.]),
1174 AC_ARG_WITH(external-hyph-dir,
1175     AS_HELP_STRING([--with-external-hyph-dir],
1176         [Specify external hyphenation pattern dir.]),
1179 AC_ARG_WITH(external-thes-dir,
1180     AS_HELP_STRING([--with-external-thes-dir],
1181         [Specify external thesaurus dir.]),
1184 AC_ARG_WITH(system-zlib,
1185     AS_HELP_STRING([--with-system-zlib],
1186         [Use zlib already on system.]),,
1187     [with_system_zlib=auto])
1189 AC_ARG_WITH(system-openssl,
1190     AS_HELP_STRING([--with-system-openssl],
1191         [Use OpenSSL already on system.]),,
1192     [with_system_openssl="$with_system_libs"])
1194 AC_ARG_WITH(system-jpeg,
1195     AS_HELP_STRING([--with-system-jpeg],
1196         [Use jpeg already on system.]),,
1197     [with_system_jpeg=auto])
1199 AC_ARG_WITH(system-clucene,
1200     AS_HELP_STRING([--with-system-clucene],
1201         [Use clucene already on system.]),,
1202     [with_system_clucene="$with_system_libs"])
1204 AC_ARG_WITH(system-expat,
1205     AS_HELP_STRING([--with-system-expat],
1206         [Use expat already on system.]),,
1207     [with_system_expat="$with_system_libs"])
1209 AC_ARG_WITH(system-libcmis,
1210     AS_HELP_STRING([--with-system-libcmis],
1211         [Use libcmis already on system.]),,
1212     [with_system_libcmis="$with_system_libs"])
1214 AC_ARG_WITH(system-lcms2,
1215     AS_HELP_STRING([--with-system-lcms2],
1216         [Use littlecms v2 already on system.]),,
1217     [with_system_lcms2="$with_system_libs"])
1219 AC_ARG_WITH(system-libcdr,
1220     AS_HELP_STRING([--with-system-libcdr],
1221         [Use libcdr already on system.]),,
1222     [with_system_libcdr="$with_system_libs"])
1224 AC_ARG_WITH(system-libvisio,
1225     AS_HELP_STRING([--with-system-libvisio],
1226         [Use libvisio already on system.]),,
1227     [with_system_libvisio="$with_system_libs"])
1229 AC_ARG_WITH(system-libwpd,
1230     AS_HELP_STRING([--with-system-libwpd],
1231         [Use libwpd already on system.]),,
1232     [with_system_libwpd="$with_system_libs"])
1234 AC_ARG_WITH(system-libwps,
1235     AS_HELP_STRING([--with-system-libwps],
1236         [Use libwps already on system.]),,
1237     [with_system_libwps="$with_system_libs"])
1239 AC_ARG_WITH(system-libwpg,
1240     AS_HELP_STRING([--with-system-libwpg],
1241         [Use libwpg already on system.]),,
1242     [with_system_libwpg="$with_system_libs"])
1244 AC_ARG_WITH(system-libxml,
1245     AS_HELP_STRING([--with-system-libxml],
1246         [Use libxml/libxslt already on system.]),,
1247     [with_system_libxml=auto])
1249 AC_ARG_WITH(system-icu,
1250     AS_HELP_STRING([--with-system-icu],
1251         [Use icu already on system.]),,
1252     [with_system_icu="$with_system_libs"])
1254 AC_ARG_WITH(system-poppler,
1255     AS_HELP_STRING([--with-system-poppler],
1256         [Use system poppler. (only needed for pdfimport extension)]),,
1257     [with_system_poppler="$with_system_libs"])
1259 AC_ARG_WITH(system-db,
1260     AS_HELP_STRING([--with-system-db],
1261         [Use Berkeley db already on system.]),,
1262     [with_system_db="$with_system_libs"])
1264 AC_ARG_WITH(system-apache-commons,
1265     AS_HELP_STRING([--with-system-apache-commons],
1266         [Use Apache commons libraries already on system.]),,
1267     [with_system_apache_commons="$with_system_jars"])
1269 AC_ARG_WITH(system-mysql,
1270     AS_HELP_STRING([--with-system-mysql],
1271         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
1272          extension. If the the mysql_config executable is not in PATH, use MYSQLCONFIG to
1273          point to it.]),,
1274     [with_system_mysql="$with_system_libs"])
1276 AC_ARG_WITH(libmysql-path,
1277     AS_HELP_STRING([--with-libmysql-path],
1278         [Use Connector/C (libmysql) installation for building the MySQL
1279          Connector/LibreOffice extension.])
1280     [
1281                           Usage:     --with-libmysql-path=<absolute path to
1282                                                   your Connector/C installation>
1283     ],
1286 AC_ARG_WITH(system-mysql-cppconn,
1287     AS_HELP_STRING([--with-system-mysql-cppconn],
1288         [Use MySQL C++ Connector libraries already on system.]),,
1289     [with_system_mysql_cppconn="$with_system_libs"])
1291 AC_ARG_WITH(system-postgresql,
1292     AS_HELP_STRING([--with-system-postgresql],
1293         [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1294          driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1295     [with_system_postgresql="$with_system_libs"])
1297 AC_ARG_WITH(libpq-path,
1298     AS_HELP_STRING([--with-libpq-path],
1299         [Use this PostgreSQL C interface (libpq) installation for building
1300          the PostgreSQL-SDBC extension.])
1301     [
1302                           Usage:     --with-libpq-path=<absolute path to
1303                                                   your libq installation>
1304     ],
1307 AC_ARG_WITH(system-hsqldb,
1308     AS_HELP_STRING([--with-system-hsqldb],
1309         [Use hsqldb already on system.]),,
1310     [with_system_hsqldb="$with_system_jars"])
1312 AC_ARG_WITH(hsqldb-jar,
1313     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1314         [Specify path to jarfile manually.]),
1315     HSQLDB_JAR=$withval)
1317 AC_ARG_WITH(system-beanshell,
1318     AS_HELP_STRING([--with-system-beanshell],
1319         [Use beanshell already on system.]),,
1320     [with_system_beanshell="$with_system_jars"])
1322 AC_ARG_WITH(beanshell-jar,
1323     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1324         [Specify path to jarfile manually.]),
1325     BSH_JAR=$withval)
1327 AC_ARG_WITH(system-rhino,
1328     AS_HELP_STRING([--with-system-rhino],
1329         [Use rhino already on system.]),,)
1330 #    [with_system_rhino="$with_system_jars"])
1331 # Above is not used as we have different debug interface
1332 # patched into internal rhino. This code needs to be fixed
1333 # before we can enable it by default.
1335 AC_ARG_WITH(rhino-jar,
1336     AS_HELP_STRING([--with-rhino-jar=JARFILE],
1337         [Specify path to jarfile manually.]),
1338     RHINO_JAR=$withval)
1340 AC_ARG_WITH(commons-codec-jar,
1341     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1342         [Specify path to jarfile manually.]),
1343     COMMONS_CODEC_JAR=$withval)
1345 AC_ARG_WITH(commons-lang-jar,
1346     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1347         [Specify path to jarfile manually.]),
1348     COMMONS_LANG_JAR=$withval)
1350 AC_ARG_WITH(commons-httpclient-jar,
1351     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1352         [Specify path to jarfile manually.]),
1353     COMMONS_HTTPCLIENT_JAR=$withval)
1355 AC_ARG_WITH(commons-logging-jar,
1356     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1357         [Specify path to jarfile manually.]),
1358     COMMONS_LOGGING_JAR=$withval)
1360 AC_ARG_WITH(system-servlet-api,
1361     AS_HELP_STRING([--with-system-servlet-api],
1362         [Use servlet-api already on system.]),,
1363     [with_system_servlet_api="$with_system_jars"])
1365 AC_ARG_WITH(servlet-api-jar,
1366     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
1367         [Specify path to jarfile manually.]),
1368     SERVLETAPI_JAR=$withval)
1370 AC_ARG_WITH(system-jfreereport,
1371     AS_HELP_STRING([--with-system-jfreereport],
1372         [Use JFreeReport already on system.]),,
1373     [with_system_jfreereport="$with_system_jars"])
1375 AC_ARG_WITH(sac-jar,
1376     AS_HELP_STRING([--with-sac-jar=JARFILE],
1377         [Specify path to jarfile manually.]),
1378     SAC_JAR=$withval)
1380 AC_ARG_WITH(libxml-jar,
1381     AS_HELP_STRING([--with-libxml-jar=JARFILE],
1382         [Specify path to jarfile manually.]),
1383     LIBXML_JAR=$withval)
1385 AC_ARG_WITH(flute-jar,
1386     AS_HELP_STRING([--with-flute-jar=JARFILE],
1387         [Specify path to jarfile manually.]),
1388     FLUTE_JAR=$withval)
1390 AC_ARG_WITH(jfreereport-jar,
1391     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1392         [Specify path to jarfile manually.]),
1393     JFREEREPORT_JAR=$withval)
1395 AC_ARG_WITH(liblayout-jar,
1396     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1397         [Specify path to jarfile manually.]),
1398     LIBLAYOUT_JAR=$withval)
1400 AC_ARG_WITH(libloader-jar,
1401     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1402         [Specify path to jarfile manually.]),
1403     LIBLOADER_JAR=$withval)
1405 AC_ARG_WITH(libloader-jar,
1406     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1407         [Specify path to jarfile manually.]),
1408     LIBLOADER_JAR=$withval)
1410 AC_ARG_WITH(libformula-jar,
1411     AS_HELP_STRING([--with-libformula-jar=JARFILE],
1412         [Specify path to jarfile manually.]),
1413     LIBFORMULA_JAR=$withval)
1415 AC_ARG_WITH(librepository-jar,
1416     AS_HELP_STRING([--with-librepository-jar=JARFILE],
1417         [Specify path to jarfile manually.]),
1418     LIBREPOSITORY_JAR=$withval)
1420 AC_ARG_WITH(libfonts-jar,
1421     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1422         [Specify path to jarfile manually.]),
1423     LIBFONTS_JAR=$withval)
1425 AC_ARG_WITH(libserializer-jar,
1426     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1427         [Specify path to jarfile manually.]),
1428     LIBSERIALIZER_JAR=$withval)
1430 AC_ARG_WITH(libbase-jar,
1431     AS_HELP_STRING([--with-libbase-jar=JARFILE],
1432         [Specify path to jarfile manually.]),
1433     LIBBASE_JAR=$withval)
1435 AC_ARG_WITH(system-saxon,
1436     AS_HELP_STRING([--with-system-saxon],
1437         [Use saxon already on system.]),,
1438     [with_system_saxon="$with_system_jars"])
1440 AC_ARG_WITH(saxon-jar,
1441     AS_HELP_STRING([--with-saxon-jar=JARFILE],
1442         [Specify path to jarfile manually.]),
1443     SAXON_JAR=$withval)
1445 AC_ARG_WITH(system-odbc,
1446     AS_HELP_STRING([--with-system-odbc],
1447         [Use the odbc headers already on system.]),,
1448     [with_system_odbc="$with_system_headers"])
1450 AC_ARG_WITH(system-sane,
1451     AS_HELP_STRING([--with-system-sane],
1452         [Use sane.h already on system.]),,
1453     [with_system_sane="$with_system_headers"])
1455 AC_ARG_WITH(system-xextensions-headers,
1456     AS_HELP_STRING([--with-system-xextensions-headers],
1457         [To build without system X11 extensions headers, use
1458          --without-system-xextensions-headers. This is possibly
1459          useful on legacy unix systems which ship with the libs
1460          but without the headers.]))
1462 AC_ARG_WITH(system-mesa-headers,
1463     AS_HELP_STRING([--with-system-mesa-headers],
1464         [Use Mesa headers already on system.]),,
1465     [with_system_mesa_headers="$with_system_headers"])
1467 AC_ARG_WITH(system-curl,
1468     AS_HELP_STRING([--with-system-curl],
1469         [Use curl already on system.]),,
1470     [with_system_curl=auto])
1472 AC_ARG_WITH(system-boost,
1473     AS_HELP_STRING([--with-system-boost],
1474         [Use boost already on system.]),,
1475     [with_system_boost="$with_system_headers"])
1477 AC_ARG_WITH(system-mdds,
1478     AS_HELP_STRING([--with-system-mdds],
1479         [Use mdds already on system.]),,
1480     [with_system_mdds="$with_system_headers"])
1482 AC_ARG_WITH(system-vigra,
1483     AS_HELP_STRING([--with-system-vigra],
1484         [Use vigra already on system.]),,
1485     [with_system_vigra="$with_system_headers"])
1487 AC_ARG_WITH(system-neon,
1488     AS_HELP_STRING([--with-system-neon],
1489         [Use neon already on system.]),,
1490     [with_system_neon="$with_system_libs"])
1492 AC_ARG_WITH(system-hunspell,
1493     AS_HELP_STRING([--with-system-hunspell],
1494         [Use libhunspell already on system.]),,
1495     [with_system_hunspell="$with_system_libs"])
1497 AC_ARG_WITH(system-mythes,
1498     AS_HELP_STRING([--with-system-mythes],
1499         [Use mythes already on system.]),,
1500     [with_system_mythes="$with_system_libs"])
1502 AC_ARG_WITH(system-altlinuxhyph,
1503     AS_HELP_STRING([--with-system-altlinuxhyph],
1504         [Use ALTLinuxhyph already on system.]),,
1505     [with_system_altlinuxhyph="$with_system_libs"])
1507 AC_ARG_WITH(system-lpsolve,
1508     AS_HELP_STRING([--with-system-lpsolve],
1509         [Use lpsolve already on system.]),,
1510     [with_system_lpsolve="$with_system_libs"])
1512 AC_ARG_WITH(system-libexttextcat,
1513     AS_HELP_STRING([--with-system-libexttextcat],
1514         [Use libexttextcat already on system.]),,
1515     [with_system_libexttextcat="$with_system_libs"])
1517 AC_ARG_WITH(system-cppunit,
1518     AS_HELP_STRING([--with-system-cppunit],
1519         [Use cppunit already on system.]),,
1520     [with_system_cppunit="$with_system_libs"])
1522 AC_ARG_WITH(system-redland,
1523     AS_HELP_STRING([--with-system-redland],
1524         [Use redland library already on system.]),,
1525     [with_system_redland="$with_system_libs"])
1527 AC_ARG_WITH(system-mozilla,
1528     AS_HELP_STRING([--with-system-mozilla],
1529         [Use Mozilla already on system. Note that some components cannot be built
1530          against a contemporary Mozilla. The flavour used can be specified by
1531          --with-system-mozilla=<flavour>. Supported are: libxul (default),
1532          xulrunner, firefox, seamonkey, mozilla, iceape.]),
1533     WITH_SYSTEM_MOZILLA=$withval ,
1534 WITH_SYSTEM_MOZILLA=no)
1536 AC_ARG_WITH(system-mozilla-headers,
1537     AS_HELP_STRING([--with-system-mozilla-headers],
1538         [Use mozilla headers provided by system instead of bundled ones. Used in
1539          nsplugin]),,
1540     [with_system_mozilla_headers="$with_system_headers"]
1543 AC_ARG_WITH(system-gettext,
1544     AS_HELP_STRING([--with-system-gettext],
1545         [Use gettext runtime library already on system.]),,
1546     [with_system_gettext="$with_system_libs"])
1548 AC_ARG_WITH(system-libpng,
1549     AS_HELP_STRING([--with-system-libpng],
1550         [Use libpng already on system.]),,
1551     [with_system_libpng=auto])
1553 AC_ARG_WITH(linker-hash-style,
1554     AS_HELP_STRING([--with-linker-hash-style],
1555         [Use linker with --hash-style=<style> when linking shared objects.
1556          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1557          if supported on the build system, and "sysv" otherwise.]))
1559 AC_ARG_WITH(stlport,
1560     AS_HELP_STRING([--with-stlport],
1561         [Build the STLPort library for compatibility with old extensions for
1562          architectures where STLPort used to be used.]),
1563     with_stlport=$withval ,
1564 with_stlport=auto)
1566 AC_ARG_WITH(jdk-home,
1567     AS_HELP_STRING([--with-jdk-home],
1568         [If you have installed JDK 1.3 or later on your system please supply the
1569          path here. Note that this is not the location of the java command but the
1570          location of the entire distribution.])
1571     [
1572                           Usage:     --with-jdk-home=<absolute path to JDK home>
1573     ],
1576 AC_ARG_WITH(gxx_include_path,
1577     AS_HELP_STRING([--with-gxx-include-path],
1578         [If you want to override the autodetected g++ include path.])
1579     [
1580                           Usage:     --with-gxx-include-path=<absolute path to
1581                                                                 g++ include dir>
1582     ],
1585 AC_ARG_WITH(help,
1586     AS_HELP_STRING([--with-help],
1587         [Enable the build of help.
1589          To build without help, use --without-help.]))
1591 AC_ARG_WITH(mono-gac-root,
1592     AS_HELP_STRING([--with-mono-gac-root],
1593         [Define the root of the mono GAC. It is especially
1594          needed if you are using $DESTDIR and want to
1595          preinstall the mono DLLs into the GAC.])
1596     [
1597                           Usage:     --with-mono-gac-root=/usr/lib
1598     ],
1601 AC_ARG_WITH(java,
1602     AS_HELP_STRING([--with-java],
1603         [Specify the name of the Java interpreter command. Typically "java"
1604          which is the default.
1606          To build without support for Java components, applets, accessibility
1607          or the XML filters written in Java, use --without-java or --with-java=no.])
1608     [
1609                           Usage:     --with-java==<java command>
1610                                      --without-java
1611     ],
1612     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1613     [ with_java=java ]
1616 AC_ARG_WITH(java_target_version,
1617     AS_HELP_STRING([--with-java-target-version],
1618         [Generate class files that will work on JVMs with the specified version.
1619          For example, use --with-java-target-version=1.4 to make sure that the
1620          application will work with JVM 1.4 even when compiled with JDK 1.5.])
1621     [
1622                           This option is ignored when you compile with gcj/gij.
1624                           Usage:     --with-java-target-version=<jvm version>
1625     ],
1628 AC_ARG_WITH(jvm-path,
1629     AS_HELP_STRING([--with-jvm-path],
1630         [Use a specific JVM search path at runtime.])
1631     [
1632                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1634                           e. g.: --with-jvm-path=/usr/lib/
1635                                  to find JRE/JDK in /usr/lib/jvm/
1636     ],
1639 AC_ARG_WITH(ant-home,
1640     AS_HELP_STRING([--with-ant-home],
1641         [If you have installed Jakarta Ant on your system, please supply the path here.
1642          Note that this is not the location of the Ant binary but the location
1643          of the entire distribution.])
1644     [
1645                           Usage:     --with-ant-home=<absolute path to Ant home>
1646     ],
1649 AC_ARG_WITH(junit,
1650     AS_HELP_STRING([--with-junit],
1651         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1652          --without-junit disables those tests. Not relevant in the --without-java case.])
1653     [
1654                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1655     ],
1656 ,with_junit=yes)
1658 AC_ARG_WITH(perl-home,
1659     AS_HELP_STRING([--with-perl-home],
1660         [If you have installed Perl 5 Distribution, on your system, please
1661          supply the path here. Note that this is not the location of the Perl
1662          binary but the location of the entire distribution.])
1663     [
1664                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1665     ],
1668 AC_ARG_WITH(
1669     [doxygen],
1670     AS_HELP_STRING(
1671         [--with-doxygen],
1672         [Specifies the doxygen executable to use when generating ODK C/C++
1673          documentation. --without-doxygen disables generation of ODK C/C++
1674          documentation. Not relevant in the --disable-odk case.])
1675     [
1676                           Usage:     --with-doxygen=<absolute path to doxygen executable>
1677     ],,
1678     [with_doxygen=yes])
1680 AC_ARG_WITH(cl-home,
1681     AS_HELP_STRING([--with-cl-home],
1682         [For Windows NT users, please supply the path for the Microsoft C/C++
1683          compiler. Note that this is not the location of the compiler binary but
1684          the location of the entire distribution.])
1685     [
1686                           Usage:     --with-cl-home=<absolute path to Microsoft
1687                                                             C/C++ compiler home>
1688     ],
1691 AC_ARG_WITH(mspdb-path,
1692     AS_HELP_STRING([--with-mspdb-path],
1693         [For Microsoft C/C++ compiler users, please supply the path pointing to
1694          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1695          Visual Studio 2010).])
1696     [
1697                           Usage:     --with-mspdb-path=<path to
1698                                                        mspdb80.dll/mspdb100.dll>
1699     ],
1702 AC_ARG_WITH(midl-path,
1703     AS_HELP_STRING([--with-midl-path],
1704         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1705     [
1706                           Usage:     --with-midl-path=<abs. path to midl.exe>
1707     ],
1710 AC_ARG_WITH(csc-path,
1711     AS_HELP_STRING([--with-csc-path],
1712         [For Windows builds, please supply the path pointing to the csc.exe.
1713          Usually found automatically when building on Windows.])
1714     [
1715                           Usage:     --with-csc-path=<abs. path to csc.exe>
1716     ],
1719 AC_ARG_WITH(dotnet-framework-home,
1720     AS_HELP_STRING([--with-dotnet-framework-home],
1721         [For Microsoft compiler users, please supply the path pointing to
1722          lib/mscoree.lib, usually something like:
1723          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1724     [
1725                           Note that in most cases it will be automatically
1726                           found, though.
1728                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1729                                                           Framework>
1730     ],
1733 AC_ARG_WITH(windows-sdk-home,
1734     AS_HELP_STRING([--with-windows-sdk-home],
1735         [For Windows builds, please supply the path to the Windows SDK.
1736          Usually found automatically when building on Windows.])
1737     [
1738                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1739     ],
1742 AC_ARG_WITH(directx-home,
1743     AS_HELP_STRING([--with-directx-home],
1744         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1745     [
1746                           Usage:     --with-directx-home=<absolute path to
1747                                                           Microsoft DirectX SDK>
1748     ],
1751 AC_ARG_WITH(mozilla-build,
1752     AS_HELP_STRING([--with-mozilla-build],
1753         [For Windows users, please supply the path to the Mozilla build tools.])
1754     [
1755                           Usage:     --with-mozilla-build=<absolute path to
1756                                                           Mozilla build tools>
1758                           At the moment of this writing, an installer for the
1759                           mozilla build tools can be obtained from http://ftp.
1760                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1761     ],
1762     MOZILLABUILD=$withval ,
1765 AC_ARG_WITH(lang,
1766     AS_HELP_STRING([--with-lang],
1767         [Use this option to build LibreOffice with additional language support.
1768          English (US) is always included by default.
1769          Separate multiple languages with space.
1770          For all languages, use --with-lang=ALL.])
1771     [
1772                           Usage:     --with-lang="es sw tu cs sk"
1773     ],
1776 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
1777 AC_ARG_WITH(krb5,
1778     AS_HELP_STRING([--with-krb5],
1779         [Enable MIT Kerberos 5 support in modules that support it.
1780          By default automatically enabled on platforms
1781          where a good system Kerberos 5 is available.]),
1784 AC_ARG_WITH(gssapi,
1785     AS_HELP_STRING([--with-gssapi],
1786         [Enable GSSAPI support in modules that support it.
1787          By default automatically enabled on platforms
1788          where a good system GSSAPI is available.]),
1791 dnl ===================================================================
1792 dnl Branding
1793 dnl ===================================================================
1795 AC_ARG_WITH(branding,
1796 [  --with-branding        Use given path to retrieve all branding images.
1797                           Expects /path/intro.png ...
1798                           /path/backing_rtl_right.png to be there. Individual
1799                           images can be overridden via --with-intro-bitmap ...
1800                           --with-startcenter-rtl-left-bitmap switches.
1802                           Usage:     --with-branding=/path/to/images
1803 ],,)
1805 AC_ARG_WITH(intro-bitmap,
1806 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1807                           the default one.
1809                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1810 ],,)
1812 AC_ARG_WITH(intro-progressbar-color,
1813 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1814                                      Comma separated RGB values in decimal format.
1816                           Usage: --with-intro-progressbar-color=126,170,23
1817 ],,)
1819 AC_ARG_WITH(intro-progressbar-size,
1820 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1821                                      Comma separated values in decimal format.
1823                           Usage: --with-intro-progressbar-size=319,10
1824 ],,)
1826 AC_ARG_WITH(intro-progressbar-position,
1827 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1828                                      Comma separated values in decimal format.
1830                           Usage: --with-intro-progressbar-position=164,225
1831 ],,)
1833 AC_ARG_WITH(intro-progressbar-frame-color,
1834 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1835                                            Comma separated RGB values in decimal format.
1837                           Usage: --with-intro-progressbar-frame-color=207,208,211
1838 ],,)
1840 AC_ARG_WITH(intro-progressbar-text-color,
1841     AS_HELP_STRING([--with-intro-progressbar-text-color],
1842         [Set color of progress bar text on intro screen. Comma separated RGB values in decimal format.])
1843     [
1844                           Usage: --with-intro-progressbar-text-color=207,208,211
1845 ],,)
1847 AC_ARG_WITH(intro-progressbar-text-baseline,
1848     AS_HELP_STRING([--with-intro-progressbar-text-baseline],
1849         [Set vertical position of progress bar text on intro screen. Value in decimal format.])
1850     [
1851                           Usage: --with-intro-progressbar-text-baseline=250
1852 ],,)
1854 AC_ARG_WITH(flat-logo-svg,
1855 [  --with-flat-logo-svg    Allows specification of the flat Logo SVG.
1857                           Usage:     --with-flat-logo-svg=/path/my_flat_logo.svg
1858 ],,)
1860 AC_ARG_WITH(about-background-svg,
1861 [  --with-about-background-svg    Allows specification of the background SVG for the About dialog.
1863                           Usage:     --with-about-background-svg=/path/my_libo_about.svg
1864 ],,)
1866 AC_ARG_WITH(startcenter-left-bitmap,
1867 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1868                                      specification of bitmap for the Start center.
1870                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1871 ],,)
1873 AC_ARG_WITH(startcenter-right-bitmap,
1874 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1875                                       specification of bitmap for the Start center.
1877                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1878 ],,)
1880 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1881 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1882                                          specification of bitmap for the Start center.
1884                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1885 ],,)
1887 AC_ARG_WITH(startcenter-rtl-right-bitmap,
1888 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
1889                                           specification of bitmap for the Start center.
1891                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
1892 ],,)
1894 AC_ARG_WITH(startcenter-space-bitmap,
1895 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
1896                                       specification of bitmap for the Start center.
1898                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
1899 ],,)
1901 AC_ARG_WITH(vendor,
1902     AS_HELP_STRING([--with-vendor],
1903         [Set vendor of the build.])
1904     [
1905                           Usage:     --with-vendor="John the Builder"
1906     ],
1909 AC_ARG_WITH(unix-wrapper,
1910     AS_HELP_STRING([--with-unix-wrapper],
1911         [Redefines the name of the UNIX wrapper that will be used in the desktop
1912          files and in the desktop-integration RPMs.])
1913     [
1914                           Usage:     --with-unix-wrapper=ooffice
1915     ],
1918 AC_ARG_WITH(compat-oowrappers,
1919     AS_HELP_STRING([--with-compat-oowrappers],
1920         [Install oo* wrappers in parallel with
1921          lo* ones to keep backward compatibility.
1922          Has effect only with make distro-pack-install]),
1925 AC_ARG_WITH(asm-home,
1926     AS_HELP_STRING([--with-asm-home],
1927         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
1928     [
1929                           Usage:     --with-asm-home=<path to assembler directory>
1930     ],
1933 AC_ARG_WITH(os-version,
1934     AS_HELP_STRING([--with-os-version],
1935         [For FreeBSD users, use this option option to override the detected OSVERSION.])
1936     [
1937                           Usage:     --with-os-version=<OSVERSION>
1938     ],
1941 AC_ARG_WITH(mingw-cross-compiler,
1942     AS_HELP_STRING([--with-mingw-cross-compiler],
1943         [Specify the MinGW cross-compiler to use.])
1944     [
1945                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
1947                           When building on the ODK on Unix and building unowinreg.dll,
1948                           specify the MinGW C++ cross-compiler.
1949     ],
1952 AC_ARG_WITH(build-version,
1953     AS_HELP_STRING([--with-build-version],
1954         [Allows the builder to add a custom version tag that will appear in the
1955          Help/About box for QA purposes.])
1956     [
1957                           Usage:     --with-build-version="Built by Jim"
1958     ],
1959     with_build_version=$withval ,
1962 AC_ARG_WITH(alloc,
1963     AS_HELP_STRING([--with-alloc],
1964         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
1965          Note that on FreeBSD/NetBSD system==jemalloc]),
1968 AC_ARG_WITH(sun-templates,
1969     AS_HELP_STRING([--with-sun-templates],
1970         [Integrate Sun template packages.]),
1973 AC_ARG_WITH(num-cpus,
1974     AS_HELP_STRING([--with-num-cpus],
1975         [Number of build processes/cpus to use (number of projects that will build at the same time).
1976          Multi-process/multi-cpu builds can save a lot of time on multi-cpu machines.
1977          Defaults to the number of CPUs on the machine.]),
1980 AC_ARG_WITH(max-jobs,
1981     AS_HELP_STRING([--with-max-jobs],
1982         [Maximum number of jobs that will be issued at the same time per dmake or gbuild subproject.
1983          The real number of the jobs is affected by the --with-num-cpus too, it can get up to CPUS*max_jobs.
1984          Defaults to 1, unless you configure --enable-icecream - then to 10.]),
1987 dnl ===================================================================
1988 dnl MacOSX build and runtime environment options
1989 dnl ===================================================================
1991 AC_ARG_WITH(macosx-sdk,
1992     AS_HELP_STRING([--with-macosx-sdk],
1993         [Use a specific SDK for building.])
1994     [
1995                           Usage:     --with-macosx-sdk=<version>
1997                           e. g.: --with-macosx-sdk=10.4
1999                           there are 3 options to controle the MacOSX build:
2000                           --with-macosx-sdk (refered as 'sdl' below)
2001                           --with-macosx-version-min-required (refered as 'min' below)
2002                           --with-macosx-version-max-allowed (refered as 'max' below)
2004                           the connection between these value and the default they take is as follow:
2005                           ( ? means not specified on the command line, constraint: x <= y <= z)
2007                           ==========================================
2008                            command line      || config result
2009                           ==========================================
2010                           min  | max  | sdk  || min  | max  | sdk  |
2011                           ?    | ?    | ?    || 10.4 | 10.4 | 10.4 |
2012                           ?    | ?    | 10.x || 10.4 | 10.4 | 10.x |
2013                           ?    | 10.x | ?    || 10.4 | 10.x | 10.x |
2014                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
2015                           10.x | ?    | ?    || 10.x | 10.x | 10.x |
2016                           10.x | ?    | 10.y || 10.x | 10.x | 10.y |
2017                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
2018                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2021                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2022                           for a detailled technical explanation of these variables
2024                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2026     ],
2029 AC_ARG_WITH(macosx-version-min-required,
2030     AS_HELP_STRING([--with-macosx-version-min-required],
2031         [set the minimum OS version needed to run the built LibreOffice])
2032     [
2033                           Usage:     --with-macosx-version-min-required=<version>
2035                           e. g.: --with-macos-version-min-required=10.4
2036                           see --with-macosx-sdk for more info
2037     ],
2040 AC_ARG_WITH(macosx-version-max-allowed,
2041     AS_HELP_STRING([--with-macosx-version-max-allowed],
2042         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2043     [
2044                           Usage:     --with-macosx-version-max-allowed=<version>
2046                           e. g.: --with-macos-version-max-allowed=10.6
2047                           see --with-macosx-sdk for more info
2048     ],
2052 dnl ===================================================================
2053 dnl options for stuff used during cross-compilation build
2054 dnl These are superseded by --with-build-platform-configure-options
2055 dnl ===================================================================
2057 AC_ARG_WITH(system-boost-for-build,
2058     AS_HELP_STRING([--with-system-boost-for-build],
2059         [Use boost already on system for build tools (cross-compilation only).]))
2061 AC_ARG_WITH(system-cppunit-for-build,
2062     AS_HELP_STRING([--with-system-cppunit-for-build],
2063         [Use cppunit already on system for build tools (cross-compilation only).]))
2065 AC_ARG_WITH(system-db-for-build,
2066     AS_HELP_STRING([--with-system-db-for-build],
2067         [Use db already on system for build tools (cross-compilation only).]))
2069 AC_ARG_WITH(system-expat-for-build,
2070     AS_HELP_STRING([--with-system-expat-for-build],
2071         [Use expat already on system for build tools (cross-compilation only).]))
2073 AC_ARG_WITH(system-icu-for-build,
2074     AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2075         [Use icu already on system for build tools (cross-compilation only).]))
2077 AC_ARG_WITH(system-libxml-for-build,
2078     AS_HELP_STRING([--with-system-libxml-for-build],
2079         [Use libxml/libxslt already on system for build tools (cross-compilation only).]))
2082 dnl ===================================================================
2083 dnl check for required programs (grep, awk, sed, bash)
2084 dnl ===================================================================
2086 pathmunge ()
2088     if test -n "$1"; then
2089         if test "$build_os" = "cygwin"; then
2090             PathFormat "$1"
2091             new_path=`cygpath -u "$formatted_path"`
2092         else
2093             new_path="$1"
2094         fi
2095         if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2096             if test "$2" = "after"; then
2097                 LO_PATH="$LO_PATH:$new_path"
2098             else
2099                 LO_PATH="$new_path:$LO_PATH"
2100             fi
2101         fi
2102         unset new_path
2103     fi
2106 AC_PROG_AWK
2107 AC_PATH_PROG( AWK, $AWK)
2108 if test -z "$AWK"; then
2109     AC_MSG_ERROR([install awk to run this script])
2112 AC_PATH_PROG(BASH, bash)
2113 if test -z "$BASH"; then
2114     AC_MSG_ERROR([bash not found in \$PATH])
2116 AC_SUBST(BASH)
2118 AC_MSG_CHECKING([for GNU or BSD tar])
2119 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
2120     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
2121     if test $? -eq 0;  then
2122         GNUTAR=$a
2123         break
2124     fi
2125 done
2126 AC_MSG_RESULT($GNUTAR)
2127 if test -z "$GNUTAR"; then
2128     AC_MSG_ERROR([not found. install GNU or BSD tar.])
2130 AC_SUBST(GNUTAR)
2132 AC_MSG_CHECKING([for tar's option to strip components])
2133 $GNUTAR --help 2> /dev/null | egrep "strip-components" 2>&1 >/dev/null
2134 if test $? -eq 0; then
2135     STRIP_COMPONENTS="--strip-components"
2136 else
2137     $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2138         if test $? -eq 0; then
2139             STRIP_COMPONENTS="--strip-path"
2140         else
2141                 STRIP_COMPONENTS="unsupported"
2142         fi
2144 AC_MSG_RESULT($STRIP_COMPONENTS)
2145 if test x$STRIP_COMPONENTS == xunsupported; then
2146         AC_MSG_ERROR([you need a tar that is able to strip components.])
2148 AC_SUBST(STRIP_COMPONENTS)
2150 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2151 dnl desktop OSes from "mobile" ones.
2153 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2154 dnl In other words, that when building for an OS that is not a
2155 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2157 dnl Note the direction of the implication; there is no assumption that
2158 dnl cross-compiling would imply a non-desktop OS.
2160 if test $_os != iOS -a $_os != Android; then
2161     BUILD_TYPE="$BUILD_TYPE DESKTOP"
2164 dnl Decide whether to build database connectivity stuff (including
2165 dnl Base) or not. We probably don't want to on non-desktop OSes.
2167 if test -z "$enable_database_connectivity"; then
2168     # Do enable database connectivity for Android for now as otherwise
2169     # we presumably will get linking errors... We are not as far in
2170     # the work for iOS, so we might as well disable it for iOS already.
2171     if test $_os != iOS; then
2172         enable_database_connectivity=yes
2173     fi
2176 DISABLE_DBCONNECTIVITY=''
2177 if test "$enable_database_connectivity" = yes; then
2178     BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2179 else
2180     DISABLE_DBCONNECTIVITY='TRUE'
2181     SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
2183 AC_SUBST(DISABLE_DBCONNECTIVITY)
2185 if test -z "$enable_extensions"; then
2186     # For iOS disable extensions unless specifically overridden with
2187     # --enable-extensions.
2188     if test $_os != iOS; then
2189         enable_extensions=yes
2190     fi
2193 DISABLE_EXTENSIONS=''
2194 if test "$enable_extensions" = yes; then
2195     BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2196 else
2197     DISABLE_EXTENSIONS='TRUE'
2199 AC_SUBST(DISABLE_EXTENSIONS)
2201 if test -z "$enable_scripting"; then
2202     # Disable scripting for iOS unless specifically overridden
2203     # with --enable-scripting.
2204     if test $_os != iOS; then
2205         enable_scripting=yes
2206     fi
2209 DISABLE_SCRIPTING=''
2210 if test "$enable_scripting" = yes; then
2211     BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2212 else
2213     DISABLE_SCRIPTING='TRUE'
2214     SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2216 AC_SUBST(DISABLE_SCRIPTING)
2218 if test $_os = iOS; then
2219     # Disable dynamic_loading always for iOS
2220     enable_dynamic_loading=no
2221 elif test -z "$enable_dynamic_loading"; then
2222     # Otherwise enable it unless speficically disabled
2223     enable_dynamic_loading=yes
2226 DISABLE_DYNLOADING=''
2227 if test "$enable_dynamic_loading" = yes; then
2228     BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2229 else
2230     DISABLE_DYNLOADING='TRUE'
2231     SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2233 AC_SUBST(DISABLE_DYNLOADING)
2235 if test -n "${with_solver_and_workdir_root}"; then
2236     if ! test -d ${with_solver_and_workdir_root}; then
2237       AC_MSG_ERROR([directory does not exist: ${with_solver_and_workdir_root}])
2238     fi
2239     PathFormat "${with_solver_and_workdir_root}"
2240     # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
2241     if echo ${formatted_path} | $GREP -q '/$'; then
2242         SOLARVER=${formatted_path}solver
2243     else
2244         SOLARVER=${formatted_path}/solver
2245     fi
2246 else
2247     SOLARVER=${SRC_ROOT}/solver
2250 dnl ===================================================================
2251 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
2252 dnl although MSVC is used to build other build-time tools and
2253 dnl LibreOffice itself.
2254 dnl ===================================================================
2255 if test "$build_os" = "cygwin"; then
2256     AC_MSG_CHECKING([for Cygwin gcc/g++])
2257     if which gcc > /dev/null && which g++ > /dev/null; then
2258         AC_MSG_RESULT([found])
2259     else
2260         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
2261     fi
2264 # remenber SYSBASE value
2265 AC_SUBST(SYSBASE)
2267 dnl ===================================================================
2268 dnl  Checks if ccache is available
2269 dnl ===================================================================
2270 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" -a "$build_os" != "cygwin" \); then
2271     case "%$CC%$CXX%" in
2272     # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
2273     # assume that's good then
2274     *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2275         AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2276         ;;
2277     *)
2278         AC_PATH_PROG([CCACHE],[ccache],[not found])
2279         if test "$CCACHE" = "not found"; then
2280             CCACHE=""
2281         else
2282             # Need to check for ccache version: otherwise prevents
2283             # caching of the results (like "-x objective-c++" for Mac)
2284             if test $_os = Darwin -o $_os = iOS; then
2285                 # Check ccache version
2286                 AC_MSG_CHECKING([whether version of ccache is suitable])
2287                 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2288                 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2289                 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2290                     AC_MSG_RESULT([yes, $CCACHE_VERSION])
2291                 else
2292                     AC_MSG_RESULT([no, $CCACHE_VERSION])
2293                     CCACHE=""
2294                 fi
2295             fi
2296         fi
2297         ;;
2298     esac
2299 else
2300     CCACHE=""
2303 if test "$CCACHE" != ""; then
2304     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2305     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2306     if test "$ccache_size" = ""; then
2307         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2308         if test "$ccache_size" = ""; then
2309             ccache_size=0
2310         fi
2311         # we could not determine the size or it was less than 1GB -> disable auto-ccache
2312         if test $ccache_size -lt 1024; then
2313             CCACHE=""
2314             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
2315             echo "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled" >> warn
2316         else
2317             # warn that ccache may be too small for debug build
2318             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2319             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
2320         fi
2321     else
2322         if test $ccache_size -lt 5; then
2323             #warn that ccache may be too small for debug build
2324             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2325             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
2326         fi
2327     fi
2330 dnl ===================================================================
2331 dnl  Checks for C compiler,
2332 dnl  The check for the C++ compiler is later on.
2333 dnl ===================================================================
2334 GCC_HOME_SET="true"
2335 AC_MSG_CHECKING([gcc home])
2336 if test -z "$with_gcc_home"; then
2337     if test "$enable_icecream" = "yes"; then
2338         if test -d "/usr/lib/icecc/bin"; then
2339             GCC_HOME="/usr/lib/icecc/"
2340         else
2341             GCC_HOME="/opt/icecream/"
2342         fi
2343     else
2344         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2345         GCC_HOME_SET="false"
2346     fi
2347 else
2348     GCC_HOME="$with_gcc_home"
2350 AC_MSG_RESULT($GCC_HOME)
2351 AC_SUBST(GCC_HOME)
2353 if test "$GCC_HOME_SET" = "true"; then
2354     if test -z "$CC"; then
2355         CC="$GCC_HOME/bin/gcc"
2356     fi
2357     if test -z "$CXX"; then
2358         CXX="$GCC_HOME/bin/g++"
2359     fi
2362 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
2363 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2364     AC_PROG_CC
2367 COMPATH=`dirname "$CC"`
2368 if test "$COMPATH" = "."; then
2369     AC_PATH_PROGS(COMPATH, $CC)
2370     dnl double square bracket to get single because of M4 quote...
2371     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
2373 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
2375 dnl ===================================================================
2376 dnl  Test the Solaris compiler version
2377 dnl ===================================================================
2378 if test "$_os" = "SunOS"; then
2379     if test "$CC" = "cc"; then
2380         AC_PATH_PROGS(_cc, cc)
2381         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2382         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2383         dnl cc -V outputs to standard error!!!!
2384         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2385         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2386         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2387         if test "$_sunstudio_major" != "5"; then
2388             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2389         else
2390             _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" }'`
2391             if test "$_sunstudio_minor" = "false"; then
2392                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2393             else
2394                 dnl compiler will do
2395                 AC_MSG_RESULT([checked])
2396             fi
2397         fi
2398     fi
2402 dnl ===================================================================
2403 dnl  Test MacOSX sdk and version requirement
2404 dnl ===================================================================
2405 if test "$_os" = "Darwin"; then
2407     if test "$with_macosx_version_min_required" = ""; then
2408         with_macosx_version_min_required="10.4"
2409     fi
2411     if test "$with_macosx_version_max_allowed" = ""; then
2412         with_macosx_version_max_allowed="$with_macosx_version_min_required"
2413     fi
2415     if test "$with_macosx_sdk" = ""; then
2416         with_macosx_sdk="$with_macosx_version_max_allowed"
2417     fi
2419     case "$with_macosx_sdk" in
2421     10.4)
2422         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.4u.sdk"
2423         if test ! -d "$MACOSX_SDK_PATH"; then
2424             MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.4u.sdk"
2425         fi
2426         if test ! -d "$MACOSX_SDK_PATH"; then
2427             MACOSX_SDK_PATH="/Xcode3/SDKs/MacOSX10.4u.sdk"
2428         fi
2429         macosx_sdk_value="1040"
2430         ;;
2431     10.5)
2432         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.5.sdk"
2433         if test ! -d "$MACOSX_SDK_PATH"; then
2434             MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.5.sdk"
2435         fi
2436         if test ! -d "$MACOSX_SDK_PATH"; then
2437             MACOSX_SDK_PATH="/Xcode3/SDKs/MacOSX10.5.sdk"
2438         fi
2439         macosx_sdk_value="1050"
2440         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
2441         echo "Building with a SDK > 10.4 is experimental" >> warn
2442         ;;
2443     10.6)
2444         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"
2445         if test ! -d "$MACOSX_SDK_PATH"; then
2446             MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
2447         fi
2448         macosx_sdk_value="1060"
2449         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
2450         echo "Building with a SDK > 10.4 is experimental" >> warn
2451         ;;
2452     10.7)
2453         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.7.sdk"
2454         if test ! -d "$MACOSX_SDK_PATH"; then
2455             MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
2456         fi
2457         macosx_sdk_value="1070"
2458         AC_MSG_WARN([Building with SDK 10.7 is known to fail in vcl])
2459         echo "Building with SDK 10.7 is known to fail in vcl" >> warn
2460         ;;
2461     *)
2462         AC_MSG_ERROR([$with_macosx_sdk is not a supported SDK value, supported value are 10.4, 10.5, 10.6 and 10.7])
2463         ;;
2464     esac
2465     AC_MSG_CHECKING([the presence of the SDK $with_macosx_sdk])
2466     if test -d "$MACOSX_SDK_PATH"; then
2467         AC_MSG_RESULT([$MACOSX_SDK_PATH ok])
2468     else
2469         AC_MSG_ERROR([$MACOSX_SDK_PATH not found])
2470     fi
2471     FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks";
2472     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2474     case "$with_macosx_version_min_required" in
2476     10.4)
2477         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
2478         ;;
2479     10.5)
2480         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2481         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2482         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2483         if test -z "$save_CC"; then
2484             CC="gcc-4.2 -m32"
2485             CXX="g++-4.2 -m32"
2486         fi
2487         ;;
2488     10.6)
2489         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2490         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2491         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2492         if test -z "$save_CC"; then
2493             CC="gcc-4.2 -m32"
2494             CXX="g++-4.2 -m32"
2495         fi
2496         ;;
2497     10.7)
2498         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2499         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2500         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2501         if test -z "$save_CC"; then
2502             CC="gcc-4.2 -m32"
2503             CXX="g++-4.2 -m32"
2504         fi
2505         ;;
2506     *)
2507         AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported value are 10.4, 10.5, 10.6 and 10.7])
2508         ;;
2509     esac
2511     case "$with_macosx_version_max_allowed" in
2513     10.4)
2514         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
2515         ;;
2516     10.5)
2517         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2518         ;;
2519     10.6)
2520         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2521         ;;
2522     10.7)
2523         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2524         ;;
2525     *)
2526         AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported value are 10.4, 10.5, 10.6 and 10.7])
2527         ;;
2528     esac
2530     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2531     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2532         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2533     else
2534         AC_MSG_RESULT([ok])
2535     fi
2537     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent macos-with-sdk])
2538     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $macosx_sdk_value; then
2539         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2540     else
2541         AC_MSG_RESULT([ok])
2542     fi
2543     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2544     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2546 AC_SUBST(FRAMEWORKSHOME)
2547 AC_SUBST(MACOSX_SDK_PATH)
2548 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2549 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2550 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2552 dnl ===================================================================
2553 dnl Windows specific tests and stuff
2554 dnl ===================================================================
2555 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
2556     dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice.
2557     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2558     if test "$enable_cl_x64" = "" -o "$enable_cl_x64" = "no"; then
2559         CL_X64=""
2560         AC_MSG_RESULT([no])
2561     else
2562         CL_X64="TRUE"
2563         AC_MSG_RESULT([yes])
2564     fi
2566     AC_MSG_CHECKING([whether to use DirectX])
2567     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2568         ENABLE_DIRECTX="TRUE"
2569         AC_MSG_RESULT([yes])
2570     else
2571         ENABLE_DIRECTX=""
2572         AC_MSG_RESULT([no])
2573     fi
2575     AC_MSG_CHECKING([whether to use ActiveX])
2576     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2577         DISABLE_ACTIVEX=""
2578         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
2579         AC_MSG_RESULT([yes])
2580     else
2581         DISABLE_ACTIVEX="TRUE"
2582         AC_MSG_RESULT([no])
2583     fi
2585     AC_MSG_CHECKING([whether to use ATL])
2586     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
2587         DISABLE_ATL=""
2588         AC_MSG_RESULT([yes])
2589     else
2590         DISABLE_ATL="TRUE"
2591         AC_MSG_RESULT([no])
2592     fi
2593 else
2594     CL_X64=""
2595     ENABLE_DIRECTX=""
2596     DISABLE_ACTIVEX="TRUE"
2597     DISABLE_ATL="TRUE"
2600 AC_SUBST(CL_X64)
2601 AC_SUBST(ENABLE_DIRECTX)
2602 AC_SUBST(DISABLE_ACTIVEX)
2603 AC_SUBST(DISABLE_ATL)
2605 dnl ===================================================================
2606 dnl  Test the gcc version
2607 dnl ===================================================================
2608 if test "$GCC" = "yes"; then
2609     AC_MSG_CHECKING([the GCC version])
2610     _gcc_version=`$CC -dumpversion`
2611     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2612     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2614     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100"; then
2615         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0"; then
2616             export CC="$GCC_HOME/bin/gcc-4.0"
2617             #  export CC to have it available in set_soenv -> config.guess
2618             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2619             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100"; then
2620                 GCCVER=$GCCVER2
2621             fi
2622         fi
2623         if test "$GCCVER" -ge "040100"; then
2624             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])
2625         else
2626             AC_MSG_RESULT([implicitly using CC=$CC])
2627         fi
2628     else
2629         AC_MSG_RESULT([gcc $_gcc_version])
2630     fi
2633 dnl ===================================================================
2634 dnl  Is GCC actually Clang?
2635 dnl ===================================================================
2637 COM_GCC_IS_CLANG=
2638 if test "$GCC" = "yes"; then
2639     AC_MSG_CHECKING([whether GCC is actually Clang])
2640     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2641         #ifndef __clang__
2642         you lose
2643         #endif
2644         int foo=42;
2645         ]])],
2646         [AC_MSG_RESULT([yes])
2647          COM_GCC_IS_CLANG=TRUE],
2648         [AC_MSG_RESULT([no])])
2650     if test "$COM_GCC_IS_CLANG" = TRUE; then
2651         AC_MSG_CHECKING([the Clang version])
2652         clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
2653         CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
2654         CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2655         AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
2656     fi
2658 AC_SUBST(COM_GCC_IS_CLANG)
2660 # ===================================================================
2661 # check various GCC options that Clang does not support now but maybe
2662 # will somewhen in the future, check them even for GCC, so that the
2663 # flags are set
2664 # ===================================================================
2666 HAVE_GCC_GGDB2=
2667 HAVE_GCC_FINLINE_LIMIT=
2668 HAVE_GCC_FNO_INLINE=
2669 if test "$GCC" = "yes"; then
2670     AC_MSG_CHECKING([whether $CC supports -ggdb2])
2671     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
2672         # Option just ignored and silly warning that isn't a real
2673         # warning printed
2674         :
2675     else
2676         save_CFLAGS=$CFLAGS
2677         CFLAGS="$CFLAGS -Werror -ggdb2"
2678         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
2679         CFLAGS=$save_CFLAGS
2680     fi
2681     if test "$HAVE_GCC_GGDB2" = "TRUE"; then
2682         AC_MSG_RESULT([yes])
2683     else
2684         AC_MSG_RESULT([no])
2685     fi
2687     AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
2688     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
2689         # As above
2690         :
2691     else
2692         save_CFLAGS=$CFLAGS
2693         CFLAGS="$CFLAGS -Werror -finline-limit=0"
2694         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
2695         CFLAGS=$save_CFLAGS
2696     fi
2697     if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
2698         AC_MSG_RESULT([yes])
2699     else
2700         AC_MSG_RESULT([no])
2701     fi
2703     AC_MSG_CHECKING([whether $CC supports -fno-inline])
2704     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
2705         # Ditto
2706         :
2707     else
2708         save_CFLAGS=$CFLAGS
2709         CFLAGS="$CFLAGS -Werror -fno-inline"
2710         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
2711         CFLAGS=$save_CFLAGS
2712     fi
2713     if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
2714         AC_MSG_RESULT([yes])
2715     else
2716         AC_MSG_RESULT([no])
2717     fi
2719 AC_SUBST(HAVE_GCC_GGDB2)
2720 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
2721 AC_SUBST(HAVE_GCC_FNO_INLINE)
2723 HAVE_LD_BSYMBOLIC_FUNCTIONS=
2724 if test "$GCC" = "yes"; then
2725     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
2726     bsymbolic_functions_ldflags_save=$LDFLAGS
2727     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
2728     AC_LINK_IFELSE([AC_LANG_PROGRAM([
2729 #include <stdio.h>
2730         ],[
2731 printf ("hello world\n");
2732         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
2733     if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
2734         AC_MSG_RESULT( found )
2735     else
2736         AC_MSG_RESULT( not found )
2737     fi
2738     LDFLAGS=$bsymbolic_functions_ldflags_save
2740 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
2742 dnl Set the ENABLE_DBGUTIL variable
2743 dnl ===================================================================
2744 AC_MSG_CHECKING([whether to build with additional debug utilities])
2745 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
2746     PROEXT=""
2747     PRODUCT=""
2749     AC_MSG_RESULT([yes])
2750     # cppunit and graphite expose STL in public headers
2751     if test "$with_system_cppunit" = "yes"; then
2752         AC_MSG_ERROR([--with-system-cppunit conflicts with DBG_UTIL build])
2753     else
2754         with_system_cppunit=no
2755     fi
2756     if test "$with_system_graphite" = "yes"; then
2757         AC_MSG_ERROR([--with-system-graphite conflicts with DBG_UTIL build])
2758     else
2759         with_system_graphite=no
2760     fi
2761     if test "$with_system_mysql_cppconn" = "yes"; then
2762         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with DBG_UTIL build])
2763     else
2764         with_system_mysql_cppconn=no
2765     fi
2766     if test $_os = WINNT -a \
2767             \( "$enable_mozilla" != no -o \
2768                "$enable_build_mozilla" != no \); then
2769         # We can't build against the Mozilla stuff if using _DEBUG, will get linking errors
2770         # See connectivity/drivers/mozab
2771         AC_MSG_WARN([Also disabling Mozilla stuff then])
2772         enable_mozilla=no
2773         enable_build_mozilla=no
2774     fi
2775 else
2776     PRODUCT="full"
2777     PROEXT=".pro"
2778     AC_MSG_RESULT([no, full product build])
2780 AC_SUBST(PRODUCT)
2781 AC_SUBST(PROEXT)
2783 dnl ===================================================================
2784 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2785 dnl ===================================================================
2786 SHOWINCLUDES_PREFIX=
2787 if test "$_os" = "WINNT"; then
2788     if test "$WITH_MINGW" != "yes"; then
2789         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
2790         if test -z "$with_cl_home"; then
2791             vctest=`./oowintool --msvc-productdir`;
2792             if test "$CL_X64" = ""; then
2793                 if test -x "$vctest/bin/cl.exe"; then
2794                     with_cl_home=$vctest;
2795                 fi
2796             else
2797                 if test -x "$vctest/bin/amd64/cl.exe"; then
2798                     with_cl_home=$vctest;
2799                 fi
2800             fi
2801         else
2802             with_cl_home=`cygpath -u "$with_cl_home"`
2803         fi
2804         with_cl_home=`cygpath -d "$with_cl_home"`
2805         with_cl_home=`cygpath -u "$with_cl_home"`
2806         AC_MSG_RESULT([$with_cl_home])
2808         dnl ===========================================================
2809         dnl  Check for mspdb80.dll/mspdb100.dll
2810         dnl ===========================================================
2811         dnl MSVS 2008/10 Compiler
2812         if test -n "$with_mspdb_path";then
2813             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2814         fi
2815         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll"; then
2816             MSPDB_PATH="$with_mspdb_path"
2817         fi
2818         dnl MSVS 2008 case
2819         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2820             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2821         fi
2822         dnl Windows SDK 6.0 case
2823         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2824             MSPDB_PATH="$with_cl_home/bin"
2825         fi
2826         dnl MSVS 2010 case
2827         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
2828             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2829         fi
2831         if test -z "$MSPDB_PATH";then
2832             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2833             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2834             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
2835             MSPDB_PATH=`dirname "$MSPDB_PATH"`
2836         fi
2838         if test -z "$MSPDB_PATH"; then
2839             AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path])
2840         fi
2841         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2842         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2843         dnl The path needs to be added before cl is called
2844         PATH="$MSPDB_PATH:$PATH"
2846         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2847         if test -z "$CC"; then
2848             if test "$CL_X64" = ""; then
2849                 if test -x "$with_cl_home/bin/cl.exe"; then
2850                     CC="$with_cl_home/bin/cl.exe"
2851                 fi
2852             else
2853                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
2854                     CC="$with_cl_home/bin/amd64/cl.exe"
2855                 fi
2856             fi
2857             if test -z "$CC"; then
2858                 AC_PATH_PROG(CC, cl.exe)
2859             fi
2860             # This gives us a posix path with 8.3 filename restrictions
2861             CC=`cygpath -d "$CC"`
2862             CC=`cygpath -u "$CC"`
2863         fi
2865         if test -n "$CC"; then
2866             # Remove /cl.exe from CC case insensitive
2867             AC_MSG_RESULT([found ($CC)])
2868             if test "$CL_X64" = ""; then
2869                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
2870             else
2871                 if test -n "$with_cl_home"; then
2872                     COMPATH=`echo $with_cl_home`
2873                 fi
2874             fi
2875             export INCLUDE=`cygpath -d "$COMPATH/Include"`
2876             dnl  Check which Microsoft C/C++ compiler is found
2877             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2878             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
2879             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
2880                             x = match( \\\$0, /..\\...\\...../ )
2881                             CCversion = substr( \\\$0, RSTART, RLENGTH)
2882                             tokencount = split (CCversion,vertoken,\".\")
2883                             for ( i = 1 ; i <= tokencount ; i++ ) {
2884                                 printf (\"%04d\",vertoken[[i]] )
2885                             }
2886                             }"`
2887             if test "$CCNUMVER" -ge "001600000000"; then
2888                 COMEX=13
2889                 MSVSVER=2010
2890             elif test "$CCNUMVER" -ge "001500000000"; then
2891                 COMEX=12
2892                 MSVSVER=2008
2893             else
2894                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
2895             fi
2896             PathFormat "$COMPATH"
2897             COMPATH="$formatted_path"
2899             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
2900         else
2901             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
2902         fi
2904         dnl We need to guess the prefix of the -showIncludes output, it can be
2905         dnl localized
2906         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
2907         echo "#include <stdlib.h>" > conftest.c
2908         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
2909             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
2910         rm -f conftest.c conftest.obj
2911         if test -z "$SHOWINCLUDES_PREFIX"; then
2912             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
2913         else
2914             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
2915         fi
2917         # Check for 64-bit (cross-)compiler to use to build the 64-bit
2918         # version of the Explorer extension (and maybe other small
2919         # bits, too) needed when installing a 32-bit LibreOffice on a
2920         # 64-bit OS. The 64-bit Explorer extension is a feature that
2921         # has been present since long in OOo. Don't confuse it with
2922         # building LibreOffice itself as 64-bit code, which is
2923         # unfished work and highly experimental.
2925         BUILD_X64=
2926         CXX_X64_BINARY=
2927         LINK_X64_BINARY=
2928         LIBMGR_X64_BINARY=
2930         AC_MSG_CHECKING([for a x64 compiler and libraries for 64bit ActiveX component])
2931         if test "$CL_X64" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
2932             # Prefer native x64 compiler to cross-compiler, in case we are running
2933             # the build on a 64-bit OS.
2934             if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2935                 BUILD_X64=TRUE
2936                 CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2937                 LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
2938                 LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
2939             elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2940                 BUILD_X64=TRUE
2941                 CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
2942                 LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
2943                 LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
2944             fi
2945         fi
2946         if test "$BUILD_X64" = TRUE; then
2947             AC_MSG_RESULT([found])
2948         else
2949             AC_MSG_RESULT([not found])
2950             AC_MSG_WARN([Installation set will not contain the 64-bit Explorer extension])
2951         fi
2952         AC_SUBST(BUILD_X64)
2954         # These are passed to the environment through set_soenv.in as usual, and then
2955         # used in set_wntx64.mk
2956         AC_SUBST(CXX_X64_BINARY)
2957         AC_SUBST(LINK_X64_BINARY)
2958         AC_SUBST(LIBMGR_X64_BINARY)
2960     else
2961         AC_MSG_CHECKING([the compiler is MinGW])
2962         MACHINE_PREFIX=`$CC -dumpmachine`
2963         if echo $MACHINE_PREFIX | $GREP -q mingw32; then
2964             COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
2965             AC_MSG_RESULT([yes])
2966         else
2967             AC_MSG_ERROR([Compiler is not MinGW.])
2968         fi
2969     fi
2971 AC_SUBST(COMEX)
2972 PathFormat "$MSPDB_PATH"
2973 MSPDB_PATH="$formatted_path"
2974 AC_SUBST(SHOWINCLUDES_PREFIX)
2977 # prefix C with ccache if needed
2979 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2980     if test "$CCACHE" != ""; then
2981         AC_MSG_CHECKING([whether $CC is already ccached])
2983         AC_LANG_PUSH([C])
2984         save_CFLAGS=$CFLAGS
2985         CFLAGS="$CFLAGS --ccache-skip -O2"
2986         dnl an empty program will do, we're checking the compiler flags
2987         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2988                           [use_ccache=yes], [use_ccache=no])
2989         if test $use_ccache = yes; then
2990             AC_MSG_RESULT([yes])
2991         else
2992             CC="$CCACHE $CC"
2993             AC_MSG_RESULT([no])
2994         fi
2995         CFLAGS=$save_CFLAGS
2996         AC_LANG_POP([C])
2997     fi
3002 # determine CPU, CPUNAME, GUI, GUIBASE, ...
3004 LIB64="lib"
3005 SOLARINC=
3007 case "$host_os" in
3009 aix*)
3010     COM=GCC
3011     CPU=P
3012     CPUNAME=POWERPC
3013     GUI=UNX
3014     GUIBASE=unx
3015     OS=AIX
3016     RTL_OS=AIX
3017     RTL_ARCH=PowerPC
3018     OUTPATH=unxaigppc
3019     P_SEP=:
3020     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3021     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3022     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3023     ;;
3025 cygwin*)
3026     COM=MSC
3027     GUI=WNT
3028     GUIBASE=WIN
3029     OS=WNT
3030     RTL_OS=Windows
3031     P_SEP=";"
3033     case "$host_cpu" in
3034     i*86|x86_64)
3035         if test "$CL_X64" != ""; then
3036             CPU=X
3037             CPUNAME=X86_64
3038             RTL_ARCH=X86_64
3039             LIB64="lib/x64"
3040             OUTPATH=wntmscx$COMEX
3041         else
3042             CPU=I
3043             CPUNAME=INTEL
3044             RTL_ARCH=x86
3045             OUTPATH=wntmsci$COMEX
3046         fi
3047         ;;
3048     *)
3049         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3050         ;;
3051     esac
3052     SCPDEFS="$SCPDEFS -D_MSC_VER"
3053     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3054     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3055     ;;
3057 darwin*)
3058     COM=GCC
3059     GUI=UNX
3060     # Not sure if "Aqua" is the right term to use?
3061     GUIBASE="aqua"
3062     OS=MACOSX
3063     RTL_OS=MacOSX
3064     P_SEP=:
3066     case "$host_cpu" in
3067     arm*)
3068         CPU=R
3069         CPUNAME=ARM
3070         RTL_ARCH=ARM_EABI
3071         GUIBASE=cocoatouch
3072         OUTPATH=unxiosr
3073         OS=IOS;
3074         ;;
3075     powerpc*)
3076         CPU=P
3077         CPUNAME=POWERPC
3078         RTL_ARCH=PowerPC
3079         OUTPATH=unxmacxp
3080         ;;
3081     i*86|x86_64)
3082         CPU=I
3083         CPUNAME=INTEL
3084         RTL_ARCH=x86
3085         OUTPATH=unxmacxi
3086         ;;
3087     *)
3088         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3089         ;;
3090     esac
3091     SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3092     ;;
3094 dragonfly*)
3095     COM=GCC
3096     GUI=UNX
3097     GUIBASE=unx
3098     OS=DRAGONFLY
3099     RTL_OS=DragonFly
3100     OUTPATH=unxdfly
3101     P_SEP=:
3103     case "$host_cpu" in
3104     i*86)
3105         CPU=I
3106         CPUNAME=INTEL
3107         RTL_ARCH=x86
3108         ;;
3109     x86_64)
3110         CPU=X
3111         CPUNAME=X86_64
3112         RTL_ARCH=X86_64
3113         ;;
3114     *)
3115         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3116         ;;
3117     esac
3118     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3119     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3120     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3121     ;;
3123 freebsd*)
3124     COM=GCC
3125     GUI=UNX
3126     GUIBASE=unx
3127     RTL_OS=FreeBSD
3128     OS=FREEBSD
3129     OUTPATH=unxfbsd
3130     P_SEP=:
3132     case "$host_cpu" in
3133     i*86)
3134         CPU=I
3135         CPUNAME=INTEL
3136         RTL_ARCH=x86
3137         OUTPATH=unxfbsdi
3138         ;;
3139     x86_64)
3140         CPU=X
3141         CPUNAME=X86_64
3142         RTL_ARCH=X86_64
3143         ;;
3144     *)
3145         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3146         ;;
3147     esac
3148     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3149     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3150     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3151     ;;
3153 kfreebsd*)
3154     COM=GCC
3155     GUI=UNX
3156     GUIBASE=unx
3157     OS=LINUX
3158     RTL_OS=kFreeBSD
3159     P_SEP=:
3161     case "$host_cpu" in
3163     i*86)
3164         CPU=I
3165         CPUNAME=INTEL
3166         RTL_ARCH=x86
3167         OUTPATH=unxkfgi6
3168         ;;
3169     x86_64)
3170         CPU=X
3171         CPUNAME=X86_64
3172         RTL_ARCH=X86_64
3173         LIB64="lib64"
3174         OUTPATH=unxkfgx6
3175         ;;
3176     *)
3177         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3178         ;;
3179     esac
3180     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3181     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3182     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3183     ;;
3185 linux-gnu*)
3186     COM=GCC
3187     GUI=UNX
3188     GUIBASE=unx
3189     OS=LINUX
3190     RTL_OS=Linux
3191     P_SEP=:
3193     case "$host_cpu" in
3195     alpha)
3196         CPU=L
3197         CPUNAME=AXP
3198         RTL_ARCH=ALPHA
3199         OUTPATH=unxlngaxp
3200         ;;
3201     arm*)
3202         CPU=R
3203         CPUNAME=ARM
3204         EPM_FLAGS="-a arm"
3205         OUTPATH=unxlngr
3206         RTL_ARCH=ARM_EABI
3207         case "$host_cpu" in
3208         arm*-linux)
3209             RTL_ARCH=ARM_OABI
3210             ;;
3211         esac
3212         ;;
3213     hppa)
3214         CPU=H
3215         CPUNAME=HPPA
3216         RTL_ARCH=HPPA
3217         EPM_FLAGS="-a hppa"
3218         OUTPATH=unxlnghppa
3219         ;;
3220     i*86)
3221         CPU=I
3222         CPUNAME=INTEL
3223         RTL_ARCH=x86
3224         OUTPATH=unxlngi6
3225         ;;
3226     ia64)
3227         CPU=A
3228         CPUNAME=IA64
3229         RTL_ARCH=IA64
3230         OUTPATH=unxlnga
3231         ;;
3232     mips)
3233         CPU=M
3234         CPUNAME=GODSON
3235         RTL_ARCH=MIPS_EB
3236         EPM_FLAGS="-a mips"
3237         OUTPATH=unxlngmips
3238         ;;
3239     mips64)
3240         CPU=M
3241         CPUNAME=GODSON
3242         RTL_ARCH=MIPS_EB
3243         EPM_FLAGS="-a mips64"
3244         OUTPATH=unxlngmips
3245         ;;
3246     mips64el)
3247         CPU=M
3248         CPUNAME=GODSON
3249         RTL_ARCH=MIPS_EL
3250         EPM_FLAGS="-a mips64el"
3251         OUTPATH=unxlngmips
3252         ;;
3253     mipsel)
3254         CPU=M
3255         CPUNAME=GODSON
3256         RTL_ARCH=MIPS_EL
3257         EPM_FLAGS="-a mipsel"
3258         OUTPATH=unxlngmips
3259         ;;
3260     m68k)
3261         CPU=6
3262         CPUNAME=M68K
3263         RTL_ARCH=M68K
3264         OUTPATH=unxlngm68k
3265         ;;
3266     powerpc)
3267         CPU=P
3268         CPUNAME=POWERPC
3269         RTL_ARCH=PowerPC
3270         OUTPATH=unxlngppc
3271         ;;
3272     powerpc64)
3273         CPU=P
3274         CPUNAME=POWERPC64
3275         RTL_ARCH=PowerPC_64
3276         LIB64="lib64"
3277         OUTPATH=unxlngppc64
3278         ;;
3279     sparc)
3280         CPU=S
3281         CPUNAME=SPARC
3282         RTL_ARCH=SPARC
3283         OUTPATH=unxlngs
3284         ;;
3285     s390)
3286         CPU=3
3287         CPUNAME=S390
3288         RTL_ARCH=S390
3289         OUTPATH=unxlngs390
3290         ;;
3291     s390x)
3292         CPU=3
3293         CPUNAME=S390X
3294         RTL_ARCH=S390x
3295         LIB64="lib64"
3296         OUTPATH=unxlngs390x
3297         ;;
3298     x86_64)
3299         CPU=X
3300         CPUNAME=X86_64
3301         RTL_ARCH=X86_64
3302         LIB64="lib64"
3303         OUTPATH=unxlngx6
3304         ;;
3305     *)
3306         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3307         ;;
3308     esac
3309     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3310     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3311     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3312     ;;
3314 linux-androideabi*)
3315     COM=GCC
3316     GUI=UNX
3317     GUIBASE=android
3318     OS=ANDROID
3319     RTL_OS=Android
3320     P_SEP=:
3322     case "$host_cpu" in
3324     arm|armel)
3325         CPU=R
3326         CPUNAME=ARM
3327         RTL_ARCH=ARM_EABI
3328         OUTPATH=unxandr
3329         ;;
3330     *)
3331         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3332         ;;
3333     esac
3334     SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/$OUTPATH"
3335     SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3336     ;;
3338 mingw*)
3339     COM=GCC
3340     GUI=WNT
3341     GUIBASE=WIN
3342     OS=WNT
3343     RTL_OS=Windows
3344     P_SEP=:
3346     case "$host_cpu" in
3347     i*86|x86_64)
3348         if test "$CL_X64" != ""; then
3349             CPU=X
3350             CPUNAME=X86_64
3351             RTL_ARCH=X86_84
3352             OUTPATH=wntgccx$COMEX
3353         else
3354             CPU=I
3355             CPUNAME=INTEL
3356             RTL_ARCH=x86
3357             OUTPATH=wntgcci$COMEX
3358         fi
3359         ;;
3360     *)
3361         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3362         ;;
3363     esac
3364     SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/win32 -I$SRC_ROOT/solenv/inc/$OUTPATH"
3365     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3366     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3367     ;;
3369 *netbsd*)
3371     COM=GCC
3372     GUI=UNX
3373     GUIBASE=unx
3374     OS=NETBSD
3375     RTL_OS=NetBSD
3376     OUTPATH=unxnbsd
3377     P_SEP=:
3379     case "$host_cpu" in
3380     i*86)
3381         CPU=I
3382         CPUNAME=INTEL
3383         RTL_ARCH=x86
3384         ;;
3385     powerpc)
3386         CPU=P
3387         CPUNAME=POWERPC
3388         RTL_ARCH=PowerPC
3389         ;;
3390     sparc)
3391         CPU=S
3392         CPUNAME=SPARC
3393         RTL_ARCH=SPARC
3394         ;;
3395     x86_64)
3396         CPU=X
3397         CPUNAME=X86_64
3398         RTL_ARCH=X86_64
3399         ;;
3400     *)
3401         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3402         ;;
3403     esac
3404     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3405     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3406     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3407     ;;
3409 openbsd*)
3410     COM=GCC
3411     GUI=UNX
3412     GUIBASE=unx
3413     OS=OPENBSD
3414     RTL_OS=OpenBSD
3415     OUTPATH=unxobsd
3416     P_SEP=:
3418     case "$host_cpu" in
3419     i*86)
3420         CPU=I
3421         CPUNAME=INTEL
3422         RTL_ARCH=x86
3423         ;;
3424     x86_64)
3425         CPU=X
3426         CPUNAME=X86_64
3427         RTL_ARCH=X86_64
3428         ;;
3429     *)
3430         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3431         ;;
3432     esac
3433     SOLARINC="$SOLARINC -I/usr/local/include"
3434     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3435     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3436     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3437     SOLARLIB="$SOLARLIB -L/usr/local/lib"
3439     ;;
3441 solaris*)
3443     COM=GCC
3444     GUI=UNX
3445     GUIBASE=unx
3446     OS=SOLARIS
3447     RTL_OS=Solaris
3448     P_SEP=:
3450     case "$host_cpu" in
3451     i*86)
3452         CPU=I
3453         CPUNAME=INTEL
3454         RTL_ARCH=x86
3455         OUTPATH=unxsogi
3456         ;;
3457     sparc)
3458         CPU=S
3459         CPUNAME=SPARC
3460         RTL_ARCH=SPARC
3461         OUTPATH=unxsogs
3462         ;;
3463     *)
3464         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3465         ;;
3466     esac
3467     SOLARINC="$SOLARINC -I/usr/local/include"
3468     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3469     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3470     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3471     SOLARLIB="$SOLARLIB -L$COMPATH/lib"
3472     SOLARLIB="$SOLARLIB -L/usr/local/bin -L/usr/dt/lib -L/usr/openwin/lib"
3473     ;;
3476     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
3477     ;;
3478 esac
3480 if test "$enable_headless" = "yes"; then
3481     GUIBASE=headless
3484 INPATH="${OUTPATH}${PROEXT}"
3485 if test -n "${with_solver_and_workdir_root}"; then
3486     PathFormat "${with_solver_and_workdir_root}"
3487     # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
3488     if echo ${formatted_path} | $GREP -q '/$'; then
3489         WORKDIR=${formatted_path}workdir/${INPATH}
3490     else
3491         WORKDIR=${formatted_path}/workdir/${INPATH}
3492     fi
3493 else
3494     WORKDIR=${SRC_ROOT}/workdir/${INPATH}
3496 OUTDIR="${SOLARVER}/${INPATH}"
3497 SOLARINC="-I. -I${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC"
3498 AC_SUBST(COM)
3499 AC_SUBST(CPU)
3500 AC_SUBST(CPUNAME)
3501 AC_SUBST(RTL_OS)
3502 AC_SUBST(RTL_ARCH)
3503 AC_SUBST(EPM_FLAGS)
3504 AC_SUBST(GUI)
3505 AC_SUBST(GUIBASE)
3506 AC_SUBST(INPATH)
3507 AC_SUBST(OS)
3508 AC_SUBST(OUTDIR)
3509 AC_SUBST(OUTPATH)
3510 AC_SUBST(P_SEP)
3511 AC_SUBST(SOLARVER)
3512 AC_SUBST(WORKDIR)
3514 dnl ===================================================================
3515 dnl Set up a different compiler to produce tools to run on the build
3516 dnl machine when doing cross-compilation
3517 dnl ===================================================================
3519 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
3520 if test "$cross_compiling" = "yes"; then
3521     AC_MSG_CHECKING([for BUILD platform configuration])
3522     echo
3523     rm -rf CONF-FOR-BUILD config_build.mk
3524     mkdir CONF-FOR-BUILD
3525     tar cf - \
3526         bin/repo-list.in \
3527         config.guess \
3528         config_host.mk.in \
3529         configure \
3530         ooo.lst.in \
3531         oowintool \
3532         post_download.in \
3533         solenv/inc/langlist.mk \
3534         solenv/inc/postset.mk \
3535     | (cd CONF-FOR-BUILD && tar xf -)
3536     (
3537     unset COM GUI GUIBASE OS CPU CPUNAME
3538     unset CC CXX SYSBASE CFLAGS
3539     unset PYTHON_CFLAGS PYTHON_LIBS
3540     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
3541     unset CPPUNIT_CFLAGS CPPUNIT_LIBS
3542     unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
3543     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
3544     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
3545     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
3546     cd CONF-FOR-BUILD
3547     sub_conf_opts=""
3548     test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
3549     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
3550     test $with_java = no && sub_conf_opts="$sub_conf_opts --without-java"
3551     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
3552     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
3553     test -n "${with_solver_and_workdir_root}" && sub_conf_opts="$sub_conf_opts --with-solver-and-workdir-root=${with_solver_and_workdir_root}"
3554     test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost"
3555     test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit"
3556     test -n "$with_system_db_for_build" && sub_conf_opts="$sub_conf_opts --with-system-db"
3557     test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat"
3558     test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
3559     test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml"
3560     sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
3561     ./configure \
3562         --disable-mozilla \
3563         --disable-build-mozilla \
3564         --disable-zenity \
3565         --with-num-cpus="$with_num_cpus" \
3566         --with-max-jobs="$with_max_jobs" \
3567         --without-doxygen \
3568         $sub_conf_opts \
3569         2>&1 | sed -e 's/^/    /'
3570     test -f ./config_host.mk 2>/dev/null || exit
3571     cp config_host.mk ../config_build.mk
3572     cp config.log ../config.Build.log
3573     sed -e 's,=\(.*\),="\1",' < config_host.mk > config_host.sh
3574     . ./config_host.sh
3575     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
3576              SYSTEM_LIBXSLT; do
3577         VV='$'$V
3578         VV=`eval "echo $VV"`
3579         if test -n "$VV"; then
3580             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
3581             echo "$line" >>build-config
3582         fi
3583     done
3585     for V in OUTDIR LO_PATH SOLARINC SOLARLIB WORKDIR; do
3586         VV='$'$V
3587         VV=`eval "echo $VV"`
3588         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
3589         if test -n "$VV"; then
3590             line="${V}_FOR_BUILD='$VV'"
3591             echo "$line" >>build-config
3592         fi
3593     done
3594     )
3595     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
3596     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])
3597     perl -pi -e 's,/CONF-FOR-BUILD,,g' config_build.mk
3598     eval `cat CONF-FOR-BUILD/build-config`
3599     AC_MSG_RESULT([checking for BUILD platform configuration... done])
3600     rm -rf CONF-FOR-BUILD
3601 else
3602     CC_FOR_BUILD="$CC"
3603     CXX_FOR_BUILD="$CXX"
3604     CC_FOR_BUILD="$CC"
3605     COM_FOR_BUILD="$COM"
3606     CPUNAME_FOR_BUILD="$CPUNAME"
3607     CPU_FOR_BUILD="$CPU"
3608     CXX_FOR_BUILD="$CXX"
3609     GUIBASE_FOR_BUILD="$GUIBASE"
3610     GUI_FOR_BUILD="$GUI"
3611     INPATH_FOR_BUILD="$INPATH"
3612     MACOSX_DEPLOYMENT_TARGET_FOR_BUILD="$MACOSX_DEPLOYMENT_TARGET"
3613     OS_FOR_BUILD="$OS"
3614     OUTDIR_FOR_BUILD="$OUTDIR"
3615     OUTPATH_FOR_BUILD="$OUTPATH"
3616     WORKDIR_FOR_BUILD="$WORKDIR"
3618 AC_SUBST(COM_FOR_BUILD)
3619 AC_SUBST(GUI_FOR_BUILD)
3620 AC_SUBST(GUIBASE_FOR_BUILD)
3621 AC_SUBST(OS_FOR_BUILD)
3622 AC_SUBST(CPU_FOR_BUILD)
3623 AC_SUBST(CPUNAME_FOR_BUILD)
3624 AC_SUBST(CC_FOR_BUILD)
3625 AC_SUBST(CXX_FOR_BUILD)
3626 AC_SUBST(INPATH_FOR_BUILD)
3627 AC_SUBST(OUTPATH_FOR_BUILD)
3628 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
3630 AC_SUBST(OUTDIR_FOR_BUILD)
3631 AC_SUBST(WORKDIR_FOR_BUILD)
3633 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
3634 SOURCEVERSION="OOO$UPD"
3635 AC_SUBST(UPD)
3636 AC_SUBST(SOURCEVERSION)
3638 dnl ===================================================================
3639 dnl Set the ENABLE_CRASHDUMP variable.
3640 dnl ===================================================================
3641 AC_MSG_CHECKING([whether to enable crashdump feature])
3642 if test "$enable_crashdump" = "yes"; then
3643     ENABLE_CRASHDUMP="TRUE"
3644     BUILD_TYPE="$BUILD_TYPE CRASHREP"
3645     AC_MSG_RESULT([yes])
3646 else
3647     ENABLE_CRASHDUMP=""
3648     AC_MSG_RESULT([no])
3650 AC_SUBST(ENABLE_CRASHDUMP)
3653 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
3654 dnl ===================================================================
3655 AC_MSG_CHECKING([whether to turn warnings to errors])
3656 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
3657     EXTERNAL_WARNINGS_NOT_ERRORS="FALSE"
3658     AC_MSG_RESULT([yes])
3659 else
3660     EXTERNAL_WARNINGS_NOT_ERRORS="TRUE"
3661     AC_MSG_RESULT([no])
3663 AC_SUBST(EXTERNAL_WARNINGS_NOT_ERRORS)
3665 dnl Set the ENABLE_DEBUG variable.
3666 dnl ===================================================================
3667 AC_MSG_CHECKING([whether to do a debug build])
3668 if test -n "$enable_debug" && test "$enable_debug" != "no"; then
3669     if test "$enable_debug" = "y" || test "$enable_debug" = "yes"; then
3670         ENABLE_DEBUG="TRUE"
3671         ENABLE_DEBUG_FOR=all
3672         AC_MSG_RESULT([yes])
3673     else
3674         ENABLE_DEBUG=""
3675         ENABLE_DEBUG_FOR="$enable_debug"
3676         AC_MSG_RESULT([for $enable_debug])
3677     fi
3678 else
3679     ENABLE_DEBUG=""
3680     ENABLE_DEBUG_FOR=""
3681     AC_MSG_RESULT([no])
3683 AC_SUBST(ENABLE_DEBUG)
3684 AC_SUBST(ENABLE_DEBUG_FOR)
3687 dnl Determine whether to use linkoo for the smoketest installation
3688 dnl ===================================================================
3689 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
3690 if test "$enable_linkoo" = "no"; then
3691     DISABLE_LINKOO="TRUE"
3692     AC_MSG_RESULT([no])
3693 else
3694     DISABLE_LINKOO=
3695     AC_MSG_RESULT([yes])
3697 AC_SUBST(DISABLE_LINKOO)
3699 # Set the ENABLE_LTO variable
3700 # ===================================================================
3701 AC_MSG_CHECKING([whether to use link-time optimization])
3702 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
3703     ENABLE_LTO="TRUE"
3704     AC_MSG_RESULT([yes])
3705 else
3706     ENABLE_LTO=""
3707     AC_MSG_RESULT([no])
3709 AC_SUBST(ENABLE_LTO)
3711 dnl whether to include symbols into final build.
3712 dnl ===================================================================
3713 AC_MSG_CHECKING([whether to include symbols])
3714 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
3715     ENABLE_SYMBOLS="TRUE"
3716     AC_MSG_RESULT([yes])
3717 else
3718     if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
3719         ENABLE_SYMBOLS="FALSE"
3720     else
3721         ENABLE_SYMBOLS=
3722     fi
3723     AC_MSG_RESULT([no])
3725 AC_SUBST(ENABLE_SYMBOLS)
3727 if test "$enable_headless" = "yes"; then
3728     # be sure to do not mess with uneeded stuff
3729     test_randr=no
3730     test_xrender=no
3731     test_cups=no
3732     test_fontconfig=yes
3733     test_gtk=no
3734     build_gstreamer=no
3735     test_tde=no
3736     test_kde=no
3737     test_kde4=no
3738     test_unix_quickstarter=no
3739     test_cairo=no
3742 dnl check for cups support
3743 dnl ===================================================================
3744 if test "$enable_cups" = "no"; then
3745     test_cups=no
3746     ENABLE_CUPS="NO"
3747 elif test "$enable_cups" = "yes"; then
3748     if test $_os = iOS -o $_os = Android; then
3749         AC_MSG_ERROR([CUPS makes no sense for $_os])
3750     fi
3751     ENABLE_CUPS="YES"
3752 elif test $_os = iOS -o $_os = Android; then
3753     ENABLE_CUPS=NO
3754 else
3755     ENABLE_CUPS="YES"
3757 AC_SUBST(ENABLE_CUPS)
3759 if test "$test_cups" = "yes"; then
3760     AC_MSG_CHECKING([whether cups support is present])
3761     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
3762     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
3763     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
3764         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
3765     fi
3769 # fontconfig checks
3770 if test "$test_fontconfig" = "yes"; then
3771     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
3772 else
3773     case "$BUILD_TYPE" in
3774     *FONTCONFIG*)
3775         FONTCONFIG_LIBS="-lfontconfig"
3776         ;;
3777     esac
3779 AC_SUBST(FONTCONFIG_CFLAGS)
3780 AC_SUBST(FONTCONFIG_LIBS)
3782 dnl whether to find & fetch external tarballs?
3783 dnl ===================================================================
3784 if test -z "$TARFILE_LOCATION"; then
3785     TARFILE_LOCATION="$SRC_ROOT/src"
3787 AC_SUBST(TARFILE_LOCATION)
3789 AC_MSG_CHECKING([whether we want to fetch tarballs])
3790 if test "$enable_fetch_external" != "no"; then
3791     AC_MSG_RESULT([yes])
3792     DO_FETCH_TARBALLS="YES"
3793 else
3794     AC_MSG_RESULT([no])
3795     DO_FETCH_TARBALLS="NO"
3797 AC_SUBST(DO_FETCH_TARBALLS)
3800 dnl Disable legacy binary file formats filters
3801 dnl ===================================================================
3802 AC_MSG_CHECKING([whether to enable filters for legacy binary file formats (StarOffice 5.2)])
3803 if test "$enable_binfilter" = "no"; then
3804     WITH_BINFILTER="NO"
3805     AC_MSG_RESULT([no])
3806 else
3807     WITH_BINFILTER="YES"
3808     BUILD_TYPE="$BUILD_TYPE BINFILTER"
3809     GIT_REPO_NAMES="$GIT_REPO_NAMES binfilter"
3810     AC_MSG_RESULT([yes])
3812 AC_SUBST(WITH_BINFILTER)
3814 AC_MSG_CHECKING([whether to build help])
3815 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
3816     AC_MSG_RESULT([yes])
3817     BUILD_TYPE="$BUILD_TYPE HELP"
3818     SCPDEFS="$SCPDEFS -DWITH_HELP"
3819     GIT_REPO_NAMES="$GIT_REPO_NAMES help"
3820 else
3821     AC_MSG_RESULT([no])
3824 dnl Test whether to include MySpell dictionaries
3825 dnl ===================================================================
3826 AC_MSG_CHECKING([whether to include MySpell dictionaries])
3827 if test -z "$with_myspell_dicts" -o "$with_myspell_dicts" = "yes"; then
3828     AC_MSG_RESULT([yes])
3829     WITH_MYSPELL_DICTS=YES
3830     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
3831     GIT_REPO_NAMES="$GIT_REPO_NAMES dictionaries"
3832 else
3833     AC_MSG_RESULT([no])
3834     WITH_MYSPELL_DICTS=NO
3836 AC_SUBST(WITH_MYSPELL_DICTS)
3838 AC_MSG_CHECKING([whether to use dicts from external paths])
3839 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
3840     AC_MSG_RESULT([yes])
3841     SYSTEM_DICTS=YES
3842     AC_MSG_CHECKING([for spelling dictionary directory])
3843     if test -n "$with_external_dict_dir"; then
3844         DICT_SYSTEM_DIR=file://$with_external_dict_dir
3845     else
3846         DICT_SYSTEM_DIR=file:///usr/share/hunspell
3847         if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
3848             DICT_SYSTEM_DIR=file:///usr/share/myspell
3849         fi
3850     fi
3851     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
3852     AC_MSG_CHECKING([for hyphenation patterns directory])
3853     if test -n "$with_external_hyph_dir"; then
3854         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
3855     else
3856         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
3857     fi
3858     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
3859     AC_MSG_CHECKING([for thesaurus directory])
3860     if test -n "$with_external_thes_dir"; then
3861         THES_SYSTEM_DIR=file://$with_external_thes_dir
3862     else
3863         THES_SYSTEM_DIR=file:///usr/share/mythes
3864     fi
3865     AC_MSG_RESULT([$THES_SYSTEM_DIR])
3866 else
3867     AC_MSG_RESULT([no])
3868     SYSTEM_DICTS=NO
3870 AC_SUBST(SYSTEM_DICTS)
3871 AC_SUBST(DICT_SYSTEM_DIR)
3872 AC_SUBST(HYPH_SYSTEM_DIR)
3873 AC_SUBST(THES_SYSTEM_DIR)
3875 dnl ===================================================================
3876 dnl ENABLE_PCH i now a no-op
3877 dnl ===================================================================
3878 AC_MSG_CHECKING([whether to enable pch feature])
3879 AC_MSG_RESULT([no, obsolete])
3881 dnl ===================================================================
3882 dnl Search all the common names for GNU make
3883 dnl ===================================================================
3884 AC_MSG_CHECKING([for GNU make])
3886 # try to use our own make if it is available and GNUMAKE was not already defined
3887 if test -z "$GNUMAKE"; then
3888     if test -x "/opt/lo/bin/make"; then
3889         GNUMAKE="/opt/lo/bin/make"
3890     fi
3893 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
3894     if test -n "$a"; then
3895         $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
3896         if test $? -eq 0;  then
3897             GNUMAKE=$a
3898             break
3899         fi
3900     fi
3901 done
3902 AC_MSG_RESULT($GNUMAKE)
3903 if test -z "$GNUMAKE"; then
3904     AC_MSG_ERROR([not found. install GNU make.])
3907 AC_MSG_CHECKING([the GNU make version])
3908 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
3909 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3910 if test "$_make_longver" -ge "038200"; then
3911     AC_MSG_RESULT([$GNUMAKE $_make_version])
3913 elif test "$_make_longver" -ge "038100"; then
3914     if test "$build_os" = "cygwin"; then
3915         AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
3916     fi
3917     AC_MSG_RESULT([$GNUMAKE $_make_version])
3919     dnl ===================================================================
3920     dnl Search all the common names for sha1sum
3921     dnl ===================================================================
3922     AC_PATH_PROGS(SHA1SUM, sha1sum sha1 shasum)
3923     if test -z "$SHA1SUM"; then
3924         AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
3925     fi
3926     AC_MSG_CHECKING([for GNU make bug 20033])
3927     TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
3928     cat > $TESTGMAKEBUG20033/Makefile << EOF
3929 A := \$(wildcard *.a)
3931 .PHONY: all
3932 all: \$(A:.a=.b)
3933         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
3935 .PHONY: setup
3936 setup:
3937         @touch 1.a 2.a 3.a 4.a 5.a 6.a
3939 define d1
3940 @echo lala \$(1)
3941 @sleep 1
3942 endef
3944 define d2
3945 @echo tyty \$(1)
3946 @sleep 1
3947 endef
3949 %.b : %.a
3950         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
3951         \$(call d1,\$(CHECKSUM)),\
3952         \$(call d2,\$(CHECKSUM)))
3954     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
3955         no_parallelism_make="YES"
3956         AC_MSG_RESULT([yes, disable parallelism])
3957     else
3958         AC_MSG_RESULT([no, keep parallelism enabled])
3959     fi
3960     rm -rf $TESTGMAKEBUG20033
3961 else
3962     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
3965 # find if gnumake support file function
3966 AC_MSG_CHECKING([whether GNU make supports the 'file' function])
3967 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
3968 cat > $TESTGMAKEFILEFUNC/Makefile << EOF
3969 \$(file >test.txt,Success )
3971 .PHONY: all
3972 all:
3973         @cat test.txt
3976 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
3977 if test -f $TESTGMAKEFILEFUNC/test.txt ; then
3978     HAVE_GNUMAKE_FILE_FUNC="YES"
3979     AC_MSG_RESULT([yes])
3980 else
3981     AC_MSG_RESULT([no])
3983 rm -rf $TESTGMAKEFILEFUNC
3984 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
3985 AC_SUBST(GNUMAKE)
3987 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`;
3988 STALE_MAKE=
3989 make_warning=
3990 if test "$_make_ver_check" = ""; then
3991    STALE_MAKE=TRUE
3994 HAVE_LD_HASH_STYLE=FALSE
3995 WITH_LINKER_HASH_STYLE=
3996 AC_MSG_CHECKING( for --hash-style gcc linker support )
3997 if test "$GCC" = "yes"; then
3998     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
3999         hash_styles="gnu sysv"
4000     elif test "$with_linker_hash_style" = "no"; then
4001         hash_styles=
4002     else
4003         hash_styles="$with_linker_hash_style"
4004     fi
4006     for hash_style in $hash_styles; do
4007         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4008         hash_style_ldflags_save=$LDFLAGS
4009         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4011         AC_LINK_IFELSE([AC_LANG_PROGRAM(
4012             [
4013 #include <stdio.h>
4014             ],[
4015 printf ("");
4016             ])],
4017             [ if ./conftest$EXEEXT; then
4018                   HAVE_LD_HASH_STYLE=TRUE
4019                   WITH_LINKER_HASH_STYLE=$hash_style
4020               fi],
4021             [HAVE_LD_HASH_STYLE=FALSE])
4022         LDFLAGS=$hash_style_ldflags_save
4023     done
4025     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
4026         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
4027     else
4028         AC_MSG_RESULT( no )
4029     fi
4030     LDFLAGS=$hash_style_ldflags_save
4031 else
4032     AC_MSG_RESULT( no )
4034 AC_SUBST(HAVE_LD_HASH_STYLE)
4035 AC_SUBST(WITH_LINKER_HASH_STYLE)
4037 dnl ===================================================================
4038 dnl Check whether there's a Perl version available.
4039 dnl ===================================================================
4040 if test -z "$with_perl_home"; then
4041     AC_PATH_PROG(PERL, perl)
4042 else
4043     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
4044     _perl_path="$with_perl_home/bin/perl"
4045     if test -x "$_perl_path"; then
4046         PERL=$_perl_path
4047     else
4048         AC_MSG_ERROR([$_perl_path not found])
4049     fi
4052 dnl ===================================================================
4053 dnl Testing for Perl version 5 or greater.
4054 dnl $] is the Perl version variable, it is returned as an integer
4055 dnl ===================================================================
4056 if test "$PERL"; then
4057     AC_MSG_CHECKING([the Perl version])
4058     ${PERL} -e "exit($]);"
4059     _perl_version=$?
4060     if test "$_perl_version" -lt 5; then
4061         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
4062     fi
4063     AC_MSG_RESULT([checked (perl $_perl_version)])
4064 else
4065     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
4068 dnl ===================================================================
4069 dnl Testing for required Perl modules
4070 dnl ===================================================================
4072 AC_MSG_CHECKING([for required Perl modules])
4073 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'`; then
4074     AC_MSG_RESULT([all modules found])
4075 else
4076     AC_MSG_ERROR([Failed to find some modules])
4080 dnl ===================================================================
4081 dnl Check for pkg-config
4082 dnl ===================================================================
4083 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4084     PKG_PROG_PKG_CONFIG
4087 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4089     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
4090     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
4091     # explicitly. Or put /path/to/compiler in PATH yourself.
4093     AC_CHECK_TOOL(AR,ar)
4094     AC_CHECK_TOOL(NM,nm)
4095     AC_CHECK_TOOL(OBJDUMP,objdump)
4096     AC_CHECK_TOOL(RANLIB,ranlib)
4097     AC_CHECK_TOOL(STRIP,strip)
4098     if test "$_os" = "WINNT"; then
4099         AC_CHECK_TOOL(DLLTOOL,dlltool)
4100         AC_CHECK_TOOL(WINDRES,windres)
4101     fi
4103 AC_SUBST(AR)
4104 AC_SUBST(DLLTOOL)
4105 AC_SUBST(NM)
4106 AC_SUBST(OBJDUMP)
4107 AC_SUBST(PKG_CONFIG)
4108 AC_SUBST(RANLIB)
4109 AC_SUBST(STRIP)
4110 AC_SUBST(WINDRES)
4112 dnl ===================================================================
4113 dnl pkg-config checks on Mac OS X
4114 dnl ===================================================================
4116 if test $_os = Darwin; then
4117     AC_MSG_CHECKING([for bogus pkg-config])
4118     if test -n "$PKG_CONFIG"; then
4119         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
4120             AC_MSG_RESULT([yes, from Mono])
4121         else
4122             AC_MSG_RESULT([yes, from unknown origin])
4123         fi
4124         AC_MSG_WARN([This might have unexpected consequences, please consider hiding $PKG_CONFIG])
4125         echo "Having a $PKG_CONFIG might have unexpected consequences, please consider hiding it" >>warn
4126     else
4127         AC_MSG_RESULT([no])
4128     fi
4131 dnl ===================================================================
4132 dnl  .NET needs special treatment
4133 dnl (does the above comment really mean .NET, or is it misusing
4134 dnl that to mean Visual Studio .NET 2003 ? And does this also
4135 dnl in fact apply equally to what we actually support, i.e.
4136 dnl Visual Studio 2008 and 2010?)
4137 dnl ===================================================================
4138 if test "$build_os" = "cygwin" ; then
4139     dnl Check midl.exe
4140     AC_PATH_PROG(MIDL_PATH, midl.exe)
4141     if test -n "$MIDL_PATH";then
4142         MIDL_PATH=`dirname "$MIDL_PATH"`
4143     fi
4144     if test -n "$with_midl_path";then
4145         with_midl_path=`cygpath -u "$with_midl_path"`
4146     fi
4147     if test -x "$with_midl_path/midl.exe"; then
4148         MIDL_PATH="$with_midl_path"
4149     fi
4150     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
4151         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
4152     fi
4153     if test -z "$MIDL_PATH"; then
4154         vstest=`./oowintool --msvs-productdir`;
4155         if test -x "$vstest/Common7/Tools/Bin/midl.exe"; then
4156             MIDL_PATH="$vstest/Common7/Tools/Bin"
4157         fi
4158     fi
4159     if test -z "$MIDL_PATH"; then
4160         winsdktest=`./oowintool --windows-sdk-home`
4161         if test -x "$winsdktest/Bin/midl.exe"; then
4162             MIDL_PATH="$winsdktest/Bin"
4163         fi
4164     fi
4165     if test ! -x "$MIDL_PATH/midl.exe"; then
4166         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
4167     fi
4168     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4169     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
4170     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
4172     dnl Check csc.exe
4173     AC_PATH_PROG(CSC_PATH, csc.exe)
4174     if test -n "$CSC_PATH";then
4175         CSC_PATH=`dirname "$CSC_PATH"`
4176     fi
4177     if test -n "$with_csc_path";then
4178         with_csc_path=`cygpath -u "$with_csc_path"`
4179     fi
4180     if test -x "$with_csc_path/csc.exe"; then
4181         CSC_PATH="$with_csc_path"
4182     else
4183        csctest=`./oowintool --csc-compilerdir`;
4184        if test -x "$csctest/csc.exe"; then
4185            CSC_PATH="$csctest"
4186        fi
4187     fi
4188     if test ! -x "$CSC_PATH/csc.exe"; then
4189         AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
4190     fi
4191     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4192     CSC_PATH=`cygpath -d "$CSC_PATH"`
4193     CSC_PATH=`cygpath -u "$CSC_PATH"`
4194     AL=al.exe
4196     dnl Check mscoree.lib / .NET Framework dir
4197     AC_MSG_CHECKING(.NET Framework)
4198     if test -n "$with_dotnet_framework_home"; then
4199         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
4200     fi
4201     if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
4202         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
4203     fi
4204     if test -z "$DOTNET_FRAMEWORK_HOME" ; then
4205         frametest=`./oowintool --dotnetsdk-dir`
4206         if test -f "$frametest/lib/mscoree.lib"; then
4207             DOTNET_FRAMEWORK_HOME="$frametest"
4208         else
4209             frametest=`./oowintool --windows-sdk-home`
4210             if test -f "$frametest/lib/mscoree.lib"; then
4211                 DOTNET_FRAMEWORK_HOME="$frametest"
4212             fi
4213         fi
4214     fi
4215     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
4216         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
4217     fi
4218     AC_MSG_RESULT(found)
4220     PathFormat "$MIDL_PATH"
4221     MIDL_PATH="$formatted_path"
4223     PathFormat "$DOTNET_FRAMEWORK_HOME"
4224     DOTNET_FRAMEWORK_HOME="$formatted_path"
4226     PathFormat "$CSC_PATH"
4227     CSC_PATH="$formatted_path"
4228         
4229         x_Mono=[\#]
4232 if test "$_os" = "Linux"; then
4233     AC_MSG_CHECKING([whether to enable Mono bindings])
4234     CSC_PATH=
4235     CSC=
4236     ENABLE_MONO=NO
4237     if test "$enable_mono" != "no" ; then
4238         AC_MSG_RESULT([yes])
4239         if test "z$with_csc_path" != "z"; then
4240                 if test -x "$with_csc_path/mcs"; then
4241                         CSC_PATH="$with_csc_path"
4242                 fi
4243                 if test -x "$with_csc_path/bin/mcs"; then
4244                         CSC_PATH="$with_csc_path/bin"
4245                 fi
4246         fi
4247             if test "z$CSC_PATH" = "z"; then
4248             AC_PATH_PROG(MCS, mcs)
4249             test -z "$MCS" || CSC_PATH=`dirname $MCS`
4250             fi
4251                 AL="$CSC_PATH/al"
4252         if test -x "$MCS" -a -x "$AL"; then
4253             MCS_VERSION=`$MCS --version | cut -d" " -f5`
4254             if test "`echo $MCS_VERSION | cut -d"." -f1`" -gt "1" || \
4255                test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
4256                     "`echo $MCS_VERSION | cut -d"." -f2`" -ge "2" || \
4257                test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
4258                     "`echo $MCS_VERSION | cut -d"." -f2`" = "1" -a \
4259                         "`echo $MCS_VERSION | cut -d"." -f3`" -ge "8"; then
4260                 ENABLE_MONO=YES
4261                 CSC=$MCS
4262                                 x_Mono=
4263                 AC_PATH_PROG(GMCS, gmcs, no)
4264                 AC_PATH_PROG(MKBUNDLE2, mkbundle2, no)
4265                 AC_PATH_PROG(MKBUNDLE, mkbundle, no)
4266                 if test "x$MKBUNDLE2" != "xno"; then
4267                     MKBUNDLE=$MKBUNDLE2
4268                 fi
4269                 GMCS_VERSION=`$GMCS --version | cut -d" " -f5`
4270                 if test "`echo $GMCS_VERSION | cut -d"." -f1`" -gt "1" || \
4271                    test "`echo $GMCS_VERSION | cut -d"." -f1`" = "1" -a \
4272                         "`echo $GMCS_VERSION | cut -d"." -f2`" -ge "3" || \
4273                    test "`echo $GMCS_VERSION | cut -d"." -f1`" = "1" -a \
4274                     "`echo $GMCS_VERSION | cut -d"." -f2`" = "2" -a \
4275                     "`echo $GMCS_VERSION | cut -d"." -f3`" -ge "3"; then
4276                     # mkbundle2 does not work on ppc, http://bugzilla.ximian.com/show_bug.cgi?id=81525
4277                     if test "`uname -m`" != "ppc" -a "`uname -m`" != "ppc64" ; then
4278                     ENABLE_MONO_CLIMAKER=YES
4279                     AC_MSG_NOTICE([mono is up-to-date enough - building mono climaker])
4280                     fi
4281                 fi
4282             else
4283                 if test -n "$enable_mono" ; then
4284                     AC_MSG_ERROR([no, mcs >= 1.1.8 is needed.])
4285                 fi
4286             fi
4287         else
4288             if test -n "$enable_mono"; then
4289                 AC_MSG_ERROR([mcs or al not found. Make sure they're in the path or use --with-csc-path])
4290             fi
4291         fi
4292         PKG_CHECK_MODULES([MONO], [mono-2 glib-2.0],,[PKG_CHECK_MODULES([MONO], [mono >= 1.1.8 glib-2.0])])
4293     else
4294         AC_MSG_RESULT([no])
4295     fi
4297     MONO_GAC_ROOT=
4298     if test -n "$with_mono_gac_root" -a "$with_mono_gac_root" != "no" ; then
4299         MONO_GAC_ROOT=$with_mono_gac_root
4300     fi
4302 AC_SUBST(x_Mono)
4303 AC_SUBST(CSC_PATH)
4304 AC_SUBST(CSC)
4305 AC_SUBST(AL)
4306 AC_SUBST(ENABLE_MONO)
4307 AC_SUBST(MONO_CFLAGS)
4308 AC_SUBST(MONO_LIBS)
4309 AC_SUBST(MONO_GAC_ROOT)
4310 AC_SUBST(ENABLE_MONO_CLIMAKER)
4311 AC_SUBST(MKBUNDLE)
4313 dnl ===================================================================
4314 dnl Check if stdc headers are available excluding MSVC.
4315 dnl ===================================================================
4316 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4317     AC_HEADER_STDC
4320 dnl ===================================================================
4321 dnl Testing for C++ compiler and version...
4322 dnl ===================================================================
4324 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4325     AC_PROG_CXX
4326 else
4327     if test -n "$CC" -a -z "$CXX"; then
4328         CXX="$CC"
4329     fi
4332 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
4333 if test "$GXX" = "yes"; then
4334     AC_MSG_CHECKING([the GNU C++ compiler version])
4336     _gpp_version=`$CXX -dumpversion`
4337     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
4339     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401"; then
4340         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0"; then
4341             export CXX="$GCC_HOME/bin/g++-4.0"
4342             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
4343             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401"; then
4344                 _gpp_majmin=$_gpp_majmin_2
4345             fi
4346         fi
4347         if test "$_gpp_majmin" -ge "401"; then
4348             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])
4349         else
4350             AC_MSG_RESULT([implicitly using CXX=$CXX])
4351         fi
4352     else
4353         AC_MSG_RESULT([checked (g++ $_gpp_version)])
4354     fi
4356     if test "$_gpp_majmin" = "304"; then
4357         AC_MSG_CHECKING([whether $CXX has the enum bug])
4358         AC_RUN_IFELSE([AC_LANG_SOURCE([[
4359             extern "C" void abort (void);
4360             extern "C" void exit (int status);
4362             enum E { E0, E1, E2, E3, E4, E5 };
4364             void test (enum E e)
4365             {
4366                 if (e == E2 || e == E3 || e == E1)
4367                     exit (1);
4368             }
4370             int main (void)
4371             {
4372                 test (E4);
4373                 test (E5);
4374                 test (E0);
4375                 return 0;
4376             }
4377             ]])],[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])],[])
4378     fi
4382 # prefx CXX with ccache if needed
4384 if test "$CCACHE" != ""; then
4385     AC_MSG_CHECKING([whether $CXX is already ccached])
4386     AC_LANG_PUSH([C++])
4387     save_CXXFLAGS=$CXXFLAGS
4388     CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
4389     dnl an empty program will do, we're checking the compiler flags
4390     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
4391                       [use_ccache=yes], [use_ccache=no])
4392     if test $use_ccache = yes; then
4393         AC_MSG_RESULT([yes])
4394     else
4395         CXX="$CCACHE $CXX"
4396         AC_MSG_RESULT([no])
4397     fi
4398     CXXFLAGS=$save_CXXFLAGS
4399     AC_LANG_POP([C++])
4402 dnl ===================================================================
4403 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
4404 dnl ===================================================================
4406 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4407     AC_PROG_CXXCPP
4409     dnl Check whether there's a C pre-processor.
4410     dnl ===================================================================
4411     dnl When using SunStudio compiler, there is a bug with the cc
4412     dnl preprocessor, so use CC preprocessor as the cc preprocessor
4413     dnl See Issuezilla #445.
4414     dnl ===================================================================
4415     if test "$_os" = "SunOS"; then
4416         CPP=$CXXCPP
4417     else
4418         AC_PROG_CPP
4419     fi
4423 dnl ===================================================================
4424 dnl Find integral type sizes and alignments
4425 dnl ===================================================================
4427 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4429     AC_CHECK_SIZEOF(long)
4430     AC_CHECK_SIZEOF(short)
4431     AC_CHECK_SIZEOF(int)
4432     AC_CHECK_SIZEOF(long long)
4433     AC_CHECK_SIZEOF(double)
4434     AC_CHECK_SIZEOF(void*)
4436     SIZEOF_SHORT=$ac_cv_sizeof_short
4437     SIZEOF_INT=$ac_cv_sizeof_int
4438     SIZEOF_LONG=$ac_cv_sizeof_long
4439     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
4440     SIZEOF_DOUBLE=$ac_cv_sizeof_double
4441     SIZEOF_POINTER=$ac_cv_sizeof_voidp
4443     dnl Allow build without AC_CHECK_ALIGNOF, grrr
4444     m4_pattern_allow([AC_CHECK_ALIGNOF])
4445     m4_ifdef([AC_CHECK_ALIGNOF],
4446         [
4447             AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
4448             AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
4449             AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
4450             AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
4451         ],
4452         [
4453             case "$_os-$host_cpu" in
4454             Darwin-powerpc)
4455                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=1
4456                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=1
4457                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=1
4458                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=1
4459                 ;;
4460             *)
4461                 if test -z "$ac_cv_alignof_short" -o \
4462                         -z "$ac_cv_alignof_int" -o \
4463                         -z "$ac_cv_alignof_long" -o \
4464                         -z "$ac_cv_alignof_double"; then
4465                    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.])
4466                 fi
4467                 ;;
4468             esac
4469         ])
4471     ALIGNOF_SHORT=$ac_cv_alignof_short
4472     ALIGNOF_INT=$ac_cv_alignof_int
4473     ALIGNOF_LONG=$ac_cv_alignof_long
4474     ALIGNOF_DOUBLE=$ac_cv_alignof_double
4476     AC_C_BIGENDIAN
4477     WORDS_BIGENDIAN=$ac_cv_c_bigendian
4479     dnl Check for large file support
4480     AC_SYS_LARGEFILE
4481     if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
4482         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
4483     fi
4484     if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
4485         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
4486     fi
4487 else
4488     # Hardcode for MSVC
4489     SIZEOF_SHORT=2
4490     SIZEOF_INT=4
4491     SIZEOF_LONG=4
4492     SIZEOF_LONGLONG=8
4493     if test "$CL_X64" = ""; then
4494         SIZEOF_POINTER=4
4495     else
4496         SIZEOF_POINTER=8
4497     fi
4498     ALIGNOF_SHORT=2
4499     ALIGNOF_INT=4
4500     ALIGNOF_LONG=4
4501     ALIGNOF_DOUBLE=8
4502     WORDS_BIGENDIAN=no
4503     LFS_CFLAGS=''
4505 AC_SUBST(WORDS_BIGENDIAN)
4506 AC_SUBST(LFS_CFLAGS)
4508 AC_SUBST(SIZEOF_SHORT)
4509 AC_SUBST(SIZEOF_INT)
4510 AC_SUBST(SIZEOF_LONG)
4511 AC_SUBST(SIZEOF_LONGLONG)
4512 AC_SUBST(SIZEOF_DOUBLE)
4513 AC_SUBST(SIZEOF_POINTER)
4514 AC_SUBST(ALIGNOF_SHORT)
4515 AC_SUBST(ALIGNOF_INT)
4516 AC_SUBST(ALIGNOF_LONG)
4517 AC_SUBST(ALIGNOF_DOUBLE)
4519 dnl ===================================================================
4520 dnl Check if valgrind.h is available
4521 dnl ===================================================================
4522 if test "$cross_compiling" != "yes" -a "$enable_dbgutil" != "no" -a \
4523         -z "$VALGRIND_CFLAGS"; then
4524     dnl Test $prefix (currently only testing for /usr and /usr/local)
4525     dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
4526     prev_cppflags=$CPPFLAGS
4527     CPPFLAGS="-I/usr/include/valgrind"
4528     AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
4529     if test -z "$VALGRIND_CFLAGS"; then
4530         CPPFLAGS="-I/usr/local/include/valgrind"
4531         AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
4532     fi
4533     if test -n "$VALGRIND_CFLAGS"; then
4534         CPPFLAGS=$VALGRIND_CFLAGS
4535         AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
4536     fi
4537     CPPFLAGS=$prev_cppflags
4539 AC_SUBST([VALGRIND_CFLAGS])
4541 dnl ===================================================================
4542 dnl Set the MinGW include directories
4543 dnl ===================================================================
4544 if test "$WITH_MINGW" = "yes"; then
4545     AC_MSG_CHECKING([for MinGW include path])
4546     cat >conftest.$ac_ext <<_ACEOF
4547 #include <stddef.h>
4548 #include <bits/c++config.h>
4549 _ACEOF
4550     _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`
4551     rm conftest.$ac_ext
4552     if test -z "$_mingw_lib_include_path"; then
4553         _mingw_lib_include_path="NO_LIB_INCLUDE"
4554         AC_MSG_RESULT([no MinGW include path])
4555     else
4556         AC_MSG_RESULT([$_mingw_lib_include_path])
4557     fi
4558     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
4559     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
4561     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
4562     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
4564     AC_LANG_PUSH([C++])
4566     AC_MSG_CHECKING([for dynamic libgcc])
4567     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4568 #include <iostream>
4569 using namespace std;
4570 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[   
4571             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
4572             if test -n "$MINGW_GCCDLL"; then
4573                 MINGW_SHARED_GCCLIB=YES
4574                 AC_MSG_RESULT([ $MINGW_GCCDLL])
4575             else
4576                 MINGW_SHARED_GCCLIB=NO
4577                 AC_MSG_RESULT([no])
4578             fi
4579        ],[ AC_MSG_RESULT([no])
4580        
4581     ])
4583     AC_MSG_CHECKING([for dynamic libstdc++])
4584     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4585 #include <iostream>
4586 using namespace std;
4587 ]], [[ cout << "Hello there." << endl; ]])],[   
4588             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
4589             if test -n "$MINGW_GXXDLL"; then
4590                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
4591                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
4592                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
4593                 MINGW_SHARED_GXXLIB=YES
4594                 AC_MSG_RESULT([$MINGW_GXXDLL])
4595             else
4596                 MINGW_SHARED_GXXLIB=NO
4597                 AC_MSG_RESULT([no])
4598             fi
4599        ],[ AC_MSG_RESULT([no])
4600        
4601     ])
4603     AC_LANG_POP([C++])
4605     AC_SUBST(MINGW_CLIB_DIR)
4606     AC_SUBST(MINGW_SHARED_GCCLIB)
4607     AC_SUBST(MINGW_SHARED_GXXLIB)
4608     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
4609     AC_SUBST(MINGW_GCCDLL)
4610     AC_SUBST(MINGW_GXXDLL)
4613 dnl ===================================================================
4614 dnl Extra checking for the SunOS compiler
4615 dnl ===================================================================
4616 if test "$_os" = "SunOS"; then
4617     dnl SunStudio C++ compiler packaged with SunStudio C compiler
4618     if test "$CC" = "cc"; then
4619     AC_MSG_CHECKING([SunStudio C++ Compiler])
4620         if test "$CXX" != "CC"; then
4621             AC_MSG_WARN([SunStudio C++ was not found])
4622             echo "SunStudio C++ was not found" >> warn
4623         else
4624             AC_MSG_RESULT([checked])
4625         fi
4626     fi
4629 dnl *************************************************************
4630 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
4631 dnl *************************************************************
4632 if test "$WITH_MINGW" = "yes"; then
4633     AC_MSG_CHECKING([exception type])
4634     AC_LANG_PUSH([C++])
4635     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
4637         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
4639         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
4640     ])
4641     AC_MSG_RESULT($exceptions_type)
4642     AC_LANG_POP([C++])
4645 EXCEPTIONS="$exceptions_type"
4646 AC_SUBST(EXCEPTIONS)
4648 dnl ===================================================================
4649 dnl Checks for what the default STL should be
4650 dnl ===================================================================
4651 AC_MSG_CHECKING([Whether building STLPort library makes sense])
4652 BUILD_STLPORT="no"
4653 if test "$_os" = "Linux"; then
4654     case "$host_cpu" in
4655     i?86)
4656         case "$host_os" in
4657         k*bsd*-gnu*)
4658             BUILD_STLPORT="no"
4659             ;;
4660         *)
4661             BUILD_STLPORT="yes"
4662             ;;
4663         esac
4664         ;;
4665     *)
4666         BUILD_STLPORT="no"
4667         ;;
4668     esac
4669 elif test "$_os" = "SunOS"; then
4670     BUILD_STLPORT="yes"
4671 elif test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
4672     BUILD_STLPORT="yes"
4673 elif test "$_os" = "FreeBSD"; then
4674     BUILD_STLPORT="yes"
4676 if test "$BUILD_STLPORT" = "yes"; then
4677     AC_MSG_RESULT([yes])
4678 else
4679     AC_MSG_RESULT([no])
4682 AC_MSG_CHECKING([Whether STLPort library will be actually built])
4683 if test "$with_stlport" = "auto" -o "$BUILD_STLPORT" = "no"; then
4684     with_stlport=$BUILD_STLPORT
4686 if test "$with_stlport" = "yes"; then
4687     AC_MSG_RESULT([yes])
4688     WITH_STLPORT=YES
4689     SCPDEFS="$SCPDEFS -DWITH_STLPORT"
4690     BUILD_TYPE="$BUILD_TYPE STLPORT"
4691 else
4692     WITH_STLPORT=NO
4693     AC_MSG_RESULT([no])
4696 AC_SUBST(WITH_STLPORT)
4698 dnl ===================================================================
4699 dnl gxx include directories needed by STLPort
4700 dnl ===================================================================
4701 # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
4702 # often contains an i386 which is expanded as a macro.
4703 if test "$GXX" = "yes"; then
4704     AC_MSG_CHECKING([for g++ include path])
4705     if test -z "$with_gxx_include_path"; then
4706         with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - 2>/dev/null | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
4707         if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
4708             with_gxx_include_path="/usr/include"
4709         fi
4710         if echo $with_gxx_include_path | $GREP -q linux; then
4711             # workaround for Mandriva - issue 100049
4712             with_gxx_include_path=`cd -P $with_gxx_include_path && pwd`
4713         fi
4714     fi
4715     dnl This is the original code...
4716     dnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
4717     if test -z "$with_gxx_include_path"; then
4718         with_gxx_include_path="NO_GXX_INCLUDE"
4719         AC_MSG_RESULT([none])
4720     else
4721         PathFormat "$with_gxx_include_path"
4722         with_gxx_include_path="$formatted_path"
4723         AC_MSG_RESULT([$with_gxx_include_path])
4724     fi
4725 else
4726     with_gxx_include_path="NO_GXX_INCLUDE"
4728 GXX_INCLUDE_PATH="$with_gxx_include_path"
4729 AC_SUBST(GXX_INCLUDE_PATH)
4731 dnl ===================================================================
4732 dnl thread-safe statics
4733 dnl ===================================================================
4734 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
4735 unset HAVE_THREADSAFE_STATICS
4736 if test "$GCC" = "yes"; then
4737     save_CXXFLAGS=$CXXFLAGS
4738     CXXFLAGS="$CXXFLAGS -fthreadsafe-statics"
4739     AC_LANG_PUSH([C++])
4740     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],[HAVE_THREADSAFE_STATICS=TRUE],[])
4741     AC_LANG_POP([C++])
4742     CXXFLAGS=$save_CXXFLAGS
4743     if test "$HAVE_THREADSAFE_STATICS" = "TRUE"; then
4744         dnl Some C++ runtimes use a single lock for all static variables, which
4745         dnl can cause deadlock in multi-threaded applications.  This is not
4746         dnl easily tested here; for POSIX-based systems, if executing the
4747         dnl following C++ program does not terminate then the tool chain
4748         dnl apparently has this problem:
4749         dnl
4750         dnl   #include <pthread.h>
4751         dnl   int h() { return 0; }
4752         dnl   void * g(void * unused) {
4753         dnl     static int n = h();
4754         dnl     return &n;
4755         dnl   }
4756         dnl   int f() {
4757         dnl     pthread_t t;
4758         dnl     pthread_create(&t, 0, g, 0);
4759         dnl     pthread_join(t, 0);
4760         dnl     return 0;
4761         dnl   }
4762         dnl   int main() {
4763         dnl     static int n = f();
4764         dnl     return n;
4765         dnl   }
4766         dnl
4767         dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is
4768         dnl at least one instance of GCC 4.2.4 (used on a "Linux
4769         dnl ooobuild1.osuosl.org 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15
4770         dnl EDT 2011 i686 i686 i386 GNU/Linux" machine); see the definition of
4771         dnl __cxa_guard_acquire in GCC's libstdc++-v3/libsupc++/guard.cc for
4772         dnl what #ifdefs actually make a difference there.  Conservative advice
4773         dnl from Jakub Jelinek is to assume it working in GCC >= 4.3:
4774         if test "$_os" = "Darwin" -o "${GCCVER?}" -lt 040300; then
4775             unset HAVE_THREADSAFE_STATICS
4776             AC_MSG_RESULT([broken (i.e., no)])
4777         else
4778             AC_MSG_RESULT([yes])
4779         fi
4780     else
4781         AC_MSG_RESULT([no])
4782     fi
4783 else
4784     AC_MSG_RESULT([unknown (assuming no)])
4786 AC_SUBST(HAVE_THREADSAFE_STATICS)
4788 dnl ===================================================================
4789 dnl visibility and c++0x features
4790 dnl ===================================================================
4791 if test "$GCC" = "yes"; then
4792     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
4793     save_CFLAGS=$CFLAGS
4794     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
4795     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
4796     CFLAGS=$save_CFLAGS
4798     if test "$COM_GCC_IS_CLANG" = TRUE -a $_os = Darwin; then
4799         # It seems that with Apple's Clang, visibility doesn't work as
4800         # we would want at least in the connectivity and dbaccess
4801         # modules. This might be because of something peculiar in
4802         # those modules? Whatever.
4803         HAVE_GCC_VISIBILITY_FEATURE=
4804     fi
4806     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
4807         AC_MSG_RESULT([yes])
4808     else
4809         AC_MSG_RESULT([no])
4810     fi
4812     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
4813     save_CFLAGS=$CFLAGS
4814     CFLAGS="$CFLAGS -Werror -Wno-long-double"
4815     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
4816     CFLAGS=$save_CFLAGS
4817     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
4818         AC_MSG_RESULT([yes])
4819     else
4820         AC_MSG_RESULT([no])
4821     fi
4823     AC_MSG_CHECKING([whether $CC supports -mno-avx])
4824     save_CFLAGS=$CFLAGS
4825     CFLAGS="$CFLAGS -Werror -mno-avx"
4826     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
4827     CFLAGS=$save_CFLAGS
4828     if test "$HAVE_GCC_AVX" = "TRUE"; then
4829         AC_MSG_RESULT([yes])
4830     else
4831         AC_MSG_RESULT([no])
4832     fi
4834     AC_MSG_CHECKING([whether $CC supports -std=gnu++0x without Language Defect 757])
4835     save_CXXFLAGS=$CXXFLAGS
4836     CXXFLAGS="$CXXFLAGS -std=gnu++0x"
4837     AC_LANG_PUSH([C++])
4839     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4840 #include <stddef.h>
4842 #include <vector>
4843     // some Clang fail when compiling against GCC 4.7 headers with --std=gnu++0x
4845 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
4847 namespace
4849         struct b
4850         {
4851                 int i;
4852                 int j;
4853         };
4855 ]], [[
4856 struct a
4858         int i;
4859         int j;
4861 a thinga[]={{0,0}, {1,1}};
4862 b thingb[]={{0,0}, {1,1}};
4863 size_t i = sizeof(sal_n_array_size(thinga));
4864 size_t j = sizeof(sal_n_array_size(thingb));
4865 return !(i != 0 && j != 0);
4866 ]])],[HAVE_CXX0X=TRUE],[])
4868     AC_LANG_POP([C++])
4869     CXXFLAGS=$save_CXXFLAGS
4870     if test "$HAVE_CXX0X" = "TRUE"; then
4871         AC_MSG_RESULT([yes])
4872     else
4873         AC_MSG_RESULT([no])
4874     fi
4877 AC_SUBST(HAVE_CXX0X)
4878 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
4879 AC_SUBST(HAVE_GCC_AVX)
4881 dnl ===================================================================
4882 dnl Check for C++11 perfect forwarding support
4883 dnl ===================================================================
4884 HAVE_CXX11_PERFECT_FORWARDING=
4885 AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding])
4886 save_CXXFLAGS=$CXXFLAGS
4887 if test "$HAVE_CXX0X" = TRUE; then
4888     CXXFLAGS="$CXXFLAGS -std=gnu++0x"
4890 AC_LANG_PUSH([C++])
4891 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4892         #include <utility>
4893         template<typename T, typename... Args> T * f(Args &&... v) {
4894             return new T(std::forward<Args>(v)...);
4895         }
4896     ]], [[
4897         f<int>(0);
4898     ]])], [perfect_forwarding=yes], [perfect_forwarding=no])
4899 AC_LANG_POP([C++])
4900 CXXFLAGS=$save_CXXFLAGS
4901 AC_MSG_RESULT([$perfect_forwarding])
4902 if test "$perfect_forwarding" = yes; then
4903     HAVE_CXX11_PERFECT_FORWARDING=TRUE
4905 AC_SUBST([HAVE_CXX11_PERFECT_FORWARDING])
4907 dnl ===================================================================
4908 dnl system stl sanity tests
4909 dnl ===================================================================
4910 HAVE_GCC_VISIBILITY_BROKEN=
4911 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
4913     AC_LANG_PUSH([C++])
4915     save_CPPFLAGS="$CPPFLAGS"
4916     if test -n "$MACOSX_SDK_PATH"; then
4917         CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
4918     fi
4920     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
4921         dnl gcc#19664, gcc#22482, rhbz#162935
4922         AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
4923         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
4924         AC_MSG_RESULT([$stlvisok])
4925         if test "$stlvisok" = "no"; then
4926             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
4927             echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
4928             unset HAVE_GCC_VISIBILITY_FEATURE
4929         fi
4930     fi
4932     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
4933         sharedlink_ldflags_save=$LDFLAGS
4934         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
4936         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
4937         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4938 #include <sstream>
4939 using namespace std;
4940             ]], [[
4941 istringstream strm( "test" ); return 0;
4942             ]])],
4943             # Ugh, surely bad to assume an error message will contain
4944             # the word "unresolvable", a problem with
4945             # -fvisibility-inlines-hidden and STL headers might cause
4946             # some more obscure message on some platform, and anway,
4947             # the error message could be localised.
4948             [$EGREP -q unresolvable conftest.err;
4949             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
4950         ])
4951         AC_MSG_RESULT([$gccvisok])
4952         if test "$gccvisok" = "no"; then
4953             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
4954             echo "Your gcc is not -fvisibility-inlines-hidden safe, disabling that." >> warn
4955             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
4956         fi
4958         LDFLAGS=$sharedlink_ldflags_save
4959     fi
4961     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
4962         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
4963         cat > conftestlib1.cc <<_ACEOF
4964 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
4965 struct S2: S1<int> { virtual ~S2(); };
4966 S2::~S2() {}
4967 _ACEOF
4968         cat > conftestlib2.cc <<_ACEOF
4969 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
4970 struct S2: S1<int> { virtual ~S2(); };
4971 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
4972 _ACEOF
4973         gccvisinlineshiddenok=yes
4974         if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
4975             gccvisinlineshiddenok=no
4976         else
4977             if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $LINKFLAGSNOUNDEFS -o libconftest2$DLLPOST >/dev/null 2>&5; then
4978                 gccvisinlineshiddenok=no
4979             fi
4980         fi
4981         
4982         rm -f libconftest1$DLLPOST libconftest2$DLLPOST
4983         AC_MSG_RESULT([$gccvisinlineshiddenok])
4984         if test "$gccvisinlineshiddenok" = "no"; then
4985             AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
4986             echo "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that." >> warn
4987             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
4988         fi
4989     fi
4991     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
4992         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
4993         cat >visibility.cxx <<_ACEOF
4994 #pragma GCC visibility push(hidden)
4995 struct __attribute__ ((visibility ("default"))) TestStruct {
4996   static void Init();
4998 __attribute__ ((visibility ("default"))) void TestFunc() {
4999   TestStruct::Init();
5001 _ACEOF
5002         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
5003             gccvisbroken=yes
5004         else
5005             case "$host_cpu" in
5006             i?86|x86_64)
5007                 if test "$_os" = "Darwin"; then
5008                     gccvisbroken=no
5009                 else
5010                     if $EGREP -q '@PLT|@GOT' visibility.s; then
5011                         gccvisbroken=no
5012                     else
5013                         gccvisbroken=yes
5014                     fi
5015                 fi
5016                 ;;
5017             *)
5018                 gccvisbroken=no
5019                 ;;
5020             esac
5021         fi
5022         rm -f visibility.s visibility.cxx
5024         AC_MSG_RESULT([$gccvisbroken])
5025         if test "$gccvisbroken" = "yes"; then
5026             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
5027             echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
5028             unset HAVE_GCC_VISIBILITY_FEATURE
5029         fi
5030     fi
5032     CPPFLAGS="$save_CPPFLAGS"
5034     AC_LANG_POP([C++])
5037 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
5038 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
5040 dnl ===================================================================
5041 dnl SFINAE test
5042 dnl Pre-C++11 does not allow types without linkage as template arguments.
5043 dnl Substitution Failure Is Not An Error is an idiom that disables
5044 dnl template instances that would cause an error, without actually
5045 dnl causing an error. Old gcc (pre-4.0.2) however causes a real error.
5046 dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21514
5047 dnl ===================================================================
5048 HAVE_SFINAE_ANONYMOUS_BROKEN=
5049 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5051     AC_LANG_PUSH([C++])
5052     AC_MSG_CHECKING([if SFINAE is broken with anonymous types])
5053     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5054 enum { AnonymousEnumValue };
5055 template< typename T > class TestPredicate {};
5056 template<> class TestPredicate< int > { public: typedef bool Type; };
5057 template< typename T >
5058 bool test( const T&, typename TestPredicate< T >::Type = false )
5059     { return true; };
5060 void test( ... );
5061             ]], [[
5062     test( 10 );
5063     test( AnonymousEnumValue );
5064             ]])],[sfinae_anonymous_broken=no],[sfinae_anonymous_broken=yes
5065         ])
5066         AC_MSG_RESULT([$sfinae_anonymous_broken])
5067         if test "$sfinae_anonymous_broken" = "yes"; then
5068             HAVE_SFINAE_ANONYMOUS_BROKEN="TRUE"
5069         fi
5070     AC_LANG_POP([C++])
5073 AC_SUBST(HAVE_SFINAE_ANONYMOUS_BROKEN)
5075 dnl ===================================================================
5076 dnl  Clang++ tests
5077 dnl ===================================================================
5079 HAVE_GCC_FNO_DEFAULT_INLINE=
5080 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
5081 if test "$GCC" = "yes"; then
5082     AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
5083     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5084         # Option just ignored and silly warning that isn't a real
5085         # warning printed
5086         :
5087     else
5088         AC_LANG_PUSH([C++])
5089         save_CXXFLAGS=$CXXFLAGS
5090         CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
5091         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
5092         CXXFLAGS=$save_CXXFLAGS
5093         AC_LANG_POP([C++])
5094     fi
5095     if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
5096         AC_MSG_RESULT([yes])
5097     else
5098         AC_MSG_RESULT([no])
5099     fi
5101     AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
5102     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5103         # As above
5104         :
5105     else
5106         AC_LANG_PUSH([C++])
5107         save_CXXFLAGS=$CXXFLAGS
5108         CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
5109         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
5110         CXXFLAGS=$save_CXXFLAGS
5111         AC_LANG_POP([C++])
5112     fi
5113     if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
5114         AC_MSG_RESULT([yes])
5115     else
5116         AC_MSG_RESULT([no])
5117     fi
5119 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
5120 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
5123 dnl ===================================================================
5124 dnl allocator
5125 dnl ===================================================================
5126 AC_MSG_CHECKING([which memory allocator to use])
5127 if test "$with_alloc" = "system"; then
5128     AC_MSG_RESULT([system])
5129     ALLOC="SYS_ALLOC";
5130     AC_CHECK_FUNCS([malloc realloc calloc free])
5132 if test "$with_alloc" = "tcmalloc"; then
5133     AC_MSG_RESULT(tcmalloc)
5134     if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
5135         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
5136     fi
5137     AC_CHECK_LIB([tcmalloc], [malloc], [:],
5138         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
5139     ALLOC="TCMALLOC";
5141 if test "$with_alloc" = "jemalloc"; then
5142     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
5143         AC_MSG_RESULT(jemalloc)
5144         save_CFLAGS=$CFLAGS
5145         CFLAGS="$CFLAGS -pthread"
5146         AC_CHECK_LIB([jemalloc], [malloc], [:],
5147             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
5148         ALLOC="JEMALLOC";
5149         CFLAGS=$save_CFLAGS
5150     else
5151         AC_MSG_RESULT([system])
5152         ALLOC="SYS_ALLOC";
5153         AC_CHECK_FUNCS([malloc realloc calloc free])
5154     fi
5156 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
5157     AC_MSG_RESULT([internal])
5159 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
5160 AC_SUBST(HAVE_POSIX_FALLOCATE)
5161 AC_SUBST(ALLOC)
5163 dnl ===================================================================
5164 dnl Custom build version
5165 dnl ===================================================================
5167 AC_MSG_CHECKING([whether to add custom build version])
5168 if test "$with_build_version" != ""; then
5169     BUILD_VER_STRING=$with_build_version
5170     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
5171 else
5172     BUILD_VER_STRING=
5173     AC_MSG_RESULT([no])
5175 AC_SUBST(BUILD_VER_STRING)
5177 dnl ===================================================================
5178 dnl Java support enable
5179 dnl ===================================================================
5180 AC_MSG_CHECKING([whether to build with Java support])
5181 if test "$with_java" != "no"; then
5182     if test "$DISABLE_SCRIPTING" = TRUE; then
5183         AC_MSG_RESULT([no, overridden by --disable-scripting])
5184         SOLAR_JAVA=""
5185         with_java=no
5186     else
5187         AC_MSG_RESULT([yes])
5188         SOLAR_JAVA="TRUE"
5189     fi
5190 else
5191     AC_MSG_RESULT([no])
5192     SOLAR_JAVA=""
5195 AC_SUBST(SOLAR_JAVA)
5197 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
5198 dnl want there to be *run-time* (and build-time) support for Java extensions in the
5199 dnl built LibreOffice.
5201 dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
5202 dnl (no runtime support). It doesn't seem to ever be set to this
5203 dnl value, though, and everywhere SOLAR_JAVA is only checked for being
5204 dnl empty or non-empty.
5206 dnl SOLAR_JAVA="" indicate no java support at all
5208 JITC_PROCESSOR_TYPE=""
5209 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
5210     # IBMs JDK needs this...
5211     JITC_PROCESSOR_TYPE=6
5212     export JITC_PROCESSOR_TYPE
5214 AC_SUBST([JITC_PROCESSOR_TYPE])
5216 if test $_os = "WINNT"; then
5217     SCPDEFS="$SCPDEFS -DWITH_VC_REDIST"
5219 AC_SUBST(WITH_VC_REDIST)
5221 dnl ===================================================================
5222 dnl Checks for Java
5223 dnl ===================================================================
5224 if test "$SOLAR_JAVA" != ""; then
5226     # Windows-specific tests
5227     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5228         if test "$CL_X64" != ""; then
5229             bitness="64-bit"
5230             otherbitness="32-bit"
5231         else
5232             bitness="32-bit"
5233             otherbitness="64-bit"
5234         fi
5236         if test -z "$with_jdk_home"; then
5238             # Unfortunately apparently no way to find, if needed, the 64-bit
5239             # JDK in the Registry from the 32-bit Perl oowintool
5241             _jdk_home=`./oowintool --jdk-home`
5242             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
5243                 with_jdk_home="$_jdk_home"
5244                 howfound="found by oowintool"
5245             else
5246                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
5247             fi
5248         else
5249             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
5250             howfound="you passed"
5251         fi
5252     fi
5254     JAVA_HOME=; export JAVA_HOME
5255     if test -z "$with_jdk_home"; then
5256         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
5257     else
5258         _java_path="$with_jdk_home/bin/$with_java"
5259         dnl Check if there is a Java interpreter at all.
5260         if test -x "$_java_path"; then
5261             JAVAINTERPRETER=$_java_path
5262         else
5263             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
5264         fi
5265     fi
5267     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5268         # Check that the JDK found is correct architecture
5269         # Why is this necessary, we don't link with any library from the JDK I think,
5271         shortjdkhome=`cygpath -d "$with_jdk_home"`
5272         if test "$CL_X64" != "" -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
5273             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
5274             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
5275         elif test "$CL_X64" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != ""  >/dev/null; then
5276             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
5277             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
5278         fi
5280         if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
5281             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
5282         fi
5283         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
5284         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
5285     elif test "$_os" = "Darwin"; then
5286         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
5287         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
5288         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
5289         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
5290         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
5291             AC_MSG_RESULT([yes])
5292             JAVAIFLAGS=-d32
5293         else
5294             AC_MSG_RESULT([no])
5295         fi
5296     fi
5299 dnl ===================================================================
5300 dnl Checks for JDK.
5301 dnl ===================================================================
5303 # Note that JAVA_HOME as for now always means the *build* platform's
5304 # JAVA_HOME. Whether all the complexity here actually is needed any
5305 # more or not, no idea.
5307 if test "$SOLAR_JAVA" != ""; then
5308     _gij_longver=0
5309     AC_MSG_CHECKING([the installed JDK])
5310     if test -n "$JAVAINTERPRETER"; then
5311         dnl java -version sends output to stderr!
5312         if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
5313             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
5314         elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
5315             JDK=gcj
5316             AC_MSG_RESULT([checked (gcj)])
5317             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
5318             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5320         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
5321             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
5322         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
5323             JDK=ibm
5325             dnl IBM JDK specific tests
5326             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
5327             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
5329             if test "$_jdk_ver" -lt 10500; then
5330                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
5331             fi
5333             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
5335             if test "$with_jdk_home" = ""; then
5336                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
5337 you must use the "--with-jdk-home" configure option explicitly])
5338             fi
5340            JAVA_HOME=$with_jdk_home
5342         else
5343             JDK=sun
5345             dnl Sun JDK specific tests
5346             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
5347             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
5349             if test "$_jdk_ver" -lt 10500; then
5350                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
5351             fi
5352             AC_MSG_RESULT([checked (JDK $_jdk)])
5353             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
5354             if test "$_os" = "WINNT"; then
5355                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
5356             fi
5357         fi
5358     else
5359         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
5360     fi
5361 else
5362     dnl Java disabled
5363     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
5366 _java_target_ver="1.5"
5367 dnl ===================================================================
5368 dnl Check for target Java bytecode version
5369 dnl ===================================================================
5370 if test "$SOLAR_JAVA" != ""; then
5371     AC_MSG_CHECKING([for target Java bytecode version])
5372     if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
5373     AC_MSG_RESULT([default by $JDK])
5374     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no"; then
5375         AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
5376     fi
5377     else
5378     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no"; then
5379         _java_target_ver="$with_java_target_version"
5380         AC_MSG_RESULT([$_java_target_ver])
5381     elif test $_jdk_ver -gt 10000; then
5382         _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
5383         AC_MSG_RESULT([$_java_target_ver])
5384     else
5385         AC_MSG_ERROR([Unable to guess Java bytecode version from Java version!])
5386     fi
5387     fi
5389     JAVA_SOURCE_VER="$_java_target_ver"
5390     JAVA_TARGET_VER="$_java_target_ver"
5393 dnl ===================================================================
5394 dnl Checks for javac
5395 dnl ===================================================================
5396 if test "$SOLAR_JAVA" != ""; then
5397     if test "$JDK" = "gcj"; then
5398         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
5399     else
5400         javacompiler="javac"
5401     fi
5402     if test -z "$with_jdk_home"; then
5403         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
5404     else
5405         _javac_path="$with_jdk_home/bin/$javacompiler"
5406         dnl Check if there is a Java compiler at all.
5407         if test -x "$_javac_path"; then
5408             JAVACOMPILER=$_javac_path
5409         fi
5410     fi
5411     if test -z "$JAVACOMPILER"; then
5412         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
5413     fi
5414     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5415         if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
5416             JAVACOMPILER="${JAVACOMPILER}.exe"
5417         fi
5418         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
5419         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
5420     fi
5422     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
5423         AC_MSG_CHECKING([re-checking JDK])
5424         JDK=gcj
5425         AC_MSG_RESULT([checked (ecj)])
5426         #TODO: what's to do here? some switch to do 1.5 compiling?
5427         JAVAFLAGS="-source 1.5 -target 1.5"
5428         _gij_longver="40200"
5429     fi
5432 JAVACISGCJ=""
5433 dnl ===================================================================
5434 dnl Checks that javac is gcj
5435 dnl ===================================================================
5436 if test "$SOLAR_JAVA" != ""; then
5437     if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
5438         JAVACISGCJ="yes"
5439     fi
5441 AC_SUBST(JAVACISGCJ)
5443 JAVACISKAFFE=""
5444 dnl ===================================================================
5445 dnl Checks that javac is kaffe
5446 dnl ===================================================================
5447 if test "$SOLAR_JAVA" != ""; then
5448     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
5449         JAVACISKAFFE="yes"
5450     fi
5452 AC_SUBST(JAVACISKAFFE)
5454 dnl ===================================================================
5455 dnl Checks for javadoc
5456 dnl ===================================================================
5457 if test "$SOLAR_JAVA" != ""; then
5458     if test -z "$with_jdk_home"; then
5459         AC_PATH_PROG(JAVADOC, javadoc)
5460     else
5461         _javadoc_path="$with_jdk_home/bin/javadoc"
5462         dnl Check if there is a javadoc at all.
5463         if test -x "$_javadoc_path"; then
5464             JAVADOC=$_javadoc_path
5465         else
5466             AC_PATH_PROG(JAVADOC, javadoc)
5467         fi
5468     fi
5469     if test -z "$JAVADOC"; then
5470         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
5471     fi
5472     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5473         if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
5474             JAVADOC="${JAVADOC}.exe"
5475         fi
5476         JAVADOC=`cygpath -d "$JAVADOC"`
5477         JAVADOC=`cygpath -u "$JAVADOC"`
5478     fi
5481 if test "$SOLAR_JAVA" != ""; then
5482     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
5483     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
5484         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
5485            # try to recover first by looking whether we have a alternatives
5486            # system as in Debian or newer SuSEs where following /usr/bin/javac
5487            # over /etc/alternatives/javac leads to the right bindir where we
5488            # just need to strip a bit away to get a valid JAVA_HOME
5489            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
5490         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
5491             # maybe only one level of symlink (e.g. on Mac)
5492             JAVA_HOME=$(readlink $JAVACOMPILER)
5493             if test "$(dirname $JAVA_HOME)" = "."; then
5494                 # we've got no path to trim back
5495                 JAVA_HOME=""
5496             fi
5497         else
5498             # else warn
5499             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
5500             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
5501             echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
5502             echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
5503         fi
5504         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
5505         if test "$JAVA_HOME" != "/usr"; then
5506             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
5507                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
5508                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
5509                 dnl Tiger already returns a JDK path..
5510                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
5511             else
5512                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
5513             fi
5514         fi
5515     fi
5516     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
5518     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
5519     if test -z "$JAVA_HOME"; then
5520         if test "x$with_jdk_home" = "x"; then
5521             cat > findhome.java <<_ACEOF
5522 [import java.io.File;
5524 class findhome
5526     public static void main(String args[])
5527     {
5528         String jrelocation = System.getProperty("java.home");
5529         File jre = new File(jrelocation);
5530         System.out.println(jre.getParent());
5531     }
5533 _ACEOF
5534             AC_MSG_CHECKING([if javac works])
5535             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
5536             AC_TRY_EVAL(javac_cmd)
5537             if test $? = 0 -a -f ./findhome.class; then
5538                 AC_MSG_RESULT([javac works])
5539             else
5540                 echo "configure: javac test failed" >&5
5541                 cat findhome.java >&5
5542                 AC_MSG_ERROR([javac does not work - java projects will not build!])
5543             fi
5544             AC_MSG_CHECKING([if gij knows its java.home])
5545             JAVA_HOME=`$JAVAINTERPRETER findhome`
5546             if test $? = 0 -a "$JAVA_HOME" != ""; then
5547                 AC_MSG_RESULT([$JAVA_HOME])
5548             else
5549                 echo "configure: java test failed" >&5
5550                 cat findhome.java >&5
5551                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
5552             fi
5553             # clean-up after ourselves
5554             rm -f ./findhome.java ./findhome.class
5555         else
5556             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
5557         fi
5558     fi
5560     dnl second sanity check JAVA_HOME if possible
5561     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
5562         # now check if $JAVA_HOME is really valid
5563         if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
5564             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
5565                 JAVA_HOME_OK="NO"
5566             fi
5567         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
5568             JAVA_HOME_OK="NO"
5569         fi
5570         if test "$JAVA_HOME_OK" = "NO"; then
5571             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
5572             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
5573             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
5574             echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
5575             echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
5576             echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
5577         fi
5578     fi
5579     PathFormat "$JAVA_HOME"
5580     JAVA_HOME="$formatted_path"
5583 AWTLIB=
5585 if test "$SOLAR_JAVA" != ""; then
5586     AC_MSG_CHECKING([for jawt lib name])
5587     if test "$JDK" = "gcj"; then
5588         save_CFLAGS=$CFLAGS
5589         save_LDFLAGS=$LDFLAGS
5590         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
5591         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
5592         exec 6>/dev/null # no output
5593         AC_CHECK_HEADER(jni.h, [],
5594                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
5595         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
5596         exec 6>&1 # output on again
5597         CFLAGS=$save_CFLAGS
5598         LDFLAGS=$save_LDFLAGS
5599     fi
5600     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
5601     # A workaround is to link also against libpmawt.so
5602     if test "$JDK" = "ibm"; then
5603         save_CFLAGS=$CFLAGS
5604         save_LDFLAGS=$LDFLAGS
5605         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
5606         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
5607         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
5608         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
5609         export LD_LIBRARY_PATH
5610         exec 6>/dev/null # no output
5611         AC_CHECK_HEADER(jni.h, [],
5612                     [AC_MSG_ERROR([jni.h could not be found.])], [])
5613         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
5614         if test -z "$AWTLIB"; then
5615             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
5616             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
5617         fi
5618         exec 6>&1 # output on again
5619         CFLAGS=$save_CFLAGS
5620         LDFLAGS=$save_LDFLAGS
5621         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
5622     fi
5623     if test -z "$AWTLIB"; then
5624         AWTLIB=-ljawt
5625     fi
5626     AC_MSG_RESULT([$AWTLIB])
5627     AC_SUBST(AWTLIB)
5631 if test "$SOLAR_JAVA" != ""; then
5633 # Determine JAVALIB
5634 # If your platform follow the common pattern
5635 # just define JAVA_ARCH and JAVA_TOOLKIT for it
5636 # if not, leave JAVA_ARCH empty and define JAVALIB manually
5637 # if you don't want JAVALIB to be exported at all
5638 # define x_JAVALIB=[\#]
5640     JAVA_ARCH=
5641     JAVA_TOOLKIT=
5642     x_JAVALIB=
5643     x_JDKLIB=[\#]
5645     case "$host_os" in
5647     aix*)
5648         JAVA_ARCH="ppc"
5649         JAVA_TOOLKIT="classic"
5650         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5651         SOLARINC="$SOLARINC -I$JAVA_HOME/include/aix"
5652         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5653         ;;
5655     cygwin*)
5656         x_JDKLIB=
5657         JDKLIB="$JAVA_HOME/lib"
5658         SOLARINC="$SOLARINC -I$JAVA_HOME/include/win32"
5659         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5660         ;;
5662     darwin*)
5663         x_JAVALIB=[\#]
5664         SOLARINC="$SOLARINC -I$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers -I$FRAMEWORKSHOME/JavaVM/Headers"
5665         ;;
5667     dragonfly*)
5668         case "$host_cpu" in
5669         i*86)
5670             JAVA_ARCH="i386"
5671             JAVA_TOOLKIT="client"
5672             ;;
5673         x86_64)
5674             JAVA_ARCH="amd64"
5675             JAVA_TOOLKIT="server"
5676             ;;
5677         esac
5678         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5679         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5680         ;;
5682     freebsd*)
5683         case "$host_cpu" in
5684         i*86)
5685             JAVA_ARCH="i386"
5686             JAVA_TOOLKIT="client"
5687             ;;
5688         x86_64)
5689             if test "`echo $JAVA_HOME | sed -e 's,.*/,,'`" = "linux"; then
5690                 JAVA_ARCH="i386"
5691                 JAVA_TOOLKIT="client"
5692             else
5693                 JAVA_ARCH="amd64"
5694                 JAVA_TOOLKIT="server"
5695             fi
5696             ;;
5697         esac
5698         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5699         SOLARINC="$SOLARINC -I$JAVA_HOME/include/freebsd"
5700         SOLARINC="$SOLARINC -I$JAVA_HOME/include/bsd"
5701         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
5702         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5703         ;;
5705     k*bsd*-gnu*)
5706         case "$host_cpu" in
5707         i*86)
5708             JAVA_ARCH="i386"
5709             JAVA_TOOLKIT="client"
5710             ;;
5711         x86_64)
5712             JAVA_ARCH="amd64"
5713             JAVA_TOOLKIT="server"
5714             ;;
5715         esac
5716         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5717         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5718         ;;
5720     linux-gnu*)
5722         case "$host_cpu" in
5724         alpha)
5725             JAVA_ARCH="alpha"
5726             JAVA_TOOLKIT="server"
5727             ;;
5728         arm*)
5729             JAVA_ARCH="arm"
5730             JAVA_TOOLKIT="server"
5731             ;;
5732         hppa)
5733             JAVA_ARCH="hppa"
5734             JAVA_TOOLKIT="server"
5735             ;;
5736         i*86)
5737             JAVA_ARCH="i386"
5738             case "$JDK" in
5739             [Ii][Bb][Mm]*)
5740                 JAVA_ARCH=
5741                 JRE_BASE_DIR="$JAVA_HOME/jre/bin"
5742                 JAVALIB="-L$JAVA_HOME/$LIB64 -L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic -L$JRE_BASE_DIR/native_thread"
5743                 ;;
5744             [Bb][Ee][Aa]*)
5745                 JAVA_TOOLKIT="jrockit";
5746                 ;;
5747             *)
5748                 JAVA_TOOLKIT="client";
5749                 ;;
5750             esac
5751             ;;
5752         ia64)
5753             JAVA_ARCH="ia64"
5754             JAVA_TOOLKIT="server"
5755             ;;
5756         m68k)
5757             JAVA_ARCH="mk68"
5758             JAVA_TOOLKIT="server"
5759             ;;
5760         mips|mips64|mipsel|mips64el)
5761             JAVA_ARCH="$host_cpu"
5762             JAVA_TOOLKIT="server"
5763             ;;
5764         mips32)
5765             JAVA_ARCH="$host_cpu"
5766             JAVA_TOOLKIT="client"
5767             ;;
5768         powerpc)
5769             JAVA_ARCH="ppc"
5770             case "$JDK" in
5771             [Ii][Bb][Mm]*)
5772                 JAVA_TOOLKIT="classic"
5773                 ;;
5774             gcj)
5775                 JAVA_TOOLKIT="client"
5776                 ;;
5777             *)
5778                 JAVA_TOOLKIT="server"
5779                 ;;
5780             esac
5781             ;;
5782         powerpc64)
5783             JAVA_ARCH="ppc64"
5784             if test "$JDK" = "gcj"; then
5785                 JAVA_TOOLKIT="client"
5786             else
5787                 JAVA_TOOLKIT="server"
5788             fi
5789             ;;
5790         sparc)
5791             JAVA_ARCH="sparc"
5792             JAVA_TOOLKIT="server"
5793             ;;
5794         s390)
5795             JAVA_ARCH="s390"
5796             JAVA_TOOLKIT="server"
5797             ;;
5798         s390x)
5799             JAVA_ARCH="s390x"
5800             JAVA_TOOLKIT="server"
5801             ;;
5802         x86_64)
5803             JAVA_ARCH="amd64"
5804             JAVA_TOOLKIT="server"
5805             ;;
5806         *)
5807             AC_MSG_ERROR([No JAVALIB definition host_cpu $host_cpu for host_os $host_os])
5808             ;;
5809         esac
5810         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5811         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
5812         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5813         ;;
5815     linux-androideabi*)
5817         case "$host_cpu" in
5819     arm|armel)
5820             JAVA_ARCH="arm"
5821             JAVA_TOOLKIT="server"
5822             ;;
5823         esac
5824         ;;
5826     mingw*)
5827         x_JAVALIB=[\#]
5828         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5829         ;;
5831     *netbsd*)
5833         case "$host_cpu" in
5834         i*86)
5835             JAVA_ARCH="i386"
5836             JAVA_TOOLKIT="client"
5837             ;;
5838         powerpc)
5839             JAVA_ARCH="pcc"
5840             JAVA_TOOLKIT="classic"
5841             ;;
5842         sparc)
5843             JAVA_ARCH="sparc"
5844             JAVA_TOOLKIT="client"
5845             ;;
5846         x86_64)
5847             JAVA_ARCH="amd64"
5848             JAVA_TOOLKIT="client"
5849             ;;
5850         esac
5851         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5852         SOLARINC="$SOLARINC -I$JAVA_HOME/include/netbsd"
5853         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5854        ;;
5856     openbsd*)
5857         case "$host_cpu" in
5858         i*86)
5859             JAVA_ARCH="i386"
5860             JAVA_TOOLKIT="client"
5861             ;;
5862         x86_64)
5863             JAVA_ARCH="amd64"
5864             JAVA_TOOLKIT="server"
5865             ;;
5866         esac
5867         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5868         SOLARINC="$SOLARINC -I$JAVA_HOME/include/openbsd"
5869         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5870         ;;
5872     solaris*)
5874         JAVA_TOOLKIT="xawt"
5875         case "$host_cpu" in
5876         i*86)
5877             JAVA_ARCH="i386"
5878             ;;
5879         sparc)
5880             JAVA_ARCH="sparc"
5881             ;;
5882         esac
5883         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
5884         SOLARINC="$SOLARINC -I$JAVA_HOME/include/solaris"
5885         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
5886         ;;
5887     esac
5889     if test -n "$JAVA_ARCH"; then
5890         JRE_BASE_DIR="$JAVA_HOME/jre/lib/$JAVA_ARCH"
5891         JAVALIB="-L$JAVA_HOME/$LIB64"
5892         test -d "$JRE_BASE_DIR" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR"
5893         test -d "$JRE_BASE_DIR/$JAVA_TOOLKIT" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/$JAVA_TOOLKIT"
5894         test -d "$JRE_BASE_DIR/native_thread" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/native_thread"
5895     fi
5897     CLASSPATH=
5898     if test "$JDK"!="gcj"; then
5899         if test -f "$JAVA_HOME/jre/lib/rt.jar"; then
5900             CLASSPATH="${JAVA_HOME}/jre/lib/rt.jar${P_SEP}."
5901         fi
5902     fi
5903     XCLASSPATH="$CLASSPATH"
5904 else
5905     x_JAVALIB=[\#]
5906     x_JDKLIB=[\#]
5909 AC_SUBST(CLASSPATH)
5910 AC_SUBST(JAVALIB)
5911 AC_SUBST(JAVACOMPILER)
5912 AC_SUBST(JAVADOC)
5913 AC_SUBST(JAVAFLAGS)
5914 AC_SUBST(JAVAINTERPRETER)
5915 AC_SUBST(JAVAIFLAGS)
5916 AC_SUBST(JAVA_HOME)
5917 AC_SUBST(JAVA_SOURCE_VER)
5918 AC_SUBST(JAVA_TARGET_VER)
5919 AC_SUBST(JDK)
5920 AC_SUBST(JDKLIB)
5921 AC_SUBST(XCLASSPATH)
5922 AC_SUBST(x_JAVALIB)
5923 AC_SUBST(x_JDKLIB)
5925 dnl ===================================================================
5926 dnl Checks for specific files.
5927 dnl ===================================================================
5929 dnl ===================================================================
5930 dnl Checks for programs.
5931 dnl ===================================================================
5933 dnl ===================================================================
5934 dnl Check whether we already have dmake
5935 dnl ===================================================================
5936 AC_PATH_PROG(DMAKE, dmake, no)
5937 if test "$DMAKE" = "no"; then
5938     BUILD_DMAKE=YES
5939     echo "dmake will be built on ./bootstrap"
5940 else
5941     AC_MSG_CHECKING([whether the found dmake is the right dmake])
5942     # we need to find out whether that dmake we found is "our" dmake
5943     # or the dmake from Sun's SunStudio Compiler which is something
5944     # different
5945     # This test _should_ work because the one accepts -V (ours) and one
5946     # (the other) not...
5947     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
5948     if test $? -eq 0; then
5949         BUILD_DMAKE=NO
5950         AC_MSG_RESULT([yes])
5951         AC_MSG_CHECKING([the dmake version])
5952         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
5953         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
5954             AC_MSG_RESULT([OK, >= 4.11])
5955         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
5956             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
5957             AC_MSG_RESULT([OK, >= 4.11])
5958         else
5959             AC_MSG_RESULT([too old. >= 4.11 is needed])
5960             echo "A newer dmake will be built on ./bootstrap"
5961             BUILD_DMAKE=YES
5962         fi
5963     else
5964         AC_MSG_RESULT([no])
5965         echo "dmake will be built on ./bootstrap"
5966         BUILD_DMAKE=YES
5967     fi
5969 AC_SUBST(BUILD_DMAKE)
5971 AC_MSG_CHECKING([whether to enable EPM for packing])
5972 BUILD_EPM=NO
5973 if test "$enable_epm" = "yes"; then
5974     AC_MSG_RESULT([yes])
5975     dnl ===================================================================
5976     dnl Check for epm - not needed for Windows
5977     dnl ===================================================================
5978     if test "$_os" != "WINNT"; then
5979         if test -n "$with_epm"; then
5980             EPM=$with_epm
5981         else
5982             AC_PATH_PROG(EPM, epm, no)
5983         fi
5984         if test "$EPM" = "no" -o "$EPM" = "internal"; then
5985             echo "EPM will be built."
5986             BUILD_EPM=YES
5987             BUILD_TYPE="$BUILD_TYPE EPM"
5988         else
5989             # Gentoo has some epm which is something different...
5990             AC_MSG_CHECKING([whether the found epm is the right epm])
5991             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
5992                 AC_MSG_RESULT([yes])
5993             else
5994                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
5995             fi
5996             AC_MSG_CHECKING([epm version])
5997             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
5998             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
5999                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
6000                 AC_MSG_RESULT([OK, >= 3.7])
6001                 BUILD_EPM=NO
6002                 if test "$_os" = "Darwin"; then
6003                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
6004                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
6005                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6006                         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)])
6007                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6008                         AC_MSG_RESULT([$_pm, ok])
6009                     else # we never should get here, but go safe
6010                         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)])
6011                     fi
6012                 fi
6013             else
6014                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
6015                 echo "EPM will be built."
6016                 BUILD_EPM=YES
6017                 BUILD_TYPE="$BUILD_TYPE EPM"
6018             fi
6019         fi
6020     fi
6022     # test which package format to use
6023     AC_MSG_CHECKING([which package format to use])
6025     # defaults
6026     case "$_os" in
6027     Darwin)
6028         PKGFORMAT=dmg
6029         ;;
6030     SunOS)
6031         PKGFORMAT=pkg
6032         ;;
6033     Linux)
6034         # if building on Debian, default should be deb...
6035         if test -e /etc/debian_version; then
6036             PKGFORMAT=deb
6037         else
6038             PKGFORMAT=rpm
6039         fi
6040         ;;
6041     AIX)
6042         PKGFORMAT=rpm
6043         ;;
6044     OpenBSD|DragonFly)
6045         PKGFORMAT=portable
6046         ;;
6047     *BSD)
6048         PKGFORMAT=bsd
6049         ;;
6050     WINNT)
6051         PKGFORMAT=msi
6052         ;;
6053     # we never should get here since we check the arciecture/os at the beginning,
6054     # but go sure...
6055     *)
6056         AC_MSG_ERROR([unknown system])
6057     esac
6058     if test -n "$with_package_format"; then
6059         for i in $with_package_format; do
6060             case "$i" in
6061             aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
6062                 ;;
6063             *)
6064                 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
6065 aix - AIX software distribution
6066 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
6067 deb - Debian software distribution
6068 inst or tardist - IRIX software distribution
6069 osx - MacOS X software distribution
6070 pkg - Solaris software distribution
6071 rpm - RedHat software distribution
6072 setld - Tru64 (setld) software distribution
6073 native - "Native" software distribution for the platform
6074 portable - Portable software distribution
6075 LibreOffice additionally supports:
6076 archive - .tar.gz or .zip
6077 dmg - Mac OS X .dmg
6078 installed - installation tree
6079 msi - Windows .msi
6080             ])
6081                 ;;
6082             esac
6083         done
6084         PKGFORMAT="$with_package_format"
6085     fi
6086     AC_MSG_RESULT([$PKGFORMAT])
6087     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
6088         AC_MSG_CHECKING([for rpm])
6089         for a in "$RPM" rpmbuild rpm; do
6090             $a --usage >/dev/null 2> /dev/null
6091             if test $? -eq 0; then
6092                 RPM=$a
6093                 break
6094             else
6095                 $a --version >/dev/null 2> /dev/null
6096                 if test $? -eq 0; then
6097                     RPM=$a
6098                     break
6099                 fi
6100             fi
6101         done
6102         if test -z "$RPM"; then
6103             AC_MSG_ERROR([not found])
6104         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
6105             RPM_PATH=`which $RPM`
6106             AC_MSG_RESULT([$RPM_PATH])
6107         else
6108             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
6109         fi
6110     fi
6111     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
6112         AC_PATH_PROG(DPKG, dpkg, no)
6113         if test "$DPKG" = "no"; then
6114             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
6115         fi
6116     fi
6117     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
6118         if test "$_os" = "Darwin"; then
6119             AC_MSG_CHECKING([for PackageMaker availability])
6120             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
6121                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
6122             else
6123                 AC_MSG_RESULT([ok])
6124             fi
6125         else
6126             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
6127         fi
6128     fi
6129     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
6130        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6131         if test "$EPM" != "no" -a "$EPM" != "internal"; then
6132             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
6133                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
6134                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
6135                     AC_MSG_RESULT([yes])
6136                 else
6137                     AC_MSG_RESULT([no])
6138                     if echo "$PKGFORMAT" | $GREP -q rpm; then
6139                         _pt="rpm"
6140                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
6141                         echo "the rpms will need to be installed with --nodeps" >> warn
6142                     else
6143                         _pt="pkg"
6144                     fi
6145                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
6146                     echo "the ${_pt}s will not be relocateable" >> warn
6147                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
6148                                  relocation will work, you need to patch your epm with the
6149                                  patch in epm/epm-3.7.patch or build with
6150                                  --with-epm=internal which will build a suitable epm])
6151                 fi
6152             fi
6153         fi
6154     fi
6155     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6156         AC_PATH_PROG(PKGMK, pkgmk, no)
6157         if test "$PKGMK" = "no"; then
6158             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
6159         fi
6160     fi
6161     AC_SUBST(RPM)
6162     AC_SUBST(DPKG)
6163     AC_SUBST(PKGMK)
6164 else
6165     AC_MSG_RESULT([no])
6166     EPM=NO
6167     PKGFORMAT=native
6169 AC_SUBST(EPM)
6170 AC_SUBST(BUILD_EPM)
6171 AC_SUBST(PKGFORMAT)
6173 dnl ===================================================================
6174 dnl Check for gperf
6175 dnl ===================================================================
6176 AC_PATH_PROG(GPERF, gperf)
6177 if test -z "$GPERF"; then
6178     AC_MSG_ERROR([gperf not found but needed. Install it.])
6180 AC_MSG_CHECKING([gperf version])
6181 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6182     AC_MSG_RESULT([OK])
6183 else
6184     AC_MSG_ERROR([too old, you need at least 3.0.0])
6186 AC_SUBST(GPERF)
6188 dnl ===================================================================
6189 dnl Check for building ODK
6190 dnl ===================================================================
6191 AC_MSG_CHECKING([whether to build the ODK])
6192 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
6193     AC_MSG_RESULT([yes])
6195     if test "$with_java" != "no"; then
6196         AC_MSG_CHECKING([whether to build unowinreg.dll])
6197         if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
6198             # build on Win by default
6199             enable_build_unowinreg=yes
6200         fi
6201         if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
6202             AC_MSG_RESULT([no])
6203             BUILD_UNOWINREG=NO
6204         else
6205             AC_MSG_RESULT([yes])
6206             BUILD_UNOWINREG=YES
6207         fi
6208         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
6209             if test -z "$with_mingw_cross_compiler"; then
6210                 dnl Guess...
6211                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
6212             elif test -x "$with_mingw_cross_compiler"; then
6213                  MINGWCXX="$with_mingw_cross_compiler"
6214             else
6215                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
6216             fi
6218             if test "$MINGWCXX" = "false"; then
6219                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
6220             fi
6222             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
6223             if test -x "$mingwstrip_test"; then
6224                 MINGWSTRIP="$mingwstrip_test"
6225             else
6226                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
6227             fi
6229             if test "$MINGWSTRIP" = "false"; then
6230                 AC_MSG_ERROR(MinGW32 binutils not found.)
6231             fi
6232         fi
6233     fi
6234     BUILD_TYPE="$BUILD_TYPE ODK"
6235 else
6236     AC_MSG_RESULT([no])
6237     BUILD_UNOWINREG=NO
6239 AC_SUBST(BUILD_UNOWINREG)
6240 AC_SUBST(MINGWCXX)
6241 AC_SUBST(MINGWSTRIP)
6243 dnl ===================================================================
6244 dnl Check for system stdlibs
6245 dnl ===================================================================
6246 AC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
6247 if test "$with_system_stdlibs" != "no"; then
6248     AC_MSG_RESULT([no])
6249     SYSTEM_STDLIBS=YES
6250 else
6251     AC_MSG_RESULT([yes])
6252     SYSTEM_STDLIBS=NO
6254 AC_SUBST(SYSTEM_STDLIBS)
6256 dnl ===================================================================
6257 dnl Check for system zlib
6258 dnl ===================================================================
6259 if test "$with_system_zlib" = "auto"; then
6260     case "$_os" in
6261     WINNT)
6262         with_system_zlib="$with_system_libs"
6263         ;;
6264     *)
6265         with_system_zlib=yes
6266         ;;
6267     esac
6270 AC_MSG_CHECKING([which zlib to use])
6271 if test "$with_system_zlib" = "yes"; then
6272     AC_MSG_RESULT([external])
6273     SYSTEM_ZLIB=YES
6274     AC_CHECK_HEADER(zlib.h, [],
6275         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
6276     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
6277         [AC_MSG_ERROR(zlib not found or functional)], [])
6278     if test "$WITH_MINGW" = "yes"; then
6279         # we need minizip too
6280         PKG_CHECK_MODULES([MINIZIP], [minizip])
6281         libo_MINGW_CHECK_DLL([MINIZIP], [libminizip])
6282         SYSTEM_MINIZIP=YES
6283     fi
6284 else
6285     AC_MSG_RESULT([internal])
6286     SYSTEM_ZLIB=NO
6287     SYSTEM_MINIZIP=NO
6288     BUILD_TYPE="$BUILD_TYPE ZLIB"
6290 AC_SUBST(SYSTEM_ZLIB)
6291 AC_SUBST([SYSTEM_MINIZIP])
6292 AC_SUBST([MINGW_MINIZIP_DLL])
6294 dnl ===================================================================
6295 dnl Check for system jpeg
6296 dnl ===================================================================
6297 AC_MSG_CHECKING([which jpeg to use])
6298 if test "$with_system_jpeg" = "auto"; then
6299     case "$_os" in
6300     WINNT|Darwin|iOS|Android)
6301         with_system_jpeg="$with_system_libs"
6302         ;;
6303     *)
6304         with_system_jpeg=yes
6305         ;;
6306     esac
6309 if test "$with_system_jpeg" = "yes"; then
6310     AC_MSG_RESULT([external])
6311     SYSTEM_JPEG=YES
6312     AC_CHECK_HEADER(jpeglib.h, [],
6313         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
6314     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
6315     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
6316     libo_MINGW_CHECK_DLL([JPEG], [libjpeg])
6317 else
6318     AC_MSG_RESULT([internal])
6319     SYSTEM_JPEG=NO
6320     BUILD_TYPE="$BUILD_TYPE JPEG"
6322 AC_SUBST(SYSTEM_JPEG)
6323 AC_SUBST([MINGW_JPEG_DLL])
6325 dnl ===================================================================
6326 dnl Check for system clucene
6327 dnl ===================================================================
6328 AC_MSG_CHECKING([which clucene to use])
6329 if test "$with_system_clucene" = "yes"; then
6330     AC_MSG_RESULT([external])
6331     SYSTEM_CLUCENE=YES
6332     PKG_CHECK_MODULES(CLUCENE, libclucene-core)
6334     AC_LANG_PUSH([C++])
6335     save_CXXFLAGS=$CXXFLAGS
6336     save_CPPFLAGS=$CPPFLAGS
6337     CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
6338     CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
6339     dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
6340     dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
6341     AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
6342                  [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
6343     CXXFLAGS=$save_CXXFLAGS
6344     CPPFLAGS=$save_CPPFLAGS
6345     AC_LANG_POP([C++])
6347     CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
6348 else
6349     AC_MSG_RESULT([internal])
6350     SYSTEM_CLUCENE=NO
6351     BUILD_TYPE="$BUILD_TYPE CLUCENE"
6353 AC_SUBST(SYSTEM_CLUCENE)
6354 AC_SUBST(CLUCENE_CFLAGS)
6355 AC_SUBST(CLUCENE_LIBS)
6357 dnl ===================================================================
6358 dnl Check for system expat
6359 dnl ===================================================================
6360 AC_MSG_CHECKING([which expat to use])
6361 if test "$with_system_expat" = "yes"; then
6362     AC_MSG_RESULT([external])
6363     SYSTEM_EXPAT=YES
6364     AC_CHECK_HEADER(expat.h, [],
6365         [AC_MSG_ERROR(expat.h not found. install expat)], [])
6366     AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
6367     [AC_MSG_RESULT(expat library not found or functional.)], [])
6368     libo_MINGW_CHECK_DLL([EXPAT], [libexpat])
6369 else
6370     AC_MSG_RESULT([internal])
6371     SYSTEM_EXPAT=NO
6372     BUILD_TYPE="$BUILD_TYPE EXPAT"
6374 AC_SUBST(SYSTEM_EXPAT)
6375 AC_SUBST([MINGW_EXPAT_DLL])
6377 dnl ===================================================================
6378 dnl Check for system libcdr
6379 dnl ===================================================================
6380 AC_MSG_CHECKING([which libcdr to use])
6381 if test "$with_system_libcdr" = "yes"; then
6382     AC_MSG_RESULT([external])
6383     SYSTEM_LIBCDR=YES
6384     PKG_CHECK_MODULES( CDR, libcdr-0.0 >= 0.0.5 )
6385 elif test $_os = iOS; then
6386     # libcdr depends on libwpd and libwpg and those are LGPL
6387     AC_MSG_RESULT([none])
6388 else
6389     AC_MSG_RESULT([internal])
6390     SYSTEM_LIBCDR=NO
6391     BUILD_TYPE="$BUILD_TYPE LIBCDR"
6393 AC_SUBST(SYSTEM_LIBCDR)
6394 AC_SUBST(CDR_CFLAGS)
6395 AC_SUBST(CDR_LIBS)
6397 dnl ===================================================================
6398 dnl Check for system libvisio
6399 dnl ===================================================================
6400 AC_MSG_CHECKING([which libvisio to use])
6401 if test "$with_system_libvisio" = "yes"; then
6402     AC_MSG_RESULT([external])
6403     SYSTEM_LIBVISIO=YES
6404     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
6405 elif test $_os = iOS; then
6406     # libvisio depends on libwpd and libwpg and those are LGPL
6407     AC_MSG_RESULT([none])
6408 else
6409     AC_MSG_RESULT([internal])
6410     SYSTEM_LIBVISIO=NO
6411     BUILD_TYPE="$BUILD_TYPE LIBVISIO"
6413 AC_SUBST(SYSTEM_LIBVISIO)
6414 AC_SUBST(VISIO_CFLAGS)
6415 AC_SUBST(VISIO_LIBS)
6417 dnl ===================================================================
6418 dnl Check for system libcmis
6419 dnl ===================================================================
6420 AC_MSG_CHECKING([which libcmis to use])
6421 if test "$with_system_libcmis" = "yes"; then
6422     AC_MSG_RESULT([external])
6423     SYSTEM_LIBCMIS=YES
6424     PKG_CHECK_MODULES( LIBCMIS, libcmis-0.2 >= 0.2.1 )
6425 else
6426     AC_MSG_RESULT([internal])
6427     SYSTEM_LIBCMIS=NO
6428     BUILD_TYPE="$BUILD_TYPE LIBCMIS"
6430 AC_SUBST(SYSTEM_LIBCMIS)
6431 AC_SUBST(LIBCMIS_CFLAGS)
6432 AC_SUBST(LIBCMIS_LIBS)
6435 dnl ===================================================================
6436 dnl Check for system libwpd
6437 dnl ===================================================================
6438 AC_MSG_CHECKING([which libwpd to use])
6439 if test "$with_system_libwpd" = "yes"; then
6440     AC_MSG_RESULT([external])
6441     SYSTEM_LIBWPD=YES
6442     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
6443 elif test $_os = iOS; then
6444     AC_MSG_RESULT([none])
6445 else
6446     AC_MSG_RESULT([internal])
6447     SYSTEM_LIBWPD=NO
6448     BUILD_TYPE="$BUILD_TYPE LIBWPD"
6450 AC_SUBST(SYSTEM_LIBWPD)
6451 AC_SUBST(WPD_CFLAGS)
6452 AC_SUBST(WPD_LIBS)
6454 dnl ===================================================================
6455 dnl Check for system lcms2
6456 dnl ===================================================================
6457 AC_MSG_CHECKING([which littlecms v2 to use])
6458 if test "$with_system_lcms2" = "yes"; then
6459     AC_MSG_RESULT([external])
6460     SYSTEM_LCMS2=YES
6461     PKG_CHECK_MODULES( LCMS2, lcms2 )
6462     libo_MINGW_CHECK_DLL([LCMS2], [liblcms2])
6463 else
6464     AC_MSG_RESULT([internal])
6465     SYSTEM_LCMS2=NO
6466     BUILD_TYPE="$BUILD_TYPE LCMS2"
6468 AC_SUBST(SYSTEM_LCMS2)
6469 AC_SUBST(LCMS2_CFLAGS)
6470 AC_SUBST(LCMS2_LIBS)
6471 AC_SUBST([MINGW_LCMS2_DLL])
6473 dnl ===================================================================
6474 dnl Check for system cppunit
6475 dnl ===================================================================
6476 AC_MSG_CHECKING([which cppunit to use])
6477 if test "$with_system_cppunit" = "yes"; then
6478     AC_MSG_RESULT([external])
6479     SYSTEM_CPPUNIT=YES
6480     # might work for earlier, too but go sure:
6481     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
6482 else
6483     AC_MSG_RESULT([internal])
6484     SYSTEM_CPPUNIT=NO
6485     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
6487 AC_SUBST(SYSTEM_CPPUNIT)
6488 AC_SUBST(CPPUNIT_CFLAGS)
6489 AC_SUBST(CPPUNIT_LIBS)
6491 dnl ===================================================================
6492 dnl Check whether freetype is available
6493 dnl ===================================================================
6494 if test  "$test_freetype" = "yes"; then
6495     AC_MSG_CHECKING([whether freetype is available])
6496     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
6497 else
6498     case "$BUILD_TYPE" in
6499     *FREETYPE*)
6500         FREETYPE_LIBS="-lfreetype"
6501         ;;
6502     esac
6504 AC_SUBST(FREETYPE_CFLAGS)
6505 AC_SUBST(FREETYPE_LIBS)
6507 dnl ===================================================================
6508 dnl Check for system libwps
6509 dnl ===================================================================
6510 AC_MSG_CHECKING([which libwps to use])
6511 if test "$with_system_libwps" = "yes"; then
6512     AC_MSG_RESULT([external])
6513     SYSTEM_LIBWPS=YES
6514     PKG_CHECK_MODULES( WPS, libwps-0.2 )
6515 elif test $_os = iOS; then
6516     AC_MSG_RESULT([none])
6517 else
6518     AC_MSG_RESULT([internal])
6519     SYSTEM_LIBWPS=NO
6520     BUILD_TYPE="$BUILD_TYPE LIBWPS"
6522 AC_SUBST(SYSTEM_LIBWPS)
6523 AC_SUBST(WPS_CFLAGS)
6524 AC_SUBST(WPS_LIBS)
6526 dnl ===================================================================
6527 dnl Check for system libwpg
6528 dnl ===================================================================
6529 AC_MSG_CHECKING([which libwpg to use])
6530 if test "$with_system_libwpg" = "yes"; then
6531     AC_MSG_RESULT([external])
6532     SYSTEM_LIBWPG=YES
6533     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
6534 elif test $_os = iOS; then
6535     AC_MSG_RESULT([none])
6536 else
6537     AC_MSG_RESULT([internal])
6538     SYSTEM_LIBWPG=NO
6539     BUILD_TYPE="$BUILD_TYPE LIBWPG"
6541 AC_SUBST(SYSTEM_LIBWPG)
6542 AC_SUBST(WPG_CFLAGS)
6543 AC_SUBST(WPG_LIBS)
6545 dnl ===================================================================
6546 dnl Check whether freetype2 supports emboldening
6547 dnl ===================================================================
6548 if test  "$test_freetype" = "yes"; then
6549     save_CPPFLAGS="$CPPFLAGS"
6550     save_LDFLAGS="$LDFLAGS"
6551     save_LIBS="$LIBS"
6552     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
6553     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
6554     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
6555                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
6556     LDFLAGS="$save_LDFLAGS"
6557     CPPFLAGS="$save_CPPFLAGS"
6558     LIBS="$save_LIBS"
6560 AC_SUBST(USE_FT_EMBOLDEN)
6562 # ===================================================================
6563 # Check for system libxslt
6564 # to prevent incompatibilities between internal libxml2 and external libxslt,
6565 # or vice versa, use with_system_libxml here
6566 # ===================================================================
6567 if test "$with_system_libxml" = "auto"; then
6568     case "$_os" in
6569     WINNT|iOS|Android)
6570         with_system_libxml="$with_system_libs"
6571         ;;
6572     *)
6573         with_system_libxml=yes
6574         ;;
6575     esac
6578 AC_MSG_CHECKING([which libxslt to use])
6579 if test "$with_system_libxml" = "yes"; then
6580     AC_MSG_RESULT([external])
6581     SYSTEM_LIBXSLT=YES
6582     if test "$_os" = "Darwin"; then
6583         dnl make sure to use SDK path
6584         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
6585         dnl omit -L/usr/lib
6586         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
6587     else
6588         PKG_CHECK_MODULES(LIBXSLT, libxslt)
6589     fi
6591     dnl Check for xsltproc
6592     AC_PATH_PROG(XSLTPROC, xsltproc, no)
6593     if test "$XSLTPROC" = "no"; then
6594         AC_MSG_ERROR([xsltproc is required])
6595     fi
6597     libo_MINGW_CHECK_DLL([LIBXSLT], [libxslt])
6598     libo_MINGW_TRY_DLL([ICONV], [iconv])
6599 else
6600     AC_MSG_RESULT([internal])
6601     SYSTEM_LIBXSLT=NO
6602     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
6604     if test "$cross_compiling" = "yes"; then
6605         AC_PATH_PROG(XSLTPROC, xsltproc, no)
6606         if test "$XSLTPROC" = "no"; then
6607             AC_MSG_ERROR([xsltproc is required])
6608         fi
6609     fi
6611 AC_SUBST(SYSTEM_LIBXSLT)
6612 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
6613     SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
6615 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
6617 AC_SUBST(LIBXSLT_CFLAGS)
6618 AC_SUBST(LIBXSLT_LIBS)
6619 AC_SUBST(XSLTPROC)
6620 AC_SUBST([MINGW_LIBXSLT_DLL])
6621 AC_SUBST([MINGW_ICONV_DLL])
6623 # ===================================================================
6624 # Check for system libxml
6625 # ===================================================================
6626 AC_MSG_CHECKING([which libxml to use])
6627 if test "$with_system_libxml" = "yes"; then
6628     AC_MSG_RESULT([external])
6629     SYSTEM_LIBXML=YES
6630     if test "$_os" = "Darwin"; then
6631         dnl make sure to use SDK path
6632         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
6633         dnl omit -L/usr/lib
6634         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
6635     elif test $_os = iOS; then
6636         dnl make sure to use SDK path
6637         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
6638         LIBXML_CFLAGS="-I$usr/include/libxml2"
6639         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
6640     else
6641         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
6642     fi
6644     dnl Check for xmllint
6645     AC_PATH_PROG(XMLLINT, xmllint, no)
6646     if test "$XMLLINT" = "no"; then
6647         AC_MSG_ERROR([xmllint is required])
6648     fi
6650     libo_MINGW_CHECK_DLL([LIBXML],[libxml2])
6651     libo_MINGW_TRY_DLL([ZLIB],[zlib1])
6652 else
6653     AC_MSG_RESULT([internal])
6654     SYSTEM_LIBXML=NO
6655     BUILD_TYPE="$BUILD_TYPE LIBXML2"
6657 AC_SUBST(SYSTEM_LIBXML)
6658 AC_SUBST(LIBXML_CFLAGS)
6659 AC_SUBST(LIBXML_LIBS)
6660 AC_SUBST(XMLLINT)
6661 AC_SUBST([MINGW_LIBXML_DLL])
6662 AC_SUBST([MINGW_ZLIB_DLL])
6663 dnl ===================================================================
6664 dnl Checks for Python
6665 dnl ===================================================================
6667 AC_MSG_CHECKING([which Python to use])
6669 case "$enable_python" in
6670 no|disable)
6671     enable_python=no
6672     AC_MSG_RESULT([none])
6673     DISABLE_PYTHON=TRUE
6674     ;;
6675 ""|yes|auto)
6676     if test "$DISABLE_SCRIPTING" = TRUE; then
6677         AC_MSG_RESULT([no, overridden by --disable-scripting])
6678         enable_python=no
6679         DISABLE_PYTHON=TRUE
6680     elif test $build_os = cygwin; then
6681         dnl When building on Windows we don't attempt to use any installed
6682         dnl "system"  Python.
6683         dnl
6684         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
6685         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
6686         dnl MinGW cross-compilation setups.)
6687         AC_MSG_RESULT([internal])
6688         enable_python=internal
6689     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
6690         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
6691         enable_python=internal
6692     else
6693         AC_MSG_RESULT([checking below])
6694         enable_python=auto
6695     fi
6696     ;;
6697 internal)
6698     AC_MSG_RESULT([internal])
6699     ;;
6700 system)
6701     if test $_os = Darwin -a -z "$PYTHON" -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
6702         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
6703     fi
6704     AC_MSG_RESULT([system])
6705     ;;
6707     AC_MSG_ERROR([Incorrect --enable-python option])
6708     ;;
6709 esac
6711 AC_SUBST(DISABLE_PYTHON)
6713 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
6714     AC_MSG_ERROR([Must use internal Python when building with MSVC])
6717 if test $enable_python != no; then
6718     BUILD_TYPE="$BUILD_TYPE PYUNO"
6721 if test "$cross_compiling" = yes; then
6722     if test $enable_python = auto; then
6723         enable_python=system
6724     fi
6725 else
6726     if test $enable_python = system -a -z "$PYTHON"; then
6727         if test $_os = Darwin; then
6728             # We already have logic above to make sure the system Python
6729             # is used only when building against SDK 10.6 or newer.
6731             # Make sure we use the 2.6 Python when building against the
6732             # 10.6 SDK.
6733             case $with_macosx_sdk in
6734             10.6)
6735                 python_version=2.6;;
6736             10.7)
6737                 python_version=2.7;;
6738             *)
6739                 # ???
6740                 python_version=2.7;;
6741             esac
6742             PYTHON=python$python_version
6743             PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
6744             PYTHON_LIBS="-framework Python"
6745         else
6746             # This causes an error if no python command is found
6747             AM_PATH_PYTHON([2.6])
6748         fi
6749     elif test $enable_python = auto; then
6750         dnl This allows lack of system Python
6751         AM_PATH_PYTHON([2.6],, [:])
6753         if test "$PYTHON" = :; then
6754             enable_python=internal
6755         else
6756             enable_python=system
6757         fi
6758     fi
6761 if test $enable_python = system; then
6762     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
6763         # Fallback: Accept these in the environment, or as set above
6764         # for MacOSX.
6765         :
6766     elif test "$cross_compiling" != yes; then
6767         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
6768         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
6769         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
6770         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
6771         if test -z "$PKG_CONFIG"; then
6772             PYTHON_CFLAGS="-I$python_include"
6773             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
6774         elif $PKG_CONFIG --exists python-$python_version; then
6775             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
6776             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
6777         else
6778             PYTHON_CFLAGS="-I$python_include"
6779             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
6780         fi
6781     else
6782         dnl How to find out the cross-compilation Python installation path?
6783         dnl Let's hardocode what we know for different distributions for now...
6785         for python_sysroot in /usr/i686-w64-mingw32/sys-root/mingw; do
6786             for python_version in 2.6; do
6787                 if test -f ${python_sysroot}/include/python${python_version}/Python.h; then
6788                     PYTHON_CFLAGS="-I${python_sysroot}/include/python$python_version"
6789                     PYTHON_LIBS="-L${python_sysroot}lib -lpython$python_version $python_libs"
6790                     break
6791                 fi
6792             done
6793             test -n "$PYTHON_CFLAGS" && break
6794         done
6795     fi
6798 dnl By now enable_python should be "system", "internal" or "no"
6799 case $enable_python in
6800 system)
6801     SYSTEM_PYTHON=YES
6803     dnl Check if the headers really work
6804     save_CPPFLAGS="$CPPFLAGS"
6805     CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
6806     AC_CHECK_HEADER(Python.h, [],
6807        [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
6808        [])
6809     CPPFLAGS="$save_CPPFLAGS"
6811     dnl FIXME Check if the Python library can be linked with, too?
6812     ;;
6814 internal)
6815     SYSTEM_PYTHON=NO
6816     BUILD_TYPE="$BUILD_TYPE PYTHON"
6817     # Embedded Python dies without Home set
6818     if test "$HOME" = ""; then
6819         export HOME="";
6820     fi
6821     # bz2 tarball and bzip2 is not standard
6822     if test -z "$BZIP2"; then
6823         AC_PATH_PROG( BZIP2, bzip2)
6824         if test -z "$BZIP2"; then
6825             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
6826         fi
6827     fi
6828     ;;
6830     SYSTEM_PYTHON=NO
6831     ;;
6833     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
6834     ;;
6835 esac
6837 AC_SUBST(SYSTEM_PYTHON)
6838 AC_SUBST(PYTHON_CFLAGS)
6839 AC_SUBST(PYTHON_LIBS)
6841 dnl ===================================================================
6842 dnl Check for system Berkeley db
6843 dnl ===================================================================
6844 AC_MSG_CHECKING([which db to use])
6845 if test "$with_system_db" = "yes"; then
6846     SYSTEM_DB=YES
6847     AC_MSG_RESULT([external])
6849     db_header=
6850     for dbver in 5.3 5.1 5.0 5 4.8 4.7 4; do
6851         for dash in - ''; do
6852             AC_CHECK_HEADER([db$dash$dbver/db.h],
6853                 [ db_header="db$dash$dbver/db.h"; break 2 ])
6854         done
6855     done
6857     if test -z "$db_header"; then
6858         AC_CHECK_HEADER([db/db.h], [db_header='db/db.h'; dbver=''])
6859     fi
6861     if test -z "$db_header"; then
6862        AC_CHECK_HEADER(db.h, [ db_header='db.h'; dbver='' ])
6863     fi
6865     if test -z "$db_header"; then
6866         AC_MSG_ERROR([db.h not found. Use the correct -I flag, or install the Berkeley db development package.])
6867     fi
6869     AC_MSG_CHECKING([whether db is at least 4.1])
6870     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$db_header>]], [[int array[(DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1))-1];]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no. you need at least db 4.1])])
6872     SYSTEM_DB_CFLAGS="-DSYSTEM_DB_HEADER='<$db_header>'"
6874     DB_LIB=
6875     dnl At least on OpenBSD dbver is not appended to the library
6876     if test "$_os" = "OpenBSD"; then
6877         dbver=''
6878     fi
6879     for dash in - ''; do
6880         AC_CHECK_LIB(db$dash$dbver, dbopen,
6881             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
6882         AC_CHECK_LIB(db$dash$dbver, __db185_open,
6883             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
6884     done
6886     if test -z "$DB_LIB"; then
6887         AC_MSG_ERROR([db library not found. Use the correct -L flag,
6888 or install the Berkeley db development package.])
6889     fi
6891     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
6892     libo_MINGW_CHECK_DLL([DB], [libdb])
6893 elif test $_os != iOS -a $_os != Android; then
6894     AC_MSG_RESULT([internal])
6895     SYSTEM_DB=NO
6896     BUILD_TYPE="$BUILD_TYPE BERKELEYDB"
6897 else
6898    AC_MSG_RESULT([none])
6900 AC_SUBST(SYSTEM_DB)
6901 AC_SUBST(SYSTEM_DB_CFLAGS)
6902 AC_SUBST(DB_LIB)
6903 AC_SUBST(DB_CPPLIB)
6904 AC_SUBST([MINGW_DB_DLL])
6906 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
6907 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
6908     AC_MSG_RESULT([yes])
6909     ENABLE_MYSQLC=YES
6910     BUILD_TYPE="$BUILD_TYPE MYSQLC"
6911 else
6912     AC_MSG_RESULT([no])
6913     ENABLE_MYSQLC=NO
6915 AC_SUBST(ENABLE_MYSQLC)
6917 if test "$ENABLE_MYSQLC" = "YES"; then
6919     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
6921     dnl ===================================================================
6922     dnl Check for system MySQL
6923     dnl ===================================================================
6924     AC_MSG_CHECKING([for MySQL prerequisites])
6925     if test "$with_system_mysql" = "yes"; then
6926         AC_MSG_RESULT([external MySQL])
6927         SYSTEM_MYSQL=YES
6928         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
6929         AC_MSG_CHECKING([MySQL version])
6930         MYSQL_VERSION=`$MYSQLCONFIG --version`
6931         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
6932         if test "$MYSQL_MAJOR" -ge "5"; then
6933             AC_MSG_RESULT([OK])
6934         else
6935             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
6936         fi
6937         AC_MSG_CHECKING([for MySQL Client library])
6938         MYSQL_INC=`$MYSQLCONFIG --include`
6939         MYSQL_LIB=`$MYSQLCONFIG --libs`
6940         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
6941         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
6942     else
6943         SYSTEM_MYSQL=NO
6944         if test -n "$with_libmysql_path"; then
6945             AC_MSG_RESULT([external Connector/C (libmysql)])
6946             LIBMYSQL=libmysql.so
6947             if test "$_os" = "Darwin"; then
6948                 LIBMYSQL=libmysql.dylib
6949             elif test "$_os" = "WINNT"; then
6950                 LIBMYSQL=libmysql.dll
6951             fi
6952             AC_MSG_CHECKING([for $LIBMYSQL])
6953             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
6954                 AC_MSG_RESULT([found.])
6955                 LIBMYSQL_PATH=$with_libmysql_path
6956             else
6957                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
6958             fi
6959         else
6960             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
6961         fi
6962     fi
6963     AC_SUBST(SYSTEM_MYSQL)
6964     AC_SUBST(MYSQL_INC)
6965     AC_SUBST(MYSQL_LIB)
6966     AC_SUBST(MYSQL_DEFINES)
6967     AC_SUBST(LIBMYSQL_PATH)
6969     AC_LANG_PUSH([C++])
6970     dnl ===================================================================
6971     dnl Check for system MySQL C++ Connector
6972     dnl ===================================================================
6973     # FIXME!
6974     # who thought this too-generic cppconn dir was a good idea?
6975     AC_MSG_CHECKING([MySQL Connector/C++])
6976     if test "$with_system_mysql_cppconn" = "yes"; then
6977         AC_MSG_RESULT([external])
6978         SYSTEM_MYSQL_CPPCONN=YES
6979         AC_LANG_PUSH([C++])
6980         AC_CHECK_HEADER(mysql_driver.h, [],
6981                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
6982         AC_CHECK_LIB([mysqlcppconn], [main], [:],
6983                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
6984         save_LIBS=$LIBS
6985         LIBS="$LIBS -lmysqlcppconn"
6986         AC_MSG_CHECKING([version])
6987         AC_RUN_IFELSE([AC_LANG_SOURCE([[
6988 #include <mysql_driver.h>
6990 int main(int argc, char **argv) {
6991     sql::Driver *driver;
6992     driver = get_driver_instance();
6993     if (driver->getMajorVersion() > 1 || \
6994        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
6995        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
6996         return 0;
6997       else
6998         return 1;
7000       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
7002         AC_LANG_POP([C++])
7003         LIBS=$save_LIBS
7004     else
7005         AC_MSG_RESULT([internal])
7006         AC_MSG_CHECKING([for mysqlcppconn module])
7007         if test -d mysqlcppconn; then
7008             AC_MSG_RESULT([OK])
7009         else
7010             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
7011         fi
7012         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
7013         SYSTEM_MYSQL_CPPCONN=NO
7014     fi
7015     AC_LANG_POP([C++])
7016     AC_SUBST(SYSTEM_MYSQL_CPPCONN)
7019 dnl ===================================================================
7020 dnl Check for system hsqldb
7021 dnl ===================================================================
7022 if test "$with_java" != "no"; then
7023 AC_MSG_CHECKING([which hsqldb to use])
7024 if test "$with_system_hsqldb" = "yes"; then
7025     AC_MSG_RESULT([external])
7026     SYSTEM_HSQLDB=YES
7027     if test -z $HSQLDB_JAR; then
7028         HSQLDB_JAR=/usr/share/java/hsqldb.jar
7029     fi
7030     AC_CHECK_FILE($HSQLDB_JAR, [],
7031                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
7032     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
7033     export HSQLDB_JAR
7034     if $PERL -e 'use Archive::Zip;
7035             my $file = "$ENV{'HSQLDB_JAR'}";
7036             my $zip = Archive::Zip->new( $file );
7037             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
7038             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
7039                push @l, split(/\n/, $mf);
7040                foreach my $line (@l) {
7041                   if ($line =~ m/Specification-Version:/) {
7042                       ($t, $version) = split (/:/,$line);
7043                       $version =~ s/^\s//;
7044                       ($a, $b, $c, $d) = split (/\./,$version);
7045                       if ($c == "0" && $d > "8")  {
7046                           exit 0;
7047                       } else {
7048                           exit 1;
7049                       }
7050                   }
7051                }
7052             } else {
7053                 exit 1;
7054             }'; then
7055         AC_MSG_RESULT([yes])
7056     else
7057         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
7058     fi
7059 else
7060     AC_MSG_RESULT([internal])
7061     SYSTEM_HSQLDB=NO
7062     BUILD_TYPE="$BUILD_TYPE HSQLDB"
7064 AC_SUBST(SYSTEM_HSQLDB)
7065 AC_SUBST(HSQLDB_JAR)
7068 dnl ===================================================================
7069 dnl Check for PostgreSQL stuff
7070 dnl ===================================================================
7071 if test "x$enable_postgresql_sdbc" != "xno"; then
7072     SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
7074     # if/when anything else than PostgreSQL uses Kerberos,
7075     # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
7076     WITH_KRB5=NO
7077     WITH_GSSAPI=no
7078     case "$_os" in
7079     Darwin)
7080         # MacOS X has system MIT Kerberos 5 since 10.4
7081         if test "$with_krb5" != "no"; then
7082             WITH_KRB5=YES
7083             save_LIBS=$LIBS
7084             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7085                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7086             LIBS=$save_LIBS
7087             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7088                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7089             LIBS=$save_LIBS
7090         fi
7091         if test "$with_gssapi" != "no"; then
7092           WITH_GSSAPI=YES
7093           save_LIBS=$LIBS
7094           AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7095                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7096           LIBS=$save_LIBS
7097         fi
7098         ;;
7099     WINNT)
7100         if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
7101             AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
7102         fi
7103         ;;
7104     Linux|GNU|*BSD|DragonFly)
7105         if test "$with_krb5" != "no"; then
7106             WITH_KRB5=YES
7107             save_LIBS=$LIBS
7108             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7109                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7110             LIBS=$save_LIBS
7111             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7112                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7113             LIBS=$save_LIBS
7114         fi
7115         if test "$with_gssapi" != "no"; then
7116             WITH_GSSAPI=YES
7117             save_LIBS=$LIBS
7118             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7119                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7120             LIBS=$save_LIBS
7121         fi
7122         ;;
7123     *)
7124         if test "$with_krb5" = "yes"; then
7125             WITH_KRB5=YES
7126             save_LIBS=$LIBS
7127             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7128                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7129             LIBS=$save_LIBS
7130             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7131                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7132             LIBS=$save_LIBS
7133         fi
7134         if test "$with_gssapi" = "yes"; then
7135             WITH_GSSAPI=YES
7136             save_LIBS=$LIBS
7137             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7138                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7139             LIBS=$save_LIBS
7140         fi
7141     esac
7143     AC_MSG_CHECKING([PostgreSQL C interface])
7144     if test "$with_system_postgresql" = "yes"; then
7145         AC_MSG_RESULT([external PostgreSQL])
7146         SYSTEM_POSTGRESQL=YES
7147         if test "$_os" = Darwin; then
7148             supp_path=''
7149             for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
7150                 pg_supp_path="$P_SEP$d$pg_supp_path"
7151             done
7152         fi
7153         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
7154         if test -z "$PGCONFIG"; then
7155             AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
7156         fi
7157         POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
7158         POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
7159     else
7160         if test -n "$with_libpq_path"; then
7161             SYSTEM_POSTGRESQL=YES
7162             AC_MSG_RESULT([external libpq])
7163             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
7164             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
7165         else
7166             SYSTEM_POSTGRESQL=NO
7167             AC_MSG_RESULT([internal])
7168             POSTGRESQL_LIB=""
7169             POSTGRESQL_INC="%OVERRIDE_ME%"
7170             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
7171         fi
7172     fi
7173     if test "${SYSTEM_POSTGRESQL}" = "YES"; then
7174         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
7175         save_CFLAGS=$CFLAGS
7176         save_CPPFLAGS=$CPPFLAGS
7177         save_LIBS=$LIBS
7178         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
7179         LIBS="${LIBS} ${POSTGRESQL_LIB}"
7180         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
7181         AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
7182             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
7183         CFLAGS=$save_CFLAGS
7184         CPPFLAGS=$save_CPPFLAGS
7185         LIBS=$save_LIBS
7186     fi
7187     BUILD_POSTGRESQL_SDBC=YES
7189 AC_SUBST(WITH_KRB5)
7190 AC_SUBST(WITH_GSSAPI)
7191 AC_SUBST(BUILD_POSTGRESQL_SDBC)
7192 AC_SUBST(SYSTEM_POSTGRESQL)
7193 AC_SUBST(POSTGRESQL_INC)
7194 AC_SUBST(POSTGRESQL_LIB)
7197 dnl ===================================================================
7198 dnl Check for system saxon
7199 dnl ===================================================================
7200 if test "$with_java" != "no"; then
7201 AC_MSG_CHECKING([which saxon to use])
7202 if test "$with_system_saxon" = "yes"; then
7203     AC_MSG_RESULT([external])
7204     SYSTEM_SAXON=YES
7205     if test -z $SAXON_JAR; then
7206         AC_CHECK_FILE(/usr/share/java/saxon9.jar,
7207             [ SAXON_JAR=/usr/share/java/saxon9.jar ],
7208             [
7209               AC_CHECK_FILE(/usr/share/java/saxon.jar,
7210                 [ SAXON_JAR=/usr/share/java/saxon.jar ],
7211                 [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
7212                     [ SAXON_JAR=/usr/share/java/saxon9.jar ],
7213                     [ AC_MSG_ERROR(saxon.jar replacement not found)]
7214                   )
7215                 ]
7216               )
7217             ]
7218           )
7219     else
7220         AC_CHECK_FILE($SAXON_JAR, [],
7221                [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
7222     fi
7223     if test -n "$SERIALIZER_JAR"; then
7224         AC_CHECK_FILE($SERIALIZER_JAR, [],
7225                [AC_MSG_ERROR(serializer.jar not found.)], [])
7226         AC_SUBST(SERIALIZER_JAR)
7227     fi
7229     dnl Saxon comes in two practically available versions, the out-of-date saxonb which
7230     dnl supports the Java extensions that LibreOffice uses, and the up-to-date saxon he
7231     dnl "home edition" version, which is crippled to not support those Java extensions.
7232     dnl And as an aside the he one also needs to be tweaked to include
7233     dnl a META-INF/services to broadcast that it supports the jaxp transform factory
7235     AC_MSG_CHECKING([if saxon works])
7236     cat > saxontest.java <<_ACEOF
7237 [import javax.xml.transform.TransformerFactory;
7238 import javax.xml.transform.Transformer;
7239 import javax.xml.transform.stream.StreamSource;
7240 import java.io.*;
7242 import net.sf.saxon.FeatureKeys;
7244 class saxontest {
7245     public static void main(String[] args) {
7246       System.setProperty("javax.xml.transform.TransformerFactory",
7247         "net.sf.saxon.TransformerFactoryImpl");
7248       try {
7249         TransformerFactory tfactory = TransformerFactory.newInstance();
7250     // some external saxons (Debian, Ubuntu, ...) have this disabled
7251     // per default
7252     tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
7253         System.out.println("TransformerFactory is" +
7254           tfactory.getClass().getName());
7255         Transformer transformer = tfactory.newTransformer(
7256           new StreamSource(new File(args[0])));
7257       } catch(Exception e){
7258         e.printStackTrace(System.err);
7259         System.exit(-1);
7260       }
7261       System.exit(0);
7262     }
7265 _ACEOF
7267     cat > saxontest.xsl<<_ACEOF
7268 [<?xml version="1.0" encoding="UTF-8"?>
7269 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7270  <xsl:template match="/">
7271   <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
7272  </xsl:template>
7273 </xsl:stylesheet>
7275 _ACEOF
7277     javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
7278     AC_TRY_EVAL(javac_cmd)
7279     if test $? = 0 -a -f ./saxontest.class; then
7280         java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
7281         AC_TRY_EVAL(java_cmd)
7282         if test $? = 0; then
7283             AC_MSG_RESULT([yes])
7284         else
7285             cat saxontest.java >&5
7286             AC_MSG_RESULT([no])
7287             AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
7288         fi
7289     else
7290         AC_MSG_RESULT([no])
7291         cat saxontest.java >&5
7292         AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
7293     fi
7294 else
7295     AC_MSG_RESULT([internal])
7296     SYSTEM_SAXON=NO
7297     NEED_SAXON=TRUE
7300 AC_SUBST(SYSTEM_SAXON)
7301 AC_SUBST(SAXON_JAR)
7303 if test -n "$NEED_SAXON"; then
7304     BUILD_TYPE="$BUILD_TYPE SAXON"
7307 # ===================================================================
7308 # Check whether to build stax
7309 # ===================================================================
7310 AC_MSG_CHECKING([whether building the stax is required])
7311 BUILD_STAX=NO
7312 if test -z "$SOLAR_JAVA"; then
7313     AC_MSG_RESULT([no (java disabled)])
7314 elif test "$SYSTEM_SAXON" = "YES"; then
7315     AC_MSG_RESULT([no (already provided by system saxon)])
7316 elif test -f "./stax/download/jsr173_1.0_api.jar"; then
7317     AC_MSG_RESULT([no (will use the prebuilt stax/download/jsr173_1.0_api.jar)])
7318 else
7319     BUILD_STAX=YES
7320     AC_MSG_RESULT([yes (no system saxon and no prebuilt copy)])
7322 AC_SUBST(BUILD_STAX)
7324 dnl ===================================================================
7325 dnl Check for system curl
7326 dnl ===================================================================
7327 AC_MSG_CHECKING([which libcurl to use])
7328 if test "$with_system_curl" = "auto"; then
7329     case "$_os" in
7330     Darwin)
7331         with_system_curl=yes
7332         ;;
7333     *)
7334         with_system_curl="$with_system_libs"
7335         ;;
7336     esac
7339 if test "$with_system_curl" = "yes"; then
7340     AC_MSG_RESULT([external])
7341     SYSTEM_CURL=YES
7343     curl_version=""
7344     if test "$cross_compiling" = "yes"; then
7345         dnl At least the OBS mingw32-libcurl-devel package
7346         dnl comes with a proper .pc file
7347         PKG_CHECK_MODULES(CURL, libcurl,, [:])
7348         if test -n "$CURL_PKG_ERRORS"; then
7349             AC_MSG_RESULT([no])
7350         else
7351             curl_version=`$PKG_CONFIG --modversion libcurl`
7352         fi
7353     fi
7354     if test -z "$curl_version"; then
7355         AC_PATH_PROG(CURLCONFIG, curl-config)
7356         if test -z "$CURLCONFIG"; then
7357             AC_MSG_ERROR([install the libcurl development package])
7358         fi
7359         CURL_LIBS=`$CURLCONFIG --libs`
7360         CURL_CFLAGS=`$CURLCONFIG --cflags`
7361         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
7362     fi
7364     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
7366     case $curl_version in
7367     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
7368     dnl so they need to be doubled to end up in the configure script
7369     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
7370         AC_MSG_RESULT([yes, you have $curl_version])
7371         ;;
7372     *)
7373         AC_MSG_ERROR([no, you have $curl_version])
7374         ;;
7375     esac
7377     libo_MINGW_CHECK_DLL([CURL], [libcurl])
7378     libo_MINGW_TRY_DLL([INTL], [libintl])
7379     libo_MINGW_TRY_DLL([IDN], [libidn])
7380     libo_MINGW_TRY_DLL([NSPR4], [libnspr4])
7381     libo_MINGW_TRY_DLL([NSSUTIL3], [nssutil3])
7382     libo_MINGW_TRY_DLL([PLC4], [libplc4])
7383     libo_MINGW_TRY_DLL([PLDS4], [libplds4])
7384     libo_MINGW_TRY_DLL([NSS3], [nss3])
7385     libo_MINGW_TRY_DLL([SSL3], [ssl3])
7386     libo_MINGW_TRY_DLL([GPG_ERROR], [libgpg-error])
7387     libo_MINGW_TRY_DLL([GCRYPT], [libgcrypt])
7388     libo_MINGW_TRY_DLL([SSH2], [libssh2])
7389 else
7390     AC_MSG_RESULT([internal])
7391     SYSTEM_CURL=NO
7392     BUILD_TYPE="$BUILD_TYPE CURL"
7394 AC_SUBST(SYSTEM_CURL)
7395 AC_SUBST(CURL_CFLAGS)
7396 AC_SUBST(CURL_LIBS)
7397 AC_SUBST([MINGW_CURL_DLL])
7398 AC_SUBST([MINGW_GCRYPT_DLL])
7399 AC_SUBST([MINGW_GPG_ERROR_DLL])
7400 AC_SUBST([MINGW_IDN_DLL])
7401 AC_SUBST([MINGW_INTL_DLL])
7402 AC_SUBST([MINGW_NSPR4_DLL])
7403 AC_SUBST([MINGW_NSS3_DLL])
7404 AC_SUBST([MINGW_NSSUTIL3_DLL])
7405 AC_SUBST([MINGW_PLC4_DLL])
7406 AC_SUBST([MINGW_PLDS4_DLL])
7407 AC_SUBST([MINGW_SSH2_DLL])
7408 AC_SUBST([MINGW_SSL3_DLL])
7410 dnl ===================================================================
7411 dnl Check for system boost
7412 dnl ===================================================================
7413 AC_MSG_CHECKING([which boost to use])
7414 if test "$with_system_boost" = "yes"; then
7415     AC_MSG_RESULT([external])
7416     SYSTEM_BOOST=YES
7417     AC_LANG_PUSH([C++])
7418     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
7419        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
7420     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
7421        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
7422     AC_CHECK_HEADER(boost/function.hpp, [],
7423        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
7424     AC_CHECK_HEADER([boost/unordered_map.hpp], [HAVE_BOOST_UNORDERED_MAP=TRUE],
7425                    [AC_MSG_WARN([boost/unordered_map.hpp not found])], [])
7427     save_CXXFLAGS=$CXXFLAGS
7428     CXXFLAGS="$CXXFLAGS -fno-exceptions"
7429     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
7430     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
7431 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
7433     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
7434         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
7435     else
7436         AC_MSG_RESULT([yes])
7437     fi
7438     CXXFLAGS=$save_CXXFLAGS
7439     AC_LANG_POP([C++])
7441     AX_BOOST_BASE
7442     AX_BOOST_DATE_TIME
7443     mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
7444     libo_MINGW_TRY_DLL([BOOST_DATE_TIME], [$mingw_boost_date_time_dll])
7445     if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
7446         # if not found, try again with 'lib' prefix
7447         libo_MINGW_CHECK_DLL([BOOST_DATE_TIME],
7448                              [lib$mingw_boost_date_time_dll])
7449     fi
7450 else
7451     AC_MSG_RESULT([internal])
7452     BUILD_TYPE="$BUILD_TYPE BOOST"
7453     SYSTEM_BOOST=NO
7454     HAVE_BOOST_UNORDERED_MAP=TRUE
7456 AC_SUBST([HAVE_BOOST_UNORDERED_MAP])
7457 AC_SUBST([MINGW_BOOST_DATE_TIME_DLL])
7458 AC_SUBST(SYSTEM_BOOST)
7460 dnl ===================================================================
7461 dnl Check for system mdds
7462 dnl ===================================================================
7463 AC_MSG_CHECKING([which mdds to use])
7464 if test "$with_system_mdds" = "yes"; then
7465     AC_MSG_RESULT([external])
7466     SYSTEM_MDDS=YES
7468     dnl ===================================================================
7469     dnl Determine which hash container mdds shall use
7470     dnl ===================================================================
7471     AC_MSG_CHECKING([which hash container mdds shall use])
7472     if test "x$HAVE_CXX0X" = "xTRUE"; then
7473         MDDS_CPPFLAGS="-std=gnu++0x"
7474         AC_MSG_RESULT([std::unordered_map])
7475     else
7476         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
7477         AC_MSG_RESULT([boost::unordered_map])
7478     fi
7480     AC_LANG_PUSH([C++])
7481     save_CPPFLAGS="$CPPFLAGS"
7482     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
7483     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
7484         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
7485     AC_CHECK_HEADER(mdds/mixed_type_matrix.hpp, [],
7486         [AC_MSG_ERROR(mdds/mixed_type_matrix.hpp not found. install mdds >= 0.4.0)], [])
7487     CPPFLAGS="$save_CPPFLAGS"
7488     save_CXXFLAGS="$CXXFLAGS"
7489     CXXFLAGS="$CXXFLAGS $MDDS_CPPFLAGS"
7490     AC_MSG_CHECKING([for correct signature of ::mdds::flat_segment_tree])
7491     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mdds/flat_segment_tree.hpp>
7493     int main(int argc, char **argv) {
7494         ::mdds::flat_segment_tree<long, short> db(0, 100, 0);
7495         short val;
7496         if (!db.search(5, val).second)
7497             return 1;
7498         return 0;
7499     }
7500 ]])],[ac_cv_cxx_mdds_flat_segment_tree_correct=yes],[ac_cv_cxx_mdds_flat_segment_tree_correct=no],[])
7502     if test "$ac_cv_cxx_mdds_flat_segment_tree_correct" = "yes"; then
7503         AC_MSG_RESULT([yes])
7504     else
7505         AC_MSG_ERROR([no, install mdds >= 0.5.0])
7506     fi
7507     CXXFLAGS=$save_CXXFLAGS
7508     AC_LANG_POP([C++])
7509 else
7510     AC_MSG_RESULT([internal])
7511     BUILD_TYPE="$BUILD_TYPE MDDS"
7512     SYSTEM_MDDS=NO
7514     dnl ===================================================================
7515     dnl Determine which hash container mdds shall use
7516     dnl ===================================================================
7517     AC_MSG_CHECKING([which hash container mdds shall use])
7518     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
7519     AC_MSG_RESULT([boost::unordered_map])
7521 AC_SUBST(SYSTEM_MDDS)
7522 AC_SUBST([MDDS_CPPFLAGS])
7524 dnl ===================================================================
7525 dnl Check for system vigra
7526 dnl ===================================================================
7527 AC_MSG_CHECKING([which vigra to use])
7528 if test "$with_system_vigra" = "yes"; then
7529     AC_MSG_RESULT([external])
7530     SYSTEM_VIGRA=YES
7531     AC_LANG_PUSH([C++])
7532     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
7533        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
7534     AC_LANG_POP([C++])
7535 else
7536     AC_MSG_RESULT([internal])
7537     BUILD_TYPE="$BUILD_TYPE VIGRA"
7538     SYSTEM_VIGRA=NO
7540 AC_SUBST(SYSTEM_VIGRA)
7542 dnl ===================================================================
7543 dnl Check for system odbc
7544 dnl ===================================================================
7545 AC_MSG_CHECKING([which odbc headers to use])
7546 if test "$with_system_odbc" = "yes"; then
7547     AC_MSG_RESULT([external])
7548     SYSTEM_ODBC_HEADERS=YES
7550     AC_CHECK_HEADER(sqlext.h, [],
7551       [AC_MSG_ERROR(odbc not found. install odbc)], [])
7552 elif test "$enable_database_connectivity" != yes; then
7553     AC_MSG_RESULT([none])
7554 else
7555     AC_MSG_RESULT([internal])
7556     SYSTEM_ODBC_HEADERS=NO
7558 AC_SUBST(SYSTEM_ODBC_HEADERS)
7560 AC_MSG_CHECKING([whether to enable build of Mozilla])
7561 if test "$enable_mozilla" = "no"; then
7562     AC_MSG_RESULT([no])
7563     WITH_MOZILLA=NO
7564 else
7565     AC_MSG_RESULT([yes])
7566     WITH_MOZILLA=YES
7568 AC_SUBST(WITH_MOZILLA)
7570 AC_MSG_CHECKING([whether to build Mozilla addressbook connectivity])
7571 if test "$enable_mozilla" = "no"; then
7572     AC_MSG_RESULT([no])
7573 elif test "$with_system_mozilla" = "yes"; then
7574     AC_MSG_RESULT([no, not possible with system-mozilla])
7575 else
7576     AC_MSG_RESULT([yes])
7579 AC_MSG_CHECKING([whether to build XML Security support])
7580 if test "$enable_xmlsec" = "no"; then
7581     AC_MSG_RESULT([no])
7582     ENABLE_XMLSEC=
7583 else
7584     ENABLE_XMLSEC="YES"
7585     BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
7586     AC_MSG_RESULT([yes])
7588 AC_SUBST(ENABLE_XMLSEC)
7590 AC_MSG_CHECKING([whether to build LDAP configuration backend])
7591 if test "$enable_ldap" != "no"; then
7592     WITH_OPENLDAP=NO
7593     WITH_LDAP=NO
7594     if test "$with_openldap" = "yes"; then
7595         WITH_LDAP=YES
7596         AC_MSG_RESULT([OpenLDAP])
7597         WITH_OPENLDAP=YES
7598         AC_CHECK_HEADERS(ldap.h, [],
7599             [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
7600         AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:],
7601             [AC_MSG_ERROR(openldap lib not found or functional)], [])
7602         AC_CHECK_LIB([ldap], [ldap_set_option], [:],
7603             [AC_MSG_ERROR(openldap lib not found or functional)], [])
7604     elif test "$enable_mozilla" != "no"; then
7605         AC_MSG_RESULT([Mozilla])
7606         WITH_LDAP=YES
7607         WITH_OPENLDAP=NO
7608     else
7609         AC_MSG_RESULT([no. Either Mozilla or OpenLDAP required])
7610     fi
7611 else
7612     AC_MSG_RESULT([no])
7613     WITH_LDAP=NO
7615 AC_SUBST(WITH_LDAP)
7616 AC_SUBST(WITH_OPENLDAP)
7618 dnl ===================================================================
7619 dnl Check for system mozilla
7620 dnl ===================================================================
7622 AC_MSG_CHECKING([which Mozilla to use])
7623 if test -n "$with_system_mozilla" -a "$with_system_mozilla" != "no"; then
7624     AC_MSG_RESULT([external])
7625     SYSTEM_MOZILLA=YES
7626     AC_MSG_CHECKING([which Mozilla flavour to use])
7627     if test -n "$with_system_mozilla" -a "$with_system_mozilla" = "libxul"; then
7628         MOZ_FLAVOUR=libxul
7629     elif test -n "$with_system_mozilla" -a "$with_system_mozilla" = "xulrunner"; then
7630         MOZ_FLAVOUR=xulrunner
7631     elif test -n "$with_system_mozilla" -a "$with_system_mozilla" = "seamonkey"; then
7632         MOZ_FLAVOUR=seamonkey
7633     elif test -n "$with_system_mozilla" -a "$with_system_mozilla" = "iceape"; then
7634         MOZ_FLAVOUR=iceape
7635     elif test -n "$with_system_mozilla" -a "$with_system_mozilla" = "firefox"; then
7636         MOZ_FLAVOUR=firefox
7637     elif test -n "$with_system_mozilla" -a "$with_system_mozilla" = "mozilla"; then
7638         MOZ_FLAVOUR=mozilla
7639     else
7640         MOZ_FLAVOUR=libxul
7641     fi
7642     tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst(<STDIN>);'`
7643     AC_MSG_RESULT($tmp)
7645     if test "$MOZ_FLAVOUR" != "libxul"; then
7646         PKG_CHECK_MODULES( MOZILLAXPCOM, $MOZ_FLAVOUR-xpcom, HASXPCOM="TRUE", HASXPCOM="" )
7647         MOZ_INC=`$PKG_CONFIG --variable=includedir $MOZ_FLAVOUR-xpcom`
7648         MOZ_LIB=`$PKG_CONFIG --variable=libdir $MOZ_FLAVOUR-xpcom`
7649     fi
7651     if test -z "$HASXPCOM"; then
7652         PKG_CHECK_MODULES( MOZILLAXPCOM, libxul )
7653         MOZ_INC=`$PKG_CONFIG --variable=includedir libxul`
7654         MOZ_LIB=`$PKG_CONFIG --variable=libdir libxul`
7655         if ! test -e "$MOZ_LIB/libxul.so"; then
7656             MOZ_LIB=`$PKG_CONFIG --variable=sdkdir libxul`
7657             if test -e "$MOZ_LIB/sdk/lib/libxul.so"; then
7658                 MOZ_LIB="$MOZ_LIB/sdk/lib"
7659             fi
7660         fi
7661     fi
7663     MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS
7664     if test "$WITH_LDAP" != "NO" -a "$WITH_OPENLDAP" != "YES"; then
7665         AC_MSG_CHECKING([whether $tmp was compiled with --enable-ldap])
7666         if test -d "$MOZ_INC/ldap"; then
7667             AC_MSG_RESULT([yes])
7668             MOZ_LDAP_CFLAGS="-I$MOZ_INC"
7669         else
7670             AC_MSG_ERROR([no.
7671 Could not find LDAP header include files in $MOZ_INC/ldap.
7672 Please recompile $tmp with --enable-ldap or use --with-openldap.])
7673         fi
7674     fi
7676     #e.g. http://fedoraproject.org/wiki/Releases/FeatureXULRunnerAPIChanges
7677     #the plugin pkg-config etc. reverts to "mozilla-plugin" with libxul
7678     if test "$MOZ_FLAVOUR" = "libxul"; then
7679         MOZ_FLAVOUR="mozilla"
7680     fi
7682 elif test "$enable_mozilla" = "no"; then
7683     AC_MSG_RESULT([none])
7684     WITH_MOZILLA=NO
7685 else
7686     AC_MSG_RESULT([internal])
7687     SYSTEM_MOZILLA=NO
7688     BUILD_TYPE="$BUILD_TYPE MOZ"
7689     if test -z "$with_mozilla_version"; then
7690         MOZILLA_VERSION=
7691     else
7692         AC_MSG_CHECKING([which Mozilla version to build])
7693         MOZILLA_VERSION=$with_mozilla_version
7694         enable_build_mozilla=1
7695         AC_MSG_RESULT([$MOZILLA_VERSION])
7696     fi
7698     AC_SUBST(MOZILLA_VERSION)
7700     AC_MSG_CHECKING([for toolkit Mozilla should use])
7701     if test -z "$with_mozilla_toolkit"; then
7702         if test "$_os" != "WINNT"; then
7703             if test "$_os" = "Darwin"; then
7704                 MOZILLA_TOOLKIT=mac
7705                 AC_MSG_RESULT([mac])
7706             else
7707                 MOZILLA_TOOLKIT=gtk2
7708                 AC_MSG_RESULT([gtk2])
7709             fi
7710         fi
7711     else
7712         MOZILLA_TOOLKIT=$with_mozilla_toolkit
7713         enable_build_mozilla=1
7714         AC_MSG_RESULT([$MOZILLA_TOOLKIT])
7715     fi
7717     AC_SUBST(MOZILLA_TOOLKIT)
7719     # default to enabling build mozilla
7720     if test "$enable_build_mozilla" != "no"; then
7721         enable_build_mozilla=yes
7722     else
7723         enable_build_mozilla=
7724     fi
7726     AC_MSG_CHECKING([whether to build Mozilla/SeaMonkey])
7727     if test -n "$enable_build_mozilla"; then
7728         BUILD_MOZAB="TRUE"
7729         AC_MSG_RESULT([yes])
7730     else
7731         BUILD_MOZAB=""
7732         AC_MSG_RESULT([no])
7733     fi
7735     if test "$BUILD_MOZAB" = "TRUE"; then
7736         if test "$_os" = "WINNT"; then
7737             if test "$WITH_MINGW" != "yes"; then
7738                 # compiling with MSVC. Only supported platform here is MSVS2005 at the moment.
7739                 if test "$MSVSVER" != "2005"; then
7740                     AC_MSG_ERROR([Building SeaMonkey is supported with Microsoft Visual Studio 2005 only.])
7741                 fi
7742             else
7743                 AC_MSG_WARN([Building SeaMonkey with MinGW is not tested, and likely to break.])
7744                 echo "Building SeaMonkey with MinGW is not tested, and likely to break." >> warn
7745             fi
7746         fi
7748         if test -z "$MOZILLA_VERSION"; then
7749             MOZILLA_VERSION=1.1.14
7750         fi
7751         MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"
7752         MOZILLA_FETCH_FILE=`grep $MOZILLA_SOURCE_VERSION ooo.lst.in`
7753         AC_MSG_CHECKING([for Mozilla sources])
7754         if test -z "$MOZILLA_FETCH_FILE"; then
7755             AC_MSG_RESULT([not found])
7756             HAVE_MOZILLA_TARBALL=n
7757         else
7758             AC_MSG_CHECKING([for $MOZILLA_FETCH_FILE])
7759             if test ! -e "$TARFILE_LOCATION/$MOZILLA_FETCH_FILE"; then
7760                 if test -z "$DO_FETCH"; then
7761                     AC_MSG_RESULT([will be fetched])
7762                     HAVE_MOZILLA_TARBALL=y
7763                 else
7764                     AC_MSG_RESULT([not found])
7765                     HAVE_MOZILLA_TARBALL=n
7766                 fi
7767             else
7768                 AC_MSG_RESULT([found])
7769                 HAVE_MOZILLA_TARBALL=y
7770             fi
7771         fi
7772         if test "$HAVE_MOZILLA_TARBALL" != "y"; then
7773             AC_MSG_ERROR([Mozilla/SeaMonkey source archive not found.
7774 Use "./download" to download.])
7775         fi
7776         if test "$_os" = "WINNT"; then
7777             AC_MSG_CHECKING([for moztools binaries])
7778             if test ! -e "$TARFILE_LOCATION/vc8-moztools.zip"; then
7779                 AC_MSG_ERROR([The following file is missing in $TARFILE_LOCATION: vc8-moztools.zip
7780 (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)])
7781             else
7782                 AC_MSG_RESULT([ok])
7783             fi
7784         elif test "$_os" = "Darwin"; then
7785             PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.6.3,  MOZIDL="TRUE", MOZIDL="")
7786             if test -z "$MOZIDL"; then
7787                 AC_MSG_ERROR([libIDL 0.6.3 or newer is needed to build Mozilla with Mac toolkit.])
7788             fi
7789         else
7790             # Generic Unix/Linux section
7791             if test "$MOZILLA_TOOLKIT" = "gtk2"; then
7792                 PKG_CHECK_MODULES(MOZLIBREQ, gtk+-2.0, MOZGTK="TRUE", MOZGTK="")
7793                 if test -z "$MOZGTK"; then
7794                     AC_MSG_ERROR([GTK2 is needed to build Mozilla.])
7795                 fi
7796                 PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.8.0, MOZIDL="TRUE", MOZIDL="")
7797                 if test -z "$MOZIDL"; then
7798                     AC_MSG_ERROR([libIDL >= 0.8.0 is needed when using GTK2 to build Mozilla.])
7799                 fi
7800             else
7801                 PKG_CHECK_MODULES(MOZLIBREQ, gtk+ >= 1.2.3, MOZGTK="TRUE", MOZGTK="")
7802                 if test -z "$MOZGTK"; then
7803                     AC_MSG_ERROR([GTK+ 1.2 is needed when not using GTK2 to build Mozilla.])
7804                 fi
7805                 PKG_CHECK_MODULES(MOZLIBREQ, libidl >= 0.6.3 libidl <= 0.6.8, MOZIDL="TRUE", MOZIDL="")
7806                 if test -z "$MOZIDL"; then
7807                     AC_MSG_ERROR([libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build Mozilla.])
7808                 fi
7809             fi
7810         fi
7811     else
7812         AC_MSG_CHECKING([which pre-built Mozilla module in moz/zipped])
7813         if test -e "$SRC_ROOT/moz/zipped/${OS}${COM}${CPU}inc.zip" -a \
7814                 -e "$SRC_ROOT/moz/zipped/${OS}${COM}${CPU}lib.zip" -a \
7815                 -e "$SRC_ROOT/moz/zipped/${OS}${COM}${CPU}runtime.zip"; then
7816             AC_MSG_RESULT([Found])
7817             PREBUILD_MOZAB="YES"
7818             if test "$_os" = "WINNT"; then
7819                 AC_MSG_CHECKING([for MSVC 2005 runtime needed for prebuilt Mozilla])
7820                 if test -e "$SRC_ROOT/external/msvcp80/Microsoft.VC80.CRT.manifest" -a \
7821                         -e "$SRC_ROOT/external/msvcp80/msvcp80.dll" -a \
7822                         -e "$SRC_ROOT/external/msvcp80/msvcr80.dll"; then
7823                     AC_MSG_RESULT([Found])
7824                 else
7825                     AC_MSG_RESULT([Not Found])
7826                     AC_MSG_ERROR([For the pre-built Mozilla libraries, you need MSVC 2005 runtime files
7827 Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll
7828 in external/msvcp80.
7830 You can get them by installing:
7831 <http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE>
7832 and copying the abovementioned files from:
7833 c:/windows/winsxs/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989/
7835 c:/windows/winsxs/manifests/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989.manifest
7837                 fi
7838             fi
7839         else
7840             AC_MSG_RESULT([Not Found])
7841             AC_MSG_ERROR([If you don't use system mozilla and also disable the build of internal mozilla, you must provided the appropriate libraries yourself.
7842 You need to copy $OS$COM$CPU{inc,lib,runtime}.zip into moz/zipped.
7843 These files can be found at <http://dev-www.libreoffice.org/mozilla/>
7845         fi
7846     fi
7849 if test "$SYSTEM_MOZILLA" = "YES"; then
7850     SOLARLIB="$SOLARLIB -L$MOZ_LIB"
7853 AC_SUBST(BUILD_MOZAB)
7854 AC_SUBST(PREBUILD_MOZAB)
7855 AC_SUBST(MOZILLABUILD)
7856 AC_SUBST(SYSTEM_MOZILLA)
7857 AC_SUBST(MOZ_FLAVOUR)
7858 AC_SUBST(MOZ_INC)
7859 AC_SUBST(MOZ_LIB)
7860 AC_SUBST(MOZ_LIB_XPCOM)
7861 AC_SUBST(MOZ_LDAP_CFLAGS)
7863 dnl ===================================================================
7864 dnl Check for system NSS only with xmlsec or mozilla build enabled
7865 dnl ===================================================================
7866 if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" != "xno"; then
7867 AC_MSG_CHECKING([which NSS to use])
7868 if test "$with_system_nss" = "yes"; then
7869     AC_MSG_RESULT([external])
7870     SYSTEM_NSS="YES"
7871     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
7872 else
7873     SYSTEM_NSS="NO"
7874     BUILD_TYPE="$BUILD_TYPE NSS"
7875     AC_MSG_RESULT([internal])
7876     if test "$build_os" = "cygwin"; then
7877         AC_MSG_CHECKING([for Mozilla build tooling. Required for nss and/or mozilla])
7878         if test -z "$MOZILLABUILD"; then
7879             AC_MSG_ERROR([Mozilla build tooling not found.
7880 Use the --with-mozilla-build option after installing the tools obtained
7881 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
7882         else
7883             if test \( "$WITH_MINGW" = "yes" \); then
7884                 if test ! -d "$MOZILLABUILD"; then
7885                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
7886                 else
7887                     AC_MSG_RESULT([ok])
7888                 fi
7889             else
7890                 if test ! -d "$MOZILLABUILD/moztools" \
7891                         -o ! -d "$MOZILLABUILD/msys"; then
7892                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
7893                 else
7894                     AC_MSG_RESULT([ok])
7895                 fi
7896             fi
7897         fi
7898     fi
7899 fi # system nss
7900 fi # enable xmlsec || enable mozilla
7901 AC_SUBST(SYSTEM_NSS)
7902 AC_SUBST(NSS_CFLAGS)
7903 AC_SUBST(NSS_LIBS)
7905 dnl ===================================================================
7906 dnl Check for system mozilla headers
7907 dnl ===================================================================
7908 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
7909 AC_MSG_CHECKING([which mozilla headers to use])
7910 if test "$with_system_mozilla_headers" = "yes"; then
7911     AC_MSG_RESULT([external])
7912     SYSTEM_MOZILLA_HEADERS=YES
7913     # First try npapi-sdk:
7914     PKG_CHECK_MODULES(MOZILLA_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
7915     # Then go with libxul:
7916     if test "x$LOCATED" != "xyes"; then
7917         PKG_CHECK_MODULES(MOZILLA_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
7918     fi
7919     if test "x$LOCATED" != "xyes"; then
7920         PKG_CHECK_MODULES(MOZILLA_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
7921     fi
7922     # if still not found bail out
7923     if test "x$LOCATED" != "xyes"; then
7924         AC_MSG_ERROR([npapi.h header file not found])
7925     fi
7927     AC_LANG_PUSH([C])
7928     save_CFLAGS=$CFLAGS
7929     CFLAGS="$CFLAGS $MOZILLA_HEADERS_CFLAGS"
7930     AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
7931     AC_COMPILE_IFELSE(
7932         [AC_LANG_SOURCE([[
7933             #define XP_UNIX
7934             #include <npapi.h>
7935             const char* NPP_GetMIMEDescription(void) { return "foo"; }
7936             ]])],
7937         [AC_MSG_RESULT([const char*])],
7938         [
7939         AC_MSG_RESULT([char*])
7940         HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
7941         ])
7942     CFLAGS=$save_CFLAGS
7943     AC_LANG_POP([C])
7944 else
7945     AC_MSG_RESULT([internal])
7946     SYSTEM_MOZILLA_HEADERS=NO
7948 AC_SUBST(MOZILLA_HEADERS_CFLAGS)
7949 AC_SUBST(SYSTEM_MOZILLA_HEADERS)
7950 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
7952 dnl ===================================================================
7953 dnl Check for system sane
7954 dnl ===================================================================
7955 AC_MSG_CHECKING([which sane header to use])
7956 if test "$with_system_sane" = "yes"; then
7957     AC_MSG_RESULT([external])
7958     AC_CHECK_HEADER(sane/sane.h, [],
7959       [AC_MSG_ERROR(sane not found. install sane)], [])
7960 else
7961     AC_MSG_RESULT([internal])
7962     BUILD_TYPE="$BUILD_TYPE SANE"
7965 dnl ===================================================================
7966 dnl Check for system icu
7967 dnl ===================================================================
7968 SYSTEM_GENBRK=
7969 SYSTEM_GENCCODE=
7970 SYSTEM_GENCMN=
7972 ICU_MAJOR=49
7973 ICU_MINOR=1
7974 ICU_MICRO=1
7975 ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
7976 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
7977 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
7978 ICU_RECLASSIFIED_HEBREW_LETTER="YES"
7979 AC_MSG_CHECKING([which icu to use])
7980 if test "$with_system_icu" = "yes"; then
7981     AC_MSG_RESULT([external])
7982     SYSTEM_ICU=YES
7983     AC_LANG_PUSH([C++])
7984     AC_MSG_CHECKING([for unicode/rbbi.h])
7985     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
7986     AC_LANG_POP([C++])
7988     ICUPATH="$PATH"
7989     if test "$WITH_MINGW" = "yes"; then
7990         ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
7991     fi
7992     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
7994     AC_MSG_CHECKING([ICU version])
7995     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
7996     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
7997     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
7998     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
8000     if test "$ICU_MAJOR" -ge "4"; then
8001         AC_MSG_RESULT([OK, $ICU_VERSION])
8002     else
8003         AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
8004     fi
8006     if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
8007         AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
8008         ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
8009         ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
8010         ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
8011         AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
8012         if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
8013             AC_MSG_RESULT([yes])
8014         else
8015             AC_MSG_RESULT([no])
8016             if test "$with_system_icu_for_build" != "force"; then
8017                 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
8018 You can use --with-system-icu-for-build=force to use it anyway.])
8019             fi
8020         fi
8021     fi
8023     if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
8024         # using the system icu tools can lead to version confusion, use the
8025         # ones from the build environment when cross-compiling
8026         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
8027         if test -z "$SYSTEM_GENBRK"; then
8028             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
8029         fi
8030         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8031         if test -z "$SYSTEM_GENCCODE"; then
8032             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
8033         fi
8034         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8035         if test -z "$SYSTEM_GENCMN"; then
8036             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
8037         fi
8038         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4"; then
8039             ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
8040         else
8041             ICU_RECLASSIFIED_CLOSE_PARENTHESIS="NO"
8042         fi
8043         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "9"; then
8044             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8045         else
8046             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
8047         fi
8048         if test "$ICU_MAJOR" -le 4; then
8049             ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
8050             ICU_RECLASSIFIED_HEBREW_LETTER="NO"
8051         fi
8052     fi
8054     libo_MINGW_CHECK_DLL([ICUDATA], [icudata][$ICU_MAJOR][$ICU_MINOR])
8055     libo_MINGW_CHECK_DLL([ICUI18N], [icui18n][$ICU_MAJOR][$ICU_MINOR])
8056     libo_MINGW_CHECK_DLL([ICUUC], [icuuc][$ICU_MAJOR][$ICU_MINOR])
8057 else
8058     AC_MSG_RESULT([internal])
8059     SYSTEM_ICU="NO"
8060     BUILD_TYPE="$BUILD_TYPE ICU"
8063 AC_SUBST(SYSTEM_ICU)
8064 AC_SUBST(SYSTEM_GENBRK)
8065 AC_SUBST(SYSTEM_GENCCODE)
8066 AC_SUBST(SYSTEM_GENCMN)
8067 AC_SUBST(ICU_MAJOR)
8068 AC_SUBST(ICU_MINOR)
8069 AC_SUBST(ICU_MICRO)
8070 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
8071 AC_SUBST([ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER])
8072 AC_SUBST([ICU_RECLASSIFIED_HEBREW_LETTER])
8073 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
8074 AC_SUBST([MINGW_ICUDATA_DLL])
8075 AC_SUBST([MINGW_ICUI18N_DLL])
8076 AC_SUBST([MINGW_ICUUC_DLL])
8078 dnl ===================================================================
8079 dnl Graphite
8080 dnl ===================================================================
8082 AC_MSG_CHECKING([whether to enable graphite support])
8083 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "$enable_graphite" = "" -o "$enable_graphite" != "no"; then
8084     AC_MSG_RESULT([yes])
8085     ENABLE_GRAPHITE="TRUE"
8086     AC_MSG_CHECKING([which graphite to use])
8087     if test "$with_system_graphite" = "yes"; then
8088         AC_MSG_RESULT([external])
8089         SYSTEM_GRAPHITE=YES
8090         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
8091         libo_MINGW_CHECK_DLL([GRAPHITE2], [libgraphite2])
8092     else
8093         AC_MSG_RESULT([internal])
8094         SYSTEM_GRAPHITE=NO
8095         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
8096     fi
8097 else
8098     AC_MSG_RESULT([no])
8100 AC_SUBST(ENABLE_GRAPHITE)
8101 AC_SUBST(SYSTEM_GRAPHITE)
8102 AC_SUBST(GRAPHITE_LIBS)
8103 AC_SUBST(GRAPHITE_CFLAGS)
8104 AC_SUBST([MINGW_GRAPHITE2_DLL])
8106 dnl ===================================================================
8107 dnl Check for nsplugin
8108 dnl ===================================================================
8109 AC_MSG_CHECKING([whether to build nsplugin extension])
8110 ENABLE_NSPLUGIN=NO
8111 if test $_os = Darwin -o $_os = iOS -o $_os = Android; then
8112     enable_gtk=no
8114 if test "$enable_nsplugin" != "no"; then
8115     if test "$enable_gtk" != "no"; then
8116         AC_MSG_RESULT([yes])
8117         ENABLE_NSPLUGIN=YES
8118     else
8119         AC_MSG_RESULT([no, disabled gtk2])
8120     fi
8121 else
8122     AC_MSG_RESULT([no])
8124 AC_SUBST(ENABLE_NSPLUGIN)
8126 AC_MSG_CHECKING([whether to use X11])
8127 dnl ***************************************
8128 dnl testing for X libraries and includes...
8129 dnl ***************************************
8130 WANT_X11="no"
8131 if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
8132     WANT_X11="yes"
8134 AC_MSG_RESULT([$WANT_X11])
8136 if test "$WANT_X11" = "yes"; then
8137     AC_PATH_X
8138     AC_PATH_XTRA
8139     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8141     if test "x$x_includes" = "x"; then
8142         x_includes="default_x_includes"
8143     fi
8144     if test "x$x_libraries" = "x"; then
8145         x_libraries="default_x_libraries"
8146     fi
8147     dnl The variables $x_libraries and $x_includes are set.
8148     if test -z "$x_libraries"; then
8149         AC_MSG_ERROR([No X libraries found]) # Exit
8150     fi
8151     if test -z "$x_includes"; then
8152         AC_MSG_ERROR([No X includes found]) # Exit
8153     fi
8154     CFLAGS="$CFLAGS $X_CFLAGS"
8155     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
8156     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
8157 else
8158     x_includes="no_x_includes"
8159     x_libraries="no_x_libraries"
8161 if test -z "$x_includes"; then
8162     x_includes="no_x_includes"
8164 if test -z "$x_libraries"; then
8165     x_libraries="no_x_libraries"
8167 if test "$x_includes" = "default_x_includes"; then
8168     XINC="/usr/include"
8169 else
8170     XINC="$x_includes"
8172 AC_SUBST(XINC)
8173 if test "$x_libraries" = "default_x_libraries"; then
8174     XLIB=`$PKG_CONFIG --variable=libdir x11`
8175     if test "x$XLIB" = x; then
8176         XLIB="/usr/lib"
8177     fi
8178 else
8179     XLIB="$x_libraries"
8181 if test "$XLIB" != "no_x_libraries" -a "$XLIB" != "/usr/lib" -a "$XLIB" != "/usr/lib64"; then
8182     SOLARLIB="$SOLARLIB -L$XLIB"
8184 if test "$XINC" != "no_x_includes" -a "$XINC" != "/usr/include"; then
8185     SOLARINC="$SOLARINC -I$XINC"
8187 AC_SUBST(XLIB)
8189 if test "$WANT_X11" = "yes"; then
8190     dnl ===================================================================
8191     dnl Check for Composite.h for Mozilla plugin
8192     dnl ===================================================================
8193     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
8194      [#include <X11/Intrinsic.h>])
8196     dnl ===================================================================
8197     dnl Check for extension headers
8198     dnl ===================================================================
8199     AC_MSG_CHECKING([whether to use internal X11 extensions headers])
8200     if test "$with_system_xextensions_headers" != "no"; then
8201         AC_MSG_RESULT([no])
8202         AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
8203         [#include <X11/extensions/shape.h>])
8204     else
8205         AC_MSG_RESULT([yes])
8206         BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
8207     fi
8211 dnl ===================================================================
8212 dnl Check for system Xrender
8213 dnl ===================================================================
8214 AC_MSG_CHECKING([whether to use Xrender])
8215 if test "$WANT_X11" = "yes" -a  "$test_xrender" = "yes"; then
8216     AC_MSG_RESULT([yes])
8217     AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
8218       [AC_MSG_ERROR(libXrender not found or functional)], [])
8219     AC_MSG_CHECKING([which Xrender headers to use])
8220     if test "$with_system_xextensions_headers" != "no"; then
8221         AC_MSG_RESULT([external])
8222         AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
8223           [AC_MSG_ERROR(Xrender not found. install X)], [])
8224     else
8225         AC_MSG_RESULT([internal])
8226     fi
8227 else
8228     AC_MSG_RESULT([no])
8231 dnl ===================================================================
8232 dnl Check for XRandr
8233 dnl ===================================================================
8234 AC_MSG_CHECKING([whether to enable RandR support])
8235 if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
8236     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
8237         XRANDR_DLOPEN="TRUE"
8238         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
8239     else
8240         AC_MSG_RESULT([yes])
8241         XRANDR_DLOPEN="FALSE"
8242         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
8243         if test "$ENABLE_RANDR" != "TRUE"; then
8244             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
8245                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
8246             XRANDR_CFLAGS=" "
8247             AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
8248               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
8249             XRANDR_LIBS="-lXrandr "
8250             ENABLE_RANDR="TRUE"
8251         fi
8252     fi
8253 else
8254     ENABLE_RANDR=""
8255     AC_MSG_RESULT([no])
8257 AC_SUBST(XRANDR_DLOPEN)
8258 AC_SUBST(XRANDR_CFLAGS)
8259 AC_SUBST(XRANDR_LIBS)
8260 AC_SUBST(ENABLE_RANDR)
8262 dnl ===================================================================
8263 dnl Check for building neon
8264 dnl ===================================================================
8265 AC_MSG_CHECKING([whether to use neon])
8266 if test "$enable_neon" = "no"; then
8267     AC_MSG_RESULT([no])
8268     DISABLE_NEON=TRUE
8269     AC_SUBST(DISABLE_NEON)
8270 else
8271     AC_MSG_RESULT([yes])
8272 dnl ===================================================================
8273 dnl Check for system neon
8274 dnl ===================================================================
8275 AC_MSG_CHECKING([which neon to use])
8276 if test "$with_system_neon" = "yes"; then
8277     AC_MSG_RESULT([external])
8278     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
8279     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
8280     NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1"
8281     SYSTEM_NEON=YES
8282     libo_MINGW_CHECK_DLL([NEON], [libneon])
8283     libo_MINGW_TRY_DLL([TASN1], [libtasn1])
8284     libo_MINGW_TRY_DLL([GNUTLS], [libgnutls])
8285 else
8286     AC_MSG_RESULT([internal])
8287     SYSTEM_NEON=NO
8288     NEON_LIBS=-lneon
8289     NEON_CFLAGS=
8290     BUILD_TYPE="$BUILD_TYPE NEON"
8292 AC_SUBST(SYSTEM_NEON)
8293 AC_SUBST(NEON_VERSION)
8294 AC_SUBST(NEON_LIBS)
8295 AC_SUBST(NEON_CFLAGS)
8296 AC_SUBST([MINGW_GNUTLS_DLL])
8297 AC_SUBST([MINGW_NEON_DLL])
8298 AC_SUBST([MINGW_TASN1_DLL])
8301 dnl ===================================================================
8302 dnl Check for system openssl
8303 dnl ===================================================================
8304 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8305         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
8306     with_system_openssl=yes
8308 AC_MSG_CHECKING([which libssl to use])
8309 if test "$with_system_openssl" = "yes"; then
8310     AC_MSG_RESULT([external])
8311     # Mac OS builds should get out without extra stuff is the Mac porters'
8312     # wish. And pkg-config is although Xcode ships a .pc for openssl
8313     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8314             "$_os" = "DragonFly"; then
8315         OPENSSL_CFLAGS=
8316         OPENSSL_LIBS="-lssl -lcrypto"
8317     else
8318         PKG_CHECK_MODULES( OPENSSL, openssl )
8319     fi
8320     SYSTEM_OPENSSL=YES
8321     libo_MINGW_CHECK_DLL([SSL], [libssl])
8322     libo_MINGW_CHECK_DLL([CRYPTO], [libcrypto])
8323 else
8324     AC_MSG_RESULT([internal])
8325     SYSTEM_OPENSSL=NO
8326     BUILD_TYPE="$BUILD_TYPE OPENSSL"
8328 AC_SUBST(SYSTEM_OPENSSL)
8329 AC_SUBST(OPENSSL_CFLAGS)
8330 AC_SUBST(OPENSSL_LIBS)
8331 AC_SUBST([MINGW_SSL_DLL])
8332 AC_SUBST([MINGW_CRYPTO_DLL])
8334 dnl ===================================================================
8335 dnl Check for system redland
8336 dnl ===================================================================
8337 AC_MSG_CHECKING([which redland library to use])
8338 if test "$with_system_redland" = "yes"; then
8339     AC_MSG_RESULT([external])
8340     SYSTEM_REDLAND=YES
8341     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
8342     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
8343     libo_MINGW_CHECK_DLL([REDLAND], [librdf])
8344     libo_MINGW_TRY_DLL([RAPTOR], [libraptor])
8345     libo_MINGW_TRY_DLL([RASQAL], [librasqal])
8346     libo_MINGW_TRY_DLL([SQLITE3], [libsqlite3])
8347 else
8348     AC_MSG_RESULT([internal])
8349     BUILD_TYPE="$BUILD_TYPE REDLAND"
8350     SYSTEM_REDLAND=NO
8352 AC_SUBST(SYSTEM_REDLAND)
8353 AC_SUBST(REDLAND_CFLAGS)
8354 AC_SUBST(REDLAND_LIBS)
8355 AC_SUBST([MINGW_RAPTOR_DLL])
8356 AC_SUBST([MINGW_RASQAL_DLL])
8357 AC_SUBST([MINGW_REDLAND_DLL])
8358 AC_SUBST([MINGW_SQLITE3_DLL])
8360 dnl ===================================================================
8361 dnl Check for system hunspell
8362 dnl ===================================================================
8363 AC_MSG_CHECKING([which libhunspell to use])
8364 if test "$with_system_hunspell" = "yes"; then
8365     AC_MSG_RESULT([external])
8366     SYSTEM_HUNSPELL=YES
8367     AC_LANG_PUSH([C++])
8368     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
8369     if test "$HUNSPELL_PC" != "TRUE"; then
8370         AC_CHECK_HEADER(hunspell.hxx, [],
8371             [
8372             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
8373             [AC_MSG_ERROR(hunspell headers not found.)], [])
8374             ], [])
8375         AC_CHECK_LIB([hunspell], [main], [:],
8376            [ AC_MSG_ERROR(hunspell library not found.) ], [])
8377         HUNSPELL_LIBS=-lhunspell
8378     fi
8379     AC_LANG_POP([C++])
8380     libo_MINGW_CHECK_DLL([HUNSPELL], [libhunspell-1.3])
8381 else
8382     AC_MSG_RESULT([internal])
8383     SYSTEM_HUNSPELL=NO
8384     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
8386 AC_SUBST(SYSTEM_HUNSPELL)
8387 AC_SUBST(HUNSPELL_CFLAGS)
8388 AC_SUBST(HUNSPELL_LIBS)
8389 AC_SUBST([MINGW_HUNSPELL_DLL])
8391 dnl ===================================================================
8392 dnl Checking for altlinuxhyph
8393 dnl ===================================================================
8394 AC_MSG_CHECKING([which altlinuxhyph to use])
8395 if test "$with_system_altlinuxhyph" = "yes"; then
8396     AC_MSG_RESULT([external])
8397     SYSTEM_HYPH=YES
8398     AC_CHECK_HEADER(hyphen.h, [],
8399        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
8400     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
8401        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
8402        [#include <hyphen.h>])
8403     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
8404         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8405     if test -z "$HYPHEN_LIB"; then
8406         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
8407            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8408     fi
8409     if test -z "$HYPHEN_LIB"; then
8410         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
8411            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8412     fi
8413     libo_MINGW_CHECK_DLL([HYPHEN], [libhyphen])
8414 else
8415     AC_MSG_RESULT([internal])
8416     SYSTEM_HYPH=NO
8417     BUILD_TYPE="$BUILD_TYPE HYPHEN"
8419 AC_SUBST(SYSTEM_HYPH)
8420 AC_SUBST(HYPHEN_LIB)
8421 AC_SUBST([MINGW_HYPHEN_DLL])
8423 dnl ===================================================================
8424 dnl Checking for mythes
8425 dnl ===================================================================
8426 AC_MSG_CHECKING([which mythes to use])
8427 if test "$with_system_mythes" = "yes"; then
8428     AC_MSG_RESULT([external])
8429     SYSTEM_MYTHES=YES
8430     AC_LANG_PUSH([C++])
8431     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
8432     if test "$MYTHES_PKGCONFIG" = "no"; then
8433         AC_CHECK_HEADER(mythes.hxx, [],
8434             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
8435         AC_CHECK_LIB([mythes-1.2], [main], [:],
8436             [ MYTHES_FOUND=no], [])
8437     if test "$MYTHES_FOUND" = "no"; then
8438         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
8439                 [ MYTHES_FOUND=no], [])
8440     fi
8441     if test "$MYTHES_FOUND" = "no"; then
8442         AC_MSG_ERROR([mythes library not found!.])
8443     fi
8444     fi
8445     AC_LANG_POP([C++])
8446     libo_MINGW_CHECK_DLL([MYTHES], [libmythes-1.2])
8447 else
8448     AC_MSG_RESULT([internal])
8449     SYSTEM_MYTHES=NO
8450     BUILD_TYPE="$BUILD_TYPE MYTHES"
8452 AC_SUBST(SYSTEM_MYTHES)
8453 AC_SUBST(MYTHES_CFLAGS)
8454 AC_SUBST(MYTHES_LIBS)
8455 AC_SUBST([MINGW_MYTHES_DLL])
8457 dnl ===================================================================
8458 dnl Checking for lpsolve
8459 dnl ===================================================================
8460 AC_MSG_CHECKING([which lpsolve to use])
8461 if test "$with_system_lpsolve" = "yes"; then
8462     AC_MSG_RESULT([external])
8463     SYSTEM_LPSOLVE=YES
8464     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
8465        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
8466     save_LIBS=$LIBS
8467     # some systems need this. Like Ubuntu....
8468     AC_CHECK_LIB(m, floor)
8469     AC_CHECK_LIB(dl, dlopen)
8470     AC_CHECK_LIB([lpsolve55], [make_lp], [:],
8471         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
8472     LIBS=$save_LIBS
8473     libo_MINGW_CHECK_DLL([LPSOLVE], [lpsolve55])
8474 else
8475     AC_MSG_RESULT([internal])
8476     SYSTEM_LPSOLVE=NO
8477     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
8479 AC_SUBST(SYSTEM_LPSOLVE)
8480 AC_SUBST([MINGW_LPSOLVE_DLL])
8482 dnl ===================================================================
8483 dnl Checking for libexttextcat
8484 dnl ===================================================================
8485 AC_MSG_CHECKING([which libexttextcat to use])
8486 if test "$with_system_libexttextcat" = "yes"; then
8487     AC_MSG_RESULT([external])
8488     SYSTEM_LIBEXTTEXTCAT=YES
8489     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
8490     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
8491 else
8492     AC_MSG_RESULT([internal])
8493     SYSTEM_LIBEXTTEXTCAT=NO
8494     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
8496 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
8497 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
8498 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
8499 AC_SUBST(LIBEXTTEXTCAT_LIBS)
8501 dnl ***************************************
8502 dnl testing libc version for Linux...
8503 dnl ***************************************
8504 if test "$_os" = "Linux"; then
8505     AC_MSG_CHECKING([whether libc is >= 2.1.1])
8506     exec 6>/dev/null # no output
8507     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
8508     exec 6>&1 # output on again
8509     if test "$HAVE_LIBC"; then
8510         AC_MSG_RESULT([yes])
8511     else
8512         AC_MSG_ERROR([no, upgrade libc])
8513     fi
8516 if test "$_os" != "WINNT"; then
8517     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
8518     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
8519     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
8520         SYSTEM_LIBC=YES
8521     fi
8522 else
8523     HAVE_GETOPT=NO
8524     HAVE_READDIR_R=NO
8525     SYSTEM_LIBC=YES
8527 AC_SUBST(HAVE_GETOPT)
8528 AC_SUBST(HAVE_READDIR_R)
8529 AC_SUBST(SYSTEM_LIBC)
8531 dnl =========================================
8532 dnl Check for the Windows  SDK.
8533 dnl =========================================
8534 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
8535 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
8536 if test "$_os" = "WINNT"; then
8537     AC_MSG_CHECKING([for Windows SDK])
8538     if test "$build_os" = "cygwin"; then
8539         if test -z "$with_windows_sdk_home"; then
8540             # This first line will detect a February 2003 Microsoft Platform SDK
8541             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
8542             # But there might be also an April 2005 PSDK, unfortunately MS changed
8543             # the registry entry. (we prefer the old version!?)
8544             if test -z "$WINDOWS_SDK_HOME"; then
8545                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
8546             fi
8547             # normalize if found
8548             if test -n "$WINDOWS_SDK_HOME"; then
8549                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
8550                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8552                 #If this sdk is incomplete, lets see if the one
8553                 #recommended to be installed is available
8554                 if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe"; then
8555                     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`
8556                     if test -n "$WINDOWS_SDK7_HOME"; then
8557                         WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK7_HOME"`
8558                         WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8559                     fi
8560                 fi
8561             fi
8562         else
8563             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
8564         fi
8565     fi
8566     if test -n "$WINDOWS_SDK_HOME"; then
8567         # Remove a possible trailing backslash
8568         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
8569         # Problem with current PSDK (iz 49865)
8570         # (What "current" does that mean?)
8571         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
8572             AC_MSG_ERROR([
8573 Some modules do not build correctly with MS Platform SDK - April 2005
8574 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
8575 Remove/rename/backup that file and restart configure. Details about this
8576 problem can be found in issue 49856.])
8577         fi
8579         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
8580              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
8581              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
8582             HAVE_PSDK_H="yes"
8583         else
8584             HAVE_PSDK_H="no"
8585         fi
8586         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
8587             HAVE_PSDK_LIB="yes"
8588         else
8589             HAVE_PSDK_LIB="no"
8590         fi
8592         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
8593             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
8594 the  Windows SDK are installed.])
8595         fi
8597         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
8598              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
8599              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
8600              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe"; then
8601             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
8602         fi
8603     fi
8605     if test -z "$WINDOWS_SDK_HOME"; then
8606         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
8607     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
8608         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
8609     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
8610         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
8611     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
8612         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
8613     else
8614         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
8615     fi
8616     PathFormat "$WINDOWS_SDK_HOME"
8617     WINDOWS_SDK_HOME="$formatted_path"
8618     if test "$build_os" = "cygwin"; then
8619         SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
8620     fi
8622 AC_SUBST(WINDOWS_SDK_HOME)
8624 dnl =========================================
8625 dnl Check for uuidgen
8626 dnl =========================================
8627 if test "$_os" = "WINNT"; then
8628     if test "$WITH_MINGW" = "yes"; then
8629         AC_PATH_PROG([UUIDGEN], [uuid])
8630         if test -z "$UUIDGEN"; then
8631             AC_MSG_WARN([uuid is needed for dev-install])
8632         fi
8633     else
8634         # presence is already tested above in the WINDOWS_SDK_HOME check
8635         UUIDGEN=uuidgen.exe
8636         AC_SUBST(UUIDGEN)
8637     fi
8640 dnl =========================================
8641 dnl Check for the Microsoft DirectX SDK.
8642 dnl =========================================
8643 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
8644     AC_MSG_CHECKING([for DirectX SDK])
8645     if test "$build_os" = "cygwin"; then
8646         if test -z "$with_directx_home"; then
8647             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
8648             if test -n "$DXSDK_DIR"; then
8649                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
8650                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
8651             fi
8652             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
8653             # the "DirectX SDK not found" error later
8654         else
8655             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
8656         fi
8657         # Remove a possible trailing backslash
8658         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
8659     elif test -n "$with_directx_home"; then
8660         DIRECTXSDK_HOME="$with_directx_home"
8661     fi
8663     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
8664         HAVE_DIRECTXSDK_H="yes"
8665     else
8666         HAVE_DIRECTXSDK_H="no"
8667     fi
8669     # MS changed the location of the libraries with Dec 2004 DirectX SDK
8670     if test -d "$DIRECTXSDK_HOME/lib/x86"; then
8671         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
8672     else
8673         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
8674     fi
8675     PathFormat "$DIRECTXSDK_LIB"
8676     DIRECTXSDK_LIB="$formatted_path"
8678     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
8679         HAVE_DIRECTXSDK_LIB="yes"
8680     else
8681         HAVE_DIRECTXSDK_LIB="no"
8682     fi
8684     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
8685         AC_MSG_RESULT([found])
8686     else
8687         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
8688     fi
8689     PathFormat "$DIRECTXSDK_HOME"
8690     DIRECTXSDK_HOME="$formatted_path"
8691     SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
8693 AC_SUBST(DIRECTXSDK_HOME)
8694 AC_SUBST(DIRECTXSDK_LIB)
8696 dnl ***************************************
8697 dnl Checking for bison and flex
8698 dnl ***************************************
8699 AC_PATH_PROG(BISON, bison)
8700 ANCIENT_BISON="NO"
8701 if test -z "$BISON"; then
8702     AC_MSG_ERROR([no bison found in \$PATH, install it])
8703 else
8704     AC_MSG_CHECKING([the bison version])
8705     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
8706     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
8707     # Accept newer than 1.875 or older(equal) than 1.75
8708     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
8709         if test "$_bison_version" = "1.875"; then
8710             AC_MSG_WARN([suspect ($BISON $_bison_version)])
8711             echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
8712         else
8713             AC_MSG_RESULT([checked ($BISON $_bison_version)])
8714         fi
8715     else
8716         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
8717     fi
8718     if test "$_bison_longver" -lt 2000; then
8719         ANCIENT_BISON="YES"
8720     fi
8722 AC_SUBST(ANCIENT_BISON)
8724 AC_PATH_PROG(FLEX, flex)
8725 if test -z "$FLEX"; then
8726     AC_MSG_ERROR([no flex found in \$PATH, install it])
8728 AC_SUBST([FLEX])
8729 dnl ***************************************
8730 dnl Checking for patch
8731 dnl ***************************************
8732 AC_PATH_PROG(PATCH, patch)
8733 if test -z "$PATCH"; then
8734     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
8737 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
8738 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
8739     if test -z "$with_gnu_patch"; then
8740         GNUPATCH=$PATCH
8741     else
8742         if test -x "$with_gnu_patch"; then
8743             GNUPATCH=$with_gnu_patch
8744         else
8745             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
8746         fi
8747     fi
8749     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
8750     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
8751         AC_MSG_RESULT([yes])
8752     else
8753         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
8754     fi
8755 else
8756     GNUPATCH=$PATCH
8759 dnl We also need to check for --with-gnu-cp
8761 if test -z "$with_gnu_cp"; then
8762     # check the place where the good stuff is hidden on Solaris...
8763     if test -x /usr/gnu/bin/cp; then
8764         GNUCP=/usr/gnu/bin/cp
8765     else
8766         AC_PATH_PROGS(GNUCP, gnucp cp)
8767     fi
8768     if test -z $GNUCP; then
8769         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
8770     fi
8771 else
8772     if test -x "$with_gnu_cp"; then
8773         GNUCP=$with_gnu_cp
8774     else
8775         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
8776     fi
8779 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
8780 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
8781     AC_MSG_RESULT([yes])
8782 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
8783     AC_MSG_RESULT([yes])
8784 else
8785     case "$build_os" in
8786     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
8787         x_GNUCP=[\#]
8788         GNUCP=''
8789         AC_MSG_RESULT([no gnucp found - using the system's cp command])
8790         ;;
8791     *)
8792         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
8793         ;;
8794     esac
8797 AC_SUBST(GNUPATCH)
8798 AC_SUBST(GNUCP)
8799 AC_SUBST(x_GNUCP)
8801 dnl ***************************************
8802 dnl testing assembler path
8803 dnl ***************************************
8804 ML_EXE=""
8805 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
8806     if test "$CL_X64" = ""; then
8807         assembler=ml.exe
8808         assembler_bin=bin
8809     else
8810         assembler=ml64.exe
8811         assembler_bin=bin/amd64
8812     fi
8813     if test -n "$with_asm_home"; then
8814         with_asm_home=`cygpath -u "$with_asm_home"`
8815     fi
8816     if test -x "$with_asm_home/$assembler"; then
8817         AC_MSG_CHECKING([$assembler assembler path])
8818         AC_MSG_RESULT([$with_asm_home/$assembler])
8819         ML_EXE="$with_asm_home/$assembler"
8820     else
8821         AC_PATH_PROG(ML_EXE, $assembler)
8822         if test -z "$ML_EXE"; then
8823             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
8824             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
8825                 with_asm_home=$with_cl_home/$assembler_bin
8826                 AC_MSG_RESULT([found])
8827                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
8828             else
8829                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
8830             fi
8831         else
8832             with_asm_home="ASM_IN_PATH"
8833             ML_EXE="$assembler"
8834         fi
8835     fi
8836     PathFormat "$with_asm_home"
8837     ASM_HOME="$formatted_path"
8838 else
8839     ASM_HOME=""
8842 AC_SUBST(ML_EXE)
8844 dnl ===================================================================
8845 dnl We need zip and unzip
8846 dnl ===================================================================
8847 AC_PATH_PROG(ZIP, zip)
8848 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
8849 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
8850     AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
8853 AC_PATH_PROG(UNZIP, unzip)
8854 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
8856 dnl ===================================================================
8857 dnl Zip must be a specific type for different build types.
8858 dnl ===================================================================
8859 if test $build_os = cygwin; then
8860     if test -n "`$ZIP -h | $GREP -i WinNT`"; then
8861         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
8862     fi
8865 dnl ===================================================================
8866 dnl Test which vclplugs have to be built.
8867 dnl ===================================================================
8868 R=""
8869 GTK3_CFLAGS=""
8870 GTK3_LIBS=""
8871 ENABLE_GTK3=""
8872 if test "x$enable_gtk3" = "xyes"; then
8873     if test "$with_system_cairo" != yes; then
8874         echo "System cairo required for gtk3 support, please use --with-system-cairo"
8875     fi
8876     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="")
8877     if test "x$ENABLE_GTK3" = "xTRUE"; then
8878         R="gtk3"
8879     else
8880         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
8881     fi
8883 AC_SUBST(GTK3_LIBS)
8884 AC_SUBST(GTK3_CFLAGS)
8885 AC_SUBST(ENABLE_GTK3)
8887 AC_MSG_CHECKING([which VCLplugs shall be built])
8888 ENABLE_GTK=""
8889 if test "x$enable_gtk" = "xyes"; then
8890     ENABLE_GTK="TRUE"
8891     R="gtk $R"
8893 AC_SUBST(ENABLE_GTK)
8895 ENABLE_TDE=""
8896 if test "x$enable_tde" = "xyes"; then
8897     # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
8898     # are built from the same sources. So we only allow one of them.
8899     if test "x$enable_kde" = "xyes"; then
8900         AC_MSG_ERROR([enabling both KDE and TDE is not supported])
8901     fi
8902     ENABLE_TDE="TRUE"
8903     R="$R tde"
8905 AC_SUBST(ENABLE_TDE)
8907 ENABLE_KDE=""
8908 if test "x$enable_kde" = "xyes"; then
8909     ENABLE_KDE="TRUE"
8910     R="$R kde"
8912 AC_SUBST(ENABLE_KDE)
8914 ENABLE_KDE4=""
8915 if test "x$enable_kde4" = "xyes"; then
8916     ENABLE_KDE4="TRUE"
8917     R="$R kde4"
8919 AC_SUBST(ENABLE_KDE4)
8921 ENABLE_HEADLESS=""
8922 if test "x$enable_headless" = "xyes"; then
8923     ENABLE_HEADLESS="TRUE"
8924     SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
8925     R="headless"
8927 AC_SUBST(ENABLE_HEADLESS)
8929 if test -z "$R"; then
8930     AC_MSG_RESULT([none])
8931 else
8932     AC_MSG_RESULT([$R])
8935 dnl ===================================================================
8936 dnl GCONF check
8937 dnl ===================================================================
8939 ENABLE_GCONF=""
8940 AC_MSG_CHECKING([whether to enable GConf support])
8941 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
8942     ENABLE_GCONF="TRUE"
8943     AC_MSG_RESULT([yes])
8944     PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
8945 else
8946     AC_MSG_RESULT([no])
8948 AC_SUBST(GCONF_LIBS)
8949 AC_SUBST(GCONF_CFLAGS)
8950 AC_SUBST(ENABLE_GCONF)
8952 dnl ===================================================================
8953 dnl Gnome VFS check
8954 dnl ===================================================================
8956 ENABLE_GNOMEVFS=""
8957 AC_MSG_CHECKING([whether to enable GNOME VFS support])
8958 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
8959     ENABLE_GNOMEVFS="TRUE"
8960     AC_MSG_RESULT([yes])
8961     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
8962 else
8963     AC_MSG_RESULT([no])
8965 AC_SUBST(GNOMEVFS_LIBS)
8966 AC_SUBST(GNOMEVFS_CFLAGS)
8967 AC_SUBST(ENABLE_GNOMEVFS)
8969 dnl ===================================================================
8970 dnl Check whether the gtk 2.0 libraries are available.
8971 dnl ===================================================================
8973 GTK_CFLAGS=""
8974 GTK_LIBS=""
8975 ENABLE_SYSTRAY_GTK=""
8976 ENABLE_DBUS=""
8977 DBUS_CFLAGS=""
8978 DBUS_LIBS=""
8979 if test  "$test_gtk" = "yes"; then
8981     if test "$ENABLE_GTK" = "TRUE"; then
8982         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]))
8983         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]))
8984         BUILD_TYPE="$BUILD_TYPE GTK"
8986         if test "x$enable_systray" = "xyes"; then
8987             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
8988                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
8989                             [ ENABLE_SYSTRAY_GTK="" ])
8990         fi
8992         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
8993         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
8994                           [ENABLE_GTK_PRINT="TRUE"],
8995                           [ENABLE_GTK_PRINT=""])
8997         AC_MSG_CHECKING([whether to enable DBUS support])
8998         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
8999             ENABLE_DBUS="TRUE"
9000             AC_MSG_RESULT([yes])
9001             PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
9002         else
9003             AC_MSG_RESULT([no])
9004         fi
9006         AC_MSG_CHECKING([whether to enable GIO support])
9007         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
9008             if test "$ENABLE_GNOMEVFS" = "TRUE"; then
9009                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
9010             fi
9011             ENABLE_GIO="TRUE"
9012             AC_MSG_RESULT([yes])
9013             PKG_CHECK_MODULES( GIO, gio-2.0 )
9014         else
9015             AC_MSG_RESULT([no])
9016         fi
9017     fi
9019 AC_SUBST(ENABLE_GIO)
9020 AC_SUBST(GIO_CFLAGS)
9021 AC_SUBST(GIO_LIBS)
9022 AC_SUBST(ENABLE_DBUS)
9023 AC_SUBST(ENABLE_SYSTRAY_GTK)
9024 AC_SUBST(GTK_CFLAGS)
9025 AC_SUBST(GTK_LIBS)
9026 AC_SUBST(GTHREAD_CFLAGS)
9027 AC_SUBST(GTHREAD_LIBS)
9028 AC_SUBST(DBUS_CFLAGS)
9029 AC_SUBST(DBUS_LIBS)
9030 AC_SUBST([ENABLE_GTK_PRINT])
9031 AC_SUBST([GTK_PRINT_CFLAGS])
9032 AC_SUBST([GTK_PRINT_LIBS])
9034 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
9035 AC_SUBST(LIBPNG_LIBS)
9036 AC_SUBST(LIBPNG_CFLAGS)
9038 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
9039 if test "x$enable_unix_qstart_libpng" != "xno"; then
9040     AC_MSG_RESULT([yes])
9041 else
9042     AC_MSG_RESULT([no])
9043     ENABLE_QUICKSTART_LIBPNG=""
9045 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
9047 SPLIT_APP_MODULES=""
9048 if test "$enable_split_app_modules" = "yes"; then
9049     SPLIT_APP_MODULES="YES"
9051 AC_SUBST(SPLIT_APP_MODULES)
9053 SPLIT_OPT_FEATURES=""
9054 if test "$enable_split_opt_features" = "yes"; then
9055     SPLIT_OPT_FEATURES="YES"
9057 AC_SUBST(SPLIT_OPT_FEATURES)
9059 if test $_os = Darwin -o $_os = WINNT; then
9060     if test "$enable_cairo_canvas" = yes; then
9061         AC_MSG_ERROR([The cairo canvas should not be used for this platform])
9062     fi
9063     enable_cairo_canvas=no
9064 elif test -z "$enable_cairo_canvas"; then
9065     enable_cairo_canvas=yes
9068 ENABLE_CAIRO_CANVAS=""
9069 if test "$test_cairo" = "yes" -a "$enable_cairo_canvas" = "yes"; then
9070     ENABLE_CAIRO_CANVAS="TRUE"
9072 AC_SUBST(ENABLE_CAIRO_CANVAS)
9074 dnl ===================================================================
9075 dnl Check whether the GStreamer libraries are available.
9076 dnl ===================================================================
9078 ENABLE_GSTREAMER=""
9080 if test  "$build_gstreamer" = "yes"; then
9082     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
9083     if test "x$enable_gstreamer" != "xno"; then
9084         ENABLE_GSTREAMER="TRUE"
9085         AC_MSG_RESULT([yes])
9086         PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 )
9087     else
9088         AC_MSG_RESULT([no])
9089     fi
9092 AC_SUBST(ENABLE_GSTREAMER)
9094 dnl ===================================================================
9095 dnl Check whether the OpenGL libraries are available
9096 dnl ===================================================================
9098 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
9099 ENABLE_OPENGL=
9101 if test "$_os" = "Darwin"; then
9102     # We use frameworks on Mac OS X, no need for detail checks
9103     ENABLE_OPENGL=TRUE
9104     SYSTEM_MESA_HEADERS=YES
9105     AC_MSG_RESULT([yes])
9106 else
9107     if test "x$enable_opengl" != "xno"; then
9108         if test "$_os" != "WINNT"; then
9109             save_LDFLAGS=$LDFLAGS
9110             LDFLAGS="$LDFLAGS -lm"
9111             AC_MSG_RESULT([yes])
9112             AC_CHECK_LIB([GL], [main], [:],
9113                       [AC_MSG_ERROR(libGL not installed or functional)], [])
9114             AC_CHECK_LIB([GLU], [main], [:],
9115                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
9116             ENABLE_OPENGL=TRUE
9117             LDFLAGS=$save_LDFLAGS
9119             dnl ===================================================================
9120             dnl Check for system Mesa
9121             dnl ===================================================================
9122             AC_MSG_CHECKING([which Mesa headers to use])
9123             if test "$with_system_mesa_headers" = "yes"; then
9124                 AC_MSG_RESULT([external])
9125                 SYSTEM_MESA_HEADERS=YES
9126                 AC_LANG_PUSH(C)
9127                 AC_CHECK_HEADER(GL/glxext.h, [],
9128                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
9129                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
9130                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
9131                 AC_LANG_POP(C)
9132             else
9133                 AC_MSG_RESULT([internal])
9134                 SYSTEM_MESA_HEADERS=NO
9135                 BUILD_TYPE="$BUILD_TYPE MESA"
9136             fi
9137         else
9138             AC_MSG_RESULT([not on Windows])
9139         fi
9140     else
9141        AC_MSG_RESULT([no])
9142     fi
9145 AC_SUBST(SYSTEM_MESA_HEADERS)
9146 AC_SUBST(ENABLE_OPENGL)
9148 # presenter minimizer extension?
9149 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
9150 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
9151    AC_MSG_RESULT([yes])
9152    ENABLE_MINIMIZER=YES
9153 else
9154    AC_MSG_RESULT([no])
9155    ENABLE_MINIMIZER=NO
9156    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
9158 AC_SUBST(ENABLE_MINIMIZER)
9160 # presenter console extension?
9161 AC_MSG_CHECKING([whether to build the Presenter Console extension])
9162 if test "x$enable_ext_presenter_console" != "xno" -a "x$enable_extension_integration" != "xno"; then
9163    AC_MSG_RESULT([yes])
9164    ENABLE_PRESENTER_SCREEN=YES
9165 else
9166    AC_MSG_RESULT([no])
9167    ENABLE_PRESENTER_SCREEN=NO
9168    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PRESENTER_SCREEN"
9170 AC_SUBST(ENABLE_PRESENTER_SCREEN)
9172 # pdf import extension?
9173 AC_MSG_CHECKING([whether to build the PDF Import extension])
9174 if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" != "xno"; then
9175   AC_MSG_RESULT([yes])
9176   ENABLE_PDFIMPORT=YES
9178   dnl ===================================================================
9179   dnl Check for system poppler
9180   dnl ===================================================================
9181   AC_MSG_CHECKING([which pdf backend to use])
9182   if test "$with_system_poppler" = "yes"; then
9183       AC_MSG_RESULT([external])
9184       SYSTEM_POPPLER=YES
9185       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
9186       AC_LANG_PUSH([C++])
9187       save_CXXFLAGS=$CXXFLAGS
9188       save_CPPFLAGS=$CPPFLAGS
9189       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
9190       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
9191       AC_CHECK_HEADER([cpp/poppler-version.h], [],
9192                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
9193       CXXFLAGS=$save_CXXFLAGS
9194       CPPFLAGS=$save_CPPFLAGS
9195       AC_LANG_POP([C++])
9196   else
9197       AC_MSG_RESULT([internal])
9198       SYSTEM_POPPLER=NO
9199       BUILD_TYPE="$BUILD_TYPE XPDF"
9200   fi
9201 else
9202   AC_MSG_RESULT([no])
9203   ENABLE_PDFIMPORT=NO
9204   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PDFIMPORT"
9206 AC_SUBST(ENABLE_PDFIMPORT)
9207 AC_SUBST(SYSTEM_POPPLER)
9208 AC_SUBST(POPPLER_CFLAGS)
9209 AC_SUBST(POPPLER_LIBS)
9212 if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then
9213    BUILD_TYPE="$BUILD_TYPE SDEXT"
9216 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
9217 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9218   AC_MSG_RESULT([yes])
9219   ENABLE_MEDIAWIKI=YES
9220   BUILD_TYPE="$BUILD_TYPE SWEXT"
9221   if test  "x$with_java" = "xno"; then
9222     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
9223   fi
9224 else
9225   AC_MSG_RESULT([no])
9226   ENABLE_MEDIAWIKI=NO
9227   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
9229 AC_SUBST(ENABLE_MEDIAWIKI)
9231 if test "$ENABLE_MEDIAWIKI" = "YES"; then
9232     AC_MSG_CHECKING([which Servlet API Jar to use])
9233     if test "$with_system_servlet_api" = "yes"; then
9234         AC_MSG_RESULT([external])
9235         SYSTEM_SERVLETAPI=YES
9236         if test -z "$SERVLETAPI_JAR"; then
9237             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
9238         fi
9239         AC_CHECK_FILE($SERVLETAPI_JAR, [],
9240               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
9241     else
9242         AC_MSG_RESULT([internal])
9243         SYSTEM_SERVLETAPI=NO
9244         BUILD_TYPE="$BUILD_TYPE TOMCAT"
9245     fi
9247 AC_SUBST(SYSTEM_SERVLETAPI)
9248 AC_SUBST(SERVLETAPI_JAR)
9250 AC_MSG_CHECKING([whether to build the Report Builder extension])
9251 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9252     AC_MSG_RESULT([yes])
9253     ENABLE_REPORTBUILDER=YES
9254     AC_MSG_CHECKING([which jfreereport libs to use])
9255     if test "$with_system_jfreereport" = "yes"; then
9256         SYSTEM_JFREEREPORT=YES
9257         AC_MSG_RESULT([external])
9258         if test -z $SAC_JAR; then
9259             SAC_JAR=/usr/share/java/sac.jar
9260         fi
9261         AC_CHECK_FILE($SAC_JAR, [],
9262              [AC_MSG_ERROR(sac.jar not found.)], [])
9264         if test -z $LIBXML_JAR; then
9265             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
9266                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
9267                 [
9268                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
9269                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
9270                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
9271                     )
9272                 ]
9273             )
9274         else
9275             AC_CHECK_FILE($LIBXML_JAR, [],
9276                  [AC_MSG_ERROR(libxml.jar not found.)], [])
9277         fi
9279         if test -z $FLUTE_JAR; then
9280             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
9281                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
9282                 [
9283                     AC_CHECK_FILE(/usr/share/java/flute.jar,
9284                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
9285                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
9286                     )
9287                 ]
9288             )
9289         else
9290             AC_CHECK_FILE($FLUTE_JAR, [],
9291                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
9292         fi
9294         if test -z $JFREEREPORT_JAR; then
9295             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
9296                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
9297                 [
9298                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
9299                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
9300                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
9301                     )
9302                 ]
9303             )
9304         else
9305             AC_CHECK_FILE($JFREEREPORT_JAR, [],
9306                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
9307         fi
9309         if test -z $LIBLAYOUT_JAR; then
9310             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
9311                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
9312                 [
9313                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
9314                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
9315                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
9316                     )
9317                 ]
9318             )
9319         else
9320             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
9321                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
9322         fi
9324         if test -z $LIBLOADER_JAR; then
9325             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
9326                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
9327                 [
9328                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
9329                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
9330                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
9331                     )
9332                 ]
9333             )
9334         else
9335             AC_CHECK_FILE($LIBLOADER_JAR, [],
9336                 [AC_MSG_ERROR(libloader.jar not found.)], [])
9337         fi
9339         if test -z $LIBFORMULA_JAR; then
9340             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
9341                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
9342                  [
9343                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
9344                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
9345                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
9346                      )
9347                  ]
9348             )
9349         else
9350             AC_CHECK_FILE($LIBFORMULA_JAR, [],
9351                 [AC_MSG_ERROR(libformula.jar not found.)], [])
9352         fi
9354         if test -z $LIBREPOSITORY_JAR; then
9355             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
9356                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
9357                 [
9358                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
9359                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
9360                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
9361                     )
9362                 ]
9363             )
9364         else
9365             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
9366                 [AC_MSG_ERROR(librepository.jar not found.)], [])
9367         fi
9369         if test -z $LIBFONTS_JAR; then
9370             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
9371                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
9372                 [
9373                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
9374                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
9375                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
9376                     )
9377                 ]
9378             )
9379         else
9380             AC_CHECK_FILE($LIBFONTS_JAR, [],
9381                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
9382         fi
9384         if test -z $LIBSERIALIZER_JAR; then
9385             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
9386                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
9387                 [
9388                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
9389                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
9390                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
9391                     )
9392                 ]
9393             )
9394         else
9395             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
9396                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
9397         fi
9399         if test -z $LIBBASE_JAR; then
9400             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
9401                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
9402                 [
9403                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
9404                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
9405                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
9406                     )
9407                 ]
9408             )
9409         else
9410             AC_CHECK_FILE($LIBBASE_JAR, [],
9411                 [AC_MSG_ERROR(libbase.jar not found.)], [])
9412         fi
9414     else
9415         AC_MSG_RESULT([internal])
9416         SYSTEM_JFREEREPORT=NO
9417         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
9418     fi
9419 else
9420     AC_MSG_RESULT([no])
9421     ENABLE_REPORTBUILDER=NO
9422     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
9423     SYSTEM_JFREEREPORT=NO
9425 AC_SUBST(ENABLE_REPORTBUILDER)
9426 AC_SUBST(SYSTEM_JFREEREPORT)
9427 AC_SUBST(SAC_JAR)
9428 AC_SUBST(LIBXML_JAR)
9429 AC_SUBST(FLUTE_JAR)
9430 AC_SUBST(JFREEREPORT_JAR)
9431 AC_SUBST(LIBBASE_JAR)
9432 AC_SUBST(LIBLAYOUT_JAR)
9433 AC_SUBST(LIBLOADER_JAR)
9434 AC_SUBST(LIBFORMULA_JAR)
9435 AC_SUBST(LIBREPOSITORY_JAR)
9436 AC_SUBST(LIBFONTS_JAR)
9437 AC_SUBST(LIBSERIALIZER_JAR)
9439 # this has to be here because both the Wiki Publisher and the SRB use
9440 # commons-logging
9441 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
9442     AC_MSG_CHECKING([which Apache commons-* libs to use])
9443     if test "$with_system_apache_commons" = "yes"; then
9444         SYSTEM_APACHE_COMMONS=YES
9445         AC_MSG_RESULT([external])
9446         if test "$ENABLE_MEDIAWIKI" = "YES"; then
9447             if test -z $COMMONS_CODEC_JAR; then
9448                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
9449                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
9450                     [
9451                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
9452                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
9453                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
9454                         )
9455                     ]
9456                 )
9457             else
9458                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
9459                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
9460             fi
9462             if test -z $COMMONS_LANG_JAR; then
9463                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
9464                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
9465                     [
9466                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
9467                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
9468                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
9469                             )
9470                     ]
9471                 )
9472             else
9473                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
9474                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
9475             fi
9477             if test -z $COMMONS_HTTPCLIENT_JAR; then
9478                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
9479                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
9480                     [
9481                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
9482                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
9483                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
9484                         )
9485                     ]
9486                 )
9487             else
9488                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
9489                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
9490             fi
9491         fi
9492         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
9493             if test -z $COMMONS_LOGGING_JAR; then
9494                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
9495                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
9496                    [
9497                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
9498                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
9499                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
9500                         )
9501                     ]
9502                 )
9503             else
9504                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
9505                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
9506             fi
9507         fi
9508     else
9509         AC_MSG_RESULT([internal])
9510         SYSTEM_APACHE_COMMONS=NO
9511         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
9512     fi
9514 AC_SUBST(SYSTEM_APACHE_COMMONS)
9515 AC_SUBST(COMMONS_CODEC_JAR)
9516 AC_SUBST(COMMONS_LANG_JAR)
9517 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
9518 AC_SUBST(COMMONS_LOGGING_JAR)
9520 # scripting provider for BeanShell extension?
9521 AC_MSG_CHECKING([whether to build extension for support of scripts in BeanShell])
9522 if test "x$enable_ext_scripting_beanshell" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
9523    AC_MSG_RESULT([yes])
9524    ENABLE_SCRIPTING_BEANSHELL=YES
9526    dnl ===================================================================
9527    dnl Check for system beanshell
9528    dnl ===================================================================
9529    AC_MSG_CHECKING([which beanshell to use])
9530    if test "$with_system_beanshell" = "yes"; then
9531        AC_MSG_RESULT([external])
9532        SYSTEM_BSH=YES
9533        if test -z $BSH_JAR; then
9534            BSH_JAR=/usr/share/java/bsh.jar
9535        fi
9536        AC_CHECK_FILE($BSH_JAR, [],
9537                   [AC_MSG_ERROR(bsh.jar not found.)], [])
9538    else
9539        AC_MSG_RESULT([internal])
9540        SYSTEM_BSH=NO
9541        BUILD_TYPE="$BUILD_TYPE BSH"
9542    fi
9543 else
9544    AC_MSG_RESULT([no])
9545    ENABLE_SCRIPTING_BEANSHELL=NO
9546    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_BEANSHELL"
9548 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
9549 AC_SUBST(SYSTEM_BSH)
9550 AC_SUBST(BSH_JAR)
9552 # scripting provider for JavaScript extension?
9553 AC_MSG_CHECKING([whether to build extension for support of scripts in JavaScript])
9554 if test "x$enable_ext_scripting_javascript" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
9555    AC_MSG_RESULT([yes])
9556    ENABLE_SCRIPTING_JAVASCRIPT=YES
9558    dnl ===================================================================
9559    dnl Check for system rhino
9560    dnl ===================================================================
9561    AC_MSG_CHECKING([which rhino to use])
9562    if test "$with_system_rhino" = "yes"; then
9563        AC_MSG_RESULT([external])
9564        SYSTEM_RHINO=YES
9565        if test -z $RHINO_JAR; then
9566            RHINO_JAR=/usr/share/java/js.jar
9567        fi
9568        AC_CHECK_FILE($RHINO_JAR, [],
9569                   [AC_MSG_ERROR(js.jar not found.)], [])
9570    else
9571        AC_MSG_RESULT([internal])
9572        SYSTEM_RHINO=NO
9573        BUILD_TYPE="$BUILD_TYPE RHINO"
9574    fi
9575 else
9576    AC_MSG_RESULT([no])
9577    ENABLE_SCRIPTING_JAVASCRIPT=NO
9578    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_JAVASCRIPT"
9580 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
9581 AC_SUBST(SYSTEM_RHINO)
9582 AC_SUBST(RHINO_JAR)
9584 dnl Scripting provider for Python extension?
9585 dnl We always provide this unless we have disabled Python completely
9586 if test $enable_python = no; then
9587     ENABLE_SCRIPTING_PYTHON=NO
9588     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_PYTHON"
9589 else
9590     ENABLE_SCRIPTING_PYTHON=YES
9592 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
9594 supports_multilib=
9595 case "$host_cpu" in
9596 x86_64 | powerpc64 | s390x)
9597     if test "$SIZEOF_LONG" = "8"; then
9598         supports_multilib="yes"
9599     fi
9600     ;;
9602     ;;
9603 esac
9605 dnl ===================================================================
9606 dnl Check whether the TQt and TDE libraries are available.
9607 dnl ===================================================================
9609 TDE_CFLAGS=""
9610 TDE_LIBS=""
9611 if test "$_os" != "OpenBSD"; then
9612     MOC="moc"
9614 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
9615     dnl Search paths for TQt and TDE
9616     if test -z "$supports_multilib"; then
9617         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"
9618         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"
9619     else
9620         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"
9621         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"
9622     fi
9623     if test -n "$TQTDIR"; then
9624         tqt_incdirs="$TQTDIR/include $tqt_incdirs"
9625         if test -z "$supports_multilib"; then
9626             tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
9627         else
9628             tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
9629         fi
9630     fi
9631     if test -z "$supports_multilib"; then
9632         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"
9633         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"
9634     else
9635         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"
9636         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"
9637     fi
9638     if test -n "$TDEDIR"; then
9639         tde_incdirs="$TDEDIR/include $tde_incdirs"
9640         if test -z "$supports_multilib"; then
9641             tde_libdirs="$TDEDIR/lib $tde_libdirs"
9642         else
9643             tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
9644         fi
9645     fi
9647     dnl What to test
9648     tqt_test_include="ntqstyle.h"
9649     tde_test_include="kapp.h"
9651     if test "$_os" != "OpenBSD"; then
9652         tqt_test_library="libtqt-mt.so"
9653         tde_test_library="libDCOP.so"
9654     else
9655         tqt_test_library="libtqt-mt.so*"
9656         tde_test_library="libDCOP.so*"
9657     fi
9659     dnl Check for TQt headers
9660     AC_MSG_CHECKING([for TQt headers])
9661     tqt_incdir="no"
9662     for tde_check in $tqt_incdirs; do
9663         if test -r "$tde_check/$tqt_test_include"; then
9664             tqt_incdir="$tde_check"
9665             break
9666         fi
9667     done
9668     AC_MSG_RESULT([$tqt_incdir])
9669     if test "x$tqt_incdir" = "xno"; then
9670         AC_MSG_ERROR([TQt headers not found.  Please specify the root of
9671 your TQt installation by exporting TQTDIR before running "configure".])
9672     fi
9674     dnl Check for TQt libraries
9675     AC_MSG_CHECKING([for TQt libraries])
9676     tqt_libdir="no"
9677     for tqt_check in $tqt_libdirs; do
9678         if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
9679             tqt_libdir="$tqt_check"
9680             break
9681         fi
9682     done
9683     AC_MSG_RESULT([$tqt_libdir])
9684     if test "x$tqt_libdir" = "xno"; then
9685         AC_MSG_ERROR([TQt libraries not found.  Please specify the root of
9686 your TQt installation by exporting TQTDIR before running "configure".])
9687     fi
9689     dnl Check for Meta Object Compiler
9690     AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
9691     if test "$MOC" = "no"; then
9692         AC_MSG_ERROR([TQt Meta Object Compiler not found.  Please specify
9693 the root of your TQt installation by exporting TQTDIR before running "configure".])
9694     fi
9696     dnl Check for TDE headers
9697     AC_MSG_CHECKING([for TDE headers])
9698     tde_incdir="no"
9699     for tde_check in $tde_incdirs; do
9700         if test -r "$tde_check/$tde_test_include"; then
9701             tde_incdir="$tde_check"
9702             break
9703         fi
9704     done
9705     AC_MSG_RESULT([$tde_incdir])
9706     if test "x$tde_incdir" = "xno"; then
9707         AC_MSG_ERROR([TDE headers not found.  Please specify the root of
9708 your TDE installation by exporting TDEDIR before running "configure".])
9709     fi
9711     dnl Check for TDE libraries
9712     AC_MSG_CHECKING([for TDE libraries])
9713     tde_libdir="no"
9714     for tde_check in $tde_libdirs; do
9715         if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
9716             tde_libdir="$tde_check"
9717             break
9718         fi
9719     done
9720     AC_MSG_RESULT([$tde_libdir])
9721     if test "x$tde_libdir" = "xno"; then
9722         AC_MSG_ERROR([TDE libraries not found.  Please specify the root of
9723 your TDE installation by exporting TDEDIR before running "configure".])
9724     fi
9726     dnl Set the variables
9727     TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
9728     TDE_LIBS="-L$tde_libdir -L$tqt_libdir -lkio -ltdeui -ltdecore -ltqt -ltqt-mt"
9730 AC_SUBST(TDE_CFLAGS)
9731 AC_SUBST(TDE_LIBS)
9732 AC_SUBST(MOC)
9734 dnl ===================================================================
9735 dnl Check whether the Qt3 and KDE3 libraries are available.
9736 dnl ===================================================================
9738 KDE_CFLAGS=""
9739 KDE_LIBS=""
9740 if test "$_os" != "OpenBSD"; then
9741     MOC="moc"
9743 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
9744     dnl Search paths for Qt3 and KDE3
9745     if test -z "$supports_multilib"; then
9746         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"
9747         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"
9748     else
9749         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"
9750         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"
9751     fi
9752     if test -n "$QTDIR"; then
9753         qt_incdirs="$QTDIR/include $qt_incdirs"
9754         if test -z "$supports_multilib"; then
9755             qt_libdirs="$QTDIR/lib $qt_libdirs"
9756         else
9757             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
9758         fi
9759     fi
9760     if test -z "$supports_multilib"; then
9761         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"
9762         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"
9763     else
9764         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"
9765         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"
9766     fi
9767     if test -n "$KDEDIR"; then
9768         kde_incdirs="$KDEDIR/include $kde_incdirs"
9769         if test -z "$supports_multilib"; then
9770             kde_libdirs="$KDEDIR/lib $kde_libdirs"
9771         else
9772             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
9773         fi
9774     fi
9776     dnl What to test
9777     qt_test_include="qstyle.h"
9778     kde_test_include="kapp.h"
9780     if test "$_os" != "OpenBSD"; then
9781         qt_test_library="libqt-mt.so"
9782         kde_test_library="libDCOP.so"
9783     else
9784         qt_test_library="libqt-mt.so*"
9785         kde_test_library="libDCOP.so*"
9786     fi
9788     dnl Check for Qt3 headers
9789     AC_MSG_CHECKING([for Qt3 headers])
9790     qt_incdir="no"
9791     for kde_check in $qt_incdirs; do
9792         if test -r "$kde_check/$qt_test_include"; then
9793             qt_incdir="$kde_check"
9794             break
9795         fi
9796     done
9797     AC_MSG_RESULT([$qt_incdir])
9798     if test "x$qt_incdir" = "xno"; then
9799         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
9800 your Qt3 installation by exporting QTDIR before running "configure".])
9801     fi
9803     dnl Check for Qt3 libraries
9804     AC_MSG_CHECKING([for Qt3 libraries])
9805     qt_libdir="no"
9806     for qt_check in $qt_libdirs; do
9807         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
9808             qt_libdir="$qt_check"
9809             break
9810         fi
9811     done
9812     AC_MSG_RESULT([$qt_libdir])
9813     if test "x$qt_libdir" = "xno"; then
9814         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
9815 your Qt3 installation by exporting QTDIR before running "configure".])
9816     fi
9818     dnl Check for Meta Object Compiler
9819     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
9820     if test "$MOC" = "no"; then
9821         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
9822 the root of your Qt3 installation by exporting QTDIR before running "configure".])
9823     fi
9825     dnl Check for KDE3 headers
9826     AC_MSG_CHECKING([for KDE3 headers])
9827     kde_incdir="no"
9828     for kde_check in $kde_incdirs; do
9829         if test -r "$kde_check/$kde_test_include"; then
9830             kde_incdir="$kde_check"
9831             break
9832         fi
9833     done
9834     AC_MSG_RESULT([$kde_incdir])
9835     if test "x$kde_incdir" = "xno"; then
9836         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
9837 your KDE3 installation by exporting KDEDIR before running "configure".])
9838     fi
9840     dnl Check for KDE3 libraries
9841     AC_MSG_CHECKING([for KDE3 libraries])
9842     kde_libdir="no"
9843     for kde_check in $kde_libdirs; do
9844         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
9845             kde_libdir="$kde_check"
9846             break
9847         fi
9848     done
9849     AC_MSG_RESULT([$kde_libdir])
9850     if test "x$kde_libdir" = "xno"; then
9851         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
9852 your KDE3 installation by exporting KDEDIR before running "configure".])
9853     fi
9855     dnl Set the variables
9856     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
9857     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
9859 AC_SUBST(KDE_CFLAGS)
9860 AC_SUBST(KDE_LIBS)
9861 AC_SUBST(MOC)
9863 dnl ===================================================================
9864 dnl KDE4 Integration
9865 dnl ===================================================================
9867 KDE4_CFLAGS=""
9868 KDE4_LIBS=""
9869 QMAKE4="qmake"
9870 MOC4="moc"
9871 KDE_GLIB_CFLAGS=""
9872 KDE_GLIB_LIBS=""
9873 KDE_HAVE_GLIB=""
9874 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
9875     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
9876     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
9878     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
9879     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
9881     if test -n "$supports_multilib"; then
9882         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
9883         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
9884     fi
9886     if test -n "$QTDIR"; then
9887         qt_incdirs="$QTDIR/include $qt_incdirs"
9888         if test -z "$supports_multilib"; then
9889             qt_libdirs="$QTDIR/lib $qt_libdirs"
9890         else
9891             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
9892         fi
9893     fi
9894     if test -n "$QT4DIR"; then
9895         qt_incdirs="$QT4DIR/include $qt_incdirs"
9896         if test -z "$supports_multilib"; then
9897             qt_libdirs="$QT4DIR/lib $qt_libdirs"
9898         else
9899             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
9900         fi
9901     fi
9903     if test -n "$KDEDIR"; then
9904         kde_incdirs="$KDEDIR/include $kde_incdirs"
9905         if test -z "$supports_multilib"; then
9906             kde_libdirs="$KDEDIR/lib $kde_libdirs"
9907         else
9908             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
9909         fi
9910     fi
9911     if test -n "$KDE4DIR"; then
9912         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
9913         if test -z "$supports_multilib"; then
9914             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
9915         else
9916             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
9917         fi
9918     fi
9920     qt_test_include="Qt/qobject.h"
9921     qt_test_library="libQtCore.so"
9922     kde_test_include="kwindowsystem.h"
9923     kde_test_library="libsolid.so"
9925     AC_MSG_CHECKING([for Qt4 headers])
9926     qt_header_dir="no"
9927     for inc_dir in $qt_incdirs; do
9928         if test -r "$inc_dir/$qt_test_include"; then
9929             qt_header_dir="$inc_dir"
9930             break
9931         fi
9932     done
9934     AC_MSG_RESULT([$qt_header_dir])
9935     if test "x$qt_header_dir" = "xno"; then
9936         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
9937     fi
9939     dnl Check for qmake
9940     AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
9941     QMAKE4="$QMAKEQT4"
9942     if test "$QMAKE4" = "no" ; then
9943         AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
9944         if test "$QMAKE4" = "no" ; then
9945             AC_MSG_ERROR([Qmake not found.  Please specify
9946 the root of your Qt installation by exporting QT4DIR before running "configure".])
9947         fi
9948     fi
9950     qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
9951     AC_MSG_CHECKING([for Qt4 libraries])
9952     qt_lib_dir="no"
9953     for lib_dir in $qt_libdirs; do
9954         if test -r "$lib_dir/$qt_test_library"; then
9955             qt_lib_dir="$lib_dir"
9956             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
9957             break
9958         fi
9959     done
9961     AC_MSG_RESULT([$qt_lib_dir])
9963     if test "x$qt_lib_dir" = "xno"; then
9964         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
9965     fi
9967     dnl Check for Meta Object Compiler
9969     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
9970     MOC4="$MOCQT4"
9971     if test "$MOC4" = "no"; then
9972         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
9973         if test "$MOC4" = "no"; then
9974             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
9975 the root of your Qt installation by exporting QT4DIR before running "configure".])
9976         fi
9977     fi
9979     dnl Check for KDE4 headers
9980     AC_MSG_CHECKING([for KDE4 headers])
9981     kde_incdir="no"
9982     for kde_check in $kde_incdirs; do
9983         if test -r "$kde_check/$kde_test_include"; then
9984             kde_incdir="$kde_check"
9985             break
9986         fi
9987     done
9988     AC_MSG_RESULT([$kde_incdir])
9989     if test "x$kde_incdir" = "xno"; then
9990         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
9991     fi
9993     dnl Check for KDE4 libraries
9994     AC_MSG_CHECKING([for KDE4 libraries])
9995     kde_libdir="no"
9996     for kde_check in $kde_libdirs; do
9997         if test -r "$kde_check/$kde_test_library"; then
9998             kde_libdir="$kde_check"
9999             break
10000         fi
10001     done
10003     AC_MSG_RESULT([$kde_libdir])
10004     if test "x$kde_libdir" = "xno"; then
10005         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10006     fi
10008     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10009     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkio -lkfile -lkdeui -lkdecore -lQtCore -lQtGui"
10011     AC_LANG_PUSH([C++])
10012     save_CXXFLAGS=$CXXFLAGS
10013     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10014     AC_MSG_CHECKING([whether KDE is >= 4.2])
10015        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10016 #include <kdeversion.h>
10018 int main(int argc, char **argv) {
10019        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
10020        else return 1;
10022        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
10023     CXXFLAGS=$save_CXXFLAGS
10024     AC_LANG_POP([C++])
10026    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
10027     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
10028         [KDE_HAVE_GLIB=1],
10029         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
10031 AC_SUBST(KDE4_CFLAGS)
10032 AC_SUBST(KDE4_LIBS)
10033 AC_SUBST(MOC4)
10034 AC_SUBST(KDE_GLIB_CFLAGS)
10035 AC_SUBST(KDE_GLIB_LIBS)
10036 AC_SUBST(KDE_HAVE_GLIB)
10038 dnl ===================================================================
10039 dnl Test for the enabling the lockdown pieces
10040 dnl ===================================================================
10041 AC_MSG_CHECKING([whether to enable the lockdown pieces])
10042 ENABLE_LOCKDOWN=""
10043 if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
10044     ENABLE_LOCKDOWN=YES
10045     AC_MSG_RESULT([yes])
10046 else
10047     AC_MSG_RESULT([no])
10049 AC_SUBST(ENABLE_LOCKDOWN)
10051 dnl ===================================================================
10052 dnl Test whether to include Evolution 2 support
10053 dnl ===================================================================
10054 AC_MSG_CHECKING([whether to enable evolution 2 support])
10055 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
10056     AC_MSG_RESULT([yes])
10057     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
10058     ENABLE_EVOAB2="TRUE"
10059 else
10060     ENABLE_EVOAB2=""
10061     AC_MSG_RESULT([no])
10063 AC_SUBST(ENABLE_EVOAB2)
10064 AC_SUBST(GOBJECT_CFLAGS)
10065 AC_SUBST(GOBJECT_LIBS)
10067 dnl ===================================================================
10068 dnl Test whether to include TDE AB support
10069 dnl ===================================================================
10070 AC_MSG_CHECKING([whether to enable TDE address book support])
10071 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
10072     AC_MSG_RESULT([yes])
10073     AC_LANG_PUSH([C++])
10074     save_CXXFLAGS=$CXXFLAGS
10075     CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
10076     AC_MSG_CHECKING([whether TDE is at least R14.0])
10077        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10078 #include <tdeversion.h>
10080 int main(int argc, char **argv) {
10081        if (TDE_VERSION_MAJOR >= 14) return 0;
10082        else return 1;
10084        ]])],[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])],[])
10085     CXXFLAGS=$save_CXXFLAGS
10086     AC_LANG_POP([C++])
10087     ENABLE_TDEAB=TRUE
10088 else
10089     AC_MSG_RESULT([no])
10090     ENABLE_TDEAB=
10092 AC_SUBST(ENABLE_TDEAB)
10094 dnl ===================================================================
10095 dnl Test whether to include KDE AB support
10096 dnl ===================================================================
10097 AC_MSG_CHECKING([whether to enable KDE address book support])
10098 if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
10099     AC_MSG_RESULT([yes])
10100     AC_LANG_PUSH([C++])
10101     save_CXXFLAGS=$CXXFLAGS
10102     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
10103     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
10104        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10105 #include <kdeversion.h>
10107 int main(int argc, char **argv) {
10108        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
10109        else return 1;
10111        ]])],[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])],[])
10112     CXXFLAGS=$save_CXXFLAGS
10113     AC_LANG_POP([C++])
10114     ENABLE_KAB=TRUE
10115 else
10116     AC_MSG_RESULT([no])
10117     ENABLE_KAB=
10119 AC_SUBST(ENABLE_KAB)
10121 dnl ===================================================================
10122 dnl Test whether to include MathMLDTD
10123 dnl ===================================================================
10124 AC_MSG_CHECKING([whether to include MathMLDTD])
10125 if test -n "$enable_mathmldtd"; then
10126     if test "$enable_mathmldtd" = "no"; then
10127         AC_MSG_RESULT([no])
10128         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10129     else
10130         AC_MSG_RESULT([yes])
10131         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
10132     fi
10133 else
10134     AC_MSG_RESULT([no])
10135     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10138 dnl ===================================================================
10139 dnl Test which themes to include
10140 dnl ===================================================================
10141 AC_MSG_CHECKING([which themes to include])
10142 # if none given use default subset of available themes
10143 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
10144     with_theme="crystal default hicontrast oxygen tango"
10147 WITH_THEMES=""
10148 for theme in $with_theme; do
10149     case $theme in
10150         crystal|default|galaxy|hicontrast|human|industrial|oxygen|tango) : ;;
10151         *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
10152     esac
10153     WITH_THEMES="$WITH_THEMES $theme"
10154     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
10155 done
10156 AC_MSG_RESULT([$WITH_THEMES])
10157 AC_SUBST([WITH_THEMES])
10159 dnl ===================================================================
10160 dnl Test whether to integrate helppacks into the product's installer
10161 dnl ===================================================================
10162 AC_MSG_CHECKING([for helppack integration])
10163 if test "$with_helppack_integration" = "no"; then
10164     WITH_HELPPACK_INTEGRATION=NO
10165     AC_MSG_RESULT([no integration])
10166 else
10167     WITH_HELPPACK_INTEGRATION=YES
10168     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
10169     AC_MSG_RESULT([integration])
10171 AC_SUBST(WITH_HELPPACK_INTEGRATION)
10173 ###############################################################################
10174 # Extensions checking
10175 ###############################################################################
10176 dnl ===================================================================
10177 dnl Test whether to integrate extensions into the product's installer
10178 dnl ===================================================================
10179 AC_MSG_CHECKING([for extensions integration])
10180 if test "x$enable_extension_integration" != "xno"; then
10181     WITH_EXTENSION_INTEGRATION=YES
10182     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
10183     AC_MSG_RESULT([yes, use integration])
10184 else
10185     WITH_EXTENSION_INTEGRATION=NO
10186     AC_MSG_RESULT([no, do not integrate])
10188 AC_SUBST(WITH_EXTENSION_INTEGRATION)
10190 dnl ===================================================================
10191 dnl Test whether to include Watch Window extension
10192 dnl ===================================================================
10193 AC_MSG_CHECKING([for Watch Window extension integration])
10194 WATCH_WINDOW_EXTENSION_PACK=
10195 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10196     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
10197     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
10198     AC_MSG_RESULT([yes])
10199 else
10200     AC_MSG_RESULT([no])
10202 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
10204 dnl ===================================================================
10205 dnl Test whether to include SmART Gallery (Diagram) extension
10206 dnl ===================================================================
10207 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
10208 DIAGRAM_EXTENSION_PACK=
10209 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10210     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
10211     DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
10212     AC_MSG_RESULT([yes])
10213 else
10214     AC_MSG_RESULT([no])
10216 AC_SUBST(DIAGRAM_EXTENSION_PACK)
10218 dnl ===================================================================
10219 dnl Test whether to include Validator extension
10220 dnl ===================================================================
10221 AC_MSG_CHECKING([for Validator extension integration])
10222 VALIDATOR_EXTENSION_PACK=
10223 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10224     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
10225     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
10226     AC_MSG_RESULT([yes])
10227 else
10228     AC_MSG_RESULT([no])
10230 AC_SUBST(VALIDATOR_EXTENSION_PACK)
10232 dnl ===================================================================
10233 dnl Test whether to include Barcode extension
10234 dnl ===================================================================
10235 AC_MSG_CHECKING([for Barcode extension integration])
10236 BARCODE_EXTENSION_PACK=
10237 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10238     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
10239     BARCODE_EXTENSION_PACK="3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt"
10240     AC_MSG_RESULT([yes])
10241 else
10242     AC_MSG_RESULT([no])
10244 AC_SUBST([BARCODE_EXTENSION_PACK])
10246 dnl ===================================================================
10247 dnl Test whether to include ConvertTextToNumber extension
10248 dnl ===================================================================
10249 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
10250 CT2N_EXTENSION_PACK=
10251 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10252     BUILD_TYPE="$BUILD_TYPE CT2N"
10253     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
10254     CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber_1.3.2.oxt"
10255     AC_MSG_RESULT([yes])
10256 else
10257     AC_MSG_RESULT([no])
10259 AC_SUBST(CT2N_EXTENSION_PACK)
10261 dnl ===================================================================
10262 dnl Test whether to include Numbertext extension
10263 dnl ===================================================================
10264 AC_MSG_CHECKING([for Numbertext extension integration])
10265 NUMBERTEXT_EXTENSION_PACK=
10266 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10267     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
10268     NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt"
10269     AC_MSG_RESULT([yes])
10270 else
10271     AC_MSG_RESULT([no])
10273 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
10275 dnl ===================================================================
10276 dnl Test whether to include Hungarian Cross-reference Toolbar extension
10277 dnl ===================================================================
10278 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
10279 HUNART_EXTENSION_PACK=
10280 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10281     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
10282     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
10283     AC_MSG_RESULT([yes])
10284 else
10285     AC_MSG_RESULT([no])
10287 AC_SUBST(HUNART_EXTENSION_PACK)
10289 dnl ===================================================================
10290 dnl Test whether to include Typography Toolbar extension
10291 dnl ===================================================================
10292 AC_MSG_CHECKING([for Typography Toolbar extension integration])
10293 TYPO_EXTENSION_PACK=
10294 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10295     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
10296     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
10297     AC_MSG_RESULT([yes])
10298 else
10299     AC_MSG_RESULT([no])
10301 AC_SUBST(TYPO_EXTENSION_PACK)
10303 dnl ===================================================================
10304 dnl Test whether to include Google Docs extension
10305 dnl ===================================================================
10306 AC_MSG_CHECKING([for Google Docs extension integration])
10307 GOOGLE_DOCS_EXTENSION_PACK=
10308 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10309     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
10310     GOOGLE_DOCS_EXTENSION_PACK="2a64b8e6f185a7f6c19d00fb8bb4cf64-gdocs_3.0.1_modified.oxt"
10311     AC_MSG_RESULT([yes])
10312 else
10313     AC_MSG_RESULT([no])
10315 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
10317 dnl ===================================================================
10318 dnl Test whether to include NLPSolver extension
10319 dnl ===================================================================
10320 AC_MSG_CHECKING([for NLPSolver extension integration])
10321 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10322     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
10323     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
10324     AC_MSG_RESULT([yes])
10325 else
10326     AC_MSG_RESULT([no])
10329 dnl ===================================================================
10330 dnl Test whether to include LanguageTool extension
10331 dnl ===================================================================
10332 AC_MSG_CHECKING([for LanguageTool extension integration])
10333 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10334     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
10335     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
10336     AC_MSG_RESULT([yes])
10337 else
10338     AC_MSG_RESULT([no])
10341 dnl ===================================================================
10342 dnl Test whether to include oooblogger extension
10343 dnl ===================================================================
10344 AC_MSG_CHECKING([for oooblogger extension integration])
10345 OOOBLOGGER_EXTENSION_PACK=
10346 if test "x$enable_ext_oooblogger" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10347     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_OOOBLOGGER"
10348     OOOBLOGGER_EXTENSION_PACK="b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt"
10349     AC_MSG_RESULT([yes])
10350 else
10351     AC_MSG_RESULT([no])
10353 AC_SUBST(OOOBLOGGER_EXTENSION_PACK)
10354 ###############################################################################
10356 dnl ===================================================================
10357 dnl Test whether to include Sun Professional Template Pack
10358 dnl ===================================================================
10359 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
10360 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
10361     AC_MSG_RESULT([no integration])
10362 else
10363     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
10364     sun_supported_langs="en-US de it fr es hu"
10365     if test "$with_sun_templates" = "yes"; then
10366         wanted_sun_templates="$sun_supported_langs"
10367     else
10368         # check whether the langs are supported by Sun
10369         wanted_sun_templates=
10370         for lang in $with_sun_templates; do
10371             if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
10372                 wanted_sun_templates="$wanted_sun_templates $lang"
10373             fi
10374         done
10375     fi
10376     SUNTEMPLATES_LANG=
10377     SUNTEMPLATES_DE_PACK=
10378     SUNTEMPLATES_EN_US_PACK=
10379     SUNTEMPLATES_ES_PACK=
10380     SUNTEMPLATES_FR_PACK=
10381     SUNTEMPLATES_HU_PACK=
10382     SUNTEMPLATES_IT_PACK=
10383     # check whether the langs are requested at all
10384     for lang in $wanted_sun_templates; do
10385     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
10386         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
10387         case $lang in
10388         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
10389         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
10390         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
10391         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
10392         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
10393         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
10394         esac
10395     fi
10396     done
10397     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
10399 AC_SUBST(SUNTEMPLATES_DE_PACK)
10400 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
10401 AC_SUBST(SUNTEMPLATES_ES_PACK)
10402 AC_SUBST(SUNTEMPLATES_FR_PACK)
10403 AC_SUBST(SUNTEMPLATES_HU_PACK)
10404 AC_SUBST(SUNTEMPLATES_IT_PACK)
10406 dnl ===================================================================
10407 dnl Test whether to include fonts
10408 dnl ===================================================================
10409 AC_MSG_CHECKING([whether to include third-party fonts])
10410 if test "$with_fonts" != "no"; then
10411     AC_MSG_RESULT([yes])
10412     WITH_FONTS=YES
10413     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
10414 else
10415     AC_MSG_RESULT([no])
10416     WITH_FONTS=NO
10417     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
10419 AC_SUBST(WITH_FONTS)
10421 AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
10422 if test "$with_agfa_monotype_fonts" = "yes"; then
10423     AC_MSG_RESULT([yes])
10424     WITH_AGFA_MONOTYPE_FONTS=YES
10425     SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
10426     BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
10427 else
10428     AC_MSG_RESULT([no])
10429     WITH_AGFA_MONOTYPE_FONTS=NO
10431 AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
10433 dnl ===================================================================
10434 dnl Test whether to include ppds
10435 dnl ===================================================================
10436 AC_MSG_CHECKING([whether to include PPDs])
10437 if test "$with_ppds" != "no"; then
10438     AC_MSG_RESULT([yes])
10439 else
10440     AC_MSG_RESULT([no])
10441     WITHOUT_PPDS=YES
10442     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
10444 AC_SUBST(WITHOUT_PPDS)
10446 dnl ===================================================================
10447 dnl Test whether to include afms
10448 dnl ===================================================================
10449 AC_MSG_CHECKING([whether to include AFMs])
10450 if test "$with_afms" != "no"; then
10451     AC_MSG_RESULT([yes])
10452     BUILD_TYPE="$BUILD_TYPE AFMS"
10453 else
10454     AC_MSG_RESULT([no])
10455     WITHOUT_AFMS=YES
10456     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
10458 AC_SUBST(WITHOUT_AFMS)
10460 dnl ===================================================================
10461 dnl Test whether to include extra galleries
10462 dnl ===================================================================
10463 AC_MSG_CHECKING([whether to include extra galleries])
10464 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
10465     AC_MSG_RESULT([no])
10466     WITH_EXTRA_GALLERY=NO
10467     OOOP_GALLERY_PACK=""
10468 else
10469     AC_MSG_RESULT([yes])
10470     WITH_EXTRA_GALLERY=YES
10471     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
10472     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
10473     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
10475 AC_SUBST(WITH_EXTRA_GALLERY)
10476 AC_SUBST(OOOP_GALLERY_PACK)
10478 dnl ===================================================================
10479 dnl Test whether to include extra templates
10480 dnl ===================================================================
10481 AC_MSG_CHECKING([whether to include extra templates])
10482 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
10483     AC_MSG_RESULT([no])
10484     WITH_EXTRA_TEMPLATE=NO
10485     OOOP_TEMPLATES_PACK=""
10486 else
10487     AC_MSG_RESULT([yes])
10488     WITH_EXTRA_TEMPLATE=YES
10489     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
10490     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
10491     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
10493 AC_SUBST(WITH_EXTRA_TEMPLATE)
10494 AC_SUBST(OOOP_TEMPLATES_PACK)
10496 dnl ===================================================================
10497 dnl Test whether to include extra samples
10498 dnl ===================================================================
10499 AC_MSG_CHECKING([whether to include extra samples])
10500 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
10501     AC_MSG_RESULT([no])
10502     WITH_EXTRA_SAMPLE=NO
10503     OOOP_SAMPLES_PACK=""
10504 else
10505     AC_MSG_RESULT([yes])
10506     WITH_EXTRA_SAMPLE=YES
10507     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
10508     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
10509     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
10511 AC_SUBST(WITH_EXTRA_SAMPLE)
10512 AC_SUBST(OOOP_SAMPLES_PACK)
10514 dnl ===================================================================
10515 dnl Test whether to include extra fonts
10516 dnl ===================================================================
10517 AC_MSG_CHECKING([whether to include extra fonts])
10518 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
10519     AC_MSG_RESULT([no])
10520     WITH_EXTRA_FONT=NO
10521     OOOP_FONTS_PACK=""
10522 else
10523     AC_MSG_RESULT([yes])
10524     WITH_EXTRA_FONT=YES
10525     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
10526     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
10527     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
10529 AC_SUBST(WITH_EXTRA_FONT)
10530 AC_SUBST(OOOP_FONTS_PACK)
10532 dnl ===================================================================
10533 dnl Test whether to download OxygenOffice branding and set custom settings
10534 dnl ===================================================================
10535 AC_MSG_CHECKING([whether to download OxygenOffice branding and set custom settings])
10536 if test "$enable_oxygenoffice" = "" -o "$enable_oxygenoffice" = "no"; then
10537     AC_MSG_RESULT([no])
10538     ENABLE_OXYGENOFFICE=NO
10539 else
10540     AC_MSG_RESULT([yes])
10541     ENABLE_OXYGENOFFICE=YES
10542     OXYGENOFFICE_PACK="18bf204479ff641d99a88cd71f6f25f7-oxygenoffice-001.zip"
10543     BUILD_TYPE="$BUILD_TYPE OXYGENOFFICE"
10545 AC_SUBST(ENABLE_OXYGENOFFICE)
10546 AC_SUBST(OXYGENOFFICE_PACK)
10548 dnl ===================================================================
10549 dnl Test whether to build global menu support
10550 dnl ===================================================================
10551 AC_MSG_CHECKING([whether to build global menu support])
10552 if test "$enable_lomenubar" = "" -o "$enable_lomenubar" = "no"; then
10553     AC_MSG_RESULT([no])
10554     ENABLE_LOMENUBAR="FALSE"
10555 else
10556     AC_MSG_RESULT([yes])
10557     PKG_CHECK_MODULES(DBUSMENUGTK, dbusmenu-gtk-0.4,, AC_MSG_ERROR([requirements to build lo-menubar not met. Use --disable-lomenubar or install the missing packages]))
10558     ENABLE_LOMENUBAR="TRUE"
10560 AC_SUBST(ENABLE_LOMENUBAR)
10562 dnl ===================================================================
10563 dnl Test whether to enable online update service
10564 dnl ===================================================================
10565 AC_MSG_CHECKING([whether to enable online update])
10566 ENABLE_ONLINE_UPDATE=
10567 if test "$enable_online_update" = ""; then
10568     if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
10569         AC_MSG_RESULT([yes])
10570         ENABLE_ONLINE_UPDATE="TRUE"
10571     else
10572         AC_MSG_RESULT([no])
10573     fi
10574 else
10575     if test "$enable_online_update" = "yes"; then
10576         AC_MSG_RESULT([yes])
10577         ENABLE_ONLINE_UPDATE="TRUE"
10578     else
10579         AC_MSG_RESULT([no])
10580     fi
10582 AC_SUBST(ENABLE_ONLINE_UPDATE)
10584 dnl ===================================================================
10585 dnl Test whether build target is Release Build
10586 dnl ===================================================================
10587 AC_MSG_CHECKING([whether build target is Release Build])
10588 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
10589     AC_MSG_RESULT([no])
10590     ENABLE_RELEASE_BUILD="FALSE"
10591 else
10592     AC_MSG_RESULT([yes])
10593     ENABLE_RELEASE_BUILD="TRUE"
10595 AC_SUBST(ENABLE_RELEASE_BUILD)
10597 dnl ===================================================================
10598 dnl Test whether to create MSI with LIMITUI=1 (silent install)
10599 dnl ===================================================================
10600 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
10601 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
10602     AC_MSG_RESULT([no])
10603     ENABLE_SILENT_MSI="FALSE"
10604 else
10605     AC_MSG_RESULT([yes])
10606     ENABLE_SILENT_MSI="TRUE"
10607     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
10609 AC_SUBST(ENABLE_SILENT_MSI)
10611 AC_SUBST(SCPDEFS)
10613 AC_MSG_CHECKING([whether and how to use Xinerama])
10614 if test "$_os" = "Darwin"; then
10615     USE_XINERAMA=YES
10616     XINERAMA_LINK=dynamic
10617     AC_MSG_RESULT([yes])
10618 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
10619     if test "$x_libraries" = "default_x_libraries"; then
10620         XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
10621         if test "x$XINERAMALIB" = x; then
10622            XINERAMALIB="/usr/lib"
10623         fi
10624     else
10625         XINERAMALIB="$x_libraries"
10626     fi
10627     if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
10628         # we have both versions, let the user decide but use the dynamic one
10629         # per default
10630         USE_XINERAMA=YES
10631         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
10632             XINERAMA_LINK=dynamic
10633         else
10634             XINERAMA_LINK=static
10635         fi
10636     elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
10637         # we have only the dynamic version
10638         USE_XINERAMA=YES
10639         XINERAMA_LINK=dynamic
10640     elif test -e "$XINERAMALIB/libXinerama.a"; then
10641         # static version
10642         if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
10643             USE_XINERAMA=YES
10644             XINERAMA_LINK=static
10645         else
10646             USE_XINERAMA=NO
10647             XINERAMA_LINK=none
10648         fi
10649     else
10650         # no Xinerama
10651         USE_XINERAMA=NO
10652         XINERAMA_LINK=none
10653     fi
10654     if test "$USE_XINERAMA" = "YES"; then
10655         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
10656         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
10657             [AC_MSG_ERROR(Xinerama header not found.)], [])
10658         XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
10659         if test "x$XEXTLIB" = x; then
10660            XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
10661         fi
10662         XINERAMA_EXTRA_LIBS="$XEXTLIBS"
10663         if test "$_os" = "FreeBSD"; then
10664             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
10665         fi
10666         if test "$_os" = "Linux"; then
10667             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
10668         fi
10669         AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
10670             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
10671     else
10672         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
10673     fi
10674 else
10675     USE_XINERAMA=NO
10676     XINERAMA_LINK=none
10677     AC_MSG_RESULT([no])
10679 AC_SUBST(USE_XINERAMA)
10680 AC_SUBST(XINERAMA_LINK)
10682 dnl ===================================================================
10683 dnl Checks for librsvg
10684 dnl ===================================================================
10686 dnl ENABLE_LIBRSVG is set to "" (for NO), SYSTEM or INTERNAL. The
10687 dnl SYSTEM_LIBRSVG, SYSTEM_GDKPIXBUF etc are redundant.
10689 ENABLE_LIBRSVG=""
10690 LIBRSVG_CFLAGS=""
10691 LIBRSVG_LIBS=""
10693 AC_MSG_CHECKING([what librsvg to use])
10695 case "$enable_librsvg" in
10696 no|disable)
10697     AC_MSG_RESULT([none])
10698     enable_librsvg=no
10699     ;;
10701 ""|yes|auto)
10702     if test $build_os = cygwin -o \
10703            $_os = Darwin; then
10704         dnl When building on/for these OSes always use the internal one,
10705         dnl if at all. Add more OSes above as needed.
10706         AC_MSG_RESULT([internal])
10707         enable_librsvg=internal
10708     elif test  $_os = iOS -o $_os = Android; then
10709         AC_MSG_RESULT([none])
10710         enable_librsvg=no
10711     else
10712         if test "$with_system_libs" = yes; then
10713             AC_MSG_RESULT([system])
10714             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
10715             enable_librsvg=system
10716         elif test "$with_system_libs" = no; then
10717             AC_MSG_RESULT([internal])
10718             enable_librsvg=internal
10719         else
10720             AC_MSG_RESULT([checking further])
10721             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14,, [:])
10722             if test -z "$LIBRSVG_PKG_ERRORS"; then
10723                 enable_librsvg=system
10724             else
10725                 enable_librsvg=internal
10726             fi
10727         fi
10728     fi
10729     ;;
10731 internal)
10732     AC_MSG_RESULT([internal])
10733     ;;
10735 fully-internal)
10736     AC_MSG_RESULT([fully internal])
10737     ;;
10739 system)
10740     if test $_os = WINNT -a "$WITH_MINGW" != yes; then
10741         AC_MSG_ERROR([Must use internal librsvg when building with MSVC])
10742     fi
10743     AC_MSG_RESULT([system])
10744     PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
10745     ;;
10748     AC_MSG_ERROR([Incorrect --enable-librsvg option])
10749     ;;
10750 esac
10752 dnl By now enable_librsvg should be "system", "internal", "fully-internal", or
10753 dnl "no":
10754 case $enable_librsvg in
10755 system)
10756     ENABLE_LIBRSVG=SYSTEM
10757     SYSTEM_LIBRSVG=YES
10758     ;;
10760 internal|fully-internal)
10761     ENABLE_LIBRSVG=INTERNAL
10762     SYSTEM_LIBRSVG=NO
10763     BUILD_TYPE="$BUILD_TYPE LIBRSVG"
10764     ;;
10767     ENABLE_LIBRSVG=NO
10768     SYSTEM_LIBRSVG=NO
10769     ;;
10772     AC_MSG_ERROR([Internal configure script error, invalid enable_librsvg value "$enable_librsvg"])
10773     ;;
10774 esac
10776 AC_SUBST(ENABLE_LIBRSVG)
10777 AC_SUBST(LIBRSVG_CFLAGS)
10778 AC_SUBST(LIBRSVG_LIBS)
10779 AC_SUBST(SYSTEM_LIBRSVG)
10781 dnl ===================================================================
10782 dnl Test whether to build cairo or rely on the system version
10783 dnl ===================================================================
10786 SYSTEM_CAIRO=""
10788 if test "$test_cairo" = "yes" ; then
10789     AC_MSG_CHECKING([whether to use the system cairo])
10791     if test "$with_system_cairo" = "yes"; then
10792         SYSTEM_CAIRO=YES
10793         AC_MSG_RESULT([yes])
10795         PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
10797         if test "$test_xrender" = "yes"; then
10798             if test "$with_system_xextensions_headers" != "no"; then
10799                 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
10800                 AC_LANG_PUSH([C])
10801                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
10802 #ifdef PictStandardA8
10803 #else
10804       return fail;
10805 #endif
10806 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
10808                 AC_LANG_POP([C])
10809             fi
10810         fi
10811         libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
10812         libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
10813         libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
10814         libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
10815         libo_MINGW_TRY_DLL([PNG15], [libpng15])
10816     else
10817         AC_MSG_RESULT([no])
10819         if test $_os = WINNT; then
10820             dnl We only need cairo for Windows if we
10821             dnl build librsvg or directx disabled
10822             if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
10823                 BUILD_TYPE="$BUILD_TYPE CAIRO"
10824             fi
10825         else
10826             if test "$enable_cairo_canvas" = "yes"; then
10827                 BUILD_TYPE="$BUILD_TYPE CAIRO"
10828             else
10829                 if test "$with_system_cairo" != "yes"; then
10830                     if test "$ENABLE_LIBRSVG" != NO; then
10831                         BUILD_TYPE="$BUILD_TYPE CAIRO"
10832                     fi
10833                 fi
10834             fi
10835         fi
10836     fi
10839 AC_SUBST(SYSTEM_CAIRO)
10840 AC_SUBST(CAIRO_CFLAGS)
10841 AC_SUBST(CAIRO_LIBS)
10842 AC_SUBST([MINGW_CAIRO_DLL])
10843 AC_SUBST([MINGW_FONTCONFIG_DLL])
10844 AC_SUBST([MINGW_FREETYPE_DLL])
10845 AC_SUBST([MINGW_PIXMAN_DLL])
10846 AC_SUBST([MINGW_PNG15_DLL])
10849 dnl ===================================================================
10850 dnl Test whether to build gdk-pixbuf or rely on the system version
10851 dnl ===================================================================
10853 AC_MSG_CHECKING([whether to use the system gdk-pixbuf])
10855 dnl As long as the only thing we need gdk-pixbuf for is below
10856 dnl librsvg, use the same --enable-librsvg (possibly implied
10857 dnl by --with-system-libs) to override this.
10859 if test "$SYSTEM_LIBRSVG" = YES; then
10860     SYSTEM_GDKPIXBUF=YES
10861     AC_MSG_RESULT([yes])
10862 elif test "$enable_librsvg" = fully-internal; then
10863     SYSTEM_GDKPIXBUF=NO
10864     AC_MSG_RESULT([no])
10865 else
10866     case "$_os" in
10867     WINNT|Darwin|iOS|Android)
10868         SYSTEM_GDKPIXBUF=NO
10869         AC_MSG_RESULT([no])
10870         ;;
10871     *)
10872         SYSTEM_GDKPIXBUF=YES
10873         AC_MSG_RESULT([yes])
10874         ;;
10875     esac
10877 AC_SUBST(SYSTEM_GDKPIXBUF)
10879 dnl ===================================================================
10880 dnl Test whether to build GLib or rely on the system version
10881 dnl ===================================================================
10883 AC_MSG_CHECKING([whether to use the system GLib])
10885 dnl As long as the only thing we need GLib for is below
10886 dnl librsvg, use the same --enable-librsvg (possibly implied
10887 dnl by --with-system-libs) to override this.
10889 if test "$SYSTEM_LIBRSVG" = YES; then
10890     SYSTEM_GLIB=YES
10891     AC_MSG_RESULT([yes])
10892 elif test "$enable_librsvg" = fully-internal; then
10893     SYSTEM_GLIB=NO
10894     AC_MSG_RESULT([no])
10895 else
10896     case "$_os" in
10897     WINNT|Darwin|iOS|Android)
10898         SYSTEM_GLIB=NO
10899         AC_MSG_RESULT([no])
10900         ;;
10901     *)
10902         SYSTEM_GLIB=YES
10903         AC_MSG_RESULT([yes])
10904         ;;
10905     esac
10907 AC_SUBST(SYSTEM_GLIB)
10909 dnl ===================================================================
10910 dnl Test whether to build gettext runtime (libintl) or rely on the
10911 dnl system version
10912 dnl ===================================================================
10914 AC_MSG_CHECKING([whether to use the system gettext runtime])
10916 if test -z "$with_system_gettext"; then
10917     case "$_os" in
10918     WINNT|Darwin|iOS|Android)
10919         with_system_gettext=no
10920         ;;
10921     *)
10922         with_system_gettext=yes
10923         ;;
10924     esac
10926 if test "$with_system_gettext" = yes; then
10927     SYSTEM_GETTEXT=YES
10928     AC_MSG_RESULT([yes])
10929 elif test "$with_system_gettext" = no; then
10930     SYSTEM_GETTEXT=NO
10931     AC_MSG_RESULT([no])
10932 else
10933     AC_MSG_ERROR([bad --with-system-gettext=$with_system_gettext])
10935 AC_SUBST(SYSTEM_GETTEXT)
10937 dnl ===================================================================
10938 dnl Test whether to build libcroco or rely on the system version
10939 dnl ===================================================================
10941 AC_MSG_CHECKING([whether to use the system libcroco])
10943 dnl As long as the only thing we need libcroco for is below
10944 dnl librsvg, use the same --enable-librsvg (possibly implied
10945 dnl by --with-system-libs) to override this.
10947 if test "$SYSTEM_LIBRSVG" = YES; then
10948     SYSTEM_LIBCROCO=YES
10949     AC_MSG_RESULT([yes])
10950 elif test "$enable_librsvg" = fully-internal; then
10951     SYSTEM_LIBCROCO=NO
10952     AC_MSG_RESULT([no])
10953 else
10954     case "$_os" in
10955     WINNT|Darwin|iOS|Android)
10956         SYSTEM_LIBCROCO=NO
10957         AC_MSG_RESULT([no])
10958         ;;
10959     *)
10960         SYSTEM_LIBCROCO=YES
10961         AC_MSG_RESULT([yes])
10962         ;;
10963     esac
10965 AC_SUBST(SYSTEM_LIBCROCO)
10967 dnl ===================================================================
10968 dnl Test whether to build Pango or rely on the system version
10969 dnl ===================================================================
10971 AC_MSG_CHECKING([whether to use the system pango])
10973 dnl As long as the only thing we need Pango for is below
10974 dnl librsvg, use the same --enable-librsvg (possibly implied
10975 dnl by --with-system-libs) to override this.
10977 if test "$SYSTEM_LIBRSVG" = YES; then
10978     SYSTEM_PANGO=YES
10979     AC_MSG_RESULT([yes])
10980 elif test "$enable_librsvg" = fully-internal; then
10981     SYSTEM_PANGO=NO
10982     AC_MSG_RESULT([no])
10983 else
10984     case "$_os" in
10985     WINNT|Darwin|iOS|Android)
10986         SYSTEM_PANGO=NO
10987         AC_MSG_RESULT([no])
10988         ;;
10989     *)
10990         SYSTEM_PANGO=YES
10991         AC_MSG_RESULT([yes])
10992         ;;
10993     esac
10995 AC_SUBST(SYSTEM_PANGO)
10997 dnl ===================================================================
10998 dnl Test whether to build libgsf or rely on the system version
10999 dnl ===================================================================
11001 AC_MSG_CHECKING([whether to use the system libgsf])
11003 dnl As long as the only thing we need libgsf for is below librsvg (is
11004 dnl it?), use the same --enable-librsvg (possibly implied by
11005 dnl --with-system-libs) to override this.
11007 if test "$SYSTEM_LIBRSVG" = YES; then
11008     SYSTEM_LIBGSF=YES
11009     AC_MSG_RESULT([yes])
11010 elif test "$enable_librsvg" = fully-internal; then
11011     SYSTEM_LIBGSF=NO
11012     AC_MSG_RESULT([no])
11013 else
11014     case "$_os" in
11015     WINNT|Darwin|iOS|Android)
11016         SYSTEM_LIBGSF=NO
11017         AC_MSG_RESULT([no])
11018         ;;
11019     *)
11020         SYSTEM_LIBGSF=YES
11021         AC_MSG_RESULT([yes])
11022         ;;
11023     esac
11025 AC_SUBST(SYSTEM_LIBGSF)
11027 dnl ===================================================================
11028 dnl Test whether to build libpng or rely on the system version
11029 dnl ===================================================================
11031 AC_MSG_CHECKING([whether to use the system libpng])
11033 dnl How should and does this interact with the checks for libpng
11034 dnl related to use of libpng in the quickstarter above? This needs to
11035 dnl be unified.
11037 if test "$with_system_libpng" = "auto"; then
11038     case "$_os" in
11039     WINNT|Darwin|iOS|Android)
11040         with_system_libpng="$with_system_libs"
11041         ;;
11042     *)
11043         with_system_libpng=yes
11044         ;;
11045     esac
11048 if test "$with_system_libpng" = yes; then
11049     SYSTEM_LIBPNG=YES
11050     AC_MSG_RESULT([yes])
11051 else
11052     SYSTEM_LIBPNG=NO
11053     BUILD_TYPE="$BUILD_TYPE LIBPNG"
11054     AC_MSG_RESULT([no])
11056 AC_SUBST(SYSTEM_LIBPNG)
11058 dnl ===================================================================
11059 dnl Check for runtime JVM search path
11060 dnl ===================================================================
11061 if test "$SOLAR_JAVA" != ""; then
11062     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11063     if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11064         AC_MSG_RESULT([yes])
11065         if ! test -d "$with_jvm_path"; then
11066             AC_MSG_ERROR(["$with_jvm_path" not a directory])
11067         fi
11068         if ! test -d "$with_jvm_path"jvm; then
11069             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11070         fi
11071         JVM_ONE_PATH_CHECK="$with_jvm_path"
11072         AC_SUBST(JVM_ONE_PATH_CHECK)
11073     else
11074         AC_MSG_RESULT([no])
11075     fi
11078 dnl ===================================================================
11079 dnl Test for the presence of Ant and that it works
11080 dnl ===================================================================
11082 if test "$SOLAR_JAVA" != ""; then
11083     ANT_HOME=; export ANT_HOME
11084     WITH_ANT_HOME=; export WITH_ANT_HOME
11085     if test -z "$with_ant_home"; then
11086         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11087     else
11088         if test "$_os" = "WINNT"; then
11089             with_ant_home=`cygpath -u "$with_ant_home"`
11090         fi
11091         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11092         WITH_ANT_HOME=$with_ant_home
11093         ANT_HOME=$with_ant_home
11094     fi
11096     if test -z "$ANT"; then
11097         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11098     else
11099         # resolve relative or absolute symlink
11100         while test -h "$ANT"; do
11101             a_cwd=`pwd`
11102             a_basename=`basename "$ANT"`
11103             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11104             cd "`dirname "$ANT"`"
11105             cd "`dirname "$a_script"`"
11106             ANT="`pwd`"/"`basename "$a_script"`"
11107             cd "$a_cwd"
11108         done
11110         AC_MSG_CHECKING([if $ANT works])
11111         cat > conftest.java << EOF
11112         public class conftest {
11113             int testmethod(int a, int b) {
11114                     return a + b;
11115             }
11116         }
11119         cat > conftest.xml << EOF
11120         <project name="conftest" default="conftest">
11121         <target name="conftest">
11122             <javac srcdir="." includes="conftest.java">
11123             </javac>
11124         </target>
11125         </project>
11128         oldJAVA_HOME=$JAVA_HOME
11129         if test "$JAVACISGCJ" = "yes"; then
11130             JAVA_HOME=; export JAVA_HOME
11131             ant_gcj="-Dbuild.compiler=gcj"
11132         fi
11133         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11134         if test $? = 0 -a -f ./conftest.class; then
11135             AC_MSG_RESULT([Ant works])
11136             if test -z "$WITH_ANT_HOME"; then
11137                 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11138                 if test -z "$ANT_HOME"; then
11139                     ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11140                 fi
11141             else
11142                 ANT_HOME="$WITH_ANT_HOME"
11143             fi
11144         else
11145             echo "configure: Ant test failed" >&5
11146             cat conftest.java >&5
11147             cat conftest.xml >&5
11148             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
11149             ANT_HOME=""
11150             echo "Ant does not work - Some Java projects will not build!" >>warn
11151         fi
11152         JAVA_HOME=$oldJAVA_HOME
11153         rm -f conftest* core core.* *.core
11154     fi
11155     if test -z "$ANT_HOME"; then
11156         ANT_HOME="NO_ANT_HOME"
11157     else
11158         PathFormat "$ANT_HOME"
11159         ANT_HOME="$formatted_path"
11160         PathFormat "$ANT"
11161         ANT="$ANT"
11162     fi
11163     AC_SUBST(ANT_HOME)
11164     AC_SUBST(ANT)
11166     dnl Checking for ant.jar
11167     if test "$ANT_HOME" != "NO_ANT_HOME"; then
11168         AC_MSG_CHECKING([Ant lib directory])
11169         if test -f $ANT_HOME/lib/ant.jar; then
11170             ANT_LIB="$ANT_HOME/lib"
11171         else
11172             if test -f $ANT_HOME/ant.jar; then
11173                 ANT_LIB="$ANT_HOME"
11174             else
11175                 if test -f /usr/share/java/ant.jar; then
11176                     ANT_LIB=/usr/share/java
11177                 else
11178                     if test -f /usr/share/ant-core/lib/ant.jar; then
11179                         ANT_LIB=/usr/share/ant-core/lib
11180                     else
11181                         if test -f $ANT_HOME/lib/ant/ant.jar; then
11182                             ANT_LIB="$ANT_HOME/lib/ant"
11183                         else
11184                             if test -f /usr/share/lib/ant/ant.jar; then
11185                                 ANT_LIB=/usr/share/lib/ant
11186                             else
11187                                 AC_MSG_ERROR([Ant libraries not found!])
11188                             fi
11189                         fi
11190                     fi
11191                 fi
11192             fi
11193         fi
11194         PathFormat "$ANT_LIB"
11195         ANT_LIB="$formatted_path"
11196         AC_MSG_RESULT([Ant lib directory found.])
11197     fi
11198     AC_SUBST(ANT_LIB)
11200     ant_minver=1.6.0
11201     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11203     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11204     ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11205     ant_version_major=`echo $ant_version | cut -d. -f1`
11206     ant_version_minor=`echo $ant_version | cut -d. -f2`
11207     echo "configure: ant_version $ant_version " >&5
11208     echo "configure: ant_version_major $ant_version_major " >&5
11209     echo "configure: ant_version_minor $ant_version_minor " >&5
11210     if test "$ant_version_major" -ge "2"; then
11211         AC_MSG_RESULT([yes, $ant_version])
11212     elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11213         AC_MSG_RESULT([yes, $ant_version])
11214     else
11215         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11216     fi
11218     if test "$ENABLE_MEDIAWIKI" = "YES"; then
11219         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
11220         rm -rf confdir
11221         mkdir confdir
11222         cat > conftest.java << EOF
11223             public class conftest {
11224                 int testmethod(int a, int b) {
11225                     return a + b;
11226                 }
11227             }
11230         cat > conftest.xml << EOF
11231             <project name="conftest" default="conftest">
11232             <target name="conftest" depends="copytest">
11233                 <javac srcdir="." includes="conftest.java">
11234                 </javac>
11235             </target>
11236             <target name="copytest">
11237                  <copy todir="confdir">
11238                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
11239                  <filterset/>
11240                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
11241                  </copy>
11242             </target>
11243             </project>
11246         if test "$JAVACISGCJ" = "yes"; then
11247             JAVA_HOME=; export JAVA_HOME
11248             ant_gcj="-Dbuild.compiler=gcj"
11249         fi
11250         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11251         if test $? = 0 -a -f ./conftest.class; then
11252             AC_MSG_RESULT([yes])
11253             rm -rf confdir
11254         else
11255             echo "configure: Ant test failed" >&5
11256             cat conftest.java >&5
11257             cat conftest.xml >&5
11258             rm -rf confdir
11259             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
11260         fi
11261     fi
11262     rm -f conftest* core core.* *.core
11265 OOO_JUNIT_JAR=
11266 if test "$SOLAR_JAVA" != "" -a "$with_junit" != "no"; then
11267     AC_MSG_CHECKING([for JUnit 4])
11268     if test "$with_junit" = "yes"; then
11269         if test -e /usr/share/java/junit4.jar; then
11270             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11271         else
11272            if test -e /usr/share/lib/java/junit.jar; then
11273               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11274            else
11275               OOO_JUNIT_JAR=/usr/share/java/junit.jar
11276            fi
11277         fi
11278     else
11279         OOO_JUNIT_JAR=$with_junit
11280     fi
11281     if test "$_os" = "WINNT"; then
11282         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11283     fi
11284     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
11285         grep org/junit/Before.class > /dev/null 2>&5
11286     if test $? -eq 0; then
11287         # check if either class-path entry is available for hamcrest or
11288         # it's bundled
11289         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
11290             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
11291             AC_MSG_RESULT([$OOO_JUNIT_JAR])
11292         else
11293             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
11294 provide a full junit jar or use --without-junit])
11295         fi
11296     else
11297         AC_MSG_RESULT([no])
11298         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
11299 location (/usr/share/java), specify its pathname via
11300 --with-junit=..., or disable it via --without-junit])
11301     fi
11302     if test $OOO_JUNIT_JAR != ""; then
11303         BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11304     fi
11306 AC_SUBST(OOO_JUNIT_JAR)
11308 if test "$enable_odk" = no; then
11309     unset DOXYGEN
11310 else
11311     if test "$with_doxygen" = no; then
11312         AC_MSG_CHECKING([for doxygen])
11313         unset DOXYGEN
11314         AC_MSG_RESULT([no])
11315     else
11316         if test "$with_doxygen" = yes; then
11317             AC_PATH_PROG([DOXYGEN], [doxygen])
11318             if test -z "$DOXYGEN"; then
11319                 AC_MSG_RESULT([no])
11320                 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
11321             fi
11322         else
11323             AC_MSG_CHECKING([for doxygen])
11324             DOXYGEN=$with_doxygen
11325             AC_MSG_RESULT([$DOXYGEN])
11326         fi
11327     fi
11329 AC_SUBST([DOXYGEN])
11331 dnl ===================================================================
11332 dnl Product version
11333 dnl ===================================================================
11334 AC_MSG_CHECKING([for product version])
11335 PRODUCTVERSION=AC_PACKAGE_VERSION
11336 AC_MSG_RESULT([$PRODUCTVERSION])
11337 AC_SUBST(PRODUCTVERSION)
11339 dnl ===================================================================
11340 dnl Dealing with l10n options
11341 dnl ===================================================================
11342 AC_MSG_CHECKING([which languages to be built])
11343 # get list of all languages
11344 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11345 # the sed command does the following:
11346 #   + if a line ends with a backslash, append the next line to it
11347 #   + adds " on the beginning of the value (after =)
11348 #   + adds " at the end of the value
11349 #   + removes en-US; we want to put it on the beginning
11350 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
11351 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
11352 ALL_LANGS="en-US $completelangiso"
11353 # check the configured localizations
11354 WITH_LANG="$with_lang"
11355 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
11356     AC_MSG_RESULT([en-US])
11357 else
11358     AC_MSG_RESULT([$WITH_LANG])
11359     GIT_REPO_NAMES="$GIT_REPO_NAMES translations"
11361 # check that the list is valid
11362 for lang in $WITH_LANG; do
11363     test "$lang" = "ALL" && continue;
11364     # need to check for the exact string, so add space before and after the list of all languages
11365     for vl in $ALL_LANGS; do
11366         if test "$vl" = "$lang"; then
11367            break;
11368         fi
11369     done
11370     if test "$vl" != "$lang"; then
11371         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
11372     fi
11373 done
11374 # list with substituted ALL
11375 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
11376 # this variable is used only by bin/distro-install-* helper scripts
11377 # they need a real list of languages
11378 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
11379 test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US" || BUILD_TYPE="$BUILD_TYPE TRANSLATIONS"
11380 AC_SUBST(ALL_LANGS)
11381 AC_SUBST(WITH_LANG)
11382 AC_SUBST(WITH_LANG_LIST)
11383 AC_SUBST(GIT_REPO_NAMES)
11386 PathFormat "$SRC_ROOT/translations"
11387 L10N_MODULE="$formatted_path"
11388 WITH_POOR_HELP_LOCALIZATIONS=
11389 if test -d "./translations"; then
11390     for l in `ls -1 translations/source`; do
11391         if test ! -d translations/source/$l/helpcontent2; then
11392             WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
11393         fi
11394     done
11396 AC_SUBST(L10N_MODULE)
11397 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
11399 dnl git-new-workdir
11400 dnl ===================================================================
11401 if test -n "${GIT_LINK_SRC}"; then
11402     for repo in ${GIT_REPO_NAMES}; do
11403         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
11404             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
11405         fi
11406     done
11408 AC_SUBST(GIT_LINK_SRC)
11410 AC_MSG_CHECKING([for custom 'intro' progress bar color])
11411 PROGRESSBARCOLOR=
11412 if test -z "$with_intro_progressbar_color"; then
11413    PROGRESSBARCOLOR="255,255,255"
11414    AC_MSG_RESULT([none])
11415 else
11416    PROGRESSBARCOLOR="$with_intro_progressbar_color"
11417    AC_MSG_RESULT([$PROGRESSBARCOLOR])
11419 AC_SUBST(PROGRESSBARCOLOR)
11421 AC_MSG_CHECKING([for custom 'intro' progress bar size])
11422 PROGRESSSIZE=
11423 if test -z "$with_intro_progressbar_size"; then
11424    PROGRESSSIZE="407,6"
11425    AC_MSG_RESULT([none])
11426 else
11427    PROGRESSSIZE="$with_intro_progressbar_size"
11428    AC_MSG_RESULT([$PROGRESSSIZE])
11430 AC_SUBST(PROGRESSSIZE)
11432 AC_MSG_CHECKING([for custom 'intro' progress bar position])
11433 PROGRESSPOSITION=
11434 if test -z "$with_intro_progressbar_position"; then
11435    PROGRESSPOSITION="61,317"
11436    AC_MSG_RESULT([none])
11437 else
11438    PROGRESSPOSITION="$with_intro_progressbar_position"
11439    AC_MSG_RESULT([$PROGRESSPOSITION])
11441 AC_SUBST(PROGRESSPOSITION)
11443 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
11444 PROGRESSFRAMECOLOR=
11445 if test -z "$with_intro_progressbar_frame_color"; then
11446    PROGRESSFRAMECOLOR="20,136,3"
11447    AC_MSG_RESULT([none])
11448 else
11449    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
11450    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
11452 AC_SUBST(PROGRESSFRAMECOLOR)
11454 AC_MSG_CHECKING([for custom 'intro' progress text color])
11455 PROGRESSTEXTCOLOR=
11456 if test -z "$with_intro_progressbar_text_color"; then
11457    PROGRESSTEXTCOLOR="255,255,255"
11458    AC_MSG_RESULT([none])
11459 else
11460    PROGRESSTEXTCOLOR="$with_intro_progressbar_text_color"
11461    AC_MSG_RESULT([$PROGRESSTEXTCOLOR])
11463 AC_SUBST(PROGRESSTEXTCOLOR)
11465 AC_MSG_CHECKING([for custom 'intro' progress text baseline])
11466 PROGRESSTEXTBASELINE=
11467 if test -z "$with_intro_progressbar_text_baseline"; then
11468    PROGRESSTEXTBASELINE="287"
11469    AC_MSG_RESULT([none])
11470 else
11471    PROGRESSTEXTBASELINE="$with_intro_progressbar_text_baseline"
11472    AC_MSG_RESULT([$PROGRESSTEXTBASELINE])
11474 AC_SUBST(PROGRESSTEXTBASELINE)
11476 AC_MSG_CHECKING([for alternative branding images directory])
11477 INTRO_BITMAP=
11478 ABOUT_BACKGROUND_SVG=
11479 FLAT_LOGO_SVG=
11480 STARTCENTER_LEFT_BITMAP=
11481 STARTCENTER_RIGHT_BITMAP=
11482 STARTCENTER_RTL_LEFT_BITMAP=
11483 STARTCENTER_RTL_RIGHT_BITMAP=
11484 STARTCENTER_SPACE_BITMAP=
11485 if test -z "$with_branding" -o "$with_branding" = "no"; then
11486     AC_MSG_RESULT([none])
11487 else
11488     INTRO_BITMAP="$with_branding/intro.png"
11489     FLAT_LOGO_SVG="$with_branding/flat_logo.svg"
11490     STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
11491     STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
11492     STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
11493     STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
11494     STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
11495     for i in $INTRO_BITMAP \
11496              $FLAT_LOGO_SVG \
11497              $STARTCENTER_LEFT_BITMAP \
11498              $STARTCENTER_RIGHT_BITMAP \
11499              $STARTCENTER_RTL_LEFT_BITMAP \
11500              $STARTCENTER_RTL_RIGHT_BITMAP \
11501              $STARTCENTER_SPACE_BITMAP; do
11502         if test ! -f $i; then
11503             AC_MSG_WARN([Required file $i does not exist!])
11504         fi
11505     done
11506     AC_MSG_RESULT([$with_branding])
11509 AC_MSG_CHECKING([for yet another 'intro' bitmap])
11510 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no"; then
11511     if test "$with_intro_bitmap" = "no"; then
11512         INTRO_BITMAP=
11513     fi
11514     AC_MSG_RESULT([none])
11515 else
11516     case "$with_intro_bitmap" in
11517     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
11518     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
11519     esac
11520     AC_MSG_RESULT([$INTRO_BITMAP])
11522 AC_SUBST(INTRO_BITMAP)
11524 AC_MSG_CHECKING([for yet another 'about' svg])
11525 if test -z "$with_about_background_svg" -o "$with_about_background_svg" = "no" ; then
11526     if test "$with_about_background_svg" = "no" ; then
11527         ABOUT_BACKGROUND_SVG=
11528     fi
11529     AC_MSG_RESULT([none])
11530 else
11531    case "$with_about_background_svg" in
11532    *.svg) ABOUT_BACKGROUND_SVG="$with_about_background_svg" ;;
11533    *)     AC_MSG_WARN([About background SVG should be a .svg file!]) ;;
11534    esac
11535    AC_MSG_RESULT([$ABOUT_BACKGROUND_SVG])
11537 AC_SUBST(ABOUT_BACKGROUND_SVG)
11539 AC_MSG_CHECKING([for yet another 'flat_logo' svg])
11540 if test -z "$with_flat_logo_svg" -o "$with_flat_logo_svg" = "no" ; then
11541     if test "$with_flat_logo_svg" = "no" ; then
11542         FLAT_LOGO_SVG=
11543     fi
11544     AC_MSG_RESULT([none])
11545 else
11546    case "$with_flat_logo_svg" in
11547    *.svg) FLAT_LOGO_SVG="$with_flat_logo_svg" ;;
11548    *)     AC_MSG_WARN([Flat logo SVG should be a .svg file!]) ;;
11549    esac
11550    AC_MSG_RESULT([$ABOUT_BITMAP])
11552 AC_SUBST(FLAT_LOGO_SVG)
11554 AC_MSG_CHECKING([for yet another 'start center left' bitmap])
11555 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no"; then
11556    if test "$with_startcenter_left_bitmap" = "no"; then
11557       STARTCENTER_LEFT_BITMAP=
11558    fi
11559    AC_MSG_RESULT([none])
11560 else
11561    case "$with_startcenter_left_bitmap" in
11562       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
11563       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11564    esac
11565    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
11567 AC_SUBST(STARTCENTER_LEFT_BITMAP)
11569 AC_MSG_CHECKING([for yet another 'start center right' bitmap])
11570 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no"; then
11571    if test "$with_startcenter_right_bitmap" = "no"; then
11572       STARTCENTER_RIGHT_BITMAP=
11573    fi
11574    AC_MSG_RESULT([none])
11575 else
11576    case "$with_startcenter_right_bitmap" in
11577       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
11578       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
11579    esac
11580    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
11582 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
11584 AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
11585 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no"; then
11586    if test "$with_startcenter_rtl_left_bitmap" = "no"; then
11587       STARTCENTER_RTL_LEFT_BITMAP=
11588    fi
11589    AC_MSG_RESULT([none])
11590 else
11591    case "$with_startcenter_rtl_left_bitmap" in
11592       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
11593       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
11594    esac
11595    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
11597 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
11599 AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
11600 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no"; then
11601    if test "$with_startcenter_rtl_right_bitmap" = "no"; then
11602       STARTCENTER_RTL_RIGHT_BITMAP=
11603    fi
11604    AC_MSG_RESULT([none])
11605 else
11606    case "$with_startcenter_rtl_right_bitmap" in
11607       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
11608       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
11609    esac
11610    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
11612 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
11614 AC_MSG_CHECKING([for yet another 'start center space' bitmap])
11615 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no"; then
11616    if test "$with_startcenter_space_bitmap" = "no"; then
11617       STARTCENTER_SPACE_BITMAP=
11618    fi
11619    AC_MSG_RESULT([none])
11620 else
11621    case "$with_startcenter_space_bitmap" in
11622       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
11623       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11624    esac
11625    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
11627 AC_SUBST(STARTCENTER_SPACE_BITMAP)
11629 OOO_VENDOR=
11630 AC_MSG_CHECKING([for vendor])
11631 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
11632     AC_MSG_RESULT([not set])
11633 else
11634     OOO_VENDOR="$with_vendor"
11635     AC_MSG_RESULT([$OOO_VENDOR])
11637 AC_SUBST(OOO_VENDOR)
11639 UNIXWRAPPERNAME=
11640 AC_MSG_CHECKING([for UNIX wrapper name])
11641 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes"; then
11642     AC_MSG_RESULT([not set])
11643 else
11644     UNIXWRAPPERNAME="$with_unix_wrapper"
11645     AC_MSG_RESULT([$UNIXWRAPPERNAME])
11647 AC_SUBST(UNIXWRAPPERNAME)
11649 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
11650 if test "$with_compat_oowrappers" = "yes"; then
11651     WITH_COMPAT_OOWRAPPERS=YES
11652     AC_MSG_RESULT(yes)
11653 else
11654     WITH_COMPAT_OOWRAPPERS=
11655     AC_MSG_RESULT(no)
11657 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
11659 AC_MSG_CHECKING([for product name])
11660 PRODUCTNAME=AC_PACKAGE_NAME
11661 AC_MSG_RESULT([$PRODUCTNAME])
11662 AC_SUBST(PRODUCTNAME)
11664 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
11665 AC_MSG_CHECKING([for install dirname])
11666 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
11667    INSTALLDIRNAME="$with_install_dirname"
11669 AC_MSG_RESULT([$INSTALLDIRNAME])
11670 AC_SUBST(INSTALLDIRNAME)
11672 AC_MSG_CHECKING([for prefix])
11673 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11674 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
11675 PREFIXDIR="$prefix"
11676 AC_MSG_RESULT([$PREFIXDIR])
11677 AC_SUBST(PREFIXDIR)
11679 AC_MSG_CHECKING([for libdir])
11680 LIBDIR=[$(eval echo $(eval echo $libdir))]
11681 AC_MSG_RESULT([$LIBDIR])
11682 AC_SUBST(LIBDIR)
11684 AC_MSG_CHECKING([for data dir])
11685 DATADIR=[$(eval echo $(eval echo $datadir))]
11686 AC_MSG_RESULT([$DATADIR])
11687 AC_SUBST(DATADIR)
11689 AC_MSG_CHECKING([for man dir])
11690 MANDIR=[$(eval echo $(eval echo $mandir))]
11691 AC_MSG_RESULT([$MANDIR])
11692 AC_SUBST(MANDIR)
11694 AC_MSG_CHECKING([for doc dir])
11695 DOCDIR=[$(eval echo $(eval echo $docdir))]
11696 AC_MSG_RESULT([$DOCDIR])
11697 AC_SUBST(DOCDIR)
11699 AC_MSG_CHECKING([for install dir])
11700 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
11701 AC_MSG_RESULT([$INSTALLDIR])
11702 AC_SUBST(INSTALLDIR)
11704 AC_MSG_CHECKING([for dev-install dir])
11705 DEVINSTALLDIR="$OUTDIR/installation"
11706 AC_MSG_RESULT([$DEVINSTALLDIR])
11707 AC_SUBST(DEVINSTALLDIR)
11709 # ===================================================================
11710 # De- or increase default verbosity of build process
11711 # ===================================================================
11712 AC_MSG_CHECKING([build verbosity])
11713 if test -n "$enable_verbose"; then
11714     if test "$enable_verbose" = "yes"; then
11715         VERBOSE="TRUE"
11716         AC_MSG_RESULT([high])
11717     fi
11718     if test "$enable_verbose" = "no"; then
11719         VERBOSE="FALSE"
11720         AC_MSG_RESULT([low])
11721     fi
11722 else
11723     AC_MSG_RESULT([not set])
11725 AC_SUBST(VERBOSE)
11727 dnl ===================================================================
11728 dnl Use zenity during build
11729 dnl ===================================================================
11730 AC_MSG_CHECKING([whether to use zenity during build])
11731 if test "$enable_zenity" = "yes"; then
11732     AC_MSG_RESULT([yes])
11733     AC_PATH_PROGS( ZNTY, zenity )
11734     if test -z "$ZNTY"; then
11735         ENABLE_ZENITY=FALSE
11736     else
11737         ENABLE_ZENITY=TRUE
11738     fi
11739 else
11740     ENABLE_ZENITY=FALSE
11741     AC_MSG_RESULT([no])
11743 AC_SUBST(ENABLE_ZENITY)
11746 dnl ===================================================================
11747 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
11748 dnl --enable-dependency-tracking configure option
11749 dnl ===================================================================
11750 AC_MSG_CHECKING([whether to enable dependency tracking])
11751 if test "$enable_dependency_tracking" = "no"; then
11752     nodep=TRUE
11753     AC_MSG_RESULT([no])
11754 else
11755     AC_MSG_RESULT([yes])
11757 AC_SUBST(nodep)
11759 dnl ===================================================================
11760 dnl Number of CPUs to use during the build
11761 dnl ===================================================================
11762 AC_MSG_CHECKING([for number of processors to use])
11763 if test -n "$with_num_cpus"; then
11764     BUILD_NCPUS=$with_num_cpus
11765 else
11766     case `uname -s` in
11768     Darwin|FreeBSD|NetBSD|OpenBSD)
11769         BUILD_NCPUS=`sysctl -n hw.ncpu`
11770         ;;
11772     Linux)
11773         BUILD_NCPUS=`getconf _NPROCESSORS_ONLN`
11774         ;;
11775     # what else than above does profit here *and* has /proc?
11776     *)
11777         BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
11778         ;;
11779     esac
11781     # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
11782     # unexpected format, 'wc -l' will have returned 0.
11783     if test "$BUILD_NCPUS" -eq 0; then
11784         BUILD_NCPUS=1
11785     fi
11787 AC_MSG_RESULT([$BUILD_NCPUS])
11788 AC_SUBST(BUILD_NCPUS)
11791 # Set up ILIB for MSVC build
11793 if test "$build_os" = "cygwin"; then
11794     ILIB=".;${SOLARVER}/$INPATH/lib"
11795     if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
11796         ILIB="$ILIB;$JAVA_HOME/lib"
11797     fi
11798     if test "$CL_X64" = "TRUE"; then
11799         ILIB="$ILIB;$COMPATH/lib/amd64"
11800         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib64"
11801     else
11802         ILIB="$ILIB;$COMPATH/lib"
11803         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
11804     fi
11805     ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
11807     if test "$ENABLE_DIRECTX" = "TRUE"; then
11808         ILIB="$ILIB;$DIRECTXSDK_LIB"
11809     fi
11810     AC_SUBST(ILIB)
11814 # ===================================================================
11815 # Creating bigger shared library to link against
11816 # ===================================================================
11817 AC_MSG_CHECKING([whether to create a big library for better performance])
11818 MERGELIBS=
11819 if test $enable_mergelibs = yes; then
11820     if test $WITH_BINFILTER = YES; then
11821         add_warning "--enable-mergelibs conflicts with --enable-binfilter. Disabling mergelibs."
11822         AC_MSG_RESULT([no])
11823     else
11824         if test $_os != Linux -a $_os != Android; then
11825             add_warning "--enable-mergelibs is not tested for this platform"
11826         fi
11827         MERGELIBS="TRUE"
11828         AC_MSG_RESULT([yes])
11829     fi
11830 else
11831     AC_MSG_RESULT([no])
11833 AC_SUBST(MERGELIBS)
11835 dnl ===================================================================
11836 dnl Number of parallel jobs to be executed by dmake
11837 dnl ===================================================================
11838 AC_MSG_CHECKING([for maximum of jobs per processor])
11839 BUILD_MAX_JOBS="1"
11840 if test "$with_max_jobs" != ""; then
11841     BUILD_MAX_JOBS="$with_max_jobs"
11842 else
11843     if test "$enable_icecream" = "yes"; then
11844         BUILD_MAX_JOBS="10"
11845     fi
11847 AC_MSG_RESULT([$BUILD_MAX_JOBS])
11848 AC_SUBST(BUILD_MAX_JOBS)
11850 # =====================================================================
11851 # determine the parallelism for gnu make
11852 # =====================================================================
11853 AC_MSG_CHECKING([for maximum parallelism for gmake])
11854 if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS; then
11855     GMAKE_PARALLELISM="$BUILD_MAX_JOBS"
11856 else
11857     GMAKE_PARALLELISM="$BUILD_NCPUS"
11859 GMAKE_MODULE_PARALLELISM="$BUILD_MAX_JOBS"
11860 if test "$no_parallelism_make" = "YES"; then
11861     if test -z "$with_num_cpus"; then
11862         GMAKE_PARALLELISM="1";
11863         if test $GMAKE_MODULE_PARALLELISM -gt 1; then
11864             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
11865             if test -z "$with_num_cpus"; then
11866                 echo "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this." >> warn
11867             fi
11868             GMAKE_MODULE_PARALLELISM="1"
11869         fi
11870     else
11871         GMAKE_PARALLELISM="$BUILD_NCPUS";
11872         echo "make 3.81 is prone to crashes with parallelism > 1. Since --with-num-cpus was explicitly given, it is honored, but do not complain when make segfault on you." >> warn
11873     fi
11876 # GMAKE_PARALLELISM is used in tail_build
11877 # GMAKE_MODULE_PARALLELISM is used when building individual gbuildified module
11878 AC_MSG_RESULT([per module:$GMAKE_MODULE_PARALLELISM, for tail_build:$GMAKE_PARALLELISM])
11879 AC_SUBST(GMAKE_PARALLELISM)
11880 AC_SUBST(GMAKE_MODULE_PARALLELISM)
11882 dnl ===================================================================
11883 dnl Setting up the environment.
11884 dnl ===================================================================
11885 echo "setting up the build environment variables..."
11887 AC_SUBST(COMPATH)
11889 if test "$build_os" = "cygwin"; then
11890     if test "$DISABLE_ACTIVEX" = "YES"; then
11891         ATL_LIB="$WINDOWS_SDK_HOME/lib"; # Doesn't exist for VSE
11892         ATL_INCLUDE="$WINDOWS_SDK_HOME/include".$ds."atl";
11893         MFC_LIB="$WINDOWS_SDK_HOME/lib"; # Doesn't exist for VSE
11894         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc";
11895     else
11896         ATL_LIB="$COMPATH/atlmfc/lib";
11897         ATL_INCLUDE="$COMPATH/atlmfc/include";
11898         MFC_LIB="$COMPATH/atlmfc/lib";
11899         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc";
11900     fi
11901     if test "$CL_X64" = "YES"; then
11902         ATL_LIB="$ATL_LIB/amd64"
11903         MFC_LIB="$MFC_LIB/amd64"
11904     fi
11905     PathFormat "/usr/bin/grep.exe"
11906     WIN_GREP="$formatted_path"
11907     PathFormat "/usr/bin/find.exe"
11908     WIN_FIND="$formatted_path"
11909     PathFormat "/usr/bin/ls.exe"
11910     WIN_LS="$formatted_path"
11911     PathFormat "/usr/bin/touch.exe"
11912     WIN_TOUCH="$formatted_path"
11915 AC_SUBST(ATL_INCLUDE)
11916 AC_SUBST(ATL_LIB)
11917 AC_SUBST(MFC_INCLUDE)
11918 AC_SUBST(MFC_LIB)
11919 AC_SUBST(WIN_FIND)
11920 AC_SUBST(WIN_GREP)
11921 AC_SUBST(WIN_LS)
11922 AC_SUBST(WIN_TOUCH)
11924 AC_SUBST(BUILD_TYPE)
11926 AC_SUBST(SOLARINC)
11927 AC_SUBST(SOLARLIB)
11929 if test -z "$SOLARINC_FOR_BUILD"; then
11930     SOLARINC_FOR_BUILD="$SOLARINC"
11932 AC_SUBST(SOLARINC_FOR_BUILD)
11934 if test -z "$SOLARLIB_FOR_BUILD"; then
11935     SOLARLIB_FOR_BUILD="$SOLARLIB"
11937 AC_SUBST(SOLARLIB_FOR_BUILD)
11939 PathFormat "$PERL"
11940 PERL="$formatted_path"
11941 AC_SUBST(PERL)
11943 if test "$build_os" = "cygwin"; then
11944     TEMP_DIRECTORY=`cygpath -m "/tmp"`
11945     if test -n "$TMP"; then
11946         TMP_DIRECTORY="$TMP"
11947     else
11948         TMP_DIRECTORY="$TEMP_DIRECTORY"
11949     fi
11950 else
11951     if test -n "$TMPDIR"; then
11952         TEMP_DIRECTORY="$TMPDIR"
11953     else
11954         TEMP_DIRECTORY="/tmp"
11955     fi
11957 AC_SUBST(TEMP_DIRECTORY)
11958 AC_SUBST(TMP_DIRECTORY)
11960 # setup the PATH for the environment
11961 if test -n "$LO_PATH_FOR_BUILD"; then
11962     LO_PATH="$LO_PATH_FOR_BUILD"
11963 else
11964     LO_PATH="$PATH"
11966     case "$host_os" in
11968     aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
11969         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
11970             pathmunge "$JAVA_HOME/bin" "after"
11971         fi
11972         ;;
11974     cygwin*)
11975         pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
11976         pathmunge "$ASM_HOME" "before"
11977         pathmunge "$WINDOWS_SDK_HOME/bin" "before"
11978         pathmunge "$CSC_PATH" "before"
11979         pathmunge "$MIDL_PATH" "before"
11980         pathmunge "$MSPDB_PATH" "before"
11981         if test "$CL_X64" = "TRUE"; then
11982             pathmunge "$COMPATH/bin/amd64" "before"
11983         else
11984             pathmunge "$COMPATH/bin" "before"
11985         fi
11986         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
11987             if test -d "$JAVA_HOME/jre/bin/client"; then
11988                 pathmunge "$JAVA_HOME/jre/bin/client" "before"
11989             fi
11990             if test -d "$JAVA_HOME/jre/bin/hotspot"; then
11991                 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
11992             fi
11993             pathmunge "$JAVA_HOME/bin" "before"
11994         fi
11995         ;;
11997     solaris*)
11998         pathmunge "/usr/css/bin" "before"
11999         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12000             pathmunge "$JAVA_HOME/bin" "after"
12001         fi
12002         ;;
12003     esac
12005     pathmunge "$SRC_ROOT/solenv/$OUTPATH/bin" "before"
12006     pathmunge "$SRC_ROOT/solenv/bin" "before"
12007     pathmunge "." "before"
12010 AC_SUBST(LO_PATH)
12012 # make sure config.guess is +x; we execute config.guess, so it has to be so;
12013 chmod +x ./config.guess
12015 dnl Setting up the post_download check script
12016 dnl Using autoconf here, so that the migration from the previous state
12017 dnl (checks for the additional Windows downloads were directly in
12018 dnl configure.in) is as easy as possible
12019 echo "setting up the post_download check script"
12020 autoconf post_download.in > post_download
12021 chmod +x post_download
12023 # Generate a configuration timestamp we can use for deps
12024 if test -f config_host.mk; then
12025     mv -f config_host.mk config_host.mk.last
12026 else
12027     echo > config_host.mk.last
12030 AC_CONFIG_FILES([config_host.mk ooo.lst bin/repo-list])
12031 AC_OUTPUT
12033 # touch the config timestamp file set_soenv.stamp
12034 if test ! -f set_soenv.stamp; then
12035     echo > set_soenv.stamp
12036 elif diff config_host.mk config_host.mk.last >/dev/null 2>&1; then
12037     echo "Configuration unchanged - avoiding scp2 stamp update"
12038 else
12039     echo > set_soenv.stamp
12043 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12044 cat << _EOS
12045 ****************************************************************************
12046 WARNING:
12047 Your make version is known to be horribly slow, and hard to debug
12048 problems with. To get a reasonably functional make please do:
12050 to install a pre-compiled binary make for cygwin
12052 mkdir -p /opt/lo/bin
12053 cd /opt/lo/bin
12054 wget http://dev-www.libreoffice.org/bin/cygwin/make
12055 chmod +x make
12057 to install from source:
12058 place yourself in a working directory of you choice.
12060 git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
12061 cd dev-tools/make-3.82-gbuild
12062 ./configure --prefix=/opt/lo
12063 make
12064 sudo make install
12066 Then re-run autogen.sh
12068 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12069 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12071 _EOS
12074 cat << _EOF
12075 ****************************************************************************
12076 To build, issue:
12077 $GNUMAKE
12079 To install when the build is finished, issue:
12080 $GNUMAKE install
12082 If you want to develop LibreOffice, you might prefer:
12083 $GNUMAKE dev-install
12085 If you want to run the smoketest, issue:
12086 $GNUMAKE check
12088 ATTENTION: Env.Host.sh and Env.Build.sh are no more.
12089 The environment is now in config_host.mk and config_build.mk (for cross-compile)
12090 You do not need to source them, even for partial build.
12091 run: make help
12092 for details
12094 _EOF
12096 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: