Version 3.5.4.2, tag libreoffice-3.5.4.2 (3.5.4-rc2)
[LibreOffice.git] / configure.in
blobd01e82ff8f1895e7a8f0ae762894319e33f7cc98
1 dnl -*- Mode: Autoconf; tab-width: 8; 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.5],[],[],[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 MINGW_EXTERNAL_DLLS=""
16 if test -n "$SOLARENV" ; then
17     AC_MSG_ERROR([You have sourced Env.Host.sh in this shell.  This may lead to trouble, please run in a fresh (login) shell.])
20 echo "********************************************************************"
21 echo "*"
22 echo "*   Running ${PACKAGE_NAME} build configuration."
23 echo "*"
24 echo "********************************************************************"
25 echo ""
27 dnl ===================================================================
28 dnl checks build and host OSes
29 dnl do this before argument processing to allow for platform dependent defaults
30 dnl ===================================================================
31 AC_CANONICAL_HOST
33 if test "$cross_compiling" = "yes"; then
34     CROSS_COMPILING=YES
35 else
36     CROSS_COMPILING=
37     BUILD_TYPE="$BUILD_TYPE NATIVE"
39 AC_SUBST(CROSS_COMPILING)
41 if test "$build_os" = "cygwin"; then
42     EXEEXT_FOR_BUILD=.exe
43     SRC_ROOT=`pwd`
44     SRC_ROOT=`cygpath -d "$SRC_ROOT"`
45     SRC_ROOT=`cygpath -u "$SRC_ROOT"`
46 else
47     EXEEXT_FOR_BUILD=
48     SRC_ROOT=`pwd`
50 AC_SUBST(SRC_ROOT)
51 AC_SUBST(EXEEXT_FOR_BUILD)
53 cat /dev/null > warn
55 if test "z$EUID" = "z0" -a "z`uname -o 2>/dev/null`" = "zCygwin"; then
56     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
59 # need sed in os checks...
60 AC_PATH_PROGS(SED, sed)
61 if test -z "$SED"; then
62     AC_MSG_ERROR([install sed to run this script])
65 dnl ===================================================================
66 dnl The following is a list of supported systems.
67 dnl Sequential to keep the logic very simple
68 dnl These values may be checked and reset later.
69 dnl ===================================================================
70 #defaults unless the os test overrides this:
71 test_randr=yes
72 test_xrender=yes
73 test_cups=yes
74 test_fontconfig=yes
76 case "$host_os" in
78 solaris*)
79     test_gtk=yes
80     build_gstreamer=yes
81     test_kde=yes
82     test_freetype=yes
83     test_gstreamer=yes
84     _os=SunOS
86     dnl ===========================================================
87     dnl Check whether we're using Solaris 10 - SPARC or Intel.
88     dnl ===========================================================
89     AC_MSG_CHECKING([the Solaris operating system release])
90     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
91     if test "$_os_release" -lt "10"; then
92         AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
93     else
94         AC_MSG_RESULT([ok ($_os_release)])
95     fi
97     dnl Check whether we're using a SPARC or i386 processor
98     AC_MSG_CHECKING([the processor type])
99     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
100         AC_MSG_RESULT([ok ($host_cpu)])
101     else
102         AC_MSG_ERROR([only SPARC and i386 processors are supported])
103     fi
104     ;;
106 linux-gnu*|k*bsd*-gnu*)
107     test_gtk=yes
108     build_gstreamer=yes
109     test_kde=yes
110     test_kde4=yes
111     test_freetype=yes
112     test_unix_quickstarter=yes
113     _os=Linux
114     ;;
116 gnu)
117     test_randr=no
118     test_xrender=no
119     _os=GNU
120      ;;
122 cygwin*|interix*|mingw32*)
124     # When building on Windows normally with MSVC under Cygwin,
125     # configure thinks that the host platform (the platform the
126     # built code will run on) is Cygwin, even if it obviously is
127     # Windows, which in Autoconf terminology is called
128     # "mingw32". (Which is misleading as MinGW is the name of the
129     # tool-chain, not an operating system.)
131     # Somewhat confusing, yes. But this configure script doesn't
132     # look at $host etc that much, it mostly uses its own $_os
133     # variable, set here in this case statement.
135     # When cross-compiling to Windows from Unix, the host platform
136     # is "mingw32" (because in that case it is the MinGW
137     # tool-chain that is used).
139     test_cups=no
140     test_randr=no
141     test_xrender=no
142     test_freetype=no
143     test_fontconfig=no
144     _os=WINNT
146     # If the host OS matches "mingw32*", that means we are using the
147     # MinGW cross-compiler, because we don't see the point in building
148     # LibreOffice using MinGW on Windows. If you want to build on
149     # Windows, use MSVC. If you want to use MinGW, surely you want to
150     # cross-compile (from Linux or some other Unix).
152     case "$host_os" in
153     mingw32*)
154         WITH_MINGW=yes
155         if test -z "$CC" ; then
156             CC="$host_cpu-$host_vendor-$host_os-gcc"
157         fi
158         if test -z "$CXX" ; then
159             CXX="$host_cpu-$host_vendor-$host_os-g++"
160         fi
161         ;;
162     esac
164     if test "$build_os" = "cygwin" ; then
165         SCPDEFS="$SCPDEFS -D_MSC_VER"
166     fi
167     ;;
169 darwin*) # Mac OS X or iOS
170     test_gtk=yes
171     test_randr=no
172     test_xrender=no
173     test_freetype=no
174     test_fontconfig=no
175     if test "$host_cpu" = "arm"; then
176         _os=iOS
177         test_gtk=no
178         test_cups=no
179     else
180         _os=Darwin
181     fi
182     enable_systray=no
185 freebsd*)
186     test_gtk=yes
187     build_gstreamer=yes
188     test_kde=yes
189     test_kde4=yes
190     test_freetype=yes
191     AC_MSG_CHECKING([the FreeBSD operating system release])
192     if test -n "$with_os_version"; then
193         OSVERSION="$with_os_version"
194     else
195         OSVERSION=`/sbin/sysctl -n kern.osreldate`
196     fi
197     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
198     AC_MSG_CHECKING([which thread library to use])
199     if test "$OSVERSION" -lt "500016"; then
200         PTHREAD_CFLAGS="-D_THREAD_SAFE"
201         PTHREAD_LIBS="-pthread"
202     elif test "$OSVERSION" -lt "502102"; then
203         PTHREAD_CFLAGS="-D_THREAD_SAFE"
204         PTHREAD_LIBS="-lc_r"
205     else
206         PTHREAD_CFLAGS=""
207         PTHREAD_LIBS="-pthread"
208     fi
209     AC_MSG_RESULT([$PTHREAD_LIBS])
210     _os=FreeBSD
211     ;;
213 *netbsd*)
214     test_gtk=yes
215     build_gstreamer=yes
216     test_kde=no
217     test_kde4=yes
218     test_freetype=yes
219     PTHREAD_LIBS="-pthread -lpthread"
220     _os=NetBSD
221     ;;
223 aix*)
224     test_randr=no
225     test_freetype=yes
226     PTHREAD_LIBS=-pthread
227     _os=AIX
228     ;;
230 openbsd*)
231     test_gtk=yes
232     test_kde=yes
233     test_freetype=yes
234     PTHREAD_CFLAGS="-D_THREAD_SAFE"
235     PTHREAD_LIBS="-pthread"
236     _os=OpenBSD
237     ;;
239 dragonfly*)
240     test_gtk=yes
241     build_gstreamer=yes
242     test_kde=yes
243     test_kde4=yes
244     test_freetype=yes
245     PTHREAD_LIBS="-pthread"
246     _os=DragonFly
247     ;;
249 linux-androideabi*)
250     build_gstreamer=no
251     test_cups=no
252     test_fontconfig=no
253     test_freetype=no
254     test_gtk=no
255     test_kde=no
256     test_kde4=no
257     test_randr=no
258     test_xrender=no
259     test_unix_quickstarter=no
260     _os=Android
262     # Make sure env vars pointing to where to find the cross-build
263     # toolchain are set. There aren't really any sensible
264     # guesstimates.
265     for var in CC CXX AR NM OBJDUMP RANLIB STRIP; do
266         if test -z "`eval echo '$'$var`"; then
267             AC_MSG_ERROR([You need to set the $var environment variable in a cross-compilation for Android. See README.cross for an example.])
268         fi
269     done
270     ;;
273     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
274     ;;
275 esac
277 if test "$_os" = "AIX"; then
278     AC_PATH_PROG(GAWK, gawk)
279     if test -z "$GAWK"; then
280         AC_MSG_ERROR([gawk not found in \$PATH])
281     fi
284 AC_SUBST(WITH_MINGW)
285 AC_SUBST(OSVERSION)
286 AC_SUBST(PTHREAD_CFLAGS)
287 AC_SUBST(PTHREAD_LIBS)
290 ###############################################################################
291 # Extensions switches --enable/--disable
292 ###############################################################################
293 # By default these should be enabled unless having extra dependencies.
294 # If there is extra dependency over configure options then the enable should
295 # be automagic based on wether the requiring feature is enabled or not.
296 # All this options change anything only with --enable-extension-integration.
297 AC_ARG_ENABLE(extension-integration,
298     AS_HELP_STRING([--disable-extension-integration],
299         [Disable integration of the builded extensions to the installer of the
300          product. Use this switch to disable the integration.])
303 AC_ARG_ENABLE(ext-barcode,
304     AS_HELP_STRING([--enable-ext-barcode],
305         [Enable the Barcode extension.])
308 AC_ARG_ENABLE(ext-diagram,
309     AS_HELP_STRING([--enable-ext-diagram],
310         [Enable the SmART Gallery (Diagram) extension.])
313 AC_ARG_ENABLE(ext-google-docs,
314     AS_HELP_STRING([--enable-ext-google-docs],
315         [Enable the Google Documents extension.])
318 AC_ARG_ENABLE(ext-hunart,
319     AS_HELP_STRING([--enable-ext-hunart],
320         [Enable the Hungarian Cross-reference Toolbar extension.])
323 AC_ARG_ENABLE(ext-languagetool,
324     AS_HELP_STRING([--enable-ext-languagetool],
325         [Enable the LanguageTool extension.])
328 AC_ARG_ENABLE(ext-mysql-connector,
329     AS_HELP_STRING([--enable-ext-mysql-connector],
330         [Enable the build of the MySQL Connector extension.])
333 AC_ARG_ENABLE(ext-nlpsolver,
334     AS_HELP_STRING([--enable-ext-nlpsolver],
335         [Enable the NLPSolver extension.])
338 AC_ARG_ENABLE(ext-ct2n,
339     AS_HELP_STRING([--enable-ext-ct2n],
340         [Enable the ConvertTextToNumber extension.])
343 AC_ARG_ENABLE(ext-numbertext,
344     AS_HELP_STRING([--enable-ext-numbertext],
345         [Enable the Numbertext extension.])
348 AC_ARG_ENABLE(ext-oooblogger,
349     AS_HELP_STRING([--enable-ext-oooblogger],
350         [Enable the OOo Blogger extension.])
353 AC_ARG_ENABLE(ext-pdfimport,
354     AS_HELP_STRING([--disable-ext-pdfimport],
355         [Disable the PDF Import extension.])
358 AC_ARG_ENABLE(ext-presenter-console,
359     AS_HELP_STRING([--disable-ext-presenter-console],
360         [Disable the Presenter Console extension.])
363 AC_ARG_ENABLE(ext-presenter-minimizer,
364     AS_HELP_STRING([--disable-ext-presenter-minimizer],
365         [Disable the Presentation Minimizer extension.])
368 AC_ARG_ENABLE(ext-report-builder,
369     AS_HELP_STRING([--disable-ext-report-builder],
370         [Disable the Report Builder extension.])
373 AC_ARG_ENABLE(ext-scripting-beanshell,
374     AS_HELP_STRING([--enable-ext-scripting-beanshell],
375         [Enable support for scripts in BeanShell.])
378 AC_ARG_ENABLE(ext-scripting-javascript,
379     AS_HELP_STRING([--enable-ext-scripting-javascript],
380         [Enable support for scripts in JavaScript.])
383 AC_ARG_ENABLE(ext-typo,
384     AS_HELP_STRING([--enable-ext-typo],
385         [Enable the Typography Toolbar extension.])
388 AC_ARG_ENABLE(ext-validator,
389     AS_HELP_STRING([--enable-ext-validator],
390         [Enable the Validator extension.])
393 AC_ARG_ENABLE(ext-watch-window,
394     AS_HELP_STRING([--enable-ext-watch-window],
395         [Enable the Watch Window extension to Calc.])
398 AC_ARG_ENABLE(ext-wiki-publisher,
399     AS_HELP_STRING([--enable-ext-wiki-publisher],
400         [Enable the Wiki Publisher extension.])
402 ###############################################################################
404 dnl ---------- *** ----------
406 AC_ARG_ENABLE(mergelibs,
407     AS_HELP_STRING([--enable-mergelibs],
408         [Enables linking of big merged library used for better performance.])
411 AC_ARG_ENABLE(graphite,
412     AS_HELP_STRING([--enable-graphite],
413         [Enables the compilation of Graphite smart font rendering.])
416 AC_ARG_ENABLE(ldap,
417     AS_HELP_STRING([--disable-ldap],
418         [Disables the use of LDAP backend via Netscape/Mozilla or OpenLDAP LDAP SDK])
421 AC_ARG_ENABLE(fetch-external,
422     AS_HELP_STRING([--disable-fetch-external],
423         [Disables fetching external tarballs from web sources.])
426 AC_ARG_ENABLE(lockdown,
427     AS_HELP_STRING([--disable-lockdown],
428         [Disables the gconf integration work in LibreOffice.]),
431 AC_ARG_ENABLE(vba,
432     AS_HELP_STRING([--disable-vba],
433         [Disables the vba compatibility feature.])
436 AC_ARG_ENABLE(pch,
437     AS_HELP_STRING([--enable-pch],
438         [DEPRECATED : is ignored])
441 AC_ARG_ENABLE(mozilla,
442     AS_HELP_STRING([--disable-mozilla],
443         [LibreOffice usually includes a strangely hacked up Mozilla binary for your
444          platform, to build without this version, use this option.])
447 AC_ARG_ENABLE(epm,
448     AS_HELP_STRING([--enable-epm],
449         [LibreOffice includes self-packaging code, that requires epm, however epm is
450          useless for large scale package building.])
453 AC_ARG_ENABLE(activex_component,
454     AS_HELP_STRING([--disable-activex-component],
455         [Remove support for ActiveX embedding of LibreOffice.])
458 AC_ARG_ENABLE(odk,
459     AS_HELP_STRING([--disable-odk],
460         [LibreOffice includes an ODK, office development kit which some packagers may
461          wish to build without.])
464 AC_ARG_ENABLE(mathmldtd,
465     AS_HELP_STRING([--disable-mathmldtd],
466         [Disable mathmldtd (useful for distributions that want to avoid
467          packaging it).])
470 AC_ARG_ENABLE(evolution2,
471     AS_HELP_STRING([--enable-evolution2],
472         [Allows the built-in evolution 2 addressbook connectivity build to be
473          enabled.])
476 AC_ARG_ENABLE(directx,
477     AS_HELP_STRING([--disable-directx],
478         [Remove DirectX implementation for the new XCanvas interface.
479          The DirectX support requires more stuff installed on Windows to
480          compile. (DirectX SDK, GDI+ libs)])
483 AC_ARG_ENABLE(activex,
484     AS_HELP_STRING([--disable-activex],
485         [Disable the use of ActiveX for a Windows build.
486         This switch is mandatory when using VC++ 2008 Express.])
489 AC_ARG_ENABLE(atl,
490     AS_HELP_STRING([--disable-atl],
491         [Disable the use of ATL for a Windows build.])
492     [
493                           This switch is mandatory when using VC++ 2008 Express.
494     ],
497 AC_ARG_ENABLE(symbols,
498     AS_HELP_STRING([--enable-symbols],
499         [Include debugging symbols in output. WARNING - a complete build needs
500          8 Gb of space and takes much longer (enables -g compiler flag).])
501     [
502                           Enabling symbols disables the stripping of the solver
503                           (--disable-strip-solver).
504     ],
507 AC_ARG_ENABLE(strip-solver,
508     AS_HELP_STRING([--disable-strip-solver],
509         [Disable the stripping of the solver. By default the solver is stripped
510          unless a build with debugging symbols (--enable-symbols) is requested.])
511     [
512                           This switch allows to override this setting.
513     ],
516 AC_ARG_ENABLE(werror,
517     AS_HELP_STRING([--enable-werror],
518         [Turn warnings to errors. (Has no effect in modules where the treating
519          of warnings as errors is disabled explicitly.)]),
522 AC_ARG_ENABLE(debug,
523     AS_HELP_STRING([--enable-debug],
524         [Include debugging symbols from --enable-symbols plus extra debugging
525          code. Extra large build! (enables -g compiler flag and dmake debug=true)
526          If you need even more verbose output, build a module with
527          "build -- debug=true dbglevel=2".]))
529 AC_ARG_ENABLE(dbgutil,
530     AS_HELP_STRING([--enable-dbgutil],
531         [Include additional debugging utilities, such as assertions, object
532          counting, etc. Larger build. Independent from --enable-debug]))
534 AC_ARG_ENABLE(linkoo,
535     AS_HELP_STRING([--disable-linkoo],
536         [Disable linkoo for the smoketest installation.]))
538 AC_ARG_ENABLE(lto,
539     AS_HELP_STRING([--enable-lto],
540         [Enable link-time optimization. Suitable for product builds.
541          Building takes longer but libraries are optimized for speed.
542          (possible only with gcc-4.5 or later,
543           better to use gcc-4.6 and 'gold' as linker)]))
545 AC_ARG_ENABLE(crashdump,
546     AS_HELP_STRING([--enable-crashdump],
547         [Enable the crashdump feature.]))
549 AC_ARG_ENABLE(python,
550     AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
551         [Enables or disables Python support at run-time and build-time.
552          Also specifies what Python to use. 'auto' is the
553          default. Note that Python can be disabled with
554          --disable-python or --enable-python=no only if no
555          translations are required.]))
557 AC_ARG_ENABLE(gtk,
558     AS_HELP_STRING([--disable-gtk],
559         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
560 ,enable_gtk=yes)
562 AC_ARG_ENABLE(gtk3,
563     AS_HELP_STRING([--disable-gtk3],
564         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
565 ,enable_gtk3=no)
567 AC_ARG_ENABLE(systray,
568     AS_HELP_STRING([--disable-systray],
569         [Determines whether to build the systray quickstarter.]),
570 ,enable_systray=yes)
572 AC_ARG_ENABLE(split-app-modules,
573     AS_HELP_STRING([--enable-split-app-modules],
574         [Split file lists for app modules, e.g. base, calc.
575          Has effect only with make distro-pack-install]),
578 AC_ARG_ENABLE(split-opt-features,
579     AS_HELP_STRING([--enable-split-opt-features],
580         [Split file lists for some optional features, .e.g. pyuno, testtool.
581          Has effect only with make distro-pack-install]),
584 AC_ARG_ENABLE(cairo-canvas,
585 [  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
586                           platforms where Cairo is available.
587 ],,enable_cairo_canvas=yes)
589 AC_ARG_ENABLE(librsvg,
590     AS_HELP_STRING([--enable-librsvg=<no/auto/system/internal>],
591         [Enables or disables use of librsvg to render SVG at run-time.
592          Also specificed what librsvg to use. 'auto' is the default.]))
594 AC_ARG_ENABLE(opengl,
595     AS_HELP_STRING([--disable-opengl],
596         [Determines whether to build the OpenGL 3D slide transitions component.]),
597 ,enable_opengl=yes)
599 AC_ARG_ENABLE(dbus,
600     AS_HELP_STRING([--enable-dbus],
601         [Determines whether to enable presentation mode screensaver control
602          under GNOME via DBUS.]),
603 ,enable_dbus=no)
605 AC_ARG_ENABLE(gconf,
606     AS_HELP_STRING([--disable-gconf],
607         [Determines whether to use the GConf support.]),
608 ,enable_gconf=yes)
610 AC_ARG_ENABLE(gnome-vfs,
611     AS_HELP_STRING([--disable-gnome-vfs],
612         [Determines whether to use the Gnome Virtual Filing System on platforms
613          where that VFS is available.]),
614 ,enable_gnome_vfs=yes)
616 AC_ARG_ENABLE(gio,
617     AS_HELP_STRING([--enable-gio],
618         [Determines whether to use the GIO support.]),
619 ,enable_gio=no)
621 AC_ARG_ENABLE(static-gtk,
622     AS_HELP_STRING([--enable-static-gtk],
623         [Modules that are linked against GTK+ libraries use the static libraries
624          instead of the dynamic ones. (Enables -Bstatic linker flag for GTK+ libraries.)]),
627 AC_ARG_ENABLE(build-mozilla,
628     AS_HELP_STRING([--disable-build-mozilla],
629         [Use this option if you do not want to build the Mozilla components from
630          the Mozilla source code but take precompiled zips.]),
633 AC_ARG_ENABLE(xmlsec,
634     AS_HELP_STRING([--disable-xmlsec],
635         [Whether to enable XMLsec for open document signing.]),
638 AC_ARG_ENABLE(kde,
639     AS_HELP_STRING([--enable-kde],
640         [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
641          KDE3 are available.]),
644 AC_ARG_ENABLE(kdeab,
645     AS_HELP_STRING([--disable-kdeab],
646         [Disable the KDE3 address book support.]),
648     if test "$enable_kde" = "yes"; then
649         enable_kdeab=yes;
650     fi
653 AC_ARG_ENABLE(kde4,
654     AS_HELP_STRING([--enable-kde4],
655         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
656          KDE4 are available. May be used with --enable-kde if you want to support
657          both KDE3 and KDE4.]),
660 AC_ARG_ENABLE(unix-qstart-libpng,
661     AS_HELP_STRING([--disable-unix-qstart-libpng],
662         [On UNIX systems, we have a faster splash app, that can use libpng to
663          render its splash, if we can safely link to the system libpng then
664          enabling this is a good idea (ie. for Linux Distro packaging).]),
665 ,enable_unix_qstart_libpng=yes)
667 AC_ARG_ENABLE(binfilter,
668     AS_HELP_STRING([--enable-binfilter],
669         [Enable legacy binary file formats filters build.]),
670 ,enable_binfilter=no
673 AC_ARG_ENABLE(ugly,
674     AS_HELP_STRING([--enable-ugly],
675         [Enables ugly pieces of functionality.]),
676 ,enable_ugly=no
679 AC_ARG_ENABLE(rpath,
680     AS_HELP_STRING([--disable-rpath],
681         [Disable the use of relative paths in shared libraries.]),
684 AC_ARG_ENABLE(randr,
685     AS_HELP_STRING([--disable-randr],
686         [Disable RandR support in the vcl project.]),
687 ,enable_randr=yes)
689 AC_ARG_ENABLE(randr-link,
690     AS_HELP_STRING([--disable-randr-link],
691         [Disable linking with libXrandr, instead dynamically open it at runtime.]),
692 ,enable_randr_link=yes)
694 AC_ARG_ENABLE(gstreamer,
695     AS_HELP_STRING([--disable-gstreamer],
696         [Disable building the gstreamer avmedia backend.]),
697 ,enable_gstreamer=yes)
699 AC_ARG_ENABLE(neon,
700     AS_HELP_STRING([--disable-neon],
701         [Disable neon and the compilation of webdav binding.]),
704 AC_ARG_ENABLE(build-unowinreg,
705     AS_HELP_STRING([--enable-build-unowinreg],
706         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
707          compiler is needed on Linux.])
708     [
709                           Usage:     --enable-build-unowinreg
710     ],
713 AC_ARG_ENABLE(verbose,
714     AS_HELP_STRING([--enable-verbose],
715         [Increase build verbosity.])[
716   --disable-verbose       Decrease build verbosity.],
719 AC_ARG_ENABLE(dependency-tracking,
720     AS_HELP_STRING([--enable-dependency-tracking],
721         [Do not reject slow dependency extractors.])[
722   --disable-dependency-tracking
723                           Disables generation of dependency information.
724                           Speed up one-time builds.],
727 AC_ARG_ENABLE(icecream,
728     AS_HELP_STRING([--enable-icecream],
729         [Use the 'icecream' distributed compiling tool to speedup the compilation.
730          It defaults to /opt/icecream for the location of the icecream gcc/g++
731          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
734 AC_ARG_ENABLE(zenity,
735     AS_HELP_STRING([--disable-zenity],
736         [Do not display a build icon in the notification area (on unix) during build.]),
737 ,enable_zenity=yes)
739 AC_ARG_ENABLE(nsplugin,
740     AS_HELP_STRING([--disable-nsplugin],
741         [Do not build nsplugin extension for browser embedding.])
744 AC_ARG_ENABLE(ccache,
745     AS_HELP_STRING([--disable-ccache],
746         [Do not try to use ccache automatically.
747          By default, we will try to detect if ccache is available; in that case if
748          CC/CXX are not yet set, and --enable-icecream is not given, we
749          attempt to use ccache. --disable-ccache disables ccache completely.
753 AC_ARG_ENABLE(cl-x64,
754     AS_HELP_STRING([--enable-cl-x64],
755         [Build a 64-bit LibreOffice using the Microsoft C/C++ x64 compiler.]),
758 AC_ARG_ENABLE(extra-gallery,
759     AS_HELP_STRING([--enable-extra-gallery],
760         [Add extra gallery content.]),
763 AC_ARG_ENABLE(extra-template,
764     AS_HELP_STRING([--enable-extra-template],
765         [Add extra template content.]),
768 AC_ARG_ENABLE(extra-sample,
769     AS_HELP_STRING([--enable-extra-sample],
770         [Add extra sample content.]),
773 AC_ARG_ENABLE(extra-font,
774     AS_HELP_STRING([--enable-extra-font],
775         [Add extra font content.]),
778 AC_ARG_ENABLE(oxygenoffice,
779     AS_HELP_STRING([--enable-oxygenoffice],
780         [Download OxygenOffice branding and set custom settings.]),
783 AC_ARG_ENABLE(lomenubar,
784     AS_HELP_STRING([--enable-lomenubar],
785         [Enable global menu support.]),
788 AC_ARG_ENABLE(online-update,
789     AS_HELP_STRING([--enable-online-update],
790         [Enable the online update service that will check for new versions of
791          LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
794 AC_ARG_ENABLE(release-build,
795     AS_HELP_STRING([--enable-release-build],
796         [Enable release build.
797          See http://wiki.documentfoundation.org/DevBuild]),
800 AC_ARG_ENABLE(silent-msi,
801     AS_HELP_STRING([--enable-silent-msi],
802         [Enable MSI with LIMITUI=1 (silent install).]),
805 AC_ARG_ENABLE(postgresql-sdbc,
806     AS_HELP_STRING([--disable-postgresql-sdbc],
807         [Disable the build of the PostgreSQL-SDBC driver.])
810 dnl ===================================================================
811 dnl Optional Packages (--with/without-)
812 dnl ===================================================================
813 AC_ARG_WITH(gnu-patch,
814     AS_HELP_STRING([--with-gnu-patch],
815         [Specify location of GNU patch on Solaris or FreeBSD.]),
818 AC_ARG_WITH(gnu-cp,
819     AS_HELP_STRING([--with-gnu-cp],
820         [Specify location of GNU cp on Solaris or FreeBSD.]),
823 AC_ARG_WITH(external-tar,
824     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
825         [Specify path to tarfiles manually.]),
826     TARFILE_LOCATION=$withval ,
829 AC_ARG_WITH(linked-git,
830     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
831         [Specify another checkout's clonedir to re-use. This makes use of
832                  git-new-workdir, and saves a lot of diskspace when having multiple
833                  trees side-by-side.]),
834     GIT_LINK_SRC=$withval ,
837 AC_ARG_WITH(openldap,
838     AS_HELP_STRING([--with-openldap],
839         [Enables the use of the OpenLDAP LDAP SDK instead of the Netscape/Mozilla one.]),
842 AC_ARG_WITH(vba-package-format,
843     AS_HELP_STRING([--with-vba-package-format],
844         [Specify package format for vba compatibility api. Specifying  "builtin"
845          means the api component and associated type library are  part of the
846          installation set. Specifying "extn" creates an uno extension that is
847          part of the installation set (located in the program directory) that
848          MUST be optionly registered using either the unopkg executeable or the
849          extension manager gui.])
850     [
851                           Note: "builtin" is the default, "extn" can cause
852                           problems.
854                           Usage:     --with-vba-package-format="builtin" or
855                                      --with-vba-package-format="extn"
856     ],
859 AC_ARG_WITH(theme,
860     AS_HELP_STRING([--with-theme="theme1 theme2..."],
861         [Choose which themes to include. By default those themes with an '*' are included.
862          Possible choices: *default, *crystal, *hicontrast, *oxygen, *tango, classic, industrial, human.]),
865 AC_ARG_WITH(helppack-integration,
867   --without-helppack-integration      It will not integrate the helppacks to the installer
868                           of the product.
869                           Please use this switch to use the online help or separate help packages.],
872 AC_ARG_WITH(fonts,
873     AS_HELP_STRING([--without-fonts],
874         [LibreOffice includes some third-party fonts to provide a reliable basis for
875          help content, templates, samples, etc. When these fonts are already
876          known to be available on the system then you should use this option.]),
879 AC_ARG_WITH(ppds,
880     AS_HELP_STRING([--without-ppds],
881         [Removes Postscript Printer definition files from LibreOffice
882          installation set, for people building for specific distributions where
883          PPDs are known to be already available (every recent distro with CUPS backend).]),
886 AC_ARG_WITH(afms,
887     AS_HELP_STRING([--without-afms],
888         [Removes bitmap font files from LibreOffice installation set, for people
889          building for specific distributions where AFM files or TrueType Fonts
890          are known to be available.]),
893 AC_ARG_WITH(agfa-monotype-fonts,
894      AS_HELP_STRING([--with-agfa-monotype-fonts],
895           [This switch should only be enabled for those who have the right
896            to use or distribute the proprietary Agfa Monotype
897            fonts.])
900 AC_ARG_WITH(epm,
901     AS_HELP_STRING([--with-epm],
902         [Decides which epm to use. Default is to use the one from the system if
903          one is built. When either this is not there or you say =internal epm
904          will be built.]),
907 AC_ARG_WITH(package-format,
908     AS_HELP_STRING([--with-package-format],
909         [Specify package format(s) for LibreOffice installsets. Default is the
910          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
911          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
912           installed, msi. Example: --with-package-format="deb dmg"]),
915 AC_ARG_WITH(system-libs,
916     AS_HELP_STRING([--with-system-libs],
917         [Use libraries already on system -- enables all --with-system-* flags except
918          mozilla.]),
921 AC_ARG_WITH(system-headers,
922     AS_HELP_STRING([--with-system-headers],
923         [Use headers already on system -- enables all --with-system-* flags for
924          external packages whose headers are the only entities used i.e.
925          boost/vigra/odbc/sane-header(s).]),
928 AC_ARG_WITH(system-jars,
929     AS_HELP_STRING([--without-system-jars],
930         [When building with --with-system-libs, also the needed jars are expected
931          on the system. Use this to disable that (except for the db case where
932          --with-system-db *has to* imply using the db.jar from there, too).]),
935 AC_ARG_WITH(system-stdlibs,
936     AS_HELP_STRING([--without-system-stdlibs],
937         [Bundle the used libstdc++/libgcc_s into the installation set.]),,
938     [with_system_stdlibs="$with_system_libs"])
940 AC_ARG_WITH(system-cairo,
941     AS_HELP_STRING([--with-system-cairo],
942         [Use Cairo libraries already on system.]),,
943     [with_system_cairo="$with_system_libs"])
945 AC_ARG_WITH(system-graphite,
946     AS_HELP_STRING([--with-system-graphite],
947         [Use graphite library already installed on system.]),,
948     [with_system_graphite="$with_system_libs"])
950 AC_ARG_WITH(system-nss,
951     AS_HELP_STRING([--with-system-nss],
952         [Use NSS/nspr libraries already on system.]),,
953     [with_system_nss="$with_system_libs"])
955 AC_ARG_WITH(system-sampleicc,
956     AS_HELP_STRING([--with-system-sampleicc],
957         [Use SampleICC libraries already on system (used only during build).]),,
958     [with_system_sampleicc="$with_system_libs"])
960 AC_ARG_WITH(mozilla-version,
961     AS_HELP_STRING([--with-mozilla-version],
962         [Choose which version of Mozilla to use while building Mozilla.
963          (default=1.7.5) Note that not all versions are supported.]),
966 AC_ARG_WITH(mozilla-toolkit,
967     AS_HELP_STRING([--with-mozilla-toolkit],
968         [Choose which GUI toolkit to use while building Mozilla components. (default=gtk2)]),
971 AC_ARG_WITH(myspell-dicts,
972     AS_HELP_STRING([--without-myspell-dicts],
973         [Removes myspell dictionaries from LibreOffice installation set, for
974          people building for specific distributions where the myspell dictionaries
975          are installed from other sources.]),
978 AC_ARG_WITH(system-dicts,
979     AS_HELP_STRING([--with-system-dicts],
980         [Use dictionaries from system paths- Specify them via
981          --with-{dict,hyph,thes}-path=/path if you want to override the default ones.]),
984 AC_ARG_WITH(external-dict-dir,
985     AS_HELP_STRING([--with-external-dict-dir],
986         [Specify external dictionary dir.]),
989 AC_ARG_WITH(external-hyph-dir,
990     AS_HELP_STRING([--with-external-hyph-dir],
991         [Specify external hyphenation pattern dir.]),
994 AC_ARG_WITH(external-thes-dir,
995     AS_HELP_STRING([--with-external-thes-dir],
996         [Specify external thesaurus dir.]),
999 AC_ARG_WITH(system-zlib,
1000     AS_HELP_STRING([--with-system-zlib],
1001         [Use zlib already on system.]),,
1002  [if test "$_os" != "WINNT"; then
1003     with_system_zlib=yes
1004   else
1005     with_system_zlib="$with_system_libs"
1006   fi])
1008 AC_ARG_WITH(system-openssl,
1009     AS_HELP_STRING([--with-system-openssl],
1010         [Use OpenSSL already on system.]),,
1011     [with_system_openssl="$with_system_libs"])
1013 AC_ARG_WITH(system-jpeg,
1014     AS_HELP_STRING([--with-system-jpeg],
1015         [Use jpeg already on system.]),,
1016  [if test "$_os" = "Linux"; then
1017     with_system_jpeg=yes
1018   else
1019     with_system_jpeg="$with_system_libs"
1020   fi])
1022 AC_ARG_WITH(system-expat,
1023     AS_HELP_STRING([--with-system-expat],
1024         [Use expat already on system.]),,
1025     [with_system_expat="$with_system_libs"])
1027 AC_ARG_WITH(system-libcmis,
1028     AS_HELP_STRING([--with-system-libcmis],
1029         [Use libcmis already on system.]),,
1030     [with_system_libcmis="$with_system_libs"])
1032 AC_ARG_WITH(system-libvisio,
1033     AS_HELP_STRING([--with-system-libvisio],
1034         [Use libvisio already on system.]),,
1035     [with_system_libvisio="$with_system_libs"])
1037 AC_ARG_WITH(system-libwpd,
1038     AS_HELP_STRING([--with-system-libwpd],
1039         [Use libwpd already on system.]),,
1040     [with_system_libwpd="$with_system_libs"])
1042 AC_ARG_WITH(system-libwps,
1043     AS_HELP_STRING([--with-system-libwps],
1044         [Use libwps already on system.]),,
1045     [with_system_libwps="$with_system_libs"])
1047 AC_ARG_WITH(system-libwpg,
1048     AS_HELP_STRING([--with-system-libwpg],
1049         [Use libwpg already on system.]),,
1050     [with_system_libwpg="$with_system_libs"])
1052 AC_ARG_WITH(system-libxml,
1053     AS_HELP_STRING([--with-system-libxml],
1054         [Use libxml/libxslt already on system.]),,
1055  [if test "$_os" = "Darwin"; then
1056     with_system_libxml=yes
1057   else
1058     with_system_libxml="$with_system_libs"
1059   fi])
1061 AC_ARG_WITH(system-icu,
1062     AS_HELP_STRING([--with-system-icu],
1063         [Use icu already on system.]),,
1064     [with_system_icu="$with_system_libs"])
1066 AC_ARG_WITH(system-poppler,
1067     AS_HELP_STRING([--with-system-poppler],
1068         [Use system poppler. (only needed for pdfimport extension)]),,
1069     [with_system_poppler="$with_system_libs"])
1071 AC_ARG_WITH(system-db,
1072     AS_HELP_STRING([--with-system-db],
1073         [Use Berkeley db already on system.]),,
1074     [with_system_db="$with_system_libs"])
1076 AC_ARG_WITH(system-lucene,
1077     AS_HELP_STRING([--with-system-lucene],
1078         [Use Lucene already on system.]),,
1079     [with_system_lucene="$with_system_jars"])
1081 AC_ARG_WITH(system-apache-commons,
1082     AS_HELP_STRING([--with-system-apache-commons],
1083         [Use Apache commons libraries already on system.]),,
1084     [with_system_apache_commons="$with_system_jars"])
1086 AC_ARG_WITH(lucene-core-jar,
1087     AS_HELP_STRING([--with-lucene-core-jar=JARFILE],
1088         [Specify path to jarfile manually.]),
1089     LUCENE_CORE_JAR=$withval)
1091 AC_ARG_WITH(lucene-analyzers-jar,
1092     AS_HELP_STRING([--with-lucene-analyzers-jar=JARFILE],
1093         [Specify path to jarfile manually.]),
1094     LUCENE_ANALYZERS_JAR=$withval ,)
1096 AC_ARG_WITH(system-mysql,
1097     AS_HELP_STRING([--with-system-mysql],
1098         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
1099          extension. If the the mysql_config executable is not in PATH, use MYSQLCONFIG to
1100          point to it.]),,
1101     [with_system_mysql="$with_system_libs"])
1103 AC_ARG_WITH(libmysql-path,
1104     AS_HELP_STRING([--with-libmysql-path],
1105         [Use Connector/C (libmysql) installation for building the MySQL
1106          Connector/LibreOffice extension.])
1107     [
1108                           Usage:     --with-libmysql-path=<absolute path to
1109                                                   your Connector/C installation>
1110     ],
1113 AC_ARG_WITH(system-mysql-cppconn,
1114     AS_HELP_STRING([--with-system-mysql-cppconn],
1115         [Use MySQL C++ Connector libraries already on system.]),,
1116     [with_system_mysql_cppconn="$with_system_libs"])
1118 AC_ARG_WITH(system-postgresql,
1119     AS_HELP_STRING([--with-system-postgresql],
1120         [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1121          driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1122     [with_system_postgresql="$with_system_libs"])
1124 AC_ARG_WITH(libpq-path,
1125     AS_HELP_STRING([--with-libpq-path],
1126         [Use this PostgreSQL C interface (libpq) installation for building
1127          the PostgreSQL-SDBC extension.])
1128     [
1129                           Usage:     --with-libpq-path=<absolute path to
1130                                                   your libq installation>
1131     ],
1134 AC_ARG_WITH(system-hsqldb,
1135     AS_HELP_STRING([--with-system-hsqldb],
1136         [Use hsqldb already on system.]),,
1137     [with_system_hsqldb="$with_system_jars"])
1139 AC_ARG_WITH(hsqldb-jar,
1140     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1141         [Specify path to jarfile manually.]),
1142     HSQLDB_JAR=$withval)
1144 AC_ARG_WITH(system-beanshell,
1145     AS_HELP_STRING([--with-system-beanshell],
1146         [Use beanshell already on system.]),,
1147     [with_system_beanshell="$with_system_jars"])
1149 AC_ARG_WITH(beanshell-jar,
1150     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1151         [Specify path to jarfile manually.]),
1152     BSH_JAR=$withval)
1154 AC_ARG_WITH(commons-codec-jar,
1155     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1156         [Specify path to jarfile manually.]),
1157     COMMONS_CODEC_JAR=$withval)
1159 AC_ARG_WITH(commons-lang-jar,
1160     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1161         [Specify path to jarfile manually.]),
1162     COMMONS_LANG_JAR=$withval)
1164 AC_ARG_WITH(commons-httpclient-jar,
1165     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1166         [Specify path to jarfile manually.]),
1167     COMMONS_HTTPCLIENT_JAR=$withval)
1169 AC_ARG_WITH(commons-logging-jar,
1170     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1171         [Specify path to jarfile manually.]),
1172     COMMONS_LOGGING_JAR=$withval)
1174 AC_ARG_WITH(system-servlet-api,
1175     AS_HELP_STRING([--with-system-servlet-api],
1176         [Use servlet-api already on system.]),,
1177     [with_system_servlet_api="$with_system_jars"])
1179 AC_ARG_WITH(servlet-api-jar,
1180     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
1181         [Specify path to jarfile manually.]),
1182     SERVLETAPI_JAR=$withval)
1184 AC_ARG_WITH(system-jfreereport,
1185     AS_HELP_STRING([--with-system-jfreereport],
1186         [Use JFreeReport already on system.]),,
1187     [with_system_jfreereport="$with_system_jars"])
1189 AC_ARG_WITH(sac-jar,
1190     AS_HELP_STRING([--with-sac-jar=JARFILE],
1191         [Specify path to jarfile manually.]),
1192     SAC_JAR=$withval)
1194 AC_ARG_WITH(libxml-jar,
1195     AS_HELP_STRING([--with-libxml-jar=JARFILE],
1196         [Specify path to jarfile manually.]),
1197     LIBXML_JAR=$withval)
1199 AC_ARG_WITH(flute-jar,
1200     AS_HELP_STRING([--with-flute-jar=JARFILE],
1201         [Specify path to jarfile manually.]),
1202     FLUTE_JAR=$withval)
1204 AC_ARG_WITH(jfreereport-jar,
1205     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1206         [Specify path to jarfile manually.]),
1207     JFREEREPORT_JAR=$withval)
1209 AC_ARG_WITH(liblayout-jar,
1210     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1211         [Specify path to jarfile manually.]),
1212     LIBLAYOUT_JAR=$withval)
1214 AC_ARG_WITH(libloader-jar,
1215     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1216         [Specify path to jarfile manually.]),
1217     LIBLOADER_JAR=$withval)
1219 AC_ARG_WITH(libloader-jar,
1220     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1221         [Specify path to jarfile manually.]),
1222     LIBLOADER_JAR=$withval)
1224 AC_ARG_WITH(libformula-jar,
1225     AS_HELP_STRING([--with-libformula-jar=JARFILE],
1226         [Specify path to jarfile manually.]),
1227     LIBFORMULA_JAR=$withval)
1229 AC_ARG_WITH(librepository-jar,
1230     AS_HELP_STRING([--with-librepository-jar=JARFILE],
1231         [Specify path to jarfile manually.]),
1232     LIBREPOSITORY_JAR=$withval)
1234 AC_ARG_WITH(libfonts-jar,
1235     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1236         [Specify path to jarfile manually.]),
1237     LIBFONTS_JAR=$withval)
1239 AC_ARG_WITH(libserializer-jar,
1240     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1241         [Specify path to jarfile manually.]),
1242     LIBSERIALIZER_JAR=$withval)
1244 AC_ARG_WITH(libbase-jar,
1245     AS_HELP_STRING([--with-libbase-jar=JARFILE],
1246         [Specify path to jarfile manually.]),
1247     LIBBASE_JAR=$withval)
1249 AC_ARG_WITH(system-saxon,
1250     AS_HELP_STRING([--with-system-saxon],
1251         [Use saxon already on system.]),,
1252     [with_system_saxon="$with_system_jars"])
1254 AC_ARG_WITH(saxon-jar,
1255     AS_HELP_STRING([--with-saxon-jar=JARFILE],
1256         [Specify path to jarfile manually.]),
1257     SAXON_JAR=$withval)
1259 AC_ARG_WITH(system-odbc,
1260     AS_HELP_STRING([--with-system-odbc],
1261         [Use the odbc headers already on system.]),,
1262     [with_system_odbc="$with_system_headers"])
1264 AC_ARG_WITH(system-sane,
1265     AS_HELP_STRING([--with-system-sane],
1266         [Use sane.h already on system.]),,
1267     [with_system_sane="$with_system_headers"])
1269 AC_ARG_WITH(system-xextensions-headers,
1270     AS_HELP_STRING([--with-system-xextensions-headers],
1271         [To build without system X11 extensions headers, use
1272          --without-system-xextensions-headers. This is possibly
1273          useful on legacy unix systems which ship with the libs
1274          but without the headers.]))
1276 AC_ARG_WITH(system-mesa-headers,
1277     AS_HELP_STRING([--with-system-mesa-headers],
1278         [Use Mesa headers already on system.]),,
1279     [with_system_mesa_headers="$with_system_headers"])
1281 AC_ARG_WITH(system-curl,
1282     AS_HELP_STRING([--with-system-curl],
1283         [Use curl already on system.]),,
1284  [if test "$_os" = "Darwin"; then
1285     with_system_curl=yes
1286   else
1287     with_system_curl="$with_system_libs"
1288   fi])
1290 AC_ARG_WITH(system-boost,
1291     AS_HELP_STRING([--with-system-boost],
1292         [Use boost already on system.]),,
1293     [with_system_boost="$with_system_headers"])
1295 AC_ARG_WITH(system-mdds,
1296     AS_HELP_STRING([--with-system-mdds],
1297         [Use mdds already on system.]),,
1298     [with_system_mdds="$with_system_headers"])
1300 AC_ARG_WITH(system-vigra,
1301     AS_HELP_STRING([--with-system-vigra],
1302         [Use vigra already on system.]),,
1303     [with_system_vigra="$with_system_headers"])
1305 AC_ARG_WITH(system-neon,
1306     AS_HELP_STRING([--with-system-neon],
1307         [Use neon already on system.]),,
1308     [with_system_neon="$with_system_libs"])
1310 AC_ARG_WITH(system-hunspell,
1311     AS_HELP_STRING([--with-system-hunspell],
1312         [Use libhunspell already on system.]),,
1313     [with_system_hunspell="$with_system_libs"])
1315 AC_ARG_WITH(system-mythes,
1316     AS_HELP_STRING([--with-system-mythes],
1317         [Use mythes already on system.]),,
1318     [with_system_mythes="$with_system_libs"])
1320 AC_ARG_WITH(system-altlinuxhyph,
1321     AS_HELP_STRING([--with-system-altlinuxhyph],
1322         [Use ALTLinuxhyph already on system.]),,
1323     [with_system_altlinuxhyph="$with_system_libs"])
1325 AC_ARG_WITH(system-lpsolve,
1326     AS_HELP_STRING([--with-system-lpsolve],
1327         [Use lpsolve already on system.]),,
1328     [with_system_lpsolve="$with_system_libs"])
1330 AC_ARG_WITH(system-libexttextcat,
1331     AS_HELP_STRING([--with-system-libexttextcat],
1332         [Use libexttextcat already on system.]),,
1333     [with_system_libexttextcat="$with_system_libs"])
1335 AC_ARG_WITH(system-cppunit,
1336     AS_HELP_STRING([--with-system-cppunit],
1337         [Use cppunit already on system.]),,
1338     [with_system_cppunit="$with_system_libs"])
1340 AC_ARG_WITH(system-redland,
1341     AS_HELP_STRING([--with-system-redland],
1342         [Use redland library already on system.]),,
1343     [with_system_redland="$with_system_libs"])
1345 AC_ARG_WITH(system-mozilla,
1346     AS_HELP_STRING([--with-system-mozilla],
1347         [Use Mozilla already on system. Note that some components cannot be built
1348          against a contemporary Mozilla. The flavour used can be specified by
1349          --with-system-mozilla=<flavour>. Supported are: libxul (default),
1350          xulrunner, firefox, seamonkey, mozilla, iceape.]),
1351     WITH_SYSTEM_MOZILLA=$withval ,
1352 WITH_SYSTEM_MOZILLA=no)
1354 AC_ARG_WITH(system-mozilla-headers,
1355     AS_HELP_STRING([--with-system-mozilla-headers],
1356         [Use mozilla headers provided by system instead of bundled ones. Used in
1357          nsplugin]),,
1358     [with_system_mozilla_headers="$with_system_headers"]
1361 AC_ARG_WITH(system-gettext,
1362     AS_HELP_STRING([--with-system-gettext],
1363         [Use gettext runtime library already on system.]),,
1364     [with_system_gettext="$with_system_libs"])
1366 AC_ARG_WITH(system-libpng,
1367     AS_HELP_STRING([--with-system-libpng],
1368         [Use libpng already on system.]),,
1369     [with_system_libpng="$with_system_libs"])
1371 AC_ARG_WITH(linker-hash-style,
1372     AS_HELP_STRING([--with-linker-hash-style],
1373         [Use linker with --hash-style=<style> when linking shared objects.
1374          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1375          if supported on the build system, and "sysv" otherwise.]))
1377 AC_ARG_WITH(stlport,
1378     AS_HELP_STRING([--with-stlport],
1379         [Build the STLPort library for compatibility with old extensions for
1380          architectures where STLPort used to be used.]),
1381     with_stlport=$withval ,
1382 with_stlport=auto)
1384 AC_ARG_WITH(jdk-home,
1385     AS_HELP_STRING([--with-jdk-home],
1386         [If you have installed JDK 1.3 or later on your system please supply the
1387          path here. Note that this is not the location of the java command but the
1388          location of the entire distribution.])
1389     [
1390                           Usage:     --with-jdk-home=<absolute path to JDK home>
1391     ],
1394 AC_ARG_WITH(gxx_include_path,
1395     AS_HELP_STRING([--with-gxx-include-path],
1396         [If you want to override the autodetected g++ include path.])
1397     [
1398                           Usage:     --with-gxx-include-path=<absolute path to
1399                                                                 g++ include dir>
1400     ],
1403 AC_ARG_WITH(help,
1404     AS_HELP_STRING([--with-help],
1405         [Enable the build of help.
1407          To build without help, use --without-help.]))
1409 AC_ARG_WITH(java,
1410     AS_HELP_STRING([--with-java],
1411         [Specify the name of the Java interpreter command. Typically "java"
1412          which is the default.
1414          To build without support for Java components, applets, accessibility
1415          or the XML filters written in Java, use --without-java or --with-java=no.])
1416     [
1417                           Usage:     --with-java==<java command>
1418                                      --without-java
1419     ],
1420     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1421     [ with_java=java ]
1424 AC_ARG_WITH(java_target_version,
1425     AS_HELP_STRING([--with-java-target-version],
1426         [Generate class files that will work on JVMs with the specified version.
1427          For example, use --with-java-target-version=1.4 to make sure that the
1428          application will work with JVM 1.4 even when compiled with JDK 1.5.])
1429     [
1430                           This option is ignored when you compile with gcj/gij.
1432                           Usage:     --with-java-target-version=<jvm version>
1433     ],
1436 AC_ARG_WITH(jvm-path,
1437     AS_HELP_STRING([--with-jvm-path],
1438         [Use a specific JVM search path at runtime.])
1439     [
1440                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1442                           e. g.: --with-jvm-path=/usr/lib/
1443                                  to find JRE/JDK in /usr/lib/jvm/
1444     ],
1447 AC_ARG_WITH(ant-home,
1448     AS_HELP_STRING([--with-ant-home],
1449         [If you have installed Jakarta Ant on your system, please supply the path here.
1450          Note that this is not the location of the Ant binary but the location
1451          of the entire distribution.])
1452     [
1453                           Usage:     --with-ant-home=<absolute path to Ant home>
1454     ],
1457 AC_ARG_WITH(junit,
1458     AS_HELP_STRING([--with-junit],
1459         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1460          --without-junit disables those tests. Not relevant in the --without-java case.])
1461     [
1462                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1463     ],
1464 ,with_junit=yes)
1466 AC_ARG_WITH(perl-home,
1467     AS_HELP_STRING([--with-perl-home],
1468         [If you have installed Perl 5 Distribution, on your system, please
1469          supply the path here. Note that this is not the location of the Perl
1470          binary but the location of the entire distribution.])
1471     [
1472                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1473     ],
1476 AC_ARG_WITH(cl-home,
1477     AS_HELP_STRING([--with-cl-home],
1478         [For Windows NT users, please supply the path for the Microsoft C/C++
1479          compiler. Note that this is not the location of the compiler binary but
1480          the location of the entire distribution.])
1481     [
1482                           Usage:     --with-cl-home=<absolute path to Microsoft
1483                                                             C/C++ compiler home>
1484     ],
1487 AC_ARG_WITH(mspdb-path,
1488     AS_HELP_STRING([--with-mspdb-path],
1489         [For Microsoft C/C++ compiler users, please supply the path pointing to
1490          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1491          Visual Studio 2010).])
1492     [
1493                           Usage:     --with-mspdb-path=<path to
1494                                                        mspdb80.dll/mspdb100.dll>
1495     ],
1498 AC_ARG_WITH(midl-path,
1499     AS_HELP_STRING([--with-midl-path],
1500         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1501     [
1502                           Usage:     --with-midl-path=<abs. path to midl.exe>
1503     ],
1506 AC_ARG_WITH(csc-path,
1507     AS_HELP_STRING([--with-csc-path],
1508         [For Windows builds, please supply the path pointing to the csc.exe.
1509          Usually found automatically when building on Windows.])
1510     [
1511                           Usage:     --with-csc-path=<abs. path to csc.exe>
1512     ],
1515 AC_ARG_WITH(dotnet-framework-home,
1516     AS_HELP_STRING([--with-dotnet-framework-home],
1517         [For Microsoft compiler users, please supply the path pointing to
1518          lib/mscoree.lib, usually something like:
1519          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1520     [
1521                           Note that in most cases it will be automatically
1522                           found, though.
1524                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1525                                                           Framework>
1526     ],
1529 AC_ARG_WITH(windows-sdk-home,
1530     AS_HELP_STRING([--with-windows-sdk-home],
1531         [For Windows builds, please supply the path to the Windows SDK.
1532          Usually found automatically when building on Windows.])
1533     [
1534                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1535     ],
1538 AC_ARG_WITH(directx-home,
1539     AS_HELP_STRING([--with-directx-home],
1540         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1541     [
1542                           Usage:     --with-directx-home=<absolute path to
1543                                                           Microsoft DirectX SDK>
1544     ],
1547 AC_ARG_WITH(mozilla-build,
1548     AS_HELP_STRING([--with-mozilla-build],
1549         [For Windows users, please supply the path to the Mozilla build tools.])
1550     [
1551                           Usage:     --with-mozilla-build=<absolute path to
1552                                                           Mozilla build tools>
1554                           At the moment of this writing, an installer for the
1555                           mozilla build tools can be obtained from http://ftp.
1556                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1557     ],
1558     MOZILLABUILD=$withval ,
1561 AC_ARG_WITH(local-solver,
1562     AS_HELP_STRING([--with-local-solver],
1563         [If you have solver in a location other than ./solver, please supply the path here.])
1564     [
1565                           Usage:     --with-local-solver=<abs. path to solver>
1566     ],
1569 AC_ARG_WITH(lang,
1570     AS_HELP_STRING([--with-lang],
1571         [Use this option to build LibreOffice with additional language support.
1572          English (US) is always included by default.
1573          Separate multiple languages with space.
1574          For all languages, use --with-lang=ALL.])
1575     [
1576                           Usage:     --with-lang="es sw tu cs sk"
1577     ],
1580 dnl ===================================================================
1581 dnl Branding
1582 dnl ===================================================================
1584 AC_ARG_WITH(branding,
1585 [  --with-branding        Use given path to retrieve all branding images.
1586                           Expects /path/intro.png ...
1587                           /path/backing_rtl_right.png to be there. Individual
1588                           images can be overridden via --with-intro-bitmap ...
1589                           --with-startcenter-rtl-left-bitmap switches.
1591                           Usage:     --with-branding=/path/to/images
1592 ],,)
1594 AC_ARG_WITH(intro-bitmap,
1595 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1596                           the default one.
1598                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1599 ],,)
1601 AC_ARG_WITH(intro-progressbar-color,
1602 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1603                                      Comma separated RGB values in decimal format.
1605                           Usage: --with-intro-progressbar-color=126,170,23
1606 ],,)
1608 AC_ARG_WITH(intro-progressbar-size,
1609 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1610                                      Comma separated values in decimal format.
1612                           Usage: --with-intro-progressbar-size=319,10
1613 ],,)
1615 AC_ARG_WITH(intro-progressbar-position,
1616 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1617                                      Comma separated values in decimal format.
1619                           Usage: --with-intro-progressbar-position=164,225
1620 ],,)
1622 AC_ARG_WITH(intro-progressbar-frame-color,
1623 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1624                                            Comma separated RGB values in decimal format.
1626                           Usage: --with-intro-progressbar-frame-color=207,208,211
1627 ],,)
1629 AC_ARG_WITH(about-bitmap,
1630 [  --with-about-bitmap    Similarly to --with-intro-bitmap, this allows
1631                           specification of bitmap for the About box.
1633                           Usage:     --with-about-bitmap=/path/my_ooo_about.png
1634 ],,)
1636 AC_ARG_WITH(startcenter-left-bitmap,
1637 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1638                                      specification of bitmap for the Start center.
1640                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1641 ],,)
1643 AC_ARG_WITH(startcenter-right-bitmap,
1644 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1645                                       specification of bitmap for the Start center.
1647                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1648 ],,)
1650 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1651 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1652                                          specification of bitmap for the Start center.
1654                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1655 ],,)
1657 AC_ARG_WITH(startcenter-rtl-right-bitmap,
1658 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
1659                                           specification of bitmap for the Start center.
1661                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
1662 ],,)
1664 AC_ARG_WITH(startcenter-space-bitmap,
1665 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
1666                                       specification of bitmap for the Start center.
1668                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
1669 ],,)
1671 AC_ARG_WITH(vendor,
1672     AS_HELP_STRING([--with-vendor],
1673         [Set vendor of the build.])
1674     [
1675                           Usage:     --with-vendor="John the Builder"
1676     ],
1679 AC_ARG_WITH(unix-wrapper,
1680     AS_HELP_STRING([--with-unix-wrapper],
1681         [Redefines the name of the UNIX wrapper that will be used in the desktop
1682          files and in the desktop-integration RPMs.])
1683     [
1684                           Usage:     --with-unix-wrapper=ooffice
1685     ],
1688 AC_ARG_WITH(compat-oowrappers,
1689     AS_HELP_STRING([--with-compat-oowrappers],
1690         [Install oo* wrappers in parallel with
1691          lo* ones to keep backward compatibility.
1692          Has effect only with make distro-pack-install]),
1695 AC_ARG_WITH(asm-home,
1696     AS_HELP_STRING([--with-asm-home],
1697         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
1698     [
1699                           Usage:     --with-asm-home=<path to assembler directory>
1700     ],
1703 AC_ARG_WITH(os-version,
1704     AS_HELP_STRING([--with-os-version],
1705         [For FreeBSD users, use this option option to override the detected OSVERSION.])
1706     [
1707                           Usage:     --with-os-version=<OSVERSION>
1708     ],
1711 AC_ARG_WITH(mingw-cross-compiler,
1712     AS_HELP_STRING([--with-mingw-cross-compiler],
1713         [Specify the MinGW cross-compiler to use.])
1714     [
1715                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
1717                           When building on the ODK on Unix and building unowinreg.dll,
1718                           specify the MinGW C++ cross-compiler.
1719     ],
1722 AC_ARG_WITH(build-version,
1723     AS_HELP_STRING([--with-build-version],
1724         [Allows the builder to add a custom version tag that will appear in the
1725          Help/About box for QA purposes.])
1726     [
1727                           Usage:     --with-build-version="Built by Jim"
1728     ],
1729     with_build_version=$withval ,
1732 AC_ARG_WITH(alloc,
1733     AS_HELP_STRING([--with-alloc],
1734         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
1735          Note that on FreeBSD/NetBSD system==jemalloc]),
1738 AC_ARG_WITH(sun-templates,
1739     AS_HELP_STRING([--with-sun-templates],
1740         [Integrate Sun template packages.]),
1743 AC_ARG_WITH(num-cpus,
1744     AS_HELP_STRING([--with-num-cpus],
1745         [Number of build processes/cpus to use (number of projects that will build at the same time).
1746          Multi-process/multi-cpu builds can save a lot of time on multi-cpu machines.
1747          Defaults to the number of CPUs on the machine.]),
1750 AC_ARG_WITH(max-jobs,
1751     AS_HELP_STRING([--with-max-jobs],
1752         [Maximum number of jobs that will be issued at the same time per dmake or gbuild subproject.
1753          The real number of the jobs is affected by the --with-num-cpus too, it can get up to CPUS*max_jobs.
1754          Defaults to 1, unless you configure --enable-icecream - then to 10.]),
1757 dnl ===================================================================
1758 dnl MacOSX build and runtime environment options
1759 dnl ===================================================================
1761 AC_ARG_WITH(macosx-sdk,
1762     AS_HELP_STRING([--with-macosx-sdk],
1763         [Use a specific SDK for building.])
1764     [
1765                           Usage:     --with-macosx-sdk=<version>
1767                           e. g.: --with-macosx-sdk=10.4
1769                           there are 3 options to controle the MacOSX build:
1770                           --with-macosx-sdk (refered as 'sdl' below)
1771                           --with-macosx-version-min-required (refered as 'min' below)
1772                           --with-macosx-version-max-allowed (refered as 'max' below)
1774                           the connection between these value and the default they take is as follow:
1775                           ( ? means not specified on the command line, constraint: x <= y <= z)
1777                           ==========================================
1778                            command line      || config result
1779                           ==========================================
1780                           min  | max  | sdk  || min  | max  | sdk  |
1781                           ?    | ?    | ?    || 10.4 | 10.4 | 10.4 |
1782                           ?    | ?    | 10.x || 10.4 | 10.4 | 10.x |
1783                           ?    | 10.x | ?    || 10.4 | 10.x | 10.x |
1784                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
1785                           10.x | ?    | ?    || 10.x | 10.x | 10.x |
1786                           10.x | ?    | 10.y || 10.x | 10.x | 10.y |
1787                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
1788                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
1791                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
1792                           for a detailled technical explanation of these variables
1794                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
1796     ],
1799 AC_ARG_WITH(macosx-version-min-required,
1800     AS_HELP_STRING([--with-macosx-version-min-required],
1801         [set the minimum OS version needed to run the built LibreOffice])
1802     [
1803                           Usage:     --with-macosx-version-min-required=<version>
1805                           e. g.: --with-macos-version-min-required=10.4
1806                           see --with-macosx-sdk for more info
1807     ],
1810 AC_ARG_WITH(macosx-version-max-allowed,
1811     AS_HELP_STRING([--with-macosx-version-max-allowed],
1812         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
1813     [
1814                           Usage:     --with-macosx-version-max-allowed=<version>
1816                           e. g.: --with-macos-version-max-allowed=10.6
1817                           see --with-macosx-sdk for more info
1818     ],
1822 dnl ===================================================================
1823 dnl check for required programs (grep, awk, sed, bash)
1824 dnl ===================================================================
1825 AC_PROG_EGREP
1826 AC_PROG_AWK
1827 AC_PATH_PROG( AWK, $AWK)
1828 if test -z "$AWK"; then
1829     AC_MSG_ERROR([install awk to run this script])
1832 AC_PATH_PROG(BASH, bash)
1833 if test -z "$BASH"; then
1834     AC_MSG_ERROR([bash not found in \$PATH])
1836 AC_SUBST(BASH)
1838 AC_MSG_CHECKING([for GNU or BSD tar])
1839 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
1840     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
1841     if test $? -eq 0;  then
1842         GNUTAR=$a
1843         break
1844     fi
1845 done
1846 AC_MSG_RESULT($GNUTAR)
1847 if test -z "$GNUTAR"; then
1848     AC_MSG_ERROR([not found. install GNU or BSD tar.])
1850 AC_SUBST(GNUTAR)
1852 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
1853 dnl desktop OSes from "mobile" ones.
1855 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
1856 dnl In other words, that when building for an OS that is not a
1857 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
1859 dnl Note the direction of the implication; there is no assumption that
1860 dnl cross-compiling would imply a non-desktop OS.
1862 if test $_os != iOS -a $_os != Android; then
1863     BUILD_TYPE="$BUILD_TYPE DESKTOP"
1866 dnl ===================================================================
1867 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
1868 dnl although MSVC is used to build other build-time tools and 
1869 dnl LibreOffice itself.
1870 dnl ===================================================================
1871 if test "$build_os" = "cygwin" ; then
1872     AC_MSG_CHECKING([for Cygwin gcc/g++])
1873     if which gcc > /dev/null && which g++ > /dev/null ; then
1874         AC_MSG_RESULT([found])
1875     else
1876         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
1877     fi
1882 dnl ===================================================================
1883 dnl  Checks if ccache is available
1884 dnl ===================================================================
1885 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \) ; then
1886     if test -z "$CC" ; then
1887         if test -z "$CXX" ; then
1888             AC_PATH_PROG([CCACHE],[ccache],[not found])
1889             if test "$CCACHE" = "not found" ; then
1890                 CCACHE=""
1891             else
1892                 CCACHE="ccache"
1893                 # need to check for ccache version: otherwise prevents
1894                 # caching of the results (like "-x objective-c++" for Mac)
1895                 if test $_os = Darwin -o $_os = iOS; then
1896                     # check ccache version
1897                     AC_MSG_CHECKING([whether version of ccache is suitable])
1898                     CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
1899                     CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1900                     if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
1901                         AC_MSG_RESULT([yes])
1902                     else
1903                         AC_MSG_RESULT([no])
1904                         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.])
1905                         CCACHE=""
1906                     fi
1907                 fi
1908             fi
1909         else
1910             AC_MSG_NOTICE([Automatic ccache detection ingored: CXX is pre-defined])
1911             CCACHE=""
1912         fi
1913     else
1914         AC_MSG_NOTICE([Automatic ccache detection ingored: CC is pre-defined])
1915         CCACHE=""
1916     fi
1917 else
1918     CCACHE=""
1921 if test "$CCACHE" != "" ; then
1922     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
1923     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
1924     if test "$ccache_size" = "" ; then
1925         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
1926         if test "$ccache_size" = "" ; then
1927             ccache_size=0
1928         fi
1929         # we could not determine the size or it was less than 1GB -> disable auto-ccache
1930         if test $ccache_size -lt 1024 ; then
1931             CCACHE=""
1932             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
1933             echo "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled" >> warn
1934         else
1935             # warn that ccache may be too small for debug build
1936             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1937             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1938         fi
1939     else
1940         if test $ccache_size -lt 5  ; then
1941             #warn that ccache may be too small for debug build
1942             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1943             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1944         fi
1945     fi
1948 dnl ===================================================================
1949 dnl  Checks for C compiler,
1950 dnl  The check for the C++ compiler is later on.
1951 dnl ===================================================================
1952 GCC_HOME_SET="true"
1953 AC_MSG_CHECKING([gcc home])
1954 if test -z "$with_gcc_home"; then
1955     if test "$enable_icecream" = "yes" ; then
1956         GCC_HOME="/opt/icecream"
1957     else
1958         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
1959         GCC_HOME_SET="false"
1960     fi
1961 else
1962     GCC_HOME="$with_gcc_home"
1964 AC_MSG_RESULT($GCC_HOME)
1965 AC_SUBST(GCC_HOME)
1967 if test "$GCC_HOME_SET" = "true" ; then
1968     if test -z "$CC"; then
1969         CC="$GCC_HOME/bin/gcc"
1970     fi
1971     if test -z "$CXX"; then
1972         CXX="$GCC_HOME/bin/g++"
1973     fi
1976 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1977 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
1978     AC_PROG_CC
1981 COMPATH=`dirname "$CC"`
1982 if test "$COMPATH" = "." ; then
1983     AC_PATH_PROGS(COMPATH, $CC)
1984     dnl double square bracket to get single because of M4 quote...
1985     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
1987 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
1992 dnl ===================================================================
1993 dnl  Test MacOSX sdk and version requirement
1994 dnl ===================================================================
1995 if test "$_os" = "Darwin" ; then
1997     if test "$with_macosx_version_min_required" = "" ; then
1998         with_macosx_version_min_required="10.4"
1999     fi
2001     if test "$with_macosx_version_max_allowed" = "" ; then
2002         with_macosx_version_max_allowed="$with_macosx_version_min_required"
2003     fi
2005     if test "$with_macosx_sdk" = "" ; then
2006         with_macosx_sdk="$with_macosx_version_max_allowed"
2007     fi
2009     case "$with_macosx_sdk" in
2011     10.4)
2012         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.4u.sdk"
2013         if test ! -d "$MACOSX_SDK_PATH"; then
2014           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.4u.sdk"
2015         fi
2016         macosx_sdk_value="1040"
2017         ;;
2018     10.5)
2019         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.5.sdk"
2020         if test ! -d "$MACOSX_SDK_PATH"; then
2021           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.5.sdk"
2022         fi
2023         macosx_sdk_value="1050"
2024         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
2025         echo "Building with a SDK > 10.4 is experimental" >> warn
2026         ;;
2027     10.6)
2028         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"
2029         macosx_sdk_value="1060"
2030         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
2031         echo "Building with a SDK > 10.4 is experimental" >> warn
2032         ;;
2033     10.7)
2034         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.7.sdk"
2035         macosx_sdk_value="1070"
2036         AC_MSG_WARN([Building with SDK 10.7 is known to fail in vcl])
2037         echo "Building with SDK 10.7 is known to fail in vcl" >> warn
2038         ;;
2039     *)
2040         AC_MSG_ERROR([$with_macosx_sdk is not a supported SDK value, supported value are 10.4, 10.5, 10.6 and 10.7])
2041         ;;
2042     esac
2043     AC_MSG_CHECKING([the presence of the SDK $with_macosx_sdk])
2044     if test -d "$MACOSX_SDK_PATH" ; then
2045         AC_MSG_RESULT([$MACOSX_SDK_PATH ok])
2046     else
2047         AC_MSG_ERROR([$MACOSX_SDK_PATH not found])
2048     fi
2049     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2051     case "$with_macosx_version_min_required" in
2053     10.4)
2054         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
2055         ;;
2056     10.5)
2057         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2058         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2059         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2060         if test -z "$save_CC" ; then
2061             CC="gcc-4.2 -m32"
2062             CXX="g++-4.2 -m32"
2063         fi
2064         ;;
2065     10.6)
2066         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2067         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2068         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2069         if test -z "$save_CC" ; then
2070             CC="gcc-4.2 -m32"
2071             CXX="g++-4.2 -m32"
2072         fi
2073         ;;
2074     10.7)
2075         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2076         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2077         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2078         if test -z "$save_CC" ; then
2079             CC="gcc-4.2 -m32"
2080             CXX="g++-4.2 -m32"
2081         fi
2082         ;;
2083     *)
2084         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])
2085         ;;
2086     esac
2088     case "$with_macosx_version_max_allowed" in
2090     10.4)
2091         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
2092         ;;
2093     10.5)
2094         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2095         ;;
2096     10.6)
2097         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2098         ;;
2099     10.7)
2100         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2101         ;;
2102     *)
2103         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])
2104         ;;
2105     esac
2107     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2108     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED ; then
2109         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2110     else
2111         AC_MSG_RESULT([ok])
2112     fi
2114     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent macos-with-sdk])
2115     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $macosx_sdk_value ; then
2116         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2117     else
2118         AC_MSG_RESULT([ok])
2119     fi
2120     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2121     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2123 AC_SUBST(MACOSX_SDK_PATH)
2124 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2125 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2126 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2128 dnl ===================================================================
2129 dnl  Test the gcc version,  3 is OK
2130 dnl ===================================================================
2131 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
2132     AC_MSG_CHECKING([the GNU C compiler version])
2133     _gcc_version=`$CC -dumpversion`
2134     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2135     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2137     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100" ; then
2138         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0" ; then
2139             export CC="$GCC_HOME/bin/gcc-4.0"
2140             #  export CC to have it available in set_soenv -> config.guess
2141             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2142             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100" ; then
2143                 GCCVER=$GCCVER2
2144             fi
2145         fi
2146         if test "$GCCVER" -ge "040100" ; then
2147             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])
2148         else
2149             AC_MSG_RESULT([implicitly using CC=$CC])
2150         fi
2151     else
2152         AC_MSG_RESULT([checked (gcc $_gcc_version)])
2153     fi
2158 # prefix C with ccache if needed
2160 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" ; then
2161     if test "$CCACHE" != "" ; then
2162         AC_MSG_CHECKING([whether $CC is already ccached])
2165         AC_LANG_PUSH([C])
2166         save_CFLAGS=$CFLAGS
2167         CFLAGS="$CFLAGS --ccache-skip -O2"
2168         dnl an empty program will do, we're checking the compiler flags
2169         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2170                           [use_ccache=yes], [use_ccache=no])
2171         if test $use_ccache = yes ; then
2172             AC_MSG_RESULT([yes])
2173         else
2174             CC="$CCACHE $CC"
2175             AC_MSG_RESULT([no])
2176         fi
2177         CFLAGS=$save_CFLAGS
2178         AC_LANG_POP([C])
2179     fi
2183 HAVE_LD_BSYMBOLIC_FUNCTIONS=
2184 if test "$GCC" = "yes"; then
2185     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
2186     bsymbolic_functions_ldflags_save=$LDFLAGS
2187     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
2188     AC_LINK_IFELSE([AC_LANG_PROGRAM([
2189 #include <stdio.h>
2190         ],[
2191 printf ("hello world\n");
2192         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
2193     if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
2194         AC_MSG_RESULT( found )
2195     else
2196         AC_MSG_RESULT( not found )
2197     fi
2198     LDFLAGS=$bsymbolic_functions_ldflags_save
2200 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
2202 dnl ===================================================================
2203 dnl Set up a different compiler to produce tools to run on the build
2204 dnl machine when doing cross-compilation
2205 dnl ===================================================================
2207 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
2208 if test "$cross_compiling" = "yes"; then
2209     AC_MSG_CHECKING([for BUILD platform configuration])
2210     echo
2211     rm -rf CONF-FOR-BUILD Env.Build.sh
2212     mkdir CONF-FOR-BUILD
2213     tar cf - \
2214         Makefile.in \
2215         bin/repo-list.in \
2216         build_env.in \
2217         config.guess \
2218         configure \
2219         ooo.lst.in \
2220         oowintool \
2221         post_download.in \
2222         set_soenv.in \
2223         solenv/inc/langlist.mk \
2224         solenv/inc/postset.mk \
2225         desktop/scripts/soffice.sh.in \
2226     | (cd CONF-FOR-BUILD && tar xf -)
2227     (
2228     unset COM GUI GUIBASE OS CPU CPUNAME
2229     unset CC CXX SYSBASE CFLAGS
2230     unset PYTHON_CFLAGS PYTHON_LIBS
2231     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
2232     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
2233     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
2234     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
2235     cd CONF-FOR-BUILD
2236     sub_conf_opts=""
2237     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
2238     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
2239     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
2240     ./configure \
2241         --disable-mozilla \
2242         --disable-build-mozilla \
2243         --disable-zenity \
2244         --with-num-cpus="$with_num_cpus" \
2245         --with-max-jobs="$with_max_jobs" \
2246         $sub_conf_opts \
2247         2>&1 | sed -e 's/^/    /'
2248     test -f ./Env.Host.sh 2>/dev/null || exit
2249     cp Env.Host.sh ../Env.Build.sh
2250     . ./Env.Host.sh
2251     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
2252              SYSTEM_LIBXSLT; do
2253         VV='$'$V
2254         VV=`eval "echo $VV"`
2255         if test -n "$VV"; then
2256             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
2257             echo "$line" >>build-config
2258         fi
2259     done
2261     for V in OUTDIR PATH SOLARINC SOLARLIB WORKDIR; do
2262         VV='$'$V
2263         VV=`eval "echo $VV"`
2264         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
2265         if test -n "$VV"; then
2266             line="${V}_FOR_BUILD='$VV'"
2267             echo "$line" >>build-config
2268         fi
2269     done
2270     )
2271     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
2272     test -f Env.Build.sh || AC_MSG_ERROR([A file called Env.Build.sh was supposed to have been copied here, but it isn't found])
2273     perl -pi -e 's,/CONF-FOR-BUILD,,g' Env.Build.sh
2274     eval `cat CONF-FOR-BUILD/build-config`
2275     AC_MSG_RESULT([checking for BUILD platform configuration... done])
2276     rm -rf CONF-FOR-BUILD
2277 else
2278     CC_FOR_BUILD="$CC"
2279     CXX_FOR_BUILD="$CXX"
2281 AC_SUBST(COM_FOR_BUILD)
2282 AC_SUBST(GUI_FOR_BUILD)
2283 AC_SUBST(GUIBASE_FOR_BUILD)
2284 AC_SUBST(OS_FOR_BUILD)
2285 AC_SUBST(CPU_FOR_BUILD)
2286 AC_SUBST(CPUNAME_FOR_BUILD)
2287 AC_SUBST(CC_FOR_BUILD)
2288 AC_SUBST(CXX_FOR_BUILD)
2289 AC_SUBST(GXX_INCLUDE_PATH_FOR_BUILD)
2290 AC_SUBST(INPATH_FOR_BUILD)
2291 AC_SUBST(OUTPATH_FOR_BUILD)
2292 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
2293 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
2295 AC_SUBST(OUTDIR_FOR_BUILD)
2296 AC_SUBST(PATH_FOR_BUILD)
2297 AC_SUBST(SOLARINC_FOR_BUILD)
2298 AC_SUBST(SOLARLIB_FOR_BUILD)
2299 AC_SUBST(WORKDIR_FOR_BUILD)
2301 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
2302 SOURCEVERSION="OOO$UPD"
2303 AC_SUBST(UPD)
2304 AC_SUBST(SOURCEVERSION)
2306 dnl ===================================================================
2307 dnl Set the ENABLE_CRASHDUMP variable.
2308 dnl ===================================================================
2309 AC_MSG_CHECKING([whether to enable crashdump feature])
2310 if test "$enable_crashdump" = "yes"; then
2311     ENABLE_CRASHDUMP="TRUE"
2312     BUILD_TYPE="$BUILD_TYPE CRASHREP"
2313     AC_MSG_RESULT([yes])
2314 else
2315     ENABLE_CRASHDUMP=""
2316     AC_MSG_RESULT([no])
2318 AC_SUBST(ENABLE_CRASHDUMP)
2321 dnl ===================================================================
2322 dnl Windows specific tests and stuff
2323 dnl ===================================================================
2324 if test "$_os" = "WINNT"; then
2326     dnl Include twain scanners
2327     BUILD_TYPE="$BUILD_TYPE TWAIN"
2329     dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice.
2330     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2331     if test "z$enable_cl_x64" = "z" -o "$enable_cl_x64" = "no"; then
2332         CL_X64=""
2333         AC_MSG_RESULT([no])
2334     else
2335         CL_X64="TRUE"
2336         AC_MSG_RESULT([yes])
2337     fi
2338     AC_SUBST(CL_X64)
2340     AC_MSG_CHECKING([whether to use DirectX])
2341     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2342         ENABLE_DIRECTX="TRUE"
2343         AC_MSG_RESULT([yes])
2344     else
2345         ENABLE_DIRECTX=""
2346         AC_MSG_RESULT([no])
2347     fi
2348     AC_SUBST(ENABLE_DIRECTX)
2350     AC_MSG_CHECKING([whether to use ActiveX])
2351     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2352         DISABLE_ACTIVEX=""
2353         AC_MSG_RESULT([yes])
2354     else
2355         DISABLE_ACTIVEX="TRUE"
2356         AC_MSG_RESULT([no])
2357     fi
2358     AC_SUBST(DISABLE_ACTIVEX)
2360     AC_MSG_CHECKING([whether to use ATL])
2361     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE"; then
2362         DISABLE_ATL=""
2363         AC_MSG_RESULT([yes])
2364     elif test "$enable_atl" = ""; then
2365         if test "$WITH_MINGW" = "yes"; then
2366             DISABLE_ATL="TRUE"
2367             AC_MSG_RESULT([no])
2368         else
2369             DISABLE_ATL=""
2370             AC_MSG_RESULT([yes])
2371         fi
2372     else
2373         DISABLE_ATL="TRUE"
2374         AC_MSG_RESULT([no])
2375     fi
2376     AC_SUBST(DISABLE_ATL)
2379 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
2380 dnl ===================================================================
2381 AC_MSG_CHECKING([whether to turn warnings to errors])
2382 if test -n "$enable_werror" && test "$enable_werror" != "no"; then
2383     ENABLE_WERROR="TRUE"
2384     AC_MSG_RESULT([yes])
2385 else
2386     ENABLE_WERROR="FALSE"
2387     AC_MSG_RESULT([no])
2389 AC_SUBST(ENABLE_WERROR)
2391 dnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
2392 dnl ===================================================================
2393 AC_MSG_CHECKING([whether to do a debug build])
2394 if test -n "$enable_debug" && test "$enable_debug" != "no"; then
2395     ENABLE_DEBUG="TRUE"
2396     enable_symbols="yes"
2397     AC_MSG_RESULT([yes])
2398 else
2399     ENABLE_DEBUG="FALSE"
2400     AC_MSG_RESULT([no])
2402 AC_SUBST(ENABLE_DEBUG)
2404 dnl Set the ENABLE_DBGUTIL variable
2405 dnl ===================================================================
2406 AC_MSG_CHECKING([whether to build with additional debug utilities])
2407 if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
2408     PROEXT=""
2409     PRODUCT=""
2411     # Compiling with MSVC using --enable-dbgutil (i.e. using the
2412     # debugging runtime, and defining _DEBUG when compiling) just
2413     # causes too many compilation errors. After having spent some
2414     # months slowly fixing them one by one, having reached sw, I give
2415     # up. Feel free to try again.
2416     if test "$_os" = WINNT -a "$WITH_MINGW" != yes; then
2417         AC_MSG_ERROR([Sorry, --enable-dbgutil won't work with MSVC])
2418     fi
2420     AC_MSG_RESULT([yes])
2421     # cppunit and graphite expose STL in public headers
2422     if test "$with_system_cppunit" = "yes"; then
2423         AC_MSG_ERROR([--with-system-cppunit conflicts with DBG_UTIL build])
2424     else
2425         with_system_cppunit=no
2426     fi
2427     if test "$with_system_graphite" = "yes"; then
2428         AC_MSG_ERROR([--with-system-graphite conflicts with DBG_UTIL build])
2429     else
2430         with_system_graphite=no
2431     fi
2432     if test "$with_system_mysql_cppconn" = "yes"; then
2433         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with DBG_UTIL build])
2434     else
2435         with_system_mysql_cppconn=no
2436     fi
2437     if test $_os = WINNT -a \
2438             \( "$enable_mozilla" != no -o \
2439                "$enable_build_mozilla" != no \); then
2440         # We can't build against the Mozilla stuff if using _DEBUG, will get linking errors
2441         # See connectivity/drivers/mozab
2442         AC_MSG_WARN([Also disabling Mozilla stuff then])
2443         enable_mozilla=no
2444         enable_build_mozilla=no
2445     fi
2446 else
2447     PRODUCT="full"
2448     PROEXT=".pro"
2449     AC_MSG_RESULT([no, full product build])
2451 AC_SUBST(PRODUCT)
2452 AC_SUBST(PROEXT)
2454 dnl Determine whether to use linkoo for the smoketest installation
2455 dnl ===================================================================
2456 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
2457 if test "$enable_linkoo" = "no"; then
2458     DISABLE_LINKOO="TRUE"
2459     AC_MSG_RESULT([no])
2460 else
2461     DISABLE_LINKOO=
2462     AC_MSG_RESULT([yes])
2464 AC_SUBST(DISABLE_LINKOO)
2466 # Set the ENABLE_LTO variable
2467 # ===================================================================
2468 AC_MSG_CHECKING([whether to use link-time optimization])
2469 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
2470     ENABLE_LTO="TRUE"
2471     AC_MSG_RESULT([yes])
2472 else
2473     ENABLE_LTO=""
2474     AC_MSG_RESULT([no])
2476 AC_SUBST(ENABLE_LTO)
2478 dnl whether to include symbols into final build.
2479 dnl ===================================================================
2480 AC_MSG_CHECKING([whether to include symbols])
2481 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
2482     ENABLE_SYMBOLS="TRUE"
2483     AC_MSG_RESULT([yes])
2484 else
2485     ENABLE_SYMBOLS=
2486     AC_MSG_RESULT([no])
2488 AC_SUBST(ENABLE_SYMBOLS)
2490 dnl Determine if the solver is to be stripped or not.
2491 dnl ===================================================================
2492 AC_MSG_CHECKING([whether to strip the solver or not.])
2493 if test "z$enable_strip_solver" = "zno"; then
2494     DISABLE_STRIP="TRUE"
2495     AC_MSG_RESULT([no])
2496 else
2497     if test -n "$ENABLE_SYMBOLS"; then
2498         DISABLE_STRIP="TRUE"
2499         AC_MSG_RESULT([no])
2500     else
2501         DISABLE_STRIP=
2502         AC_MSG_RESULT([yes])
2503     fi
2505 AC_SUBST(DISABLE_STRIP)
2507 dnl check for cups support
2508 dnl ===================================================================
2509 if test "$test_cups" = "yes"; then
2510     AC_MSG_CHECKING([whether cups support is present])
2511     AC_CHECK_LIB(cups, cupsPrintFiles)
2512     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
2513     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
2514         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
2515     fi
2519 # check for fontconfig support
2520 AC_MSG_CHECKING([whether we need fontconfig])
2521 if test "z$test_fontconfig" = "zyes"; then
2522     ENABLE_FONTCONFIG="TRUE"
2523     AC_MSG_RESULT([yes])
2524     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
2525 else
2526     ENABLE_FONTCONFIG=""
2527     AC_MSG_RESULT([no])
2529 AC_SUBST(ENABLE_FONTCONFIG)
2530 AC_SUBST(FONTCONFIG_CFLAGS)
2531 AC_SUBST(FONTCONFIG_LIBS)
2533 dnl whether to find & fetch external tarballs?
2534 dnl ===================================================================
2535 if test -z "$TARFILE_LOCATION"; then
2536     TARFILE_LOCATION="DEFAULT"
2538 AC_SUBST(TARFILE_LOCATION)
2540 AC_MSG_CHECKING([whether we want to fetch tarballs])
2541 if test "z$enable_fetch_external" != "zno" ; then
2542     AC_MSG_RESULT([yes])
2543     DO_FETCH_TARBALLS="YES"
2544 else
2545     AC_MSG_RESULT([no])
2546     DO_FETCH_TARBALLS="NO"
2548 AC_SUBST(DO_FETCH_TARBALLS)
2551 dnl Disable legacy binary file formats filters
2552 dnl ===================================================================
2553 AC_MSG_CHECKING([whether to enable filters for legacy binary file formats (StarOffice 5.2)])
2554 if test "$enable_binfilter" = "no"; then
2555     WITH_BINFILTER="NO"
2556     AC_MSG_RESULT([no])
2557 else
2558     WITH_BINFILTER="YES"
2559     BUILD_TYPE="$BUILD_TYPE BINFILTER"
2560     GIT_REPO_NAMES="$GIT_REPO_NAMES binfilter"
2561     AC_MSG_RESULT([yes])
2563 AC_SUBST(WITH_BINFILTER)
2565 AC_MSG_CHECKING([whether to build help])
2566 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
2567     AC_MSG_RESULT([yes])
2568     BUILD_TYPE="$BUILD_TYPE HELP"
2569     SCPDEFS="$SCPDEFS -DWITH_HELP"
2570     GIT_REPO_NAMES="$GIT_REPO_NAMES help"
2571 else
2572     AC_MSG_RESULT([no])
2575 dnl Enable ugly pieces of code we're better off without
2576 dnl ===================================================================
2577 if test "$enable_ugly" = "yes"; then
2578     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2579     SCPDEFS="$SCPDEFS -DWITH_UGLY"
2580     ENABLE_UGLY=YES
2581 else
2582     ENABLE_UGLY=NO
2584 AC_SUBST(ENABLE_UGLY)
2586 dnl ===================================================================
2587 dnl Disable rpath in shared libraries?
2588 dnl ===================================================================
2589 AC_MSG_CHECKING([whether to use RPATH in shared libraries])
2590 if test "$enable_rpath" = "no"; then
2591     ENABLE_RPATH="no"
2592 else
2593     ENABLE_RPATH="yes"
2595 AC_MSG_RESULT([$ENABLE_RPATH])
2596 AC_SUBST(ENABLE_RPATH)
2598 dnl Test whether to include MySpell dictionaries
2599 dnl ===================================================================
2600 AC_MSG_CHECKING([whether to include MySpell dictionaries])
2601 if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then
2602     AC_MSG_RESULT([yes])
2603     WITH_MYSPELL_DICTS=YES
2604     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2605     GIT_REPO_NAMES="$GIT_REPO_NAMES dictionaries"
2606 else
2607     AC_MSG_RESULT([no])
2608     WITH_MYSPELL_DICTS=NO
2610 AC_SUBST(WITH_MYSPELL_DICTS)
2612 AC_MSG_CHECKING([whether to use dicts from external paths])
2613 if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
2614     AC_MSG_RESULT([yes])
2615     SYSTEM_DICTS=YES
2616     AC_MSG_CHECKING([for spelling dictionary directory])
2617     if test -n "$with_external_dict_dir"; then
2618         DICT_SYSTEM_DIR=file://$with_external_dict_dir
2619     else
2620         DICT_SYSTEM_DIR=file:///usr/share/hunspell
2621     fi
2622     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
2623     AC_MSG_CHECKING([for hyphenation patterns directory])
2624     if test -n "$with_external_hyph_dir"; then
2625         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
2626     else
2627         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
2628     fi
2629     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
2630     AC_MSG_CHECKING([for thesaurus directory])
2631     if test -n "$with_external_thes_dir"; then
2632         THES_SYSTEM_DIR=file://$with_external_thes_dir
2633     else
2634         THES_SYSTEM_DIR=file:///usr/share/mythes
2635     fi
2636     AC_MSG_RESULT([$THES_SYSTEM_DIR])
2637 else
2638     AC_MSG_RESULT([no])
2639     SYSTEM_DICTS=NO
2641 AC_SUBST(SYSTEM_DICTS)
2642 AC_SUBST(DICT_SYSTEM_DIR)
2643 AC_SUBST(HYPH_SYSTEM_DIR)
2644 AC_SUBST(THES_SYSTEM_DIR)
2646 dnl ===================================================================
2647 dnl ENABLE_PCH i now a no-op
2648 dnl ===================================================================
2649 AC_MSG_CHECKING([whether to enable pch feature])
2650 AC_MSG_RESULT([no, obsolete])
2652 dnl ===================================================================
2653 dnl Search all the common names for GNU make
2654 dnl ===================================================================
2655 AC_MSG_CHECKING([for GNU make])
2657 # try to use our own make if it is available and GNUMAKE was not already defined
2658 if test -z "$GNUMAKE"; then
2659     if test -x "/opt/lo/bin/make"; then
2660         GNUMAKE="/opt/lo/bin/make"
2661     fi
2664 for a in "$MAKE" $GNUMAKE make gmake gnumake; do
2665     $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
2666     if test $? -eq 0;  then
2667         GNUMAKE=$a
2668         break
2669     fi
2670 done
2671 AC_MSG_RESULT($GNUMAKE)
2672 if test -z "$GNUMAKE"; then
2673     AC_MSG_ERROR([not found. install GNU make.])
2676 AC_MSG_CHECKING([the GNU make version])
2677 _make_version=`$GNUMAKE --version | grep GNU | grep -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
2678 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2679 if test "$_make_longver" -ge "038200" ; then
2680     AC_MSG_RESULT([$GNUMAKE $_make_version])
2682 elif test "$_make_longver" -ge "038100" ; then
2683     AC_MSG_RESULT([$GNUMAKE $_make_version])
2684     AC_MSG_CHECKING([for GNU make bug 20033])
2685     TESTGMAKEBUG20033=`mktemp -d`
2686     cat > $TESTGMAKEBUG20033/Makefile << EOF
2687 A := \$(wildcard *.a)
2689 .PHONY: all
2690 all: \$(A:.a=.b)
2691         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
2693 .PHONY: setup
2694 setup:
2695         @touch 1.a 2.a 3.a 4.a 5.a 6.a
2697 define d1
2698 @echo lala \$(1)
2699 @sleep 1
2700 endef
2702 define d2
2703 @echo tyty \$(1)
2704 @sleep 1
2705 endef
2707 %.b : %.a
2708         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | sha1sum))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
2709         \$(call d1,\$(CHECKSUM)),\
2710         \$(call d2,\$(CHECKSUM)))
2712     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
2713         no_parallelism_make="YES"
2714         AC_MSG_RESULT([yes, disable parallelism])
2715     else
2716         AC_MSG_RESULT([no, keep parallelism enabled])
2717     fi
2718     rm -rf $TESTGMAKEBUG20033
2719 else
2720     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
2722 AC_SUBST(GNUMAKE)
2724 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`;
2725 STALE_MAKE=
2726 make_warning=
2727 if test "z$_make_ver_check" = "z"; then
2728    STALE_MAKE=TRUE
2730 AC_SUBST(STALE_MAKE)
2732 dnl ===================================================================
2733 dnl  Test the Solaris compiler version
2734 dnl ===================================================================
2735 if test "$_os" = "SunOS"; then
2736     if test "$CC" = "cc"; then
2737         AC_PATH_PROGS(_cc, cc)
2738         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2739         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2740         dnl cc -V outputs to standard error!!!!
2741         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2742         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2743         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2744         if test "$_sunstudio_major" != "5"; then
2745             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2746         else
2747             _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" }'`
2748             if test "$_sunstudio_minor" = "false"; then
2749                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2750             else
2751                 dnl compiler will do
2752                 AC_MSG_RESULT([checked])
2753             fi
2754         fi
2755     fi
2758 HAVE_LD_HASH_STYLE=FALSE
2759 WITH_LINKER_HASH_STYLE=
2760 AC_MSG_CHECKING( for --hash-style gcc linker support )
2761 if test "$GCC" = "yes" ; then
2762     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes" ; then
2763         hash_styles="gnu sysv"
2764     elif test "$with_linker_hash_style" = "no" ; then
2765         hash_styles=
2766     else
2767         hash_styles="$with_linker_hash_style"
2768     fi
2770     for hash_style in $hash_styles ; do
2771         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
2772         hash_style_ldflags_save=$LDFLAGS
2773         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
2775         AC_LINK_IFELSE([AC_LANG_PROGRAM(
2776             [
2777 #include <stdio.h>
2778             ],[
2779 printf ("");
2780             ])],
2781             [ if ./conftest$EXEEXT; then
2782                   HAVE_LD_HASH_STYLE=TRUE
2783                   WITH_LINKER_HASH_STYLE=$hash_style
2784               fi],
2785             [HAVE_LD_HASH_STYLE=FALSE])
2786         LDFLAGS=$hash_style_ldflags_save
2787     done
2789     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
2790         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
2791     else
2792         AC_MSG_RESULT( no )
2793     fi
2794     LDFLAGS=$hash_style_ldflags_save
2795 else
2796     AC_MSG_RESULT( no )
2798 AC_SUBST(HAVE_LD_HASH_STYLE)
2799 AC_SUBST(WITH_LINKER_HASH_STYLE)
2801 dnl ===================================================================
2802 dnl Check whether there's a Perl version available.
2803 dnl ===================================================================
2804 if test -z "$with_perl_home"; then
2805     AC_PATH_PROG(PERL, perl)
2806 else
2807     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
2808     _perl_path="$with_perl_home/bin/perl"
2809     if test -x "$_perl_path"; then
2810         PERL=$_perl_path
2811     else
2812         AC_MSG_ERROR([$_perl_path not found])
2813     fi
2816 dnl ===================================================================
2817 dnl Testing for Perl version 5 or greater.
2818 dnl $] is the Perl version variable, it is returned as an integer
2819 dnl ===================================================================
2820 if test "$PERL"; then
2821     AC_MSG_CHECKING([the Perl version])
2822     ${PERL} -e "exit($]);"
2823     _perl_version=$?
2824     if test "$_perl_version" -lt 5; then
2825         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
2826     fi
2827     AC_MSG_RESULT([checked (perl $_perl_version)])
2828 else
2829     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
2831 AC_SUBST(PERL)
2833 dnl ===================================================================
2834 dnl Testing for required Perl modules
2835 dnl ===================================================================
2837 AC_MSG_CHECKING([for required Perl modules])
2838 if `$PERL -e 'use Archive::Zip; use Cwd;'`; then
2839     AC_MSG_RESULT([all modules found])
2840 else
2841     AC_MSG_ERROR([Failed to find some modules])
2844 dnl ===================================================================
2845 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2846 dnl ===================================================================
2847 SHOWINCLUDES_PREFIX=
2848 if test "$_os" = "WINNT"; then
2849     if test "$WITH_MINGW" != "yes"; then
2850         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
2851         if test -z "$with_cl_home"; then
2852             vctest=`./oowintool --msvc-productdir`;
2853             if test "$CL_X64" = ""; then
2854                 if test -x "$vctest/bin/cl.exe"; then
2855                     with_cl_home=$vctest;
2856                 fi
2857             else
2858                 if test -x "$vctest/bin/amd64/cl.exe"; then
2859                     with_cl_home=$vctest;
2860                 fi
2861             fi
2862         else
2863             with_cl_home=`cygpath -u "$with_cl_home"`
2864         fi
2865         with_cl_home=`cygpath -d "$with_cl_home"`
2866         with_cl_home=`cygpath -u "$with_cl_home"`
2867         AC_MSG_RESULT([$with_cl_home])
2869         dnl ===========================================================
2870         dnl  Check for mspdb80.dll/mspdb100.dll
2871         dnl ===========================================================
2872         dnl MSVS 2008/10 Compiler
2873         if test -n "$with_mspdb_path";then
2874             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2875         fi
2876         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll"; then
2877             MSPDB_PATH="$with_mspdb_path"
2878         fi
2879         dnl MSVS 2008 case
2880         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2881             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2882         fi
2883         dnl Windows SDK 6.0 case
2884         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2885             MSPDB_PATH="$with_cl_home/bin"
2886         fi
2887         dnl MSVS 2010 case
2888         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
2889             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2890         fi
2892         if test -z "$MSPDB_PATH";then
2893             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2894             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2895             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
2896             MSPDB_PATH=`dirname "$MSPDB_PATH"`
2897         fi
2899         if test -z "$MSPDB_PATH"; then
2900             AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path])
2901         fi
2902         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2903         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2904         dnl The path needs to be added before cl is called
2905         PATH="$MSPDB_PATH:$PATH"
2907         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2908         if test -z "$CC"; then
2909             if test "$CL_X64" = ""; then
2910                 if test -x "$with_cl_home/bin/cl.exe"; then
2911                     CC="$with_cl_home/bin/cl.exe"
2912                 fi
2913             else
2914                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
2915                     CC="$with_cl_home/bin/amd64/cl.exe"
2916                 fi
2917             fi
2918             if test -z "$CC"; then
2919                 AC_PATH_PROG(CC, cl.exe)
2920             fi
2921             # This gives us a posix path with 8.3 filename restrictions
2922             CC=`cygpath -d "$CC"`
2923             CC=`cygpath -u "$CC"`
2924         fi
2926         if test -n "$CC"; then
2927             # Remove /cl.exe from CC case insensitive
2928             AC_MSG_RESULT([found ($CC)])
2929             if test "$CL_X64" = ""; then
2930                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
2931             else
2932                 if test -n "$with_cl_home"; then
2933                     COMPATH=`echo $with_cl_home`
2934                 fi
2935             fi
2936             export INCLUDE=`cygpath -d "$COMPATH/Include"`
2937             dnl  Check which Microsoft C/C++ compiler is found
2938             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2939             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
2940             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
2941                             x = match( \\\$0, /..\\...\\...../ )
2942                             CCversion = substr( \\\$0, RSTART, RLENGTH)
2943                             tokencount = split (CCversion,vertoken,\".\")
2944                             for ( i = 1 ; i <= tokencount ; i++ ) {
2945                                 printf (\"%04d\",vertoken[[i]] )
2946                             }
2947                             }"`
2948             if test "$CCNUMVER" -ge "001600000000"; then
2949                 COMEX=13
2950                 MSVSVER=2010
2951             elif test "$CCNUMVER" -ge "001500000000"; then
2952                 COMEX=12
2953                 MSVSVER=2008
2954             else
2955                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
2956             fi
2957             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
2958         else
2959             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
2960         fi
2962         dnl We need to guess the prefix of the -showIncludes output, it can be
2963         dnl localized
2964         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
2965         echo "#include <stdlib.h>" > conftest.c
2966         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
2967             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
2968         rm -f conftest.c conftest.obj
2969         if test -z "$SHOWINCLUDES_PREFIX" ; then
2970             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
2971         else
2972             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
2973         fi
2975         # Check for 64-bit (cross-)compiler to use to build the 64-bit
2976         # version of the Explorer extension (and maybe other small
2977         # bits, too) needed when installing a 32-bit LibreOffice on a
2978         # 64-bit OS. The 64-bit Explorer extension is a feature that
2979         # has been present since long in OOo. Don't confuse it with
2980         # building LibreOffice itself as 64-bit code, which is
2981         # unfished work and highly experimental.
2983         BUILD_X64=
2984         CC_X64_BINARY=
2985         LINK_X64_BINARY=
2986         LIBMGR_X64_BINARY=
2988         AC_MSG_CHECKING([for a x64 compiler and libraries for 64bit ActiveX component])
2989         if test "$CL_X64" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
2990             # Prefer native x64 compiler to cross-compiler, in case we are running
2991             # the build on a 64-bit OS.
2992             if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2993                 BUILD_X64=TRUE
2994                 CC_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2995                 CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2996                 LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
2997                 LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
2998             elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2999                 BUILD_X64=TRUE
3000                 CC_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
3001                 CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
3002                 LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
3003                 LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
3004             fi
3005         fi
3006         if test "$BUILD_X64" = TRUE; then
3007             AC_MSG_RESULT([found])
3008         else
3009             AC_MSG_RESULT([not found])
3010             AC_MSG_WARN([Installation set will not contain the 64-bit Explorer extension])
3011         fi
3012         AC_SUBST(BUILD_X64)
3014         # These are passed to the environment through set_soenv.in as usual, and then
3015         # used in set_wntx64.mk
3016         AC_SUBST(CC_X64_BINARY)
3017         AC_SUBST(CXX_X64_BINARY)
3018         AC_SUBST(LINK_X64_BINARY)
3019         AC_SUBST(LIBMGR_X64_BINARY)
3021     else
3022         AC_MSG_CHECKING([the compiler is MinGW])
3023         MACHINE_PREFIX=`$CC -dumpmachine`
3024         if echo $MACHINE_PREFIX | grep -q mingw32; then
3025             AC_MSG_RESULT([yes])
3026         else
3027             AC_MSG_ERROR([Compiler is not MinGW.])
3028         fi
3029     fi
3031 AC_SUBST(COMEX)
3032 AC_SUBST(MSPDB_PATH)
3033 AC_SUBST(SHOWINCLUDES_PREFIX)
3035 dnl ===================================================================
3036 dnl Check for pkg-config
3037 dnl ===================================================================
3038 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3039     PKG_PROG_PKG_CONFIG
3042 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3044     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
3045     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
3046     # explicitly. Or put /path/to/compiler in PATH yourself.
3048     AC_CHECK_TOOL(AR,ar)
3049     AC_CHECK_TOOL(NM,nm)
3050     AC_CHECK_TOOL(OBJDUMP,objdump)
3051     AC_CHECK_TOOL(RANLIB,ranlib)
3052     AC_CHECK_TOOL(STRIP,strip)
3053     if test "$_os" = "WINNT"; then
3054         AC_CHECK_TOOL(DLLTOOL,dlltool)
3055         AC_CHECK_TOOL(WINDRES,windres)
3056     fi
3058 AC_SUBST(AR)
3059 AC_SUBST(DLLTOOL)
3060 AC_SUBST(NM)
3061 AC_SUBST(OBJDUMP)
3062 AC_SUBST(PKG_CONFIG)
3063 AC_SUBST(RANLIB)
3064 AC_SUBST(STRIP)
3065 AC_SUBST(WINDRES)
3067 dnl ===================================================================
3068 dnl pkg-config checks on Mac OS X
3069 dnl ===================================================================
3071 if test $_os = Darwin; then
3072     AC_MSG_CHECKING([for bogus pkg-config])
3073     if test -n "$PKG_CONFIG"; then
3074         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | grep -q Mono.framework; then
3075             AC_MSG_RESULT([yes, from Mono])
3076         else
3077             AC_MSG_RESULT([yes, from unknown origin])
3078         fi
3079         AC_MSG_WARN([This might have unexpected consequences, please consider hiding $PKG_CONFIG])
3080         echo "Having a $PKG_CONFIG might have unexpected consequences, please consider hiding it" >>warn
3081     else
3082         AC_MSG_RESULT([no])
3083     fi
3086 dnl ===================================================================
3087 dnl  .NET needs special treatment
3088 dnl (does the above comment really mean .NET, or is it misusing
3089 dnl that to mean Visual Studio .NET 2003 ? And does this also
3090 dnl in fact apply equally to what we actually support, i.e.
3091 dnl Visual Studio 2008 and 2010?)
3092 dnl ===================================================================
3093 if test "$build_os" = "cygwin"; then
3094     dnl Check midl.exe
3095     AC_PATH_PROG(MIDL_PATH, midl.exe)
3096     if test -n "$MIDL_PATH";then
3097         MIDL_PATH=`dirname "$MIDL_PATH"`
3098     fi
3099     if test -n "$with_midl_path";then
3100         with_midl_path=`cygpath -u "$with_midl_path"`
3101     fi
3102     if test -x "$with_midl_path/midl.exe"; then
3103         MIDL_PATH="$with_midl_path"
3104     fi
3105     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
3106         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
3107     fi
3108     if test -z "$MIDL_PATH" ; then
3109         vstest=`./oowintool --msvs-productdir`;
3110         if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
3111             MIDL_PATH="$vstest/Common7/Tools/Bin"
3112         fi
3113     fi
3114     if test -z "$MIDL_PATH" ; then
3115         winsdktest=`./oowintool --windows-sdk-home`
3116         if test -x "$winsdktest/Bin/midl.exe" ; then
3117             MIDL_PATH="$winsdktest/Bin"
3118         fi
3119     fi
3120     if test ! -x "$MIDL_PATH/midl.exe"; then
3121         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
3122     fi
3123     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3124     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
3125     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
3127     dnl Check csc.exe
3128     AC_PATH_PROG(CSC_PATH, csc.exe)
3129     if test -n "$CSC_PATH";then
3130         CSC_PATH=`dirname "$CSC_PATH"`
3131     fi
3132     if test -n "$with_csc_path";then
3133         with_csc_path=`cygpath -u "$with_csc_path"`
3134     fi
3135     if test -x "$with_csc_path/csc.exe"; then
3136         CSC_PATH="$with_csc_path"
3137     else
3138        csctest=`./oowintool --csc-compilerdir`;
3139        if test -x "$csctest/csc.exe"; then
3140            CSC_PATH="$csctest"
3141        fi
3142     fi
3143     if test ! -x "$CSC_PATH/csc.exe"; then
3144         AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
3145     fi
3146     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3147     CSC_PATH=`cygpath -d "$CSC_PATH"`
3148     CSC_PATH=`cygpath -u "$CSC_PATH"`
3150     dnl Check mscoree.lib / .NET Framework dir
3151     AC_MSG_CHECKING(.NET Framework)
3152     if test -n "$with_dotnet_framework_home"; then
3153         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
3154     fi
3155     if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
3156         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
3157     fi
3158     if test -z "$DOTNET_FRAMEWORK_HOME" ; then
3159         frametest=`./oowintool --dotnetsdk-dir`
3160         if test -f "$frametest/lib/mscoree.lib"; then
3161             DOTNET_FRAMEWORK_HOME="$frametest"
3162         else
3163             frametest=`./oowintool --windows-sdk-home`
3164             if test -f "$frametest/lib/mscoree.lib"; then
3165                 DOTNET_FRAMEWORK_HOME="$frametest"
3166             fi
3167         fi
3168     fi
3169     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
3170         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
3171     fi
3172     AC_MSG_RESULT(found)
3173     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3174     DOTNET_FRAMEWORK_HOME=`cygpath -d "$DOTNET_FRAMEWORK_HOME"`
3175     DOTNET_FRAMEWORK_HOME=`cygpath -u "$DOTNET_FRAMEWORK_HOME"`
3176     AC_SUBST(MIDL_PATH)
3177     AC_SUBST(CSC_PATH)
3178     AC_SUBST(DOTNET_FRAMEWORK_HOME)
3181 dnl ===================================================================
3182 dnl Check if stdc headers are available excluding MSVC.
3183 dnl ===================================================================
3184 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3185     AC_HEADER_STDC
3188 dnl ===================================================================
3189 dnl Testing for C++ compiler and version...
3190 dnl ===================================================================
3192 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3193     AC_PROG_CXX
3194 else
3195     if test -n "$CC" -a -z "$CXX"; then
3196         CXX="$CC"
3197     fi
3200 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
3201 if test "$GXX" = "yes"; then
3202     AC_MSG_CHECKING([the GNU C++ compiler version])
3204     _gpp_version=`$CXX -dumpversion`
3205     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
3207     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401" ; then
3208         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0" ; then
3209             export CXX="$GCC_HOME/bin/g++-4.0"
3210             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
3211             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401" ; then
3212                 _gpp_majmin=$_gpp_majmin_2
3213             fi
3214         fi
3215         if test "$_gpp_majmin" -ge "401" ; then
3216             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])
3217         else
3218             AC_MSG_RESULT([implicitly using CXX=$CXX])
3219         fi
3220     else
3221         AC_MSG_RESULT([checked (g++ $_gpp_version)])
3222     fi
3224     if test "$_gpp_majmin" = "304"; then
3225         AC_MSG_CHECKING([whether $CXX has the enum bug])
3226         AC_RUN_IFELSE([AC_LANG_SOURCE([[
3227             extern "C" void abort (void);
3228             extern "C" void exit (int status);
3230             enum E { E0, E1, E2, E3, E4, E5 };
3232             void test (enum E e)
3233             {
3234                 if (e == E2 || e == E3 || e == E1)
3235                     exit (1);
3236             }
3238             int main (void)
3239             {
3240                 test (E4);
3241                 test (E5);
3242                 test (E0);
3243                 return 0;
3244             }
3245             ]])],[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])],[])
3246     fi
3250 # prefx CXX with ccache if needed
3252 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3253     if test "$CCACHE" != "" ; then
3254         AC_MSG_CHECKING([whether $CXX is already ccached])
3255         AC_LANG_PUSH([C++])
3256         save_CXXFLAGS=$CXXFLAGS
3257         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
3258         dnl an empty program will do, we're checking the compiler flags
3259         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3260                           [use_ccache=yes], [use_ccache=no])
3261         if test $use_ccache = yes ; then
3262             AC_MSG_RESULT([yes])
3263         else
3264             CXX="$CCACHE $CXX"
3265             AC_MSG_RESULT([no])
3266         fi
3267         CXXFLAGS=$save_CXXFLAGS
3268         AC_LANG_POP([C++])
3269     fi
3272 dnl ===================================================================
3273 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
3274 dnl ===================================================================
3276 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3277     AC_PROG_CXXCPP
3279     dnl Check whether there's a C pre-processor.
3280     dnl ===================================================================
3281     dnl When using SunStudio compiler, there is a bug with the cc
3282     dnl preprocessor, so use CC preprocessor as the cc preprocessor
3283     dnl See Issuezilla #445.
3284     dnl ===================================================================
3285     if test "$_os" = "SunOS"; then
3286         CPP=$CXXCPP
3287     else
3288         AC_PROG_CPP
3289     fi
3293 dnl ===================================================================
3294 dnl Find integral type sizes and alignments
3295 dnl ===================================================================
3297 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3299     AC_CHECK_SIZEOF(long)
3300     AC_CHECK_SIZEOF(short)
3301     AC_CHECK_SIZEOF(int)
3302     AC_CHECK_SIZEOF(long long)
3303     AC_CHECK_SIZEOF(double)
3304     AC_CHECK_SIZEOF(void*)
3306     SIZEOF_SHORT=$ac_cv_sizeof_short
3307     SIZEOF_INT=$ac_cv_sizeof_int
3308     SIZEOF_LONG=$ac_cv_sizeof_long
3309     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
3310     SIZEOF_DOUBLE=$ac_cv_sizeof_double
3311     SIZEOF_POINTER=$ac_cv_sizeof_voidp
3313     dnl Allow build without AC_CHECK_ALIGNOF, grrr
3314     m4_pattern_allow([AC_CHECK_ALIGNOF])
3315     m4_ifdef([AC_CHECK_ALIGNOF],
3316       ,
3317       [
3318          dnl We know that the ALIGNOF_ variables are used only when cross-compiling
3319          dnl in sal/typesconfig/makefile.mk...
3320          if test "$cross_compiling" = "yes"; then
3321             AC_MSG_ERROR([When cross-compiling you must use a recent Autoconf with [AC_][CHECK_ALIGNOF]])
3322          fi
3323          m4_define([AC_CHECK_ALIGNOF],
3324             [
3325                AC_MSG_WARN([Cannot determine alignment of $1])
3326                AS_TR_SH([ac_cv_alignof_$3])=unknown
3327             ])
3328       ])
3330     AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
3331     AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
3332     AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
3333     AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
3335     ALIGNOF_SHORT=$ac_cv_alignof_short
3336     ALIGNOF_INT=$ac_cv_alignof_int
3337     ALIGNOF_LONG=$ac_cv_alignof_long
3338     ALIGNOF_DOUBLE=$ac_cv_alignof_double
3340     AC_C_BIGENDIAN
3341     WORDS_BIGENDIAN=$ac_cv_c_bigendian
3343     dnl Check for large file support
3344     AC_SYS_LARGEFILE
3345     if test -n "$ac_cv_sys_file_offset_bits"; then
3346         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
3347     fi
3348     if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
3349         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
3350     fi
3351 else
3352     # Hardcode for MSVC
3353     SIZEOF_SHORT=2
3354     SIZEOF_INT=4
3355     SIZEOF_LONG=4
3356     SIZEOF_LONGLONG=8
3357     if test "$CL_X64" = ""; then
3358         SIZEOF_POINTER=4
3359     else
3360         SIZEOF_POINTER=8
3361     fi
3362     ALIGNOF_SHORT=2
3363     ALIGNOF_INT=4
3364     ALIGNOF_LONG=4
3365     ALIGNOF_DOUBLE=8
3366     WORDS_BIGENDIAN=no
3367     LFS_CFLAGS=''
3369 AC_SUBST(WORDS_BIGENDIAN)
3370 AC_SUBST(LFS_CFLAGS)
3372 AC_SUBST(SIZEOF_SHORT)
3373 AC_SUBST(SIZEOF_INT)
3374 AC_SUBST(SIZEOF_LONG)
3375 AC_SUBST(SIZEOF_LONGLONG)
3376 AC_SUBST(SIZEOF_DOUBLE)
3377 AC_SUBST(SIZEOF_POINTER)
3378 AC_SUBST(ALIGNOF_SHORT)
3379 AC_SUBST(ALIGNOF_INT)
3380 AC_SUBST(ALIGNOF_LONG)
3381 AC_SUBST(ALIGNOF_DOUBLE)
3383 dnl ===================================================================
3384 dnl Check if valgrind.h is available
3385 dnl ===================================================================
3386 if test "$cross_compiling" != "yes" -a "$enable_dbgutil" != "no" -a \
3387         -z "$VALGRIND_CFLAGS"; then
3388     dnl Test $prefix (currently only testing for /usr and /usr/local)
3389     dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
3390     prev_cppflags=$CPPFLAGS
3391     CPPFLAGS="-I/usr/include/valgrind"
3392     AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
3393     if test -z "$VALGRIND_CFLAGS"; then
3394         CPPFLAGS="-I/usr/local/include/valgrind"
3395         AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
3396     fi
3397     if test -n "$VALGRIND_CFLAGS"; then
3398         CPPFLAGS=$VALGRIND_CFLAGS
3399         AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
3400     fi
3401     CPPFLAGS=$prev_cppflags
3403 AC_SUBST([VALGRIND_CFLAGS])
3405 dnl ===================================================================
3406 dnl Set the gcc/gxx include directories
3407 dnl ===================================================================
3408 # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
3409 # often contains an i386 which is expanded as a macro.
3410 if test "$GXX" = "yes"; then
3411     AC_MSG_CHECKING([for g++ include path])
3412     if test -z "$with_gxx_include_path"; then
3413         with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
3414         if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
3415             with_gxx_include_path="/usr/include"
3416         fi
3417         if echo $with_gxx_include_path | grep -q linux; then
3418             # workaround for Mandriva - issue 100049
3419             with_gxx_include_path=`cd $with_gxx_include_path && pwd`
3420         fi
3421     fi
3422     dnl This is the original code...
3423     dnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
3424     if test -z "$with_gxx_include_path"; then
3425         with_gxx_include_path="NO_GXX_INCLUDE"
3426         AC_MSG_RESULT([none])
3427     else
3428         AC_MSG_RESULT([$with_gxx_include_path])
3429     fi
3430 else
3431     with_gxx_include_path="NO_GXX_INCLUDE"
3433 GXX_INCLUDE_PATH="$with_gxx_include_path"
3434 AC_SUBST(GXX_INCLUDE_PATH)
3436 dnl ===================================================================
3437 dnl Set the MinGW include directories
3438 dnl ===================================================================
3439 if test "$WITH_MINGW" = "yes"; then
3440     AC_MSG_CHECKING([for MinGW include path])
3441     cat >conftest.$ac_ext <<_ACEOF
3442 #include <stddef.h>
3443 #include <bits/c++config.h>
3444 _ACEOF
3445     _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`
3446     rm conftest.$ac_ext
3447     if test -z "$_mingw_lib_include_path"; then
3448         _mingw_lib_include_path="NO_LIB_INCLUDE"
3449         AC_MSG_RESULT([no MinGW include path])
3450     else
3451         AC_MSG_RESULT([$_mingw_lib_include_path])
3452     fi
3453     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
3454     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
3456     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
3457     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
3459     AC_LANG_PUSH([C++])
3461     AC_MSG_CHECKING([for dynamic libgcc])
3462     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3463 #include <iostream>
3464 using namespace std;
3465 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[   
3466             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
3467             if test -n "$MINGW_GCCDLL"; then
3468                 MINGW_SHARED_GCCLIB=YES
3469                 AC_MSG_RESULT([ $MINGW_GCCDLL])
3470             else
3471                 MINGW_SHARED_GCCLIB=NO
3472                 AC_MSG_RESULT([no])
3473             fi
3474        ],[ AC_MSG_RESULT([no])
3475        
3476     ])
3478     AC_MSG_CHECKING([for dynamic libstdc++])
3479     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3480 #include <iostream>
3481 using namespace std;
3482 ]], [[ cout << "Hello there." << endl; ]])],[   
3483             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
3484             if test -n "$MINGW_GXXDLL"; then
3485                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
3486                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
3487                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
3488                 MINGW_SHARED_GXXLIB=YES
3489                 AC_MSG_RESULT([$MINGW_GXXDLL])
3490             else
3491                 MINGW_SHARED_GXXLIB=NO
3492                 AC_MSG_RESULT([no])
3493             fi
3494        ],[ AC_MSG_RESULT([no])
3495        
3496     ])
3498     AC_LANG_POP([C++])
3500     AC_SUBST(MINGW_CLIB_DIR)
3501     AC_SUBST(MINGW_SHARED_GCCLIB)
3502     AC_SUBST(MINGW_SHARED_GXXLIB)
3503     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
3504     AC_SUBST(MINGW_GCCDLL)
3505     AC_SUBST(MINGW_GXXDLL)
3508 dnl ===================================================================
3509 dnl Extra checking for the SunOS compiler
3510 dnl ===================================================================
3511 if test "$_os" = "SunOS"; then
3512     dnl SunStudio C++ compiler packaged with SunStudio C compiler
3513     if test "$CC" = "cc"; then
3514     AC_MSG_CHECKING([SunStudio C++ Compiler])
3515         if test "$CXX" != "CC"; then
3516             AC_MSG_WARN([SunStudio C++ was not found])
3517             echo "SunStudio C++ was not found" >> warn
3518         else
3519             AC_MSG_RESULT([checked])
3520         fi
3521     fi
3524 dnl *************************************************************
3525 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
3526 dnl *************************************************************
3527 if test "$WITH_MINGW" = "yes"; then
3528     AC_MSG_CHECKING([exception type])
3529     AC_LANG_PUSH([C++])
3530     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
3532         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
3534         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
3535     ])
3536     AC_MSG_RESULT($exceptions_type)
3537     AC_LANG_POP([C++])
3540 EXCEPTIONS="$exceptions_type"
3541 AC_SUBST(EXCEPTIONS)
3543 dnl ===================================================================
3544 dnl Checks for what the default STL should be
3545 dnl ===================================================================
3546 AC_MSG_CHECKING([Whether building STLPort library makes sense])
3547 BUILD_STLPORT="no"
3548 if test "$_os" = "Linux"; then
3549     case "$host_cpu" in
3550     i?86)
3551         case "$host_os" in
3552         k*bsd*-gnu*)
3553             BUILD_STLPORT="no"
3554             ;;
3555         *)
3556             BUILD_STLPORT="yes"
3557             ;;
3558         esac
3559         ;;
3560     *)
3561         BUILD_STLPORT="no"
3562         ;;
3563     esac
3564 elif test "$_os" = "SunOS"; then
3565     BUILD_STLPORT="yes"
3566 elif test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
3567     BUILD_STLPORT="yes"
3568 elif test "$_os" = "FreeBSD"; then
3569     BUILD_STLPORT="yes"
3571 if test "$BUILD_STLPORT" = "yes" ; then
3572     AC_MSG_RESULT([yes])
3573 else
3574     AC_MSG_RESULT([no])
3577 AC_MSG_CHECKING([Whether STLPort library will be actually built])
3578 if test "$with_stlport" = "auto" -o "$BUILD_STLPORT" = "no"; then
3579     with_stlport=$BUILD_STLPORT
3581 if test "$with_stlport" = "yes" ; then
3582     AC_MSG_RESULT([yes])
3583     WITH_STLPORT=YES
3584     SCPDEFS="$SCPDEFS -DWITH_STLPORT"
3585     BUILD_TYPE="$BUILD_TYPE STLPORT"
3586 else
3587     WITH_STLPORT=NO
3588     AC_MSG_RESULT([no])
3591 AC_SUBST(WITH_STLPORT)
3593 dnl ===================================================================
3594 dnl thread-safe statics
3595 dnl ===================================================================
3596 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
3597 unset HAVE_THREADSAFE_STATICS
3598 if test "$GCC" = "yes"; then
3599     save_CXXFLAGS=$CXXFLAGS
3600     CXXFLAGS="$CXXFLAGS -fthreadsafe-statics"
3601     AC_LANG_PUSH([C++])
3602     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],[HAVE_THREADSAFE_STATICS=TRUE],[])
3603     AC_LANG_POP([C++])
3604     CXXFLAGS=$save_CXXFLAGS
3605     if test "$HAVE_THREADSAFE_STATICS" = "TRUE"; then
3606         dnl Some C++ runtimes use a single lock for all static variables, which
3607         dnl can cause deadlock in multi-threaded applications.  This is not
3608         dnl easily tested here; for POSIX-based systems, if executing the
3609         dnl following C++ program does not terminate then the tool chain
3610         dnl apparently has this problem:
3611         dnl
3612         dnl   #include <pthread.h>
3613         dnl   int h() { return 0; }
3614         dnl   void * g(void * unused) {
3615         dnl     static int n = h();
3616         dnl     return &n;
3617         dnl   }
3618         dnl   int f() {
3619         dnl     pthread_t t;
3620         dnl     pthread_create(&t, 0, g, 0);
3621         dnl     pthread_join(t, 0);
3622         dnl     return 0;
3623         dnl   }
3624         dnl   int main() {
3625         dnl     static int n = f();
3626         dnl     return n;
3627         dnl   }
3628         dnl
3629         dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is
3630         dnl at least one instance of GCC 4.2.4 (used on a "Linux
3631         dnl ooobuild1.osuosl.org 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15
3632         dnl EDT 2011 i686 i686 i386 GNU/Linux" machine); see the definition of
3633         dnl __cxa_guard_acquire in GCC's libstdc++-v3/libsupc++/guard.cc for
3634         dnl what #ifdefs actually make a difference there.  Conservative advice
3635         dnl from Jakub Jelinek is to assume it working in GCC >= 4.3:
3636         if test "$_os" = "Darwin" -o "${GCCVER?}" -lt 040300; then
3637             unset HAVE_THREADSAFE_STATICS
3638             AC_MSG_RESULT([broken (i.e., no)])
3639         else
3640             AC_MSG_RESULT([yes])
3641         fi
3642     else
3643         AC_MSG_RESULT([no])
3644     fi
3645 else
3646     AC_MSG_RESULT([unknown (assuming no)])
3648 AC_SUBST(HAVE_THREADSAFE_STATICS)
3650 dnl ===================================================================
3651 dnl visibility and c++0x features
3652 dnl ===================================================================
3653 if test "$GCC" = "yes"; then
3654     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
3655     save_CFLAGS=$CFLAGS
3656     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
3657     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
3658     CFLAGS=$save_CFLAGS
3659     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3660         AC_MSG_RESULT([yes])
3661     else
3662         AC_MSG_RESULT([no])
3663     fi
3665     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
3666     save_CFLAGS=$CFLAGS
3667     CFLAGS="$CFLAGS -Werror -Wno-long-double"
3668     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
3669     CFLAGS=$save_CFLAGS
3670     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
3671         AC_MSG_RESULT([yes])
3672     else
3673         AC_MSG_RESULT([no])
3674     fi
3676     AC_MSG_CHECKING([whether $CC supports -mno-avx])
3677     save_CFLAGS=$CFLAGS
3678     CFLAGS="$CFLAGS -Werror -mno-avx"
3679     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
3680     CFLAGS=$save_CFLAGS
3681     if test "$HAVE_GCC_AVX" = "TRUE"; then
3682         AC_MSG_RESULT([yes])
3683     else
3684         AC_MSG_RESULT([no])
3685     fi
3687     AC_MSG_CHECKING([whether $CC supports -std=c++0x without Language Defect 757])
3688     save_CXXFLAGS=$CXXFLAGS
3689     CXXFLAGS="$CXXFLAGS -std=c++0x"
3690     AC_LANG_PUSH([C++])
3692     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3693 #include <stddef.h>
3695 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
3697 namespace
3699         struct b
3700         {
3701                 int i;
3702                 int j;
3703         };
3705 ]], [[
3706 struct a
3708         int i;
3709         int j;
3711 a thinga[]={{0,0}, {1,1}};
3712 b thingb[]={{0,0}, {1,1}};
3713 size_t i = sizeof(sal_n_array_size(thinga));
3714 size_t j = sizeof(sal_n_array_size(thingb));
3715 return !(i != 0 && j != 0);
3716 ]])],[HAVE_CXX0X=TRUE],[])
3718     AC_LANG_POP([C++])
3719     CXXFLAGS=$save_CXXFLAGS
3720     if test "$HAVE_CXX0X" = "TRUE"; then
3721         AC_MSG_RESULT([yes])
3722     else
3723         AC_MSG_RESULT([no])
3724     fi
3727 AC_SUBST(HAVE_CXX0X)
3728 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
3729 AC_SUBST(HAVE_GCC_AVX)
3731 dnl ===================================================================
3732 dnl system stl sanity tests
3733 dnl ===================================================================
3734 HAVE_GCC_VISIBILITY_BROKEN=
3735 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) ; then
3737     AC_LANG_PUSH([C++])
3739     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3740         AC_MSG_CHECKING([if STL headers are visibility safe])
3741         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
3742         AC_MSG_RESULT([$stlvisok])
3743         if test "$stlvisok" = "no"; then
3744             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
3745             echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
3746             unset HAVE_GCC_VISIBILITY_FEATURE
3747         fi
3748     fi
3750     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3751         sharedlink_ldflags_save=$LDFLAGS
3752         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
3754         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
3755         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3756 #include <sstream>
3757 using namespace std;
3758             ]], [[
3759 istringstream strm( "test" ); return 0;
3760             ]])],[$EGREP -q  unresolvable conftest.err;
3761             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
3762         ])
3763         AC_MSG_RESULT([$gccvisok])
3764         if test "$gccvisok" = "no"; then
3765             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
3766             echo "Your gcc is not -fvisibility-inlines-hidden safe, disabling that." >> warn
3767             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
3768         fi
3770         LDFLAGS=$sharedlink_ldflags_save
3771     fi
3773     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3774         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
3775         cat >visibility.cxx <<_ACEOF
3776 #pragma GCC visibility push(hidden)
3777 struct __attribute__ ((visibility ("default"))) TestStruct {
3778   static void Init();
3780 __attribute__ ((visibility ("default"))) void TestFunc() {
3781   TestStruct::Init();
3783 _ACEOF
3784         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
3785             gccvisbroken=yes
3786         else
3787             case "$host_cpu" in
3788             i?86|x86_64)
3789                 if test "$_os" = "Darwin"; then
3790                     gccvisbroken=no
3791                 else
3792                     if $EGREP -q '@PLT' visibility.s; then
3793                         gccvisbroken=no
3794                     else
3795                         gccvisbroken=yes
3796                     fi
3797                 fi
3798                 ;;
3799             *)
3800                 gccvisbroken=no
3801                 ;;
3802             esac
3803         fi
3804         rm -f visibility.s visibility.cxx
3806         AC_MSG_RESULT([$gccvisbroken])
3807         if test "$gccvisbroken" = "yes"; then
3808             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
3809             echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
3810             unset HAVE_GCC_VISIBILITY_FEATURE
3811         fi
3812     fi
3814     AC_LANG_POP([C++])
3817 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
3818 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
3820 dnl ===================================================================
3821 dnl allocator
3822 dnl ===================================================================
3823 AC_MSG_CHECKING([which memory allocator to use])
3824 if test "$with_alloc" = "system"; then
3825     AC_MSG_RESULT([system])
3826     ALLOC="SYS_ALLOC";
3827     AC_CHECK_FUNCS([malloc realloc calloc free])
3829 if test "$with_alloc" = "tcmalloc"; then
3830     AC_MSG_RESULT(tcmalloc)
3831     if ! echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
3832         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
3833     fi
3834     AC_CHECK_LIB(tcmalloc, malloc, [],
3835         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
3836     ALLOC="TCMALLOC";
3838 if test "$with_alloc" = "jemalloc"; then
3839     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
3840         AC_MSG_RESULT(jemalloc)
3841         save_CFLAGS=$CFLAGS
3842         CFLAGS="$CFLAGS -pthread"
3843         AC_CHECK_LIB(jemalloc, malloc, [],
3844             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
3845         ALLOC="JEMALLOC";
3846         CFLAGS=$save_CFLAGS
3847     else
3848         AC_MSG_RESULT([system])
3849         ALLOC="SYS_ALLOC";
3850         AC_CHECK_FUNCS([malloc realloc calloc free])
3851     fi
3853 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
3854     AC_MSG_RESULT([internal])
3856 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
3857 AC_SUBST(HAVE_POSIX_FALLOCATE)
3858 AC_SUBST(ALLOC)
3860 dnl ===================================================================
3861 dnl Custom build version
3862 dnl ===================================================================
3864 AC_MSG_CHECKING([whether to add custom build version])
3865 if test "z$with_build_version" != "z"; then
3866     BUILD_VER_STRING=$with_build_version
3867     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
3868 else
3869     BUILD_VER_STRING=
3870     AC_MSG_RESULT([no])
3872 AC_SUBST(BUILD_VER_STRING)
3874 dnl ===================================================================
3875 dnl Java support enable
3876 dnl ===================================================================
3877 AC_MSG_CHECKING([whether to build with Java support])
3878 if test "$with_java" != "no"; then
3879     AC_MSG_RESULT([yes])
3880     SOLAR_JAVA="TRUE"
3881 else
3882     AC_MSG_RESULT([no])
3883     SOLAR_JAVA=""
3886 AC_SUBST(SOLAR_JAVA)
3888 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
3889 dnl want there to be *run-time* (and build-time) support for Java extensions in the
3890 dnl built LibreOffice.
3892 dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
3893 dnl (no runtime support). It doesn't seem to ever be set to this
3894 dnl value, though, and everywhere SOLAR_JAVA is only checked for being
3895 dnl empty or non-empty.
3897 dnl SOLAR_JAVA="" indicate no java support at all
3899 if test "$_os" = "Linux" && test "$host_cpu" = "powerpc"; then
3900     # IBMs JDK needs this...
3901     JITC_PROCESSOR_TYPE=6
3902     export JITC_PROCESSOR_TYPE
3903     JITC_PROCESSOR_TYPE_EXPORT="export JITC_PROCESSOR_TYPE=$JITC_PROCESSOR_TYPE"
3905 AC_SUBST([JITC_PROCESSOR_TYPE_EXPORT])
3907 if test $_os = "WINNT"; then
3908     WITH_VC_REDIST="TRUE"
3910 AC_SUBST(WITH_VC_REDIST)
3912 dnl ===================================================================
3913 dnl Checks for Java
3914 dnl ===================================================================
3915 if test "$SOLAR_JAVA" != ""; then
3917     # Windows-specific tests
3918     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3919         if test "$CL_X64" != ""; then
3920             bitness="64-bit"
3921             otherbitness="32-bit"
3922         else
3923             bitness="32-bit"
3924             otherbitness="64-bit"
3925         fi
3927         if test -z "$with_jdk_home"; then
3929             # Unfortunately apparently no way to find, if needed, the 64-bit
3930             # JDK in the Registry from the 32-bit Perl oowintool
3932             _jdk_home=`./oowintool --jdk-home`
3933             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
3934                 with_jdk_home="$_jdk_home"
3935                 howfound="found by oowintool"
3936             else
3937                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
3938             fi
3939         else
3940             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
3941             howfound="you passed"
3942         fi
3943     fi
3945     JAVA_HOME=; export JAVA_HOME
3946     if test -z "$with_jdk_home"; then
3947         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
3948     else
3949         _java_path="$with_jdk_home/bin/$with_java"
3950         dnl Check if there is a Java interpreter at all.
3951         if test -x "$_java_path"; then
3952             JAVAINTERPRETER=$_java_path
3953         else
3954             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
3955         fi
3956     fi
3958     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3959         # Check that the JDK found is correct architecture
3960         # Why is this necessary, we don't link with any library from the JDK I think,
3962         shortjdkhome=`cygpath -d "$with_jdk_home"`
3963         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
3964             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
3965             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
3966         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
3967             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
3968             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
3969         fi
3971         if test x`echo "$JAVAINTERPRETER" | grep -i '\.exe$'` = x; then
3972             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
3973         fi
3974         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
3975         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
3976     elif test "$_os" = "Darwin"; then
3977         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
3978         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
3979         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
3980         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
3981         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
3982             AC_MSG_RESULT([yes])
3983             JAVAIFLAGS=-d32
3984         else
3985             AC_MSG_RESULT([no])
3986         fi
3987     fi
3990 dnl ===================================================================
3991 dnl Checks for JDK.
3992 dnl ===================================================================
3994 # Note that JAVA_HOME as for now always means the *build* platform's
3995 # JAVA_HOME. Whether all the complexity here actually is needed any
3996 # more or not, no idea.
3998 if test "$SOLAR_JAVA" != ""; then
3999     _gij_longver=0
4000     AC_MSG_CHECKING([the installed JDK])
4001     if test -n "$JAVAINTERPRETER"; then
4002         dnl java -version sends output to stderr!
4003         if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
4004             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
4005         elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then
4006             JDK=gcj
4007             AC_MSG_RESULT([checked (gcj)])
4008             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
4009             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4011         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "BEA"` -gt 0; then
4012             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
4013         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "IBM"` -gt 0; then
4014             JDK=ibm
4016             dnl IBM JDK specific tests
4017             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
4018             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
4020             if test "$_jdk_ver" -lt 10500; then
4021                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
4022             fi
4024             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
4026             if test "$with_jdk_home" = ""; then
4027                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
4028 you must use the "--with-jdk-home" configure option explicitly])
4029             fi
4031            JAVA_HOME=$with_jdk_home
4033         else
4034             JDK=sun
4036             dnl Sun JDK specific tests
4037             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
4038             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
4040             if test "$_jdk_ver" -lt 10500; then
4041                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
4042             fi
4043             AC_MSG_RESULT([checked (JDK $_jdk)])
4044             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
4045             if test "$_os" = "WINNT"; then
4046                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
4047             fi
4048         fi
4049     else
4050         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
4051     fi
4052 else
4053     dnl Java disabled
4054     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
4057 _java_target_ver="1.5"
4058 dnl ===================================================================
4059 dnl Check for target Java bytecode version
4060 dnl ===================================================================
4061 if test "$SOLAR_JAVA" != ""; then
4062     AC_MSG_CHECKING([for target Java bytecode version])
4063     if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
4064     AC_MSG_RESULT([default by $JDK])
4065     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
4066         AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
4067     fi
4068     else
4069     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
4070         _java_target_ver="$with_java_target_version"
4071         AC_MSG_RESULT([$_java_target_ver])
4072     elif test $_jdk_ver -gt 10000 ; then
4073         _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
4074         AC_MSG_RESULT([$_java_target_ver])
4075     else
4076         AC_MSG_ERROR([Unable to guess Java bytecode version from Java version!])
4077     fi
4078     fi
4080     if ! test -z "$_java_target_ver" -o \
4081         "$_java_target_ver" = "1.1" -o \
4082             "$_java_target_ver" = "1.2" -o \
4083         "$_java_target_ver" = "1.3" -o \
4084         "$_java_target_ver" = "1.4" -o \
4085         "$_java_target_ver" = "1.5" -o \
4086         "$_java_target_ver" = "1.6" -o \
4087         "$_java_target_ver" = "5" ; then
4088         AC_MSG_ERROR([$_java_target_ver is not a supported Java bytecode version!])
4089     fi
4091     JAVA_SOURCE_VER="$_java_target_ver"
4092     JAVA_TARGET_VER="$_java_target_ver"
4095 dnl ===================================================================
4096 dnl Checks for javac
4097 dnl ===================================================================
4098 if test "$SOLAR_JAVA" != ""; then
4099     if test "$JDK" = "gcj"; then
4100         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
4101     else
4102         javacompiler="javac"
4103     fi
4104     if test -z "$with_jdk_home"; then
4105         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
4106     else
4107         _javac_path="$with_jdk_home/bin/$javacompiler"
4108         dnl Check if there is a Java compiler at all.
4109         if test -x "$_javac_path"; then
4110             JAVACOMPILER=$_javac_path
4111         fi
4112     fi
4113     if test -z "$JAVACOMPILER"; then
4114         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
4115     fi
4116     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4117         if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then
4118             JAVACOMPILER="${JAVACOMPILER}.exe"
4119         fi
4120         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
4121         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
4122     fi
4124     if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then
4125         AC_MSG_CHECKING([re-checking JDK])
4126         JDK=gcj
4127         AC_MSG_RESULT([checked (ecj)])
4128         #TODO: what's to do here? some switch to do 1.5 compiling?
4129         JAVAFLAGS="-source 1.5 -target 1.5"
4130         _gij_longver="40200"
4131     fi
4134 JAVACISGCJ=""
4135 dnl ===================================================================
4136 dnl Checks that javac is gcj
4137 dnl ===================================================================
4138 if test "$SOLAR_JAVA" != ""; then
4139     if test `$JAVACOMPILER --version 2>&1 | grep -c "GCC"` -gt 0; then
4140         JAVACISGCJ="yes"
4141     fi
4143 AC_SUBST(JAVACISGCJ)
4145 JAVACISKAFFE=""
4146 dnl ===================================================================
4147 dnl Checks that javac is kaffe
4148 dnl ===================================================================
4149 if test "$SOLAR_JAVA" != ""; then
4150     if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
4151         JAVACISKAFFE="yes"
4152     fi
4154 AC_SUBST(JAVACISKAFFE)
4156 dnl ===================================================================
4157 dnl Checks for javadoc
4158 dnl ===================================================================
4159 if test "$SOLAR_JAVA" != ""; then
4160     if test -z "$with_jdk_home"; then
4161         AC_PATH_PROG(JAVADOC, javadoc)
4162     else
4163         _javadoc_path="$with_jdk_home/bin/javadoc"
4164         dnl Check if there is a javadoc at all.
4165         if test -x "$_javadoc_path"; then
4166             JAVADOC=$_javadoc_path
4167         else
4168             AC_PATH_PROG(JAVADOC, javadoc)
4169         fi
4170     fi
4171     if test -z "$JAVADOC"; then
4172         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
4173     fi
4174     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4175         if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then
4176             JAVADOC="${JAVADOC}.exe"
4177         fi
4178         JAVADOC=`cygpath -d "$JAVADOC"`
4179         JAVADOC=`cygpath -u "$JAVADOC"`
4180     fi
4183 if test "$SOLAR_JAVA" != ""; then
4184     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
4185     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
4186         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
4187            # try to recover first by looking whether we have a alternatives
4188            # system as in Debian or newer SuSEs where following /usr/bin/javac
4189            # over /etc/alternatives/javac leads to the right bindir where we
4190            # just need to strip a bit away to get a valid JAVA_HOME
4191            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
4192         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
4193             # maybe only one level of symlink (e.g. on Mac)
4194             JAVA_HOME=$(readlink $JAVACOMPILER)
4195             if test "$(dirname $JAVA_HOME)" = "."; then
4196                 # we've got no path to trim back
4197                 JAVA_HOME=""
4198             fi
4199         else
4200             # else warn
4201             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
4202             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
4203             echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
4204             echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
4205         fi
4206         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
4207         if test "$JAVA_HOME" != "/usr"; then
4208             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
4209                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
4210                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
4211                 dnl Tiger already returns a JDK path..
4212                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
4213             else
4214                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
4215             fi
4216         fi
4217     fi
4218     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
4220     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
4221     if test -z "$JAVA_HOME"; then
4222         if test "x$with_jdk_home" = "x"; then
4223             cat > findhome.java <<_ACEOF
4224 [import java.io.File;
4226 class findhome
4228     public static void main(String args[])
4229     {
4230         String jrelocation = System.getProperty("java.home");
4231         File jre = new File(jrelocation);
4232         System.out.println(jre.getParent());
4233     }
4235 _ACEOF
4236             AC_MSG_CHECKING([if javac works])
4237             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
4238             AC_TRY_EVAL(javac_cmd)
4239             if test $? = 0 && test -f ./findhome.class ; then
4240                 AC_MSG_RESULT([javac works])
4241             else
4242                 echo "configure: javac test failed" >&5
4243                 cat findhome.java >&5
4244                 AC_MSG_ERROR([javac does not work - java projects will not build!])
4245             fi
4246             AC_MSG_CHECKING([if gij knows its java.home])
4247             JAVA_HOME=`$JAVAINTERPRETER findhome`
4248             if test $? = 0 && test "$JAVA_HOME" != "" ; then
4249                 AC_MSG_RESULT([$JAVA_HOME])
4250             else
4251                 echo "configure: java test failed" >&5
4252                 cat findhome.java >&5
4253                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
4254             fi
4255             # clean-up after ourselves
4256             rm -f ./findhome.java ./findhome.class
4257         else
4258             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
4259         fi
4260     fi
4262     dnl second sanity check JAVA_HOME if possible
4263     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
4264         # now check if $JAVA_HOME is really valid
4265         if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
4266             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
4267                 JAVA_HOME_OK="NO"
4268             fi
4269         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
4270             JAVA_HOME_OK="NO"
4271         fi
4272         if test "$JAVA_HOME_OK" = "NO"; then
4273             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
4274             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
4275             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
4276             echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
4277             echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
4278             echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
4279         fi
4280     fi
4283 AWTLIB=
4285 if test "$SOLAR_JAVA" != ""; then
4286     AC_MSG_CHECKING([for jawt lib name])
4287     if test "$JDK" = "gcj"; then
4288         save_CFLAGS=$CFLAGS
4289         save_LDFLAGS=$LDFLAGS
4290         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4291         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
4292         exec 6>/dev/null # no output
4293         AC_CHECK_HEADER(jni.h, [],
4294                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
4295         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
4296         exec 6>&1 # output on again
4297         CFLAGS=$save_CFLAGS
4298         LDFLAGS=$save_LDFLAGS
4299     fi
4300     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
4301     # A workaround is to link also against libpmawt.so
4302     if test "$JDK" = "ibm" ; then
4303         save_CFLAGS=$CFLAGS
4304         save_LDFLAGS=$LDFLAGS
4305         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
4306         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4307         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
4308         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
4309         export LD_LIBRARY_PATH
4310         exec 6>/dev/null # no output
4311         AC_CHECK_HEADER(jni.h, [],
4312                     [AC_MSG_ERROR([jni.h could not be found.])], [])
4313         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
4314         if test -z "$AWTLIB"; then
4315             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
4316             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
4317         fi
4318         exec 6>&1 # output on again
4319         CFLAGS=$save_CFLAGS
4320         LDFLAGS=$save_LDFLAGS
4321         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
4322     fi
4323     if test -z "$AWTLIB"; then
4324         AWTLIB=-ljawt
4325     fi
4326     AC_MSG_RESULT([$AWTLIB])
4327     AC_SUBST(AWTLIB)
4330 AC_SUBST(JAVA_HOME)
4331 AC_SUBST(JDK)
4332 AC_SUBST(JAVAFLAGS)
4333 AC_SUBST(JAVA_SOURCE_VER)
4334 AC_SUBST(JAVA_TARGET_VER)
4335 AC_SUBST(JAVAINTERPRETER)
4336 AC_SUBST(JAVAIFLAGS)
4337 AC_SUBST(JAVACOMPILER)
4338 AC_SUBST(JAVADOC)
4340 dnl ===================================================================
4341 dnl Checks for specific files.
4342 dnl ===================================================================
4344 dnl ===================================================================
4345 dnl Checks for programs.
4346 dnl ===================================================================
4348 dnl ===================================================================
4349 dnl Check whether we already have dmake
4350 dnl ===================================================================
4351 AC_PATH_PROG(DMAKE, dmake, no)
4352 if test "$DMAKE" = "no"; then
4353     BUILD_DMAKE=YES
4354     echo "dmake will be built on ./bootstrap"
4355 else
4356     AC_MSG_CHECKING([whether the found dmake is the right dmake])
4357     # we need to find out whether that dmake we found is "our" dmake
4358     # or the dmake from Sun's SunStudio Compiler which is something
4359     # different
4360     # This test _should_ work because the one accepts -V (ours) and one
4361     # (the other) not...
4362     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
4363     if test $? -eq 0; then
4364         BUILD_DMAKE=NO
4365         AC_MSG_RESULT([yes])
4366         AC_MSG_CHECKING([the dmake version])
4367         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
4368         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
4369             AC_MSG_RESULT([OK, >= 4.11])
4370         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
4371             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
4372             AC_MSG_RESULT([OK, >= 4.11])
4373         else
4374             AC_MSG_RESULT([too old. >= 4.11 is needed])
4375             echo "A newer dmake will be built on ./bootstrap"
4376             BUILD_DMAKE=YES
4377         fi
4378     else
4379         AC_MSG_RESULT([no])
4380         echo "dmake will be built on ./bootstrap"
4381         BUILD_DMAKE=YES
4382     fi
4384 AC_SUBST(BUILD_DMAKE)
4386 AC_MSG_CHECKING([whether to enable EPM for packing])
4387 BUILD_EPM=NO
4388 if test "$enable_epm" = "yes"; then
4389     AC_MSG_RESULT([yes])
4390     dnl ===================================================================
4391     dnl Check for epm - not needed for Windows
4392     dnl ===================================================================
4393     if test "$_os" != "WINNT"; then
4394         if test -n "$with_epm"; then
4395             EPM=$with_epm
4396         else
4397             AC_PATH_PROG(EPM, epm, no)
4398         fi
4399         if test "$EPM" = "no" || test "$EPM" = "internal"; then
4400             echo "EPM will be built."
4401             BUILD_EPM=YES
4402             BUILD_TYPE="$BUILD_TYPE EPM"
4403         else
4404             # Gentoo has some epm which is something different...
4405             AC_MSG_CHECKING([whether the found epm is the right epm])
4406             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
4407                 AC_MSG_RESULT([yes])
4408             else
4409                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
4410             fi
4411             AC_MSG_CHECKING([epm version])
4412             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
4413             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
4414                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
4415                 AC_MSG_RESULT([OK, >= 3.7])
4416                 BUILD_EPM=NO
4417                 if test "$_os" = "Darwin"; then
4418                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
4419                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
4420                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4421                         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)])
4422                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4423                         AC_MSG_RESULT([$_pm, ok])
4424                     else # we never should get here, but go safe
4425                         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)])
4426                     fi
4427                 fi
4428             else
4429                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
4430                 echo "EPM will be built."
4431                 BUILD_EPM=YES
4432                 BUILD_TYPE="$BUILD_TYPE EPM"
4433             fi
4434         fi
4435     fi
4437     # test which package format to use
4438     AC_MSG_CHECKING([which package format to use])
4440     # defaults
4441     case "$_os" in
4442     Darwin)
4443         PKGFORMAT=dmg
4444         ;;
4445     SunOS)
4446         PKGFORMAT=pkg
4447         ;;
4448     Linux)
4449         # if building on Debian, default should be deb...
4450         if test -e /etc/debian_version; then
4451             PKGFORMAT=deb
4452         else
4453             PKGFORMAT=rpm
4454         fi
4455         ;;
4456     AIX)
4457         PKGFORMAT=rpm
4458         ;;
4459     OpenBSD|DragonFly)
4460         PKGFORMAT=portable
4461         ;;
4462     *BSD)
4463         PKGFORMAT=bsd
4464         ;;
4465     WINNT)
4466         PKGFORMAT=msi
4467         ;;
4468     # we never should get here since we check the arciecture/os at the beginning,
4469     # but go sure...
4470     *)
4471         AC_MSG_ERROR([unknown system])
4472     esac
4473     if test -n "$with_package_format"; then
4474         for i in $with_package_format; do
4475             case "$i" in
4476             aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
4477                 ;;
4478             *)
4479                 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4480 aix - AIX software distribution
4481 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4482 deb - Debian software distribution
4483 inst or tardist - IRIX software distribution
4484 osx - MacOS X software distribution
4485 pkg - Solaris software distribution
4486 rpm - RedHat software distribution
4487 setld - Tru64 (setld) software distribution
4488 native - "Native" software distribution for the platform
4489 portable - Portable software distribution
4490 LibreOffice additionally supports:
4491 archive - .tar.gz or .zip
4492 dmg - Mac OS X .dmg
4493 installed - installation tree
4494 msi - Windows .msi
4495             ])
4496                 ;;
4497             esac
4498         done
4499         PKGFORMAT="$with_package_format"
4500     fi
4501     AC_MSG_RESULT([$PKGFORMAT])
4502     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
4503         AC_MSG_CHECKING([for rpm])
4504         for a in "$RPM" rpmbuild rpm; do
4505             $a --usage >/dev/null 2> /dev/null
4506             if test $? -eq 0; then
4507                 RPM=$a
4508                 break
4509             else
4510                 $a --version >/dev/null 2> /dev/null
4511                 if test $? -eq 0; then
4512                     RPM=$a
4513                     break
4514                 fi
4515             fi
4516         done
4517         if test -z "$RPM" ; then
4518             AC_MSG_ERROR([not found])
4519         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
4520             RPM_PATH=`which $RPM`
4521             AC_MSG_RESULT([$RPM_PATH])
4522         else
4523             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
4524         fi
4525     fi
4526     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
4527         AC_PATH_PROG(DPKG, dpkg, no)
4528         if test "$DPKG" = "no"; then
4529             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
4530         fi
4531     fi
4532     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
4533         if test "$_os" = "Darwin"; then
4534             AC_MSG_CHECKING([for PackageMaker availability])
4535             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
4536                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
4537             else
4538                 AC_MSG_RESULT([ok])
4539             fi
4540         else
4541             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
4542         fi
4543     fi
4544     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
4545        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4546         if test "$EPM" != "no" && test "$EPM" != "internal"; then
4547             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
4548                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
4549                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
4550                     AC_MSG_RESULT([yes])
4551                 else
4552                     AC_MSG_RESULT([no])
4553                     if echo "$PKGFORMAT" | grep -q rpm; then
4554                         _pt="rpm"
4555                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
4556                         echo "the rpms will need to be installed with --nodeps" >> warn
4557                     else
4558                         _pt="pkg"
4559                     fi
4560                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
4561                     echo "the ${_pt}s will not be relocateable" >> warn
4562                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
4563                                  relocation will work, you need to patch your epm with the
4564                                  patch in epm/epm-3.7.patch or build with
4565                                  --with-epm=internal which will build a suitable epm])
4566                 fi
4567             fi
4568         fi
4569     fi
4570     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4571         AC_PATH_PROG(PKGMK, pkgmk, no)
4572         if test "$PKGMK" = "no"; then
4573             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
4574         fi
4575     fi
4576     AC_SUBST(RPM)
4577     AC_SUBST(DPKG)
4578     AC_SUBST(PKGMK)
4579 else
4580     AC_MSG_RESULT([no])
4581     EPM=NO
4582     PKGFORMAT=native
4584 AC_SUBST(EPM)
4585 AC_SUBST(BUILD_EPM)
4586 AC_SUBST(PKGFORMAT)
4588 dnl ===================================================================
4589 dnl Check for gperf
4590 dnl ===================================================================
4591 AC_PATH_PROG(GPERF, gperf)
4592 if test -z "$GPERF"; then
4593     AC_MSG_ERROR([gperf not found but needed. Install it.])
4595 AC_MSG_CHECKING([gperf version])
4596 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
4597     AC_MSG_RESULT([OK])
4598 else
4599     AC_MSG_ERROR([too old, you need at least 3.0.0])
4601 AC_SUBST(GPERF)
4603 dnl ===================================================================
4604 dnl Check for building ODK
4605 dnl ===================================================================
4606 AC_MSG_CHECKING([whether to build the ODK])
4607 if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
4608     AC_MSG_RESULT([yes])
4610     if test "$with_java" != "no"; then
4611         AC_MSG_CHECKING([whether to build unowinreg.dll])
4612         if test "$_os" = "WINNT" -a "z$enable_build_unowinreg" = "z" ; then
4613             # build on Win by default
4614             enable_build_unowinreg=yes
4615         fi
4616         if test "z$enable_build_unowinreg" = "z" -o "$enable_build_unowinreg" = "no"; then
4617             AC_MSG_RESULT([no])
4618             BUILD_UNOWINREG=NO
4619         else
4620             AC_MSG_RESULT([yes])
4621             BUILD_UNOWINREG=YES
4622         fi
4623         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
4624             if test -z "$with_mingw_cross_compiler"; then
4625                 dnl Guess...
4626                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
4627             elif test -x "$with_mingw_cross_compiler"; then
4628                  MINGWCXX="$with_mingw_cross_compiler"
4629             else
4630                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
4631             fi
4633             if test "$MINGWCXX" = "false"; then
4634                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
4635             fi
4637             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
4638             if test -x "$mingwstrip_test"; then
4639                 MINGWSTRIP="$mingwstrip_test"
4640             else
4641                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
4642             fi
4644             if test "$MINGWSTRIP" = "false"; then
4645                 AC_MSG_ERROR(MinGW32 binutils not found.)
4646             fi
4647         fi
4648     fi
4649     BUILD_TYPE="$BUILD_TYPE ODK"
4650 else
4651     AC_MSG_RESULT([no])
4652     BUILD_UNOWINREG=NO
4654 AC_SUBST(BUILD_UNOWINREG)
4655 AC_SUBST(MINGWCXX)
4656 AC_SUBST(MINGWSTRIP)
4658 dnl ===================================================================
4659 dnl Check for system stdlibs
4660 dnl ===================================================================
4661 AC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
4662 if test "$with_system_stdlibs" != "no"; then
4663     AC_MSG_RESULT([no])
4664     SYSTEM_STDLIBS=YES
4665 else
4666     AC_MSG_RESULT([yes])
4667     SYSTEM_STDLIBS=NO
4669 AC_SUBST(SYSTEM_STDLIBS)
4671 dnl ===================================================================
4672 dnl Check for system zlib
4673 dnl ===================================================================
4674 AC_MSG_CHECKING([which zlib to use])
4675 if test "$with_system_zlib" = "yes"; then
4676     AC_MSG_RESULT([external])
4677     SYSTEM_ZLIB=YES
4678     AC_CHECK_HEADER(zlib.h, [],
4679         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
4680     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
4681         [AC_MSG_ERROR(zlib not found or functional)], [])
4682 else
4683     AC_MSG_RESULT([internal])
4684     SYSTEM_ZLIB=NO
4685     BUILD_TYPE="$BUILD_TYPE ZLIB"
4687 AC_SUBST(SYSTEM_ZLIB)
4689 dnl ===================================================================
4690 dnl Check for system jpeg
4691 dnl ===================================================================
4692 AC_MSG_CHECKING([which jpeg to use])
4693 if test "$with_system_jpeg" = "yes"; then
4694     AC_MSG_RESULT([external])
4695     SYSTEM_JPEG=YES
4696     AC_CHECK_HEADER(jpeglib.h, [],
4697         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
4698     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
4699     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
4700 else
4701     AC_MSG_RESULT([internal])
4702     SYSTEM_JPEG=NO
4703     BUILD_TYPE="$BUILD_TYPE JPEG"
4705 AC_SUBST(SYSTEM_JPEG)
4707 dnl ===================================================================
4708 dnl Check for system expat
4709 dnl ===================================================================
4710 AC_MSG_CHECKING([which expat to use])
4711 if test "$with_system_expat" = "yes"; then
4712     AC_MSG_RESULT([external])
4713     SYSTEM_EXPAT=YES
4714     AC_CHECK_HEADER(expat.h, [],
4715         [AC_MSG_ERROR(expat.h not found. install expat)], [])
4716     AC_CHECK_LIB(expat, XML_ParserCreate, [],
4717     [AC_MSG_RESULT(expat library not found or functional.)], [])
4718     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libexpat-1.dll"
4719 else
4720     AC_MSG_RESULT([internal])
4721     SYSTEM_EXPAT=NO
4722     BUILD_TYPE="$BUILD_TYPE EXPAT"
4724 AC_SUBST(SYSTEM_EXPAT)
4726 dnl ===================================================================
4727 dnl Check for system libvisio
4728 dnl ===================================================================
4729 AC_MSG_CHECKING([which libvisio to use])
4730 if test "$with_system_libvisio" = "yes"; then
4731     AC_MSG_RESULT([external])
4732     SYSTEM_LIBVISIO=YES
4733     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
4734 else
4735     AC_MSG_RESULT([internal])
4736     SYSTEM_LIBVISIO=NO
4737     BUILD_TYPE="$BUILD_TYPE LIBVISIO"
4739 AC_SUBST(SYSTEM_LIBVISIO)
4740 AC_SUBST(VISIO_CFLAGS)
4741 AC_SUBST(VISIO_LIBS)
4743 dnl ===================================================================
4744 dnl Check for system libcmis
4745 dnl ===================================================================
4746 AC_MSG_CHECKING([which libcmis to use])
4747 if test "$with_system_libcmis" = "yes"; then
4748     AC_MSG_RESULT([external])
4749     SYSTEM_LIBCMIS=YES
4750     PKG_CHECK_MODULES( LIBCMIS, libcmis-0.2 )
4751 else
4752     AC_MSG_RESULT([internal])
4753     SYSTEM_LIBCMIS=NO
4754     BUILD_TYPE="$BUILD_TYPE LIBCMIS"
4756 AC_SUBST(SYSTEM_LIBCMIS)
4757 AC_SUBST(LIBCMIS_CFLAGS)
4758 AC_SUBST(LIBCMIS_LIBS)
4761 dnl ===================================================================
4762 dnl Check for system libwpd
4763 dnl ===================================================================
4764 AC_MSG_CHECKING([which libwpd to use])
4765 if test "$with_system_libwpd" = "yes"; then
4766     AC_MSG_RESULT([external])
4767     SYSTEM_LIBWPD=YES
4768     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
4769 else
4770     AC_MSG_RESULT([internal])
4771     SYSTEM_LIBWPD=NO
4772     BUILD_TYPE="$BUILD_TYPE LIBWPD"
4774 AC_SUBST(SYSTEM_LIBWPD)
4775 AC_SUBST(WPD_CFLAGS)
4776 AC_SUBST(WPD_LIBS)
4778 dnl ===================================================================
4779 dnl Check for system cppunit
4780 dnl ===================================================================
4781 AC_MSG_CHECKING([which cppunit to use])
4782 if test "$with_system_cppunit" = "yes"; then
4783     AC_MSG_RESULT([external])
4784     SYSTEM_CPPUNIT=YES
4785     # might work for earlier, too but go sure:
4786     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
4787 else
4788     AC_MSG_RESULT([internal])
4789     SYSTEM_CPPUNIT=NO
4790     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
4792 AC_SUBST(SYSTEM_CPPUNIT)
4793 AC_SUBST(CPPUNIT_CFLAGS)
4794 AC_SUBST(CPPUNIT_LIBS)
4796 dnl ===================================================================
4797 dnl Check whether freetype is available
4798 dnl ===================================================================
4799 if test  "$test_freetype" = "yes"; then
4800     AC_MSG_CHECKING([whether freetype is available])
4801     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
4803 AC_SUBST(FREETYPE_CFLAGS)
4804 AC_SUBST(FREETYPE_LIBS)
4806 dnl ===================================================================
4807 dnl Check for system libwps
4808 dnl ===================================================================
4809 AC_MSG_CHECKING([which libwps to use])
4810 if test "$with_system_libwps" = "yes"; then
4811     AC_MSG_RESULT([external])
4812     SYSTEM_LIBWPS=YES
4813     PKG_CHECK_MODULES( WPS, libwps-0.2 )
4814 else
4815     AC_MSG_RESULT([internal])
4816     SYSTEM_LIBWPS=NO
4817     BUILD_TYPE="$BUILD_TYPE LIBWPS"
4819 AC_SUBST(SYSTEM_LIBWPS)
4820 AC_SUBST(WPS_CFLAGS)
4821 AC_SUBST(WPS_LIBS)
4823 dnl ===================================================================
4824 dnl Check for system libwpg
4825 dnl ===================================================================
4826 AC_MSG_CHECKING([which libwpg to use])
4827 if test "$with_system_libwpg" = "yes"; then
4828     AC_MSG_RESULT([external])
4829     SYSTEM_LIBWPG=YES
4830     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
4831 else
4832     AC_MSG_RESULT([internal])
4833     SYSTEM_LIBWPG=NO
4834     BUILD_TYPE="$BUILD_TYPE LIBWPG"
4836 AC_SUBST(SYSTEM_LIBWPG)
4837 AC_SUBST(WPG_CFLAGS)
4838 AC_SUBST(WPG_LIBS)
4840 dnl ===================================================================
4841 dnl Check whether freetype2 supports emboldening
4842 dnl ===================================================================
4843 if test  "$test_freetype" = "yes"; then
4844     save_CPPFLAGS="$CPPFLAGS"
4845     save_LDFLAGS="$LDFLAGS"
4846     save_LIBS="$LIBS"
4847     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
4848     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
4849     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
4850                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
4851     LDFLAGS="$save_LDFLAGS"
4852     CPPFLAGS="$save_CPPFLAGS"
4853     LIBS="$save_LIBS"
4855 AC_SUBST(USE_FT_EMBOLDEN)
4857 # ===================================================================
4858 # Check for system libxslt
4859 # to prevent incompatibilities between internal libxml2 and external libxslt,
4860 # or vice versa, use with_system_libxml here
4861 # ===================================================================
4862 AC_MSG_CHECKING([which libxslt to use])
4863 if test "$with_system_libxml" = "yes"; then
4864     AC_MSG_RESULT([external])
4865     SYSTEM_LIBXSLT=YES
4866     if test "$_os" = "Darwin"; then
4867         dnl make sure to use SDK path
4868         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4869         dnl omit -L/usr/lib
4870         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
4871     else
4872         PKG_CHECK_MODULES(LIBXSLT, libxslt)
4873     fi
4875     dnl Check for xsltproc
4876     AC_PATH_PROG(XSLTPROC, xsltproc, no)
4877     if test "$XSLTPROC" = "no"; then
4878         AC_MSG_ERROR([xsltproc is required])
4879     fi
4881     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libxslt-1.dll"
4882 else
4883     AC_MSG_RESULT([internal])
4884     SYSTEM_LIBXSLT=NO
4885     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
4887     if test "$cross_compiling" = "yes"; then
4888         AC_PATH_PROG(XSLTPROC, xsltproc, no)
4889         if test "$XSLTPROC" = "no"; then
4890             AC_MSG_ERROR([xsltproc is required])
4891         fi
4892     fi
4894 AC_SUBST(SYSTEM_LIBXSLT)
4895 AC_SUBST(LIBXSLT_CFLAGS)
4896 AC_SUBST(LIBXSLT_LIBS)
4897 AC_SUBST(XSLTPROC)
4899 # ===================================================================
4900 # Check for system libxml
4901 # ===================================================================
4902 AC_MSG_CHECKING([which libxml to use])
4903 if test "$with_system_libxml" = "yes"; then
4904     AC_MSG_RESULT([external])
4905     SYSTEM_LIBXML=YES
4906     if test "$_os" = "Darwin"; then
4907         dnl make sure to use SDK path
4908         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4909         dnl omit -L/usr/lib
4910         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
4911     elif test $_os = iOS; then
4912         dnl make sure to use SDK path
4913         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
4914         LIBXML_CFLAGS="-I$usr/include/libxml2"
4915         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
4916     else
4917         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
4918     fi
4919     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS zlib1.dll libxml2-2.dll"
4920 else
4921     AC_MSG_RESULT([internal])
4922     SYSTEM_LIBXML=NO
4923     BUILD_TYPE="$BUILD_TYPE LIBXML2"
4925 AC_SUBST(SYSTEM_LIBXML)
4926 AC_SUBST(LIBXML_CFLAGS)
4927 AC_SUBST(LIBXML_LIBS)
4929 dnl ===================================================================
4930 dnl Checks for Python
4931 dnl ===================================================================
4933 AC_MSG_CHECKING([which Python to use])
4935 case "$enable_python" in
4936 no|disable)
4937     enable_python=no
4938     AC_MSG_RESULT([none])
4939     DISABLE_PYTHON=TRUE
4940     ;;
4941 ""|yes|auto)
4942     if test $build_os = cygwin; then
4943         dnl When building on Windows we don't attempt to use any installed
4944         dnl "system"  Python.
4945         dnl
4946         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
4947         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
4948         dnl MinGW cross-compilation setups.)
4949         AC_MSG_RESULT([internal])
4950         enable_python=internal
4951     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4952         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4953         enable_python=internal
4954     else
4955         AC_MSG_RESULT([checking below])
4956         enable_python=auto
4957     fi
4958     ;;
4959 internal)
4960     AC_MSG_RESULT([internal])
4961     ;;
4962 system)
4963     if test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4964         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4965     fi
4966     AC_MSG_RESULT([system])
4967     ;;
4969     AC_MSG_ERROR([Incorrect --enable-python option])
4970     ;;
4971 esac
4973 AC_SUBST(DISABLE_PYTHON)
4975 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
4976     AC_MSG_ERROR([Must use internal Python when building with MSVC])
4979 if test $enable_python != no; then
4980     BUILD_TYPE="$BUILD_TYPE PYUNO"
4983 if test "$cross_compiling" = yes; then
4984     if test $enable_python = auto; then
4985         enable_python=system
4986     fi
4987 else
4988     if test $enable_python = system; then
4989         # This causes an error if no python command is found
4990         # Note that this takes the system python called just "python",
4991         # which isn't actually what we want on MacOSX when building
4992         # against the 10.6 SDK. But that shouldn't matter, we
4993         # select the correct python command manually below anyway.
4994         AM_PATH_PYTHON([2.6])
4995     elif test $enable_python = auto; then
4996         dnl This allows lack of system Python
4997         AM_PATH_PYTHON([2.6],, [:])
4999         if test "$PYTHON" = :; then
5000             enable_python=internal
5001         else
5002             enable_python=system
5003         fi
5004     fi
5007 if test $enable_python = system; then
5008     if test $_os = Darwin; then
5009         # We already have logic above to make sure the system Python
5010         # is used only when building against SDK 10.6 or newer.
5012         # Make sure we use the 2.6 Python when building against the
5013         # 10.6 SDK.
5014         case $with_macosx_sdk in
5015         10.6)
5016             python_version=2.6;;
5017         10.7)
5018             python_version=2.7;;
5019         *)
5020             # ???
5021             python_version=2.7;;
5022         esac
5023         PYTHON=python$python_version
5025         PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
5026         PYTHON_LIBS="-framework Python"
5027     fi
5028     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
5029         # Fallback: Accept these in the environment, or as set above
5030         # for MacOSX.
5031         :
5032     elif test "$cross_compiling" != yes; then
5033         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
5034         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
5035         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
5036         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
5037         if $PKG_CONFIG --exists python-$python_version; then
5038             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
5039             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version`"
5040         else
5041             PYTHON_CFLAGS="-I$python_include"
5042             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
5043         fi
5044     elif test "$cross_compiling" = yes; then
5045         dnl How to find out the cross-compilation Python installation path?
5046         dnl Let's hardocode what we know for different distributions for now...
5048         for python_sysroot in /usr/i686-w64-mingw32/sys-root/mingw ; do
5049             for python_version in 2.6 ; do
5050                 if test -f ${python_sysroot}/include/python${python_version}/Python.h; then
5051                     PYTHON_CFLAGS="-I ${python_sysroot}/include/python$python_version"
5052                     PYTHON_LIBS="-L ${python_sysroot}lib -lpython$python_version $python_libs"
5053                     break
5054                 fi
5055             done
5056             test -n "$PYTHON_CFLAGS" && break
5057         done
5058     fi
5061 dnl By now enable_python should be "system", "internal" or "no"
5062 case $enable_python in
5063 system)
5064     SYSTEM_PYTHON=YES
5066     dnl Check if the headers really work
5067     save_CPPFLAGS="$CPPFLAGS"
5068     CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
5069     AC_CHECK_HEADER(Python.h, [],
5070        [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
5071        [])
5072     CPPFLAGS="$save_CPPFLAGS"
5074     dnl FIXME Check if the Python library can be linked with, too?
5075     ;;
5077 internal)
5078     SYSTEM_PYTHON=NO
5079     BUILD_TYPE="$BUILD_TYPE PYTHON"
5080     # Embedded Python dies without Home set
5081     if test "z$HOME" = "z"; then
5082         export HOME="";
5083     fi
5084     # bz2 tarball and bzip2 is not standard
5085     if test -z "$BZIP2"; then
5086         AC_PATH_PROG( BZIP2, bzip2)
5087         if test -z "$BZIP2"; then
5088             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
5089         fi
5090     fi
5091     ;;
5093     SYSTEM_PYTHON=NO
5094     ;;
5096     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
5097     ;;
5098 esac
5100 AC_SUBST(SYSTEM_PYTHON)
5101 AC_SUBST(PYTHON_CFLAGS)
5102 AC_SUBST(PYTHON_LIBS)
5104 dnl ===================================================================
5105 dnl Check for system Berkeley db
5106 dnl ===================================================================
5107 AC_MSG_CHECKING([which db to use])
5108 if test "$with_system_db" = "yes"; then
5109     SYSTEM_DB=YES
5110     AC_MSG_RESULT([external])
5112     db_header=
5113     for dbver in 5.3 5.1 5.0 5 4.8 4.7 4; do
5114         for dash in - ''; do
5115             AC_CHECK_HEADER([db$dash$dbver/db.h],
5116                 [ db_header="db$dash$dbver/db.h"; break 2 ])
5117         done
5118     done
5120     if test -z "$db_header"; then
5121         AC_CHECK_HEADER([db/db.h], [db_header='db/db.h'; dbver=''])
5122     fi
5124     if test -z "$db_header"; then
5125        AC_CHECK_HEADER(db.h, [ db_header='db.h'; dbver='' ])
5126     fi
5128     if test -z "$db_header"; then
5129         AC_MSG_ERROR([db.h not found. Use the correct -I flag, or install the Berkeley db development package.])
5130     fi
5132     AC_MSG_CHECKING([whether db is at least 4.1])
5133     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])])
5135     SYSTEM_DB_CFLAGS="-DSYSTEM_DB_HEADER='<$db_header>'"
5137     DB_LIB=
5138     dnl At least on OpenBSD dbver is not appended to the library
5139     if test "$_os" = "OpenBSD"; then
5140         dbver=''
5141     fi
5142     for dash in - ''; do
5143         AC_CHECK_LIB(db$dash$dbver, dbopen,
5144             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5145         AC_CHECK_LIB(db$dash$dbver, __db185_open,
5146             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5147     done
5149     if test -z "$DB_LIB" ; then
5150         AC_MSG_ERROR([db library not found. Use the correct -L flag,
5151 or install the Berkeley db development package.])
5152     fi
5154     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
5155     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libdb-4.8.dll"
5156 else
5157     AC_MSG_RESULT([internal])
5158     SYSTEM_DB=NO
5159     BUILD_TYPE="$BUILD_TYPE BERKELEYDB"
5161 AC_SUBST(SYSTEM_DB)
5162 AC_SUBST(SYSTEM_DB_CFLAGS)
5163 AC_SUBST(DB_LIB)
5164 AC_SUBST(DB_CPPLIB)
5166 dnl ===================================================================
5167 dnl Check for system lucene
5168 dnl ===================================================================
5169 if test "$with_java" != "no"; then
5170 AC_MSG_CHECKING([which lucene to use])
5171 if test "$with_system_lucene" = "yes"; then
5172     AC_MSG_RESULT([external])
5173     SYSTEM_LUCENE=YES
5174     if test -z $LUCENE_CORE_JAR; then
5175          AC_CHECK_FILE(/usr/share/java/lucene-core-2.3.jar,
5176             [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar ],
5177             [
5178               AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
5179                 [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
5180                 [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
5181                    [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
5182                    [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
5183                   )
5184                 ]
5185               )
5186             ]
5187          )
5188     else
5189         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5190                [AC_MSG_ERROR(lucene-core.jar not found.)], [])
5191     fi
5193     if test -z $LUCENE_ANALYZERS_JAR; then
5194         AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
5195             [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
5196             [
5197               AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
5198                 [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
5199                 [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
5200               )
5201             ]
5202         )
5203     else
5204         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5205                [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
5206     fi
5207     AC_MSG_CHECKING([whether lucene is version 2.x])
5208     export LUCENE_CORE_JAR
5209     if $PERL -e 'use Archive::Zip;
5210             my $file = "$ENV{'LUCENE_CORE_JAR'}";
5211             my $zip = Archive::Zip->new( $file );
5212             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5213             if ( $mf =~ m/Specification-Version: 2.*/ ) {
5214                 exit 0;
5215             } else {
5216                 exit 1;
5217             }'; then
5218         AC_MSG_RESULT([yes])
5219     else
5220         AC_MSG_ERROR([no, you need lucene 2])
5221     fi
5223 else
5224     AC_MSG_RESULT([internal])
5225     SYSTEM_LUCENE=NO
5226     BUILD_TYPE="$BUILD_TYPE LUCENE"
5229 AC_SUBST(SYSTEM_LUCENE)
5230 AC_SUBST(LUCENE_CORE_JAR)
5231 AC_SUBST(LUCENE_ANALYZERS_JAR)
5233 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
5234 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
5235     AC_MSG_RESULT([yes])
5236     ENABLE_MYSQLC=YES
5237     BUILD_TYPE="$BUILD_TYPE MYSQLC"
5238 else
5239     AC_MSG_RESULT([no])
5240     ENABLE_MYSQLC=NO
5242 AC_SUBST(ENABLE_MYSQLC)
5244 if test "$ENABLE_MYSQLC" = "YES"; then
5246     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
5248     dnl ===================================================================
5249     dnl Check for system MySQL
5250     dnl ===================================================================
5251     AC_MSG_CHECKING([for MySQL prerequisites])
5252     if test "$with_system_mysql" = "yes"; then
5253         AC_MSG_RESULT([external MySQL])
5254         SYSTEM_MYSQL=YES
5255         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
5256         AC_MSG_CHECKING([MySQL version])
5257         MYSQL_VERSION=`$MYSQLCONFIG --version`
5258         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
5259         if test "$MYSQL_MAJOR" -ge "5"; then
5260             AC_MSG_RESULT([OK])
5261         else
5262             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
5263         fi
5264         AC_MSG_CHECKING([for MySQL Client library])
5265         MYSQL_INC=`$MYSQLCONFIG --include`
5266         MYSQL_LIB=`$MYSQLCONFIG --libs`
5267         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
5268         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
5269     else
5270         SYSTEM_MYSQL=NO
5271         if test -n "$with_libmysql_path"; then
5272             AC_MSG_RESULT([external Connector/C (libmysql)])
5273             LIBMYSQL=libmysql.so
5274             if test "$_os" = "Darwin"; then
5275                 LIBMYSQL=libmysql.dylib
5276             elif test "$_os" = "WINNT"; then
5277                 LIBMYSQL=libmysql.dll
5278             fi
5279             AC_MSG_CHECKING([for $LIBMYSQL])
5280             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
5281                 AC_MSG_RESULT([found.])
5282                 LIBMYSQL_PATH=$with_libmysql_path
5283             else
5284                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
5285             fi
5286         else
5287             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
5288         fi
5289     fi
5290     AC_SUBST(SYSTEM_MYSQL)
5291     AC_SUBST(MYSQL_INC)
5292     AC_SUBST(MYSQL_LIB)
5293     AC_SUBST(MYSQL_DEFINES)
5294     AC_SUBST(LIBMYSQL_PATH)
5296     AC_LANG_PUSH([C++])
5297     dnl ===================================================================
5298     dnl Check for system MySQL C++ Connector
5299     dnl ===================================================================
5300     # FIXME!
5301     # who thought this too-generic cppconn dir was a good idea?
5302     AC_MSG_CHECKING([MySQL Connector/C++])
5303     if test "$with_system_mysql_cppconn" = "yes"; then
5304         AC_MSG_RESULT([external])
5305         SYSTEM_MYSQL_CPPCONN=YES
5306         AC_LANG_PUSH([C++])
5307         AC_CHECK_HEADER(mysql_driver.h, [],
5308                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
5309         AC_CHECK_LIB(mysqlcppconn, main, [],
5310                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
5311         AC_MSG_CHECKING([version])
5312         AC_RUN_IFELSE([AC_LANG_SOURCE([[
5313 #include <mysql_driver.h>
5315 int main(int argc, char **argv) {
5316     sql::Driver *driver;
5317     driver = get_driver_instance();
5318     if (driver->getMajorVersion() > 1 || \
5319        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
5320        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
5321         return 0;
5322       else
5323         return 1;
5325       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
5327         AC_LANG_POP([C++])
5329     else
5330         AC_MSG_RESULT([internal])
5331         AC_MSG_CHECKING([for mysqlcppconn module])
5332         if test -d mysqlcppconn; then
5333             AC_MSG_RESULT([OK])
5334         else
5335             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
5336         fi
5337         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
5338         SYSTEM_MYSQL_CPPCONN=NO
5339     fi
5340     AC_LANG_POP([C++])
5341     AC_SUBST(SYSTEM_MYSQL_CPPCONN)
5344 dnl ===================================================================
5345 dnl Check for system hsqldb
5346 dnl ===================================================================
5347 if test "$with_java" != "no"; then
5348 AC_MSG_CHECKING([which hsqldb to use])
5349 if test "$with_system_hsqldb" = "yes"; then
5350     AC_MSG_RESULT([external])
5351     SYSTEM_HSQLDB=YES
5352     if test -z $HSQLDB_JAR; then
5353         HSQLDB_JAR=/usr/share/java/hsqldb.jar
5354     fi
5355     AC_CHECK_FILE($HSQLDB_JAR, [],
5356                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
5357     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
5358     export HSQLDB_JAR
5359     if $PERL -e 'use Archive::Zip;
5360             my $file = "$ENV{'HSQLDB_JAR'}";
5361             my $zip = Archive::Zip->new( $file );
5362             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5363             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
5364                push @l, split(/\n/, $mf);
5365                foreach my $line (@l) {
5366                   if ($line =~ m/Specification-Version:/) {
5367                       ($t, $version) = split (/:/,$line);
5368                       $version =~ s/^\s//;
5369                       ($a, $b, $c, $d) = split (/\./,$version);
5370                       if ($c == "0" && $d > "8")  {
5371                           exit 0;
5372                       } else {
5373                           exit 1;
5374                       }
5375                   }
5376                }
5377             } else {
5378                 exit 1;
5379             }'; then
5380         AC_MSG_RESULT([yes])
5381     else
5382         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
5383     fi
5384 else
5385     AC_MSG_RESULT([internal])
5386     SYSTEM_HSQLDB=NO
5387     BUILD_TYPE="$BUILD_TYPE HSQLDB"
5389 AC_SUBST(SYSTEM_HSQLDB)
5390 AC_SUBST(HSQLDB_JAR)
5393 dnl ===================================================================
5394 dnl Check for PostgreSQL stuff
5395 dnl ===================================================================
5397 if test "x$enable_postgresql_sdbc" != "xno"; then
5398     SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
5399     AC_MSG_CHECKING([PostgreSQL C interface])
5400     if test "$with_system_postgresql" = "yes"; then
5401         AC_MSG_RESULT([external PostgreSQL])
5402         SYSTEM_POSTGRESQL=YES
5403         if test "$_os" = Darwin; then
5404            supp_path=''
5405            for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
5406             pg_supp_path="$PATH_SEPARATOR$d$pg_supp_path"
5407            done
5408         fi
5409         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
5410         if test -z "$PGCONFIG"; then
5411            AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
5412         fi
5413         POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
5414         POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
5415     else
5416         if test -n "$with_libpq_path"; then
5417             SYSTEM_POSTGRESQL=YES
5418             AC_MSG_RESULT([external libpq])
5419             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
5420             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
5421         else
5422             SYSTEM_POSTGRESQL=NO
5423             AC_MSG_RESULT([internal])
5424             POSTGRESQL_LIB=""
5425             POSTGRESQL_INC="%OVERRIDE_ME%"
5426             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
5427         fi
5428     fi
5429     if test "${SYSTEM_POSTGRESQL}" = "YES"; then
5430         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
5431         save_CFLAGS=$CFLAGS
5432         save_CPPFLAGS=$CPPFLAGS
5433         save_LIBS=$LIBS
5434         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
5435         LIBS="${LIBS} ${POSTGRESQL_LIB}"
5436         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
5437         AC_CHECK_LIB(pq, PQconnectdbParams, [],
5438             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
5439         CFLAGS=$save_CFLAGS
5440         CPPFLAGS=$save_CPPFLAGS
5441         LIBS=$save_LIBS
5442     fi
5443     BUILD_POSTGRESQL_SDBC=YES
5445 AC_SUBST(BUILD_POSTGRESQL_SDBC)
5446 AC_SUBST(SYSTEM_POSTGRESQL)
5447 AC_SUBST(POSTGRESQL_INC)
5448 AC_SUBST(POSTGRESQL_LIB)
5450 dnl ===================================================================
5451 dnl Check for system beanshell
5452 dnl ===================================================================
5453 if test "$with_java" != "no"; then
5454 AC_MSG_CHECKING([which beanshell to use])
5455 if test "$with_system_beanshell" = "yes"; then
5456     AC_MSG_RESULT([external])
5457     SYSTEM_BSH=YES
5458     if test -z $BSH_JAR; then
5459         BSH_JAR=/usr/share/java/bsh.jar
5460     fi
5461     AC_CHECK_FILE($BSH_JAR, [],
5462                [AC_MSG_ERROR(bsh.jar not found.)], [])
5463 else
5464     AC_MSG_RESULT([internal])
5465     SYSTEM_BSH=NO
5466     BUILD_TYPE="$BUILD_TYPE BSH"
5469 AC_SUBST(SYSTEM_BSH)
5470 AC_SUBST(BSH_JAR)
5473 dnl ===================================================================
5474 dnl Check for system saxon
5475 dnl ===================================================================
5476 if test "$with_java" != "no"; then
5477 AC_MSG_CHECKING([which saxon to use])
5478 if test "$with_system_saxon" = "yes"; then
5479     AC_MSG_RESULT([external])
5480     SYSTEM_SAXON=YES
5481     if test -z $SAXON_JAR; then
5482         AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5483             [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5484             [
5485               AC_CHECK_FILE(/usr/share/java/saxon.jar,
5486                 [ SAXON_JAR=/usr/share/java/saxon.jar ],
5487                 [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5488                     [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5489                     [ AC_MSG_ERROR(saxon.jar replacement not found)]
5490                   )
5491                 ]
5492               )
5493             ]
5494           )
5495     else
5496         AC_CHECK_FILE($SAXON_JAR, [],
5497                [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
5498     fi
5499     if test -n "$SERIALIZER_JAR"; then
5500         AC_CHECK_FILE($SERIALIZER_JAR, [],
5501                [AC_MSG_ERROR(serializer.jar not found.)], [])
5502         AC_SUBST(SERIALIZER_JAR)
5503     fi
5505     dnl Saxon comes in two practically available versions, the out-of-date saxonb which
5506     dnl supports the Java extensions that LibreOffice uses, and the up-to-date saxon he
5507     dnl "home edition" version, which is crippled to not support those Java extensions.
5508     dnl And as an aside the he one also needs to be tweaked to include
5509     dnl a META-INF/services to broadcast that it supports the jaxp transform factory
5511     AC_MSG_CHECKING([if saxon works])
5512     cat > saxontest.java <<_ACEOF
5513 [import javax.xml.transform.TransformerFactory;
5514 import javax.xml.transform.Transformer;
5515 import javax.xml.transform.stream.StreamSource;
5516 import java.io.*;
5518 import net.sf.saxon.FeatureKeys;
5520 class saxontest {
5521     public static void main(String[] args) {
5522       System.setProperty("javax.xml.transform.TransformerFactory",
5523         "net.sf.saxon.TransformerFactoryImpl");
5524       try {
5525         TransformerFactory tfactory = TransformerFactory.newInstance();
5526     // some external saxons (Debian, Ubuntu, ...) have this disabled
5527     // per default
5528     tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
5529         System.out.println("TransformerFactory is" +
5530           tfactory.getClass().getName());
5531         Transformer transformer = tfactory.newTransformer(
5532           new StreamSource(new File(args[0])));
5533       } catch(Exception e){
5534         e.printStackTrace(System.err);
5535         System.exit(-1);
5536       }
5537       System.exit(0);
5538     }
5541 _ACEOF
5543     cat > saxontest.xsl<<_ACEOF
5544 [<?xml version="1.0" encoding="UTF-8"?>
5545 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5546  <xsl:template match="/">
5547   <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
5548  </xsl:template>
5549 </xsl:stylesheet>
5551 _ACEOF
5553     javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
5554     AC_TRY_EVAL(javac_cmd)
5555     if test $? = 0 && test -f ./saxontest.class ; then
5556         java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
5557         AC_TRY_EVAL(java_cmd)
5558         if test $? = 0; then
5559             AC_MSG_RESULT([yes])
5560         else
5561             cat saxontest.java >&5
5562             AC_MSG_RESULT([no])
5563             AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
5564         fi
5565     else
5566         AC_MSG_RESULT([no])
5567         cat saxontest.java >&5
5568         AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
5569     fi
5570 else
5571     AC_MSG_RESULT([internal])
5572     SYSTEM_SAXON=NO
5573     NEED_SAXON=TRUE
5576 AC_SUBST(SYSTEM_SAXON)
5577 AC_SUBST(SAXON_JAR)
5579 if test -n "$NEED_SAXON"; then
5580     BUILD_TYPE="$BUILD_TYPE SAXON"
5583 # ===================================================================
5584 # Check whether to build stax
5585 # ===================================================================
5586 AC_MSG_CHECKING([whether building the stax is required])
5587 BUILD_STAX=NO
5588 if test -z "$SOLAR_JAVA"; then
5589     AC_MSG_RESULT([no (java disabled)])
5590 elif test "$SYSTEM_SAXON" = "YES"; then
5591     AC_MSG_RESULT([no (already provided by system saxon)])
5592 elif test -f "./stax/download/jsr173_1.0_api.jar"; then
5593     AC_MSG_RESULT([no (will use the prebuilt stax/download/jsr173_1.0_api.jar)])
5594 else
5595     BUILD_STAX=YES
5596     AC_MSG_RESULT([yes (no system saxon and no prebuilt copy)])
5598 AC_SUBST(BUILD_STAX)
5600 dnl ===================================================================
5601 dnl Check for system curl
5602 dnl ===================================================================
5603 AC_MSG_CHECKING([which libcurl to use])
5604 if test "$with_system_curl" = "yes"; then
5605     AC_MSG_RESULT([external])
5606     SYSTEM_CURL=YES
5608     curl_version=""
5609     if test "$cross_compiling" = "yes"; then
5610         dnl At least the OBS mingw32-libcurl-devel package
5611         dnl comes with a proper .pc file
5612         PKG_CHECK_MODULES(CURL, libcurl,, [:])
5613         if test -n "$CURL_PKG_ERRORS"; then
5614             AC_MSG_RESULT([no])
5615         else
5616             curl_version=`$PKG_CONFIG --modversion libcurl`
5617         fi
5618     fi
5619     if test -z "$curl_version"; then
5620         AC_PATH_PROG(CURLCONFIG, curl-config)
5621         if test -z "$CURLCONFIG"; then
5622             AC_MSG_ERROR([install the libcurl development package])
5623         fi
5624         CURL_LIBS=`$CURLCONFIG --libs`
5625         CURL_CFLAGS=`$CURLCONFIG --cflags`
5626         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
5627     fi
5629     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
5631     case $curl_version in
5632     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
5633     dnl so they need to be doubled to end up in the configure script
5634     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
5635         AC_MSG_RESULT([yes, you have $curl_version])
5636         ;;
5637     *)
5638         AC_MSG_ERROR([no, you have $curl_version])
5639         ;;
5640     esac
5642     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libintl-8.dll libidn-11.dll libnspr4.dll nssutil3.dll libplc4.dll libplds4.dll nss3.dll ssl3.dll libgpg-error-0.dll libgcrypt-11.dll libssh2-1.dll libcurl-4.dll"
5643 else
5644     AC_MSG_RESULT([internal])
5645     SYSTEM_CURL=NO
5646     BUILD_TYPE="$BUILD_TYPE CURL"
5648 AC_SUBST(SYSTEM_CURL)
5649 AC_SUBST(CURL_CFLAGS)
5650 AC_SUBST(CURL_LIBS)
5652 dnl ===================================================================
5653 dnl Check for system boost
5654 dnl ===================================================================
5655 AC_MSG_CHECKING([which boost to use])
5656 if test "$with_system_boost" = "yes"; then
5657     AC_MSG_RESULT([external])
5658     SYSTEM_BOOST=YES
5659     AC_LANG_PUSH([C++])
5660     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
5661        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
5662     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
5663        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
5664     AC_CHECK_HEADER(boost/function.hpp, [],
5665        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
5666     AC_CHECK_HEADER([boost/unordered_map.hpp], [HAVE_BOOST_UNORDERED_MAP=TRUE],
5667                    [AC_MSG_WARN([boost/unordered_map.hpp not found])], [])
5669     save_CXXFLAGS=$CXXFLAGS
5670     CXXFLAGS="$CXXFLAGS -fno-exceptions"
5671     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
5672     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
5673 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
5675     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
5676         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
5677     else
5678         AC_MSG_RESULT([yes])
5679     fi
5680     CXXFLAGS=$save_CXXFLAGS
5681     AC_LANG_POP([C++])
5682 else
5683     AC_MSG_RESULT([internal])
5684     BUILD_TYPE="$BUILD_TYPE BOOST"
5685     SYSTEM_BOOST=NO
5686     HAVE_BOOST_UNORDERED_MAP=TRUE
5688 AC_SUBST([HAVE_BOOST_UNORDERED_MAP])
5689 AC_SUBST(SYSTEM_BOOST)
5691 dnl ===================================================================
5692 dnl Check for system mdds
5693 dnl ===================================================================
5694 AC_MSG_CHECKING([which mdds to use])
5695 if test "$with_system_mdds" = "yes"; then
5696     AC_MSG_RESULT([external])
5697     SYSTEM_MDDS=YES
5699     dnl ===================================================================
5700     dnl Determine which hash container mdds shall use
5701     dnl ===================================================================
5702     AC_MSG_CHECKING([which hash container mdds shall use])
5703     if test "x$HAVE_CXX0X" = "xTRUE"; then
5704         MDDS_CPPFLAGS="-std=c++0x"
5705         AC_MSG_RESULT([std::unordered_map])
5706     else
5707         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5708         AC_MSG_RESULT([boost::unordered_map])
5709     fi
5711     AC_LANG_PUSH([C++])
5712     save_CPPFLAGS="$CPPFLAGS"
5713     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
5714     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
5715         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
5716     AC_CHECK_HEADER(mdds/mixed_type_matrix.hpp, [],
5717         [AC_MSG_ERROR(mdds/mixed_type_matrix.hpp not found. install mdds >= 0.4.0)], [])
5718     CPPFLAGS="$save_CPPFLAGS"
5719     save_CXXFLAGS="$CXXFLAGS"
5720     CXXFLAGS="$CXXFLAGS $MDDS_CPPFLAGS"
5721     AC_MSG_CHECKING([for correct signature of ::mdds::flat_segment_tree])
5722     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mdds/flat_segment_tree.hpp>
5724     int main(int argc, char **argv) {
5725         ::mdds::flat_segment_tree<long, short> db(0, 100, 0);
5726         short val;
5727         if (!db.search(5, val).second)
5728             return 1;
5729         return 0;
5730     }
5731 ]])],[ac_cv_cxx_mdds_flat_segment_tree_correct=yes],[ac_cv_cxx_mdds_flat_segment_tree_correct=no],[])
5733     if test "$ac_cv_cxx_mdds_flat_segment_tree_correct" = "yes"; then
5734         AC_MSG_RESULT([yes])
5735     else
5736         AC_MSG_ERROR([no, install mdds >= 0.5.0])
5737     fi
5738     CXXFLAGS=$save_CXXFLAGS
5739     AC_LANG_POP([C++])
5740 else
5741     AC_MSG_RESULT([internal])
5742     BUILD_TYPE="$BUILD_TYPE MDDS"
5743     SYSTEM_MDDS=NO
5745     dnl ===================================================================
5746     dnl Determine which hash container mdds shall use
5747     dnl ===================================================================
5748     AC_MSG_CHECKING([which hash container mdds shall use])
5749     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5750     AC_MSG_RESULT([boost::unordered_map])
5752 AC_SUBST(SYSTEM_MDDS)
5753 AC_SUBST([MDDS_CPPFLAGS])
5755 dnl ===================================================================
5756 dnl Check for system vigra
5757 dnl ===================================================================
5758 AC_MSG_CHECKING([which vigra to use])
5759 if test "$with_system_vigra" = "yes"; then
5760     AC_MSG_RESULT([external])
5761     SYSTEM_VIGRA=YES
5762     AC_LANG_PUSH([C++])
5763     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
5764        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
5765     AC_LANG_POP([C++])
5766 else
5767     AC_MSG_RESULT([internal])
5768     BUILD_TYPE="$BUILD_TYPE VIGRA"
5769     SYSTEM_VIGRA=NO
5771 AC_SUBST(SYSTEM_VIGRA)
5773 dnl ===================================================================
5774 dnl Check for system odbc
5775 dnl ===================================================================
5776 AC_MSG_CHECKING([which odbc headers to use])
5777 if test "$with_system_odbc" = "yes"; then
5778     AC_MSG_RESULT([external])
5779     SYSTEM_ODBC_HEADERS=YES
5781     AC_CHECK_HEADER(sqlext.h, [],
5782       [AC_MSG_ERROR(odbc not found. install odbc)], [])
5783 else
5784     AC_MSG_RESULT([internal])
5785     SYSTEM_ODBC_HEADERS=NO
5786     BUILD_TYPE="$BUILD_TYPE UNIXODBC"
5788 AC_SUBST(SYSTEM_ODBC_HEADERS)
5790 AC_MSG_CHECKING([whether to enable build of Mozilla])
5791 if test "$enable_mozilla" = "no"; then
5792     AC_MSG_RESULT([no])
5793     WITH_MOZILLA=NO
5794 else
5795     AC_MSG_RESULT([yes])
5796     WITH_MOZILLA=YES
5798 AC_SUBST(WITH_MOZILLA)
5800 AC_MSG_CHECKING([whether to build Mozilla addressbook connectivity])
5801 if test "$enable_mozilla" = "no"; then
5802     AC_MSG_RESULT([no])
5803 elif test "$with_system_mozilla" = "yes"; then
5804     AC_MSG_RESULT([no, not possible with system-mozilla])
5805 else
5806     AC_MSG_RESULT([yes])
5809 AC_MSG_CHECKING([whether to build XML Security support])
5810 if test "$enable_xmlsec" = "no"; then
5811     AC_MSG_RESULT([no])
5812     ENABLE_XMLSEC=
5813 else
5814     ENABLE_XMLSEC="YES"
5815     BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
5816     AC_MSG_RESULT([yes])
5818 AC_SUBST(ENABLE_XMLSEC)
5820 AC_MSG_CHECKING([whether to build LDAP configuration backend])
5821 if test "$enable_ldap" != "no"; then
5822     WITH_OPENLDAP=NO
5823     WITH_LDAP=NO
5824     if test "$with_openldap" = "yes"; then
5825         WITH_LDAP=YES
5826         AC_MSG_RESULT([OpenLDAP])
5827         WITH_OPENLDAP=YES
5828         AC_CHECK_HEADERS(ldap.h, [],
5829             [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
5830         AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
5831             [AC_MSG_ERROR(openldap lib not found or functional)], [])
5832         AC_CHECK_LIB(ldap, ldap_set_option, [],
5833             [AC_MSG_ERROR(openldap lib not found or functional)], [])
5834     elif test "$enable_mozilla" != "no"; then
5835         AC_MSG_RESULT([Mozilla])
5836         WITH_LDAP=YES
5837         WITH_OPENLDAP=NO
5838     else
5839         AC_MSG_RESULT([no. Either Mozilla or OpenLDAP required])
5840     fi
5841 else
5842     AC_MSG_RESULT([no])
5843     WITH_LDAP=NO
5845 AC_SUBST(WITH_LDAP)
5846 AC_SUBST(WITH_OPENLDAP)
5848 dnl ===================================================================
5849 dnl Check for system mozilla
5850 dnl ===================================================================
5851 AC_MSG_CHECKING([which Mozilla to use])
5852 if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then
5853     AC_MSG_RESULT([external])
5854     SYSTEM_MOZILLA=YES
5855     AC_MSG_CHECKING([which Mozilla flavour to use])
5856     if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then
5857         MOZ_FLAVOUR=libxul
5858     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then
5859         MOZ_FLAVOUR=xulrunner
5860     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "seamonkey"; then
5861         MOZ_FLAVOUR=seamonkey
5862     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "iceape"; then
5863         MOZ_FLAVOUR=iceape
5864     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "firefox"; then
5865         MOZ_FLAVOUR=firefox
5866     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "mozilla"; then
5867         MOZ_FLAVOUR=mozilla
5868     else
5869         MOZ_FLAVOUR=libxul
5870     fi
5871     tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst(<STDIN>);'`
5872     AC_MSG_RESULT($tmp)
5874     if test "$MOZ_FLAVOUR" != "libxul"; then
5875         PKG_CHECK_MODULES( MOZILLAXPCOM, $MOZ_FLAVOUR-xpcom, HASXPCOM="TRUE", HASXPCOM="" )
5876         MOZ_INC=`$PKG_CONFIG --variable=includedir $MOZ_FLAVOUR-xpcom`
5877         MOZ_LIB=`$PKG_CONFIG --variable=libdir $MOZ_FLAVOUR-xpcom`
5878     fi
5880     if test -z "$HASXPCOM"; then
5881         PKG_CHECK_MODULES( MOZILLAXPCOM, libxul )
5882         MOZ_INC=`$PKG_CONFIG --variable=includedir libxul`
5883         MOZ_LIB=`$PKG_CONFIG --variable=libdir libxul`
5884         if ! test -e "$MOZ_LIB/libxul.so"; then
5885             MOZ_LIB=`$PKG_CONFIG --variable=sdkdir libxul`
5886             if test -e "$MOZ_LIB/sdk/lib/libxul.so"; then
5887                 MOZ_LIB="$MOZ_LIB/sdk/lib"
5888             fi
5889         fi
5890     fi
5892     MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS
5893     if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then
5894         AC_MSG_CHECKING([whether $tmp was compiled with --enable-ldap])
5895         if test -d "$MOZ_INC/ldap"; then
5896             AC_MSG_RESULT([yes])
5897             MOZ_LDAP_CFLAGS="-I$MOZ_INC"
5898         else
5899             AC_MSG_ERROR([no.
5900 Could not find LDAP header include files in $MOZ_INC/ldap.
5901 Please recompile $tmp with --enable-ldap or use --with-openldap.])
5902         fi
5903     fi
5905     #e.g. http://fedoraproject.org/wiki/Releases/FeatureXULRunnerAPIChanges
5906     #the plugin pkg-config etc. reverts to "mozilla-plugin" with libxul
5907     if test "$MOZ_FLAVOUR" = "libxul"; then
5908         MOZ_FLAVOUR="mozilla"
5909     fi
5911 elif test "$enable_mozilla" = "no"; then
5912     AC_MSG_RESULT([none])
5913     WITH_MOZILLA=NO
5914 else
5915     AC_MSG_RESULT([internal])
5916     SYSTEM_MOZILLA=NO
5917     BUILD_TYPE="$BUILD_TYPE MOZ"
5918 if test -z "$with_mozilla_version"; then
5919     MOZILLA_VERSION=
5920 else
5921     AC_MSG_CHECKING([which Mozilla version to build])
5922     MOZILLA_VERSION=$with_mozilla_version
5923     enable_build_mozilla=1
5924     AC_MSG_RESULT([$MOZILLA_VERSION])
5927 AC_SUBST(MOZILLA_VERSION)
5929 AC_MSG_CHECKING([for toolkit Mozilla should use])
5930 if test -z "$with_mozilla_toolkit"; then
5931     if test "$_os" != "WINNT" ; then
5932         if test "$_os" = "Darwin" ; then
5933             MOZILLA_TOOLKIT=mac
5934             AC_MSG_RESULT([mac])
5935         else
5936             MOZILLA_TOOLKIT=gtk2
5937             AC_MSG_RESULT([gtk2])
5938         fi
5939     fi
5940 else
5941     MOZILLA_TOOLKIT=$with_mozilla_toolkit
5942     enable_build_mozilla=1
5943     AC_MSG_RESULT([$MOZILLA_TOOLKIT])
5946 AC_SUBST(MOZILLA_TOOLKIT)
5948 # default to enabling build mozilla
5949 if test "$enable_build_mozilla" != "no"; then
5950     enable_build_mozilla=yes
5951 else
5952     enable_build_mozilla=
5955 AC_MSG_CHECKING([whether to build Mozilla/SeaMonkey])
5956 if test -n "$enable_build_mozilla"; then
5957     BUILD_MOZAB="TRUE"
5958     AC_MSG_RESULT([yes])
5959 else
5960     BUILD_MOZAB=""
5961     AC_MSG_RESULT([no])
5964 if test "$BUILD_MOZAB" = "TRUE"; then
5965     if test "$_os" = "WINNT"; then
5966         if test "$WITH_MINGW" != "yes"; then
5967             # compiling with MSVC. Only supported platform here is MSVS2005 at the moment.
5968             if test "$MSVSVER" != "2005"; then
5969                 AC_MSG_ERROR([Building SeaMonkey is supported with Microsoft Visual Studio 2005 only.])
5970             fi
5971         else
5972             AC_MSG_WARN([Building SeaMonkey with MinGW is not tested, and likely to break.])
5973             echo "Building SeaMonkey with MinGW is not tested, and likely to break." >> warn
5974         fi
5975     fi
5977     if test -z "$MOZILLA_VERSION"; then
5978         MOZILLA_VERSION=1.1.14
5979     fi
5980     MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"
5981     MOZILLA_FETCH_FILE=`grep $MOZILLA_SOURCE_VERSION ooo.lst.in`
5982     AC_MSG_CHECKING([for Mozilla sources])
5983     if test -z "$MOZILLA_FETCH_FILE"; then
5984         AC_MSG_RESULT([not found])
5985         HAVE_MOZILLA_TARBALL=n
5986     else
5987         AC_MSG_CHECKING([for $MOZILLA_FETCH_FILE])
5988         if test ! -e "$TARFILE_LOCATION/$MOZILLA_FETCH_FILE"; then
5989             if test -z "$DO_FETCH"; then
5990                 AC_MSG_RESULT([will be fetched])
5991                 HAVE_MOZILLA_TARBALL=y
5992             else
5993                 AC_MSG_RESULT([not found])
5994                 HAVE_MOZILLA_TARBALL=n
5995             fi
5996         else
5997             AC_MSG_RESULT([found])
5998             HAVE_MOZILLA_TARBALL=y
5999         fi
6000     fi
6001     if test "$HAVE_MOZILLA_TARBALL" != "y"; then
6002         AC_MSG_ERROR([Mozilla/SeaMonkey source archive not found.
6003 Use "./download" to download.])
6004     fi
6005     if test "$_os" = "WINNT"; then
6006         AC_MSG_CHECKING([for moztools binaries])
6007         if test ! -e "$TARFILE_LOCATION/vc8-moztools.zip" ; then
6008             AC_MSG_ERROR([The following file is missing in $TARFILE_LOCATION: vc8-moztools.zip
6009 (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)])
6010         else
6011             AC_MSG_RESULT([ok])
6012         fi
6013     elif test "$_os" = "Darwin"; then
6014         PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.6.3,  MOZIDL="TRUE", MOZIDL="")
6015         if test -z "$MOZIDL"; then
6016             AC_MSG_ERROR([libIDL 0.6.3 or newer is needed to build Mozilla with Mac toolkit.])
6017         fi
6018     else
6019         # Generic Unix/Linux section
6020         if test "$MOZILLA_TOOLKIT" = "gtk2"; then
6021             PKG_CHECK_MODULES(MOZLIBREQ, gtk+-2.0, MOZGTK="TRUE", MOZGTK="")
6022             if test -z "$MOZGTK"; then
6023                 AC_MSG_ERROR([GTK2 is needed to build Mozilla.])
6024             fi
6025             PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.8.0, MOZIDL="TRUE", MOZIDL="")
6026             if test -z "$MOZIDL"; then
6027                 AC_MSG_ERROR([libIDL >= 0.8.0 is needed when using GTK2 to build Mozilla.])
6028             fi
6029         else
6030             PKG_CHECK_MODULES(MOZLIBREQ, gtk+ >= 1.2.3, MOZGTK="TRUE", MOZGTK="")
6031             if test -z "$MOZGTK"; then
6032                 AC_MSG_ERROR([GTK+ 1.2 is needed when not using GTK2 to build Mozilla.])
6033             fi
6034             PKG_CHECK_MODULES(MOZLIBREQ, libidl >= 0.6.3 libidl <= 0.6.8, MOZIDL="TRUE", MOZIDL="")
6035             if test -z "$MOZIDL"; then
6036                 AC_MSG_ERROR([libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build Mozilla.])
6037             fi
6038         fi
6039     fi
6042 AC_SUBST(BUILD_MOZAB)
6045 AC_SUBST(MOZILLABUILD)
6046 AC_SUBST(SYSTEM_MOZILLA)
6047 AC_SUBST(MOZ_FLAVOUR)
6048 AC_SUBST(MOZ_INC)
6049 AC_SUBST(MOZ_LIB)
6050 AC_SUBST(MOZ_LIB_XPCOM)
6051 AC_SUBST(MOZ_LDAP_CFLAGS)
6053 dnl ===================================================================
6054 dnl Check for system NSS only with xmlsec or mozilla build enabled
6055 dnl ===================================================================
6056 if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" != "xno"; then
6057 AC_MSG_CHECKING([which NSS to use])
6058 if test "$with_system_nss" = "yes"; then
6059     AC_MSG_RESULT([external])
6060     SYSTEM_NSS="YES"
6061     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
6062 else
6063     SYSTEM_NSS="NO"
6064     BUILD_TYPE="$BUILD_TYPE NSS"
6065     AC_MSG_RESULT([internal])
6066     if test "$build_os" = "cygwin"; then
6067         AC_MSG_CHECKING([for Mozilla build tooling. Required for nss and/or mozilla])
6068         if test -z "$MOZILLABUILD" ; then
6069             AC_MSG_ERROR([Mozilla build tooling not found.
6070 Use the --with-mozilla-build option after installing the tools obtained
6071 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
6072         else
6073             if test \( "$WITH_MINGW" = "yes" \) ; then
6074                 if test ! -d "$MOZILLABUILD" ; then
6075                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
6076                 else
6077                     AC_MSG_RESULT([ok])
6078                 fi
6079             else
6080                 if test ! -d "$MOZILLABUILD/moztools" \
6081                         -o ! -d "$MOZILLABUILD/msys" ; then
6082                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
6083                 else
6084                     AC_MSG_RESULT([ok])
6085                 fi
6086             fi
6087         fi
6088     fi
6089 fi # system nss
6090 fi # enable xmlsec || enable mozilla
6091 AC_SUBST(SYSTEM_NSS)
6092 AC_SUBST(NSS_CFLAGS)
6093 AC_SUBST(NSS_LIBS)
6095 dnl ===================================================================
6096 dnl Check for system mozilla headers
6097 dnl ===================================================================
6098 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
6099 AC_MSG_CHECKING([which mozilla headers to use])
6100 if test "$with_system_mozilla_headers" = "yes"; then
6101     AC_MSG_RESULT([external])
6102     SYSTEM_MOZILLA_HEADERS=YES
6103     # First try npapi-sdk:
6104     PKG_CHECK_MODULES(MOZILLA_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
6105     # Then go with libxul:
6106     if test "x$LOCATED" != "xyes"; then
6107         PKG_CHECK_MODULES(MOZILLA_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
6108     fi
6109     # if still not found bail out
6110     if test "x$LOCATED" != "xyes"; then
6111         AC_MSG_ERROR([npapi.h header file not found])
6112     fi
6114     AC_LANG_PUSH([C])
6115     save_CFLAGS=$CFLAGS
6116     CFLAGS="$CFLAGS $MOZILLA_HEADERS_CFLAGS"
6117     AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
6118     AC_COMPILE_IFELSE(
6119         [AC_LANG_SOURCE([[
6120             #define XP_UNIX
6121             #include <npapi.h>
6122             const char* NPP_GetMIMEDescription(void) { return "foo"; }
6123             ]])],
6124         [AC_MSG_RESULT([const char*])],
6125         [
6126         AC_MSG_RESULT([char*])
6127         HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
6128         ])
6129     CFLAGS=$save_CFLAGS
6130     AC_LANG_POP([C])
6131 else
6132     AC_MSG_RESULT([internal])
6133     SYSTEM_MOZILLA_HEADERS=NO
6135 AC_SUBST(MOZILLA_HEADERS_CFLAGS)
6136 AC_SUBST(SYSTEM_MOZILLA_HEADERS)
6137 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
6139 dnl ===================================================================
6140 dnl Check for system sane
6141 dnl ===================================================================
6142 AC_MSG_CHECKING([which sane header to use])
6143 if test "$with_system_sane" = "yes"; then
6144     AC_MSG_RESULT([external])
6145     SYSTEM_SANE_HEADER=YES
6146     AC_CHECK_HEADER(sane/sane.h, [],
6147       [AC_MSG_ERROR(sane not found. install sane)], [])
6148 else
6149     AC_MSG_RESULT([internal])
6150     SYSTEM_SANE_HEADER=NO
6151     BUILD_TYPE="$BUILD_TYPE SANE"
6153 AC_SUBST(SYSTEM_SANE_HEADER)
6155 dnl ===================================================================
6156 dnl Check for system icu
6157 dnl ===================================================================
6158 SYSTEM_GENBRK=
6159 SYSTEM_GENCCODE=
6160 SYSTEM_GENCMN=
6161 ICU_MAJOR=
6162 ICU_MINOR=
6163 ICU_MICRO=
6164 ICU_RECLASSIFIED_CLOSE_PARENTHESIS=
6165 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
6166 AC_MSG_CHECKING([which icu to use])
6167 if test "$with_system_icu" = "yes"; then
6168     AC_MSG_RESULT([external])
6169     SYSTEM_ICU=YES
6170     AC_LANG_PUSH([C++])
6171     AC_MSG_CHECKING([for unicode/rbbi.h])
6172     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
6173     AC_LANG_POP([C++])
6175     ICUPATH="$PATH"
6176     if test "$WITH_MINGW" = "yes" ; then
6177         ICUPATH="/usr/i686-w64-mingw32/sys-root/mingw/bin:$ICUPATH"
6178     fi
6179     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
6181     AC_MSG_CHECKING([ICU version])
6182     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
6183     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
6184     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
6185     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
6187     if test "$ICU_MAJOR" -ge "4"; then
6188         AC_MSG_RESULT([OK, $ICU_VERSION])
6189     else
6190         AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
6191     fi
6193     if test "$cross_compiling" != "yes"; then
6194         # using the system icu tools can lead to version confusion, use the
6195         # ones from the build environment when cross-compiling
6196         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
6197         if test -z "$SYSTEM_GENBRK"; then
6198             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
6199         fi
6200         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6201         if test -z "$SYSTEM_GENCCODE"; then
6202             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
6203         fi
6204         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6205         if test -z "$SYSTEM_GENCMN"; then
6206             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
6207         fi
6208         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4"; then
6209             ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6210         fi
6211         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "9"; then
6212             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
6213         fi
6214     fi
6216     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS icui18n$ICU_MAJOR$ICU_MINOR.dll icuuc$ICU_MAJOR$ICU_MINOR.dll icudata$ICU_MAJOR$ICU_MINOR.dll"
6217 else
6218     AC_MSG_RESULT([internal])
6219     SYSTEM_ICU="NO"
6220     ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6221     # ICU_RECLASSIFIED_PREPEND_SET_EMPTY not applied for our internal ICU 4.4.2
6222     BUILD_TYPE="$BUILD_TYPE ICU"
6224 AC_SUBST(SYSTEM_ICU)
6225 AC_SUBST(SYSTEM_GENBRK)
6226 AC_SUBST(SYSTEM_GENCCODE)
6227 AC_SUBST(SYSTEM_GENCMN)
6228 AC_SUBST(ICU_MAJOR)
6229 AC_SUBST(ICU_MINOR)
6230 AC_SUBST(ICU_MICRO)
6231 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
6232 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
6234 dnl ===================================================================
6235 dnl Graphite
6236 dnl ===================================================================
6238 AC_MSG_CHECKING([whether to enable graphite support])
6239 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" = "z" -o "$enable_graphite" != "no" ; then
6240     AC_MSG_RESULT([yes])
6241     ENABLE_GRAPHITE="TRUE"
6242     AC_MSG_CHECKING([which graphite to use])
6243     if test "$with_system_graphite" = "yes"; then
6244         AC_MSG_RESULT([external])
6245         SYSTEM_GRAPHITE=YES
6246         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
6247         MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libgraphite2.dll"
6248     else
6249         AC_MSG_RESULT([internal])
6250         SYSTEM_GRAPHITE=NO
6251         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
6252     fi
6253 else
6254     AC_MSG_RESULT([no])
6256 AC_SUBST(ENABLE_GRAPHITE)
6257 AC_SUBST(SYSTEM_GRAPHITE)
6258 AC_SUBST(GRAPHITE_LIBS)
6259 AC_SUBST(GRAPHITE_CFLAGS)
6261 dnl ===================================================================
6262 dnl SampleICC
6263 dnl ===================================================================
6264 AC_MSG_CHECKING([whether to use system SampleICC])
6265 if test "$with_system_sampleicc" = "yes"; then
6266     AC_MSG_RESULT([yes])
6267     SYSTEM_SAMPLEICC=YES
6268     PKG_CHECK_MODULES(SAMPLEICC, sampleicc)
6269 else
6270     AC_MSG_RESULT([no])
6271     SYSTEM_SAMPLEICC=NO
6273 AC_SUBST(SYSTEM_SAMPLEICC)
6274 AC_SUBST(SAMPLEICC_LIBS)
6275 AC_SUBST(SAMPLEICC_CFLAGS)
6277 dnl ===================================================================
6278 dnl Checks for libraries.
6279 dnl ===================================================================
6280 dnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
6281 dnl See if we have the AppKit framework for building with Quartz graphics.
6283 if test  "$_os" = "Darwin"; then
6284     if test "x$with_x" = "xyes"; then
6285         AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
6286     else
6287         AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
6288         if test -d "/System/Library/Frameworks/AppKit.framework/"; then
6289             AC_MSG_RESULT([yes])
6290             x_includes="no_x_includes"
6291             x_libraries="no_x_libraries"
6292             dnl disable some things used on other Unix versions but not on the aqua build
6293             enable_gtk=no
6294         else
6295             AC_MSG_ERROR([No AppKit.framewrok found])
6296         fi
6297     fi
6300 if test $_os = iOS -o $_os = Android; then
6301     enable_gtk=no
6304 dnl ===================================================================
6305 dnl Check for nsplugin
6306 dnl ===================================================================
6307 AC_MSG_CHECKING([wether to build nsplugin extension])
6308 ENABLE_NSPLUGIN=NO
6309 if test "$enable_nsplugin" != "no"; then
6310     if test "$enable_gtk" != "no"; then
6311         AC_MSG_RESULT([yes])
6312         ENABLE_NSPLUGIN=YES
6313     else
6314         AC_MSG_RESULT([no, disabled gtk2])
6315     fi
6316 else
6317     AC_MSG_RESULT([no])
6319 AC_SUBST(ENABLE_NSPLUGIN)
6321 dnl ***************************************
6322 dnl testing for X libraries and includes...
6323 dnl ***************************************
6324 if test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
6325     dnl Mac OS X using Aqua graphics. Don't check for X11.
6326     :
6327 elif test "$_os" != "WINNT" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6328     AC_PATH_X
6329     AC_PATH_XTRA
6330     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6332     if test "x$x_includes" = "x"; then
6333         x_includes="default_x_includes"
6334     fi
6335     if test "x$x_libraries" = "x"; then
6336         x_libraries="default_x_libraries"
6337     fi
6338     dnl The variables $x_libraries and $x_includes are set.
6339     if test -z "$x_libraries"; then
6340         AC_MSG_ERROR([No X libraries found]) # Exit
6341     fi
6342     if test -z "$x_includes"; then
6343         AC_MSG_ERROR([No X includes found]) # Exit
6344     fi
6345     CFLAGS="$CFLAGS $X_CFLAGS"
6346     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
6347     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
6348     dnl Check if the XauDisposeAuth symbol is provided by libXau.
6349     AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
6350 else
6351     x_includes="no_x_includes"
6352     x_libraries="no_x_libraries"
6354 if test -z "$x_includes"; then
6355     x_includes="no_x_includes"
6357 if test -z "$x_libraries"; then
6358     x_libraries="no_x_libraries"
6360 if test "$x_includes" = "default_x_includes"; then
6361     XINC="/usr/include"
6362 else
6363     XINC="$x_includes"
6365 AC_SUBST(XINC)
6366 if test "$x_libraries" = "default_x_libraries"; then
6367     XLIB=`$PKG_CONFIG --variable=libdir x11`
6368     if test "x$XLIB" = x; then
6369         XLIB="/usr/lib"
6370     fi
6371 else
6372     XLIB="$x_libraries"
6374 AC_SUBST(XLIB)
6375 AC_SUBST(XAU_LIBS)
6377 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6378     dnl ===================================================================
6379     dnl Check for Composite.h for Mozilla plugin
6380     dnl ===================================================================
6381     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
6382      [#include <X11/Intrinsic.h>])
6385 AC_MSG_CHECKING([whether to use internal X11 extensions headers])
6386 if test "$with_system_xextensions_headers" != "no"; then
6387     AC_MSG_RESULT([no])
6388 else
6389     AC_MSG_RESULT([yes])
6390     BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
6393 dnl ===================================================================
6394 dnl Check for system Xrender
6395 dnl ===================================================================
6396 AC_MSG_CHECKING([whether to use Xrender])
6397 if test "$test_xrender" = "yes"; then
6398     AC_MSG_RESULT([yes])
6399     AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
6400       [AC_MSG_ERROR(libXrender not found or functional)], [])
6401     AC_MSG_CHECKING([which Xrender headers to use])
6402     if test "$with_system_xextensions_headers" != "no"; then
6403         AC_MSG_RESULT([external])
6404         AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
6405           [AC_MSG_ERROR(Xrender not found. install X)], [])
6406     else
6407         AC_MSG_RESULT([internal])
6408     fi
6411 dnl ===================================================================
6412 dnl Check for XRandr
6413 dnl ===================================================================
6414 AC_MSG_CHECKING([whether to enable RandR support])
6415 if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
6416     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
6417         XRANDR_DLOPEN="TRUE"
6418         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
6419     else
6420         AC_MSG_RESULT([yes])
6421         XRANDR_DLOPEN="FALSE"
6422         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
6423         if test "$ENABLE_RANDR" != "TRUE"; then
6424             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
6425                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
6426             XRANDR_CFLAGS=" "
6427             AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
6428               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
6429             XRANDR_LIBS="-lXrandr "
6430             ENABLE_RANDR="TRUE"
6431         fi
6432     fi
6433 else
6434     ENABLE_RANDR=""
6435     AC_MSG_RESULT([no])
6437 AC_SUBST(XRANDR_DLOPEN)
6438 AC_SUBST(XRANDR_CFLAGS)
6439 AC_SUBST(XRANDR_LIBS)
6440 AC_SUBST(ENABLE_RANDR)
6442 dnl ===================================================================
6443 dnl Check for building neon
6444 dnl ===================================================================
6445 AC_MSG_CHECKING([whether to use neon])
6446 if test "$enable_neon" = "no"; then
6447     AC_MSG_RESULT([no])
6448     DISABLE_NEON=TRUE
6449     AC_SUBST(DISABLE_NEON)
6450 else
6451     AC_MSG_RESULT([yes])
6452 dnl ===================================================================
6453 dnl Check for system neon
6454 dnl ===================================================================
6455 AC_MSG_CHECKING([which neon to use])
6456 if test "$with_system_neon" = "yes"; then
6457     AC_MSG_RESULT([external])
6458     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
6459     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
6460     NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1"
6461     SYSTEM_NEON=YES
6462     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libtasn1-3.dll libgnutls-26.dll libneon-27.dll"
6463 else
6464     AC_MSG_RESULT([internal])
6465     SYSTEM_NEON=NO
6466     NEON_LIBS=-lneon
6467     NEON_CFLAGS=
6468     BUILD_TYPE="$BUILD_TYPE NEON"
6470 AC_SUBST(SYSTEM_NEON)
6471 AC_SUBST(NEON_VERSION)
6472 AC_SUBST(NEON_LIBS)
6473 AC_SUBST(NEON_CFLAGS)
6476 dnl ===================================================================
6477 dnl Check for system openssl
6478 dnl ===================================================================
6479 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6480         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
6481     with_system_openssl=yes
6483 AC_MSG_CHECKING([which libssl to use])
6484 if test "$with_system_openssl" = "yes"; then
6485     AC_MSG_RESULT([external])
6486     # Mac OS builds should get out without extra stuff is the Mac porters'
6487     # wish. And pkg-config is although Xcode ships a .pc for openssl
6488     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6489             "$_os" = "DragonFly"; then
6490         OPENSSL_CFLAGS=
6491         OPENSSL_LIBS="-lssl -lcrypto"
6492     else
6493         PKG_CHECK_MODULES( OPENSSL, openssl )
6494     fi
6495     SYSTEM_OPENSSL=YES
6496     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libssl-8.dll libcrypto-8.dll"
6497 else
6498     AC_MSG_RESULT([internal])
6499     SYSTEM_OPENSSL=NO
6500     BUILD_TYPE="$BUILD_TYPE OPENSSL"
6502 AC_SUBST(SYSTEM_OPENSSL)
6503 AC_SUBST(OPENSSL_CFLAGS)
6504 AC_SUBST(OPENSSL_LIBS)
6506 dnl ===================================================================
6507 dnl Check for system redland
6508 dnl ===================================================================
6509 AC_MSG_CHECKING([which redland library to use])
6510 if test "$with_system_redland" = "yes"; then
6511     AC_MSG_RESULT([external])
6512     SYSTEM_REDLAND=YES
6513     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
6514     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
6515     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libraptor-1.dll librasqal-2.dll libsqlite3-0.dll librdf-0.dll"
6516 else
6517     AC_MSG_RESULT([internal])
6518     BUILD_TYPE="$BUILD_TYPE REDLAND"
6519     SYSTEM_REDLAND=NO
6521 AC_SUBST(SYSTEM_REDLAND)
6522 AC_SUBST(REDLAND_CFLAGS)
6523 AC_SUBST(REDLAND_LIBS)
6525 dnl ===================================================================
6526 dnl Check for system hunspell
6527 dnl ===================================================================
6528 AC_MSG_CHECKING([which libhunspell to use])
6529 if test "$with_system_hunspell" = "yes"; then
6530     AC_MSG_RESULT([external])
6531     SYSTEM_HUNSPELL=YES
6532     AC_LANG_PUSH([C++])
6533     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
6534     if test "$HUNSPELL_PC" != "TRUE"; then
6535         AC_CHECK_HEADER(hunspell.hxx, [],
6536             [
6537             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
6538             [AC_MSG_ERROR(hunspell headers not found.)], [])
6539             ], [])
6540         AC_CHECK_LIB(hunspell, main, [],
6541            [ AC_MSG_ERROR(hunspell library not found.) ], [])
6542         HUNSPELL_LIBS=-lhunspell
6543     fi
6544     AC_LANG_POP([C++])
6545     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhunspell-1.3-0.dll"
6546 else
6547     AC_MSG_RESULT([internal])
6548     SYSTEM_HUNSPELL=NO
6549     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
6551 AC_SUBST(SYSTEM_HUNSPELL)
6552 AC_SUBST(HUNSPELL_CFLAGS)
6553 AC_SUBST(HUNSPELL_LIBS)
6555 dnl ===================================================================
6556 dnl Checking for altlinuxhyph
6557 dnl ===================================================================
6558 AC_MSG_CHECKING([which altlinuxhyph to use])
6559 if test "$with_system_altlinuxhyph" = "yes"; then
6560     AC_MSG_RESULT([external])
6561     SYSTEM_HYPH=YES
6562     AC_CHECK_HEADER(hyphen.h, [],
6563        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
6564     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
6565        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
6566        [#include <hyphen.h>])
6567     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
6568         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6569     if test -z "$HYPHEN_LIB"; then
6570         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
6571            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6572     fi
6573     if test -z "$HYPHEN_LIB"; then
6574         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
6575            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6576     fi
6577     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhyphen-0.dll"
6578 else
6579     AC_MSG_RESULT([internal])
6580     SYSTEM_HYPH=NO
6581     BUILD_TYPE="$BUILD_TYPE HYPHEN"
6583 AC_SUBST(SYSTEM_HYPH)
6584 AC_SUBST(HYPHEN_LIB)
6586 dnl ===================================================================
6587 dnl Checking for mythes
6588 dnl ===================================================================
6589 AC_MSG_CHECKING([which mythes to use])
6590 if test "$with_system_mythes" = "yes"; then
6591     AC_MSG_RESULT([external])
6592     SYSTEM_MYTHES=YES
6593     AC_LANG_PUSH([C++])
6594     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
6595     if test "$MYTHES_PKGCONFIG" = "no"; then
6596         AC_CHECK_HEADER(mythes.hxx, [],
6597             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
6598         AC_CHECK_LIB(mythes-1.2, main, [],
6599             [ MYTHES_FOUND=no], [])
6600     if test "$MYTHES_FOUND" = "no"; then
6601         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
6602                 [ MYTHES_FOUND=no], [])
6603     fi
6604     if test "$MYTHES_FOUND" = "no"; then
6605         AC_MSG_ERROR([mythes library not found!.])
6606     fi
6607     fi
6608     AC_LANG_POP([C++])
6609     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libmythes-1.2-0.dll"
6610 else
6611     AC_MSG_RESULT([internal])
6612     SYSTEM_MYTHES=NO
6613     BUILD_TYPE="$BUILD_TYPE MYTHES"
6615 AC_SUBST(SYSTEM_MYTHES)
6616 AC_SUBST(MYTHES_CFLAGS)
6617 AC_SUBST(MYTHES_LIBS)
6619 dnl ===================================================================
6620 dnl Checking for lpsolve
6621 dnl ===================================================================
6622 AC_MSG_CHECKING([which lpsolve to use])
6623 if test "$with_system_lpsolve" = "yes"; then
6624     AC_MSG_RESULT([external])
6625     SYSTEM_LPSOLVE=YES
6626     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
6627        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
6628     # some systems need this. Like Ubuntu....
6629     AC_CHECK_LIB(m, floor)
6630     AC_CHECK_LIB(dl, dlopen)
6631     AC_CHECK_LIB(lpsolve55, make_lp, ,
6632         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
6633     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS lpsolve55.dll"
6634 else
6635     AC_MSG_RESULT([internal])
6636     SYSTEM_LPSOLVE=NO
6637     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
6639 AC_SUBST(SYSTEM_LPSOLVE)
6641 dnl ===================================================================
6642 dnl Checking for libexttextcat
6643 dnl ===================================================================
6644 AC_MSG_CHECKING([which libexttextcat to use])
6645 if test "$with_system_libexttextcat" = "yes"; then
6646     AC_MSG_RESULT([external])
6647     SYSTEM_LIBEXTTEXTCAT=YES
6648     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
6649     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
6650 else
6651     AC_MSG_RESULT([internal])
6652     SYSTEM_LIBEXTTEXTCAT=NO
6653     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
6655 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
6656 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
6657 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
6658 AC_SUBST(LIBEXTTEXTCAT_LIBS)
6660 dnl ***************************************
6661 dnl testing libc version for Linux...
6662 dnl ***************************************
6663 if test "$_os" = "Linux"; then
6664     AC_MSG_CHECKING([whether libc is >= 2.1.1])
6665     exec 6>/dev/null # no output
6666     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
6667     exec 6>&1 # output on again
6668     if test "$HAVE_LIBC"; then
6669         AC_MSG_RESULT([yes])
6670     else
6671         AC_MSG_ERROR([no, upgrade libc])
6672     fi
6675 if test "$_os" != "WINNT"; then
6676     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
6677     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
6678     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
6679         SYSTEM_LIBC=YES
6680     fi
6681 else
6682     HAVE_GETOPT=NO
6683     HAVE_READDIR_R=NO
6684     SYSTEM_LIBC=YES
6686 AC_SUBST(HAVE_GETOPT)
6687 AC_SUBST(HAVE_READDIR_R)
6688 AC_SUBST(SYSTEM_LIBC)
6690 dnl =========================================
6691 dnl Check for the Windows  SDK.
6692 dnl =========================================
6693 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
6694 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
6695 if test "$_os" = "WINNT"; then
6696     AC_MSG_CHECKING([for Windows SDK])
6697     if test "$build_os" = "cygwin"; then
6698         if test -z "$with_windows_sdk_home"; then
6699             # This first line will detect a February 2003 Microsoft Platform SDK
6700             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
6701             # But there might be also an April 2005 PSDK, unfortunately MS changed
6702             # the registry entry. (we prefer the old version!?)
6703             if test -z "$WINDOWS_SDK_HOME"; then
6704                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
6705             fi
6706             # normalize if found
6707             if test -n "$WINDOWS_SDK_HOME"; then
6708                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
6709                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
6710             fi
6711         else
6712             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
6713         fi
6714     fi
6715     if test -n "$WINDOWS_SDK_HOME"; then
6716         # Remove a possible trailing backslash
6717         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6718         # Problem with current PSDK (iz 49865)
6719         # (What "current" does that mean?)
6720         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
6721             AC_MSG_ERROR([
6722 Some modules do not build correctly with MS Platform SDK - April 2005
6723 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
6724 Remove/rename/backup that file and restart configure. Details about this
6725 problem can be found in issue 49856.])
6726         fi
6728         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6729              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6730              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6731             HAVE_PSDK_H="yes"
6732         else
6733             HAVE_PSDK_H="no"
6734         fi
6735         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
6736             HAVE_PSDK_LIB="yes"
6737         else
6738             HAVE_PSDK_LIB="no"
6739         fi
6741         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
6742             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
6743 the  Windows SDK are installed.])
6744         fi
6746         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
6747              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
6748              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
6749              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe" ; then
6750             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
6751         fi
6752     fi
6754     if test -z "$WINDOWS_SDK_HOME"; then
6755         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6756     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
6757         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
6758     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
6759         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
6760     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
6761         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
6762     else
6763         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
6764     fi
6766 AC_SUBST(WINDOWS_SDK_HOME)
6768 dnl =========================================
6769 dnl Check for the Microsoft DirectX SDK.
6770 dnl =========================================
6771 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
6772     AC_MSG_CHECKING([for DirectX SDK])
6773     if test "$build_os" = "cygwin"; then
6774         if test -z "$with_directx_home"; then
6775             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
6776             if test -n "$DXSDK_DIR"; then
6777                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
6778                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
6779             fi
6780             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
6781             # the "DirectX SDK not found" error later
6782         else
6783             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
6784         fi
6785         # Remove a possible trailing backslash
6786         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
6787     elif test -n "$with_directx_home"; then
6788         DIRECTXSDK_HOME="$with_directx_home"
6789     fi
6791     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
6792         HAVE_DIRECTXSDK_H="yes"
6793     else
6794         HAVE_DIRECTXSDK_H="no"
6795     fi
6797     # MS changed the location of the libraries with Dec 2004 DirectX SDK
6798     if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
6799         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
6800     else
6801         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
6802     fi
6804     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
6805         HAVE_DIRECTXSDK_LIB="yes"
6806     else
6807         HAVE_DIRECTXSDK_LIB="no"
6808     fi
6810     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
6811         AC_MSG_RESULT([found])
6812     else
6813         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6814     fi
6816 AC_SUBST(DIRECTXSDK_HOME)
6817 AC_SUBST(DIRECTXSDK_LIB)
6819 dnl ***************************************
6820 dnl Checking for bison and flex
6821 dnl ***************************************
6822 AC_PATH_PROG(BISON, bison)
6823 ANCIENT_BISON="NO"
6824 if test -z "$BISON"; then
6825     AC_MSG_ERROR([no bison found in \$PATH, install it])
6826 else
6827     AC_MSG_CHECKING([the bison version])
6828     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
6829     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
6830     # Accept newer than 1.875 or older(equal) than 1.75
6831     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
6832         if test "$_bison_version" = "1.875" ; then
6833             AC_MSG_WARN([suspect ($BISON $_bison_version)])
6834             echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
6835         else
6836             AC_MSG_RESULT([checked ($BISON $_bison_version)])
6837         fi
6838     else
6839         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
6840     fi
6841     if test "$_bison_longver" -lt 2000; then
6842         ANCIENT_BISON="YES"
6843     fi
6845 AC_SUBST(ANCIENT_BISON)
6847 AC_PATH_PROG(FLEX, flex)
6848 if test -z "$FLEX"; then
6849     AC_MSG_ERROR([no flex found in \$PATH, install it])
6851 dnl ***************************************
6852 dnl Checking for patch
6853 dnl ***************************************
6854 AC_PATH_PROG(PATCH, patch)
6855 if test -z "$PATCH"; then
6856     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
6859 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
6860 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
6861     if test -z "$with_gnu_patch"; then
6862         GNUPATCH=$PATCH
6863     else
6864         if test -x "$with_gnu_patch"; then
6865             GNUPATCH=$with_gnu_patch
6866         else
6867             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
6868         fi
6869     fi
6871     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
6872     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
6873         AC_MSG_RESULT([yes])
6874     else
6875         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
6876     fi
6879 dnl We also need to check for --with-gnu-cp
6881 if test -z "$with_gnu_cp"; then
6882     # check the place where the good stuff is hidden on Solaris...
6883     if test -x /usr/gnu/bin/cp; then
6884         GNUCP=/usr/gnu/bin/cp
6885     else
6886         AC_PATH_PROGS(GNUCP, gnucp cp)
6887     fi
6888     if test -z $GNUCP; then
6889         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
6890     fi
6891 else
6892     if test -x "$with_gnu_cp"; then
6893         GNUCP=$with_gnu_cp
6894     else
6895         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
6896     fi
6899 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
6900 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
6901     AC_MSG_RESULT([yes])
6902 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
6903     AC_MSG_RESULT([yes])
6904 else
6905     case "$build_os" in
6906     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
6907         GNUCP=''
6908         AC_MSG_RESULT([no gnucp found - using the system's cp command])
6909         ;;
6910     *)
6911         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
6912         ;;
6913     esac
6916 AC_SUBST(GNUPATCH)
6917 AC_SUBST(GNUCP)
6919 dnl ***************************************
6920 dnl testing assembler path
6921 dnl ***************************************
6922 ML_EXE=""
6923 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
6924     if test "$CL_X64" = ""; then
6925         assembler=ml.exe
6926         assembler_bin=bin
6927     else
6928         assembler=ml64.exe
6929         assembler_bin=bin/amd64
6930     fi
6931     if test -n "$with_asm_home"; then
6932         with_asm_home=`cygpath -u "$with_asm_home"`
6933     fi
6934     if test -x "$with_asm_home/$assembler"; then
6935         AC_MSG_CHECKING([$assembler assembler path])
6936         AC_MSG_RESULT([$with_asm_home/$assembler])
6937         ML_EXE="$with_asm_home/$assembler"
6938     else
6939         AC_PATH_PROG(ML_EXE, $assembler)
6940         if test -z "$ML_EXE"; then
6941             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
6942             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
6943                 with_asm_home=$with_cl_home/$assembler_bin
6944                 AC_MSG_RESULT([found])
6945                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
6946             else
6947                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
6948             fi
6949         else
6950             with_asm_home="ASM_IN_PATH"
6951             ML_EXE="$assembler"
6952         fi
6953     fi
6954 else
6955     with_asm_home="NO_ASM_HOME"
6957 ASM_HOME="$with_asm_home"
6958 AC_SUBST(ASM_HOME)
6959 AC_SUBST(ML_EXE)
6961 dnl ===================================================================
6962 dnl We need zip and unzip
6963 dnl ===================================================================
6964 AC_PATH_PROG(ZIP, zip)
6965 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
6966 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
6967     AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
6970 AC_PATH_PROG(UNZIP, unzip)
6971 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
6973 dnl ===================================================================
6974 dnl Zip must be a specific type for different build types.
6975 dnl ===================================================================
6976 if test $build_os = cygwin; then
6977     if test -n "`$ZIP -h | grep -i WinNT`" ; then
6978         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
6979     fi
6982 dnl ===================================================================
6983 dnl Test which vclplugs have to be built.
6984 dnl ===================================================================
6985 R=""
6986 GTK3_CFLAGS=""
6987 GTK3_LIBS=""
6988 ENABLE_GTK3=""
6989 if test "x$enable_gtk3" = "xyes"; then
6990     if test "$with_system_cairo" != yes; then
6991         echo "System cairo required for gtk3 support, please use --with-system-cairo"
6992     fi
6993     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 gtk+-unix-print-3.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
6994     if test "x$ENABLE_GTK3" = "xTRUE"; then
6995         R="gtk3"
6996     else
6997         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
6998     fi
7000 AC_SUBST(GTK3_LIBS)
7001 AC_SUBST(GTK3_CFLAGS)
7002 AC_SUBST(ENABLE_GTK3)
7004 AC_MSG_CHECKING([which VCLplugs shall be built])
7005 ENABLE_GTK=""
7006 if test "x$enable_gtk" = "xyes"; then
7007     ENABLE_GTK="TRUE"
7008     R="gtk $R"
7010 AC_SUBST(ENABLE_GTK)
7012 ENABLE_KDE=""
7013 if test "x$enable_kde" = "xyes"; then
7014     ENABLE_KDE="TRUE"
7015     R="$R kde"
7017 AC_SUBST(ENABLE_KDE)
7019 ENABLE_KDE4=""
7020 if test "x$enable_kde4" = "xyes"; then
7021     ENABLE_KDE4="TRUE"
7022     R="$R kde4"
7024 AC_SUBST(ENABLE_KDE4)
7026 if test -z "$R"; then
7027     AC_MSG_RESULT([none])
7028 else
7029     AC_MSG_RESULT([$R])
7032 dnl ===================================================================
7033 dnl GCONF check
7034 dnl ===================================================================
7036 ENABLE_GCONF=""
7037 AC_MSG_CHECKING([whether to enable GConf support])
7038 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
7039     ENABLE_GCONF="TRUE"
7040     AC_MSG_RESULT([yes])
7041     PKG_CHECK_MODULES( GCONF, gconf-2.0 ORBit-2.0 )
7042 else
7043     AC_MSG_RESULT([no])
7045 AC_SUBST(ENABLE_GCONF)
7047 dnl ===================================================================
7048 dnl Gnome VFS check
7049 dnl ===================================================================
7051 ENABLE_GNOMEVFS=""
7052 AC_MSG_CHECKING([whether to enable GNOME VFS support])
7053 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
7054     ENABLE_GNOMEVFS="TRUE"
7055     AC_MSG_RESULT([yes])
7056     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
7057 else
7058     AC_MSG_RESULT([no])
7060 AC_SUBST(ENABLE_GNOMEVFS)
7062 dnl ===================================================================
7063 dnl Check whether the gtk 2.0 libraries are available.
7064 dnl ===================================================================
7066 GTK_CFLAGS=""
7067 GTK_LIBS=""
7068 ENABLE_SYSTRAY_GTK=""
7069 ENABLE_DBUS=""
7070 DBUS_CFLAGS=""
7071 DBUS_LIBS=""
7072 if test  "$test_gtk" = "yes"; then
7074     if test "$ENABLE_GTK" = "TRUE" ; then
7075         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]))
7076         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]))
7077         BUILD_TYPE="$BUILD_TYPE GTK"
7079         if test "x$enable_systray" = "xyes"; then
7080             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
7081                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
7082                             [ ENABLE_SYSTRAY_GTK="" ])
7083         fi
7085         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
7086         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
7087                           [ENABLE_GTK_PRINT="TRUE"],
7088                           [ENABLE_GTK_PRINT=""])
7090         AC_MSG_CHECKING([whether to enable DBUS support])
7091         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
7092             ENABLE_DBUS="TRUE"
7093             AC_MSG_RESULT([yes])
7094             PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
7095         else
7096             AC_MSG_RESULT([no])
7097         fi
7099         AC_MSG_CHECKING([whether to enable GIO support])
7100         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
7101             if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
7102                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
7103             fi
7104             ENABLE_GIO="TRUE"
7105             AC_MSG_RESULT([yes])
7106             PKG_CHECK_MODULES( GIO, gio-2.0 )
7107         else
7108             AC_MSG_RESULT([no])
7109         fi
7110     fi
7112 AC_SUBST(ENABLE_GIO)
7113 AC_SUBST(ENABLE_DBUS)
7114 AC_SUBST(ENABLE_SYSTRAY_GTK)
7115 AC_SUBST(GTK_CFLAGS)
7116 AC_SUBST(GTK_LIBS)
7117 AC_SUBST(GTHREAD_CFLAGS)
7118 AC_SUBST(GTHREAD_LIBS)
7119 AC_SUBST(DBUS_CFLAGS)
7120 AC_SUBST(DBUS_LIBS)
7121 AC_SUBST([ENABLE_GTK_PRINT])
7122 AC_SUBST([GTK_PRINT_CFLAGS])
7123 AC_SUBST([GTK_PRINT_LIBS])
7125 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
7126 AC_SUBST(LIBPNG_LIBS)
7127 AC_SUBST(LIBPNG_CFLAGS)
7129 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
7130 if test "x$enable_unix_qstart_libpng" != "xno"; then
7131     AC_MSG_RESULT([yes])
7132 else
7133     AC_MSG_RESULT([no])
7134     ENABLE_QUICKSTART_LIBPNG=""
7136 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
7138 SPLIT_APP_MODULES=""
7139 if test "$enable_split_app_modules" = "yes"; then
7140     SPLIT_APP_MODULES="YES"
7142 AC_SUBST(SPLIT_APP_MODULES)
7144 SPLIT_OPT_FEATURES=""
7145 if test "$enable_split_opt_features" = "yes"; then
7146     SPLIT_OPT_FEATURES="YES"
7148 AC_SUBST(SPLIT_OPT_FEATURES)
7150 ENABLE_CAIRO_CANVAS="FALSE"
7151 if test "$enable_cairo_canvas" = "yes" ; then
7152    ENABLE_CAIRO_CANVAS="TRUE"
7154 AC_SUBST(ENABLE_CAIRO_CANVAS)
7156 dnl ===================================================================
7157 dnl Check whether the GStreamer libraries are available.
7158 dnl ===================================================================
7160 ENABLE_GSTREAMER=""
7162 if test  "$build_gstreamer" = "yes"; then
7164     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
7165     if test "x$enable_gstreamer" != "xno" ; then
7166         ENABLE_GSTREAMER="TRUE"
7167         AC_MSG_RESULT([yes])
7168         PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 )
7169     else
7170         AC_MSG_RESULT([no])
7171     fi
7174 AC_SUBST(ENABLE_GSTREAMER)
7176 dnl ===================================================================
7177 dnl Check whether the OpenGL libraries are available
7178 dnl ===================================================================
7180 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
7181 ENABLE_OPENGL=
7183 if test "$_os" = "Darwin" ; then
7184     # We use frameworks on Mac OS X, no need for detail checks
7185     ENABLE_OPENGL=TRUE
7186     SYSTEM_MESA_HEADERS=YES
7187     AC_MSG_RESULT([yes])
7188 else
7189     if test "x$enable_opengl" != "xno" ; then
7190         if test "$_os" != "WINNT"; then
7191             save_LDFLAGS=$LDFLAGS
7192             LDFLAGS="$LDFLAGS -lm"
7193             AC_MSG_RESULT([yes])
7194             AC_CHECK_LIB(GL, main, [],
7195                       [AC_MSG_ERROR(libGL not installed or functional)], [])
7196             AC_CHECK_LIB(GLU, main, [],
7197                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
7198             ENABLE_OPENGL=TRUE
7199             LDFLAGS=$save_LDFLAGS
7201             dnl ===================================================================
7202             dnl Check for system Mesa
7203             dnl ===================================================================
7204             AC_MSG_CHECKING([which Mesa headers to use])
7205             if test "$with_system_mesa_headers" = "yes"; then
7206                 AC_MSG_RESULT([external])
7207                 SYSTEM_MESA_HEADERS=YES
7208                 AC_LANG_PUSH(C)
7209                 AC_CHECK_HEADER(GL/glxext.h, [],
7210                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
7211                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
7212                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
7213                 AC_LANG_POP(C)
7214             else
7215                 AC_MSG_RESULT([internal])
7216                 SYSTEM_MESA_HEADERS=NO
7217                 BUILD_TYPE="$BUILD_TYPE MESA"
7218             fi
7219         else
7220             AC_MSG_RESULT([not on Windows])
7221         fi
7222     else
7223        AC_MSG_RESULT([no])
7224     fi
7227 AC_SUBST(SYSTEM_MESA_HEADERS)
7228 AC_SUBST(ENABLE_OPENGL)
7230 # presenter minimizer extension?
7231 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
7232 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
7233    AC_MSG_RESULT([yes])
7234    ENABLE_MINIMIZER=YES
7235 else
7236    AC_MSG_RESULT([no])
7237    ENABLE_MINIMIZER=NO
7238    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
7240 AC_SUBST(ENABLE_MINIMIZER)
7242 # presenter console extension?
7243 AC_MSG_CHECKING([whether to build the Presenter Console extension])
7244 if test "x$enable_ext_presenter_console" != "xno" -a "x$enable_extension_integration" != "xno"; then
7245    AC_MSG_RESULT([yes])
7246    ENABLE_PRESENTER_SCREEN=YES
7247 else
7248    AC_MSG_RESULT([no])
7249    ENABLE_PRESENTER_SCREEN=NO
7250    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PRESENTER_SCREEN"
7252 AC_SUBST(ENABLE_PRESENTER_SCREEN)
7254 # pdf import extension?
7255 AC_MSG_CHECKING([whether to build the PDF Import extension])
7256 if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" != "xno"; then
7257   AC_MSG_RESULT([yes])
7258   ENABLE_PDFIMPORT=YES
7260   dnl ===================================================================
7261   dnl Check for system poppler
7262   dnl ===================================================================
7263   AC_MSG_CHECKING([which pdf backend to use])
7264   if test "$with_system_poppler" = "yes"; then
7265       AC_MSG_RESULT([external])
7266       SYSTEM_POPPLER=YES
7267       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
7268       AC_LANG_PUSH([C++])
7269       save_CXXFLAGS=$CXXFLAGS
7270       save_CPPFLAGS=$CPPFLAGS
7271       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
7272       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
7273       AC_CHECK_HEADER([cpp/poppler-version.h], [],
7274                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
7275       CXXFLAGS=$save_CXXFLAGS
7276       CPPFLAGS=$save_CPPFLAGS
7277       AC_LANG_POP([C++])
7278   else
7279       AC_MSG_RESULT([internal])
7280       SYSTEM_POPPLER=NO
7281       BUILD_TYPE="$BUILD_TYPE XPDF"
7282   fi
7283 else
7284   AC_MSG_RESULT([no])
7285   ENABLE_PDFIMPORT=NO
7286   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PDFIMPORT"
7288 AC_SUBST(ENABLE_PDFIMPORT)
7289 AC_SUBST(SYSTEM_POPPLER)
7290 AC_SUBST(POPPLER_CFLAGS)
7291 AC_SUBST(POPPLER_LIBS)
7294 if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then
7295    AC_MSG_CHECKING([for sdext module])
7296    BUILD_TYPE="$BUILD_TYPE SDEXT"
7299 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
7300 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7301   AC_MSG_RESULT([yes])
7302   AC_MSG_CHECKING([for swext module])
7303   ENABLE_MEDIAWIKI=YES
7304   BUILD_TYPE="$BUILD_TYPE SWEXT"
7305   if test  "x$with_java" = "xno"; then
7306     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
7307   fi
7308 else
7309   AC_MSG_RESULT([no])
7310   ENABLE_MEDIAWIKI=NO
7311   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
7313 AC_SUBST(ENABLE_MEDIAWIKI)
7315 if test "$ENABLE_MEDIAWIKI" = "YES"; then
7316     AC_MSG_CHECKING([which Servlet API Jar to use])
7317     if test "$with_system_servlet_api" = "yes"; then
7318         AC_MSG_RESULT([external])
7319         SYSTEM_SERVLETAPI=YES
7320         if test -z "$SERVLETAPI_JAR"; then
7321             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
7322         fi
7323         AC_CHECK_FILE($SERVLETAPI_JAR, [],
7324               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
7325     else
7326         AC_MSG_RESULT([internal])
7327         SYSTEM_SERVLETAPI=NO
7328         BUILD_TYPE="$BUILD_TYPE TOMCAT"
7329     fi
7331 AC_SUBST(SYSTEM_SERVLETAPI)
7332 AC_SUBST(SERVLETAPI_JAR)
7334 AC_MSG_CHECKING([whether to build the Report Builder extension])
7335 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7336     AC_MSG_RESULT([yes])
7337     ENABLE_REPORTBUILDER=YES
7338     AC_MSG_CHECKING([for reportbuilder module])
7339     AC_MSG_CHECKING([which jfreereport libs to use])
7340     if test "$with_system_jfreereport" = "yes"; then
7341         SYSTEM_JFREEREPORT=YES
7342         AC_MSG_RESULT([external])
7343         if test -z $SAC_JAR; then
7344             SAC_JAR=/usr/share/java/sac.jar
7345         fi
7346         AC_CHECK_FILE($SAC_JAR, [],
7347              [AC_MSG_ERROR(sac.jar not found.)], [])
7349         if test -z $LIBXML_JAR; then
7350             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
7351                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
7352                 [
7353                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
7354                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
7355                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
7356                     )
7357                 ]
7358             )
7359         else
7360             AC_CHECK_FILE($LIBXML_JAR, [],
7361                  [AC_MSG_ERROR(libxml.jar not found.)], [])
7362         fi
7364         if test -z $FLUTE_JAR; then
7365             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
7366                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
7367                 [
7368                     AC_CHECK_FILE(/usr/share/java/flute.jar,
7369                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
7370                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
7371                     )
7372                 ]
7373             )
7374         else
7375             AC_CHECK_FILE($FLUTE_JAR, [],
7376                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
7377         fi
7379         if test -z $JFREEREPORT_JAR; then
7380             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
7381                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
7382                 [
7383                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
7384                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
7385                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
7386                     )
7387                 ]
7388             )
7389         else
7390             AC_CHECK_FILE($JFREEREPORT_JAR, [],
7391                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
7392         fi
7394         if test -z $LIBLAYOUT_JAR; then
7395             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
7396                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
7397                 [
7398                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
7399                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
7400                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
7401                     )
7402                 ]
7403             )
7404         else
7405             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
7406                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
7407         fi
7409         if test -z $LIBLOADER_JAR; then
7410             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
7411                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
7412                 [
7413                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
7414                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
7415                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
7416                     )
7417                 ]
7418             )
7419         else
7420             AC_CHECK_FILE($LIBLOADER_JAR, [],
7421                 [AC_MSG_ERROR(libloader.jar not found.)], [])
7422         fi
7424         if test -z $LIBFORMULA_JAR; then
7425             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
7426                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
7427                  [
7428                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
7429                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
7430                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
7431                      )
7432                  ]
7433             )
7434         else
7435             AC_CHECK_FILE($LIBFORMULA_JAR, [],
7436                 [AC_MSG_ERROR(libformula.jar not found.)], [])
7437         fi
7439         if test -z $LIBREPOSITORY_JAR; then
7440             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
7441                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
7442                 [
7443                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
7444                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
7445                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
7446                     )
7447                 ]
7448             )
7449         else
7450             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
7451                 [AC_MSG_ERROR(librepository.jar not found.)], [])
7452         fi
7454         if test -z $LIBFONTS_JAR; then
7455             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
7456                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
7457                 [
7458                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
7459                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
7460                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
7461                     )
7462                 ]
7463             )
7464         else
7465             AC_CHECK_FILE($LIBFONTS_JAR, [],
7466                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
7467         fi
7469         if test -z $LIBSERIALIZER_JAR; then
7470             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
7471                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
7472                 [
7473                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
7474                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
7475                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
7476                     )
7477                 ]
7478             )
7479         else
7480             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
7481                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
7482         fi
7485         if test -z $LIBBASE_JAR; then
7486             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
7487                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
7488                 [
7489                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
7490                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
7491                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
7492                     )
7493                 ]
7494             )
7495         else
7496             AC_CHECK_FILE($LIBBASE_JAR, [],
7497                 [AC_MSG_ERROR(libbase.jar not found.)], [])
7498         fi
7500     else
7501         AC_MSG_RESULT([internal])
7502         AC_MSG_CHECKING([for jfreereport module])
7503         SYSTEM_JFREEREPORT=NO
7504         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
7505     fi
7506     BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
7507 else
7508     AC_MSG_RESULT([no])
7509     ENABLE_REPORTBUILDER=NO
7510     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
7511     SYSTEM_JFREEREPORT=NO
7513 AC_SUBST(ENABLE_REPORTBUILDER)
7514 AC_SUBST(SYSTEM_JFREEREPORT)
7515 AC_SUBST(SAC_JAR)
7516 AC_SUBST(LIBXML_JAR)
7517 AC_SUBST(FLUTE_JAR)
7518 AC_SUBST(JFREEREPORT_JAR)
7519 AC_SUBST(LIBBASE_JAR)
7520 AC_SUBST(LIBLAYOUT_JAR)
7521 AC_SUBST(LIBLOADER_JAR)
7522 AC_SUBST(LIBFORMULA_JAR)
7523 AC_SUBST(LIBREPOSITORY_JAR)
7524 AC_SUBST(LIBFONTS_JAR)
7525 AC_SUBST(LIBSERIALIZER_JAR)
7527 # this has to be here because both the Wiki Publisher and the SRB use
7528 # commons-logging
7529 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7530     AC_MSG_CHECKING([which Apache commons-* libs to use])
7531     if test "$with_system_apache_commons" = "yes"; then
7532         SYSTEM_APACHE_COMMONS=YES
7533         AC_MSG_RESULT([external])
7534         if test "$ENABLE_MEDIAWIKI" = "YES"; then
7535             if test -z $COMMONS_CODEC_JAR; then
7536                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
7537                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
7538                     [
7539                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
7540                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
7541                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
7542                         )
7543                     ]
7544                 )
7545             else
7546                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
7547                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
7548             fi
7550             if test -z $COMMONS_LANG_JAR; then
7551                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
7552                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
7553                     [
7554                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
7555                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
7556                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
7557                             )
7558                     ]
7559                 )
7560             else
7561                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
7562                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
7563             fi
7565             if test -z $COMMONS_HTTPCLIENT_JAR; then
7566                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
7567                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
7568                     [
7569                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
7570                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
7571                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
7572                         )
7573                     ]
7574                 )
7575             else
7576                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
7577                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
7578             fi
7579         fi
7580         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7581             if test -z $COMMONS_LOGGING_JAR; then
7582                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
7583                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
7584                    [
7585                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
7586                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
7587                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
7588                         )
7589                     ]
7590                 )
7591             else
7592                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
7593                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
7594             fi
7595         fi
7596     else
7597         AC_MSG_RESULT([internal])
7598         SYSTEM_APACHE_COMMONS=NO
7599         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
7600     fi
7602 AC_SUBST(SYSTEM_APACHE_COMMONS)
7603 AC_SUBST(COMMONS_CODEC_JAR)
7604 AC_SUBST(COMMONS_LANG_JAR)
7605 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
7606 AC_SUBST(COMMONS_LOGGING_JAR)
7608 # scripting provider for BeanShell extension?
7609 AC_MSG_CHECKING([whether to build extension for support of scripts in BeanShell])
7610 if test "x$enable_ext_scripting_beanshell" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
7611    AC_MSG_RESULT([yes])
7612    ENABLE_SCRIPTING_BEANSHELL=YES
7613 else
7614    AC_MSG_RESULT([no])
7615    ENABLE_SCRIPTING_BEANSHELL=NO
7616    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_BEANSHELL"
7618 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
7620 # scripting provider for JavaScript extension?
7621 AC_MSG_CHECKING([whether to build extension for support of scripts in JavaScript])
7622 if test "x$enable_ext_scripting_javascript" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
7623    AC_MSG_RESULT([yes])
7624    ENABLE_SCRIPTING_JAVASCRIPT=YES
7625 else
7626    AC_MSG_RESULT([no])
7627    ENABLE_SCRIPTING_JAVASCRIPT=NO
7628    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_JAVASCRIPT"
7630 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
7632 dnl Scripting provider for Python extension?
7633 dnl We always provide this unless we have disabled Python completely
7634 if test $enable_python = no; then
7635     ENABLE_SCRIPTING_PYTHON=NO
7636 else
7637     ENABLE_SCRIPTING_PYTHON=YES
7639 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
7641 supports_multilib=
7642 case "$host_cpu" in
7643 x86_64 | powerpc64 | s390x)
7644     if test "$SIZEOF_LONG" = "8"; then
7645         supports_multilib="yes"
7646     fi
7647     ;;
7649     ;;
7650 esac
7652 dnl ===================================================================
7653 dnl Check whether the Qt3 and KDE3 libraries are available.
7654 dnl ===================================================================
7656 KDE_CFLAGS=""
7657 KDE_LIBS=""
7658 if test "$_os" != "OpenBSD"; then
7659     MOC="moc"
7661 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
7662     dnl Search paths for Qt3 and KDE3
7663     if test -z "$supports_multilib" ; then
7664         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"
7665         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"
7666     else
7667         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"
7668         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"
7669     fi
7670     if test -n "$QTDIR" ; then
7671         qt_incdirs="$QTDIR/include $qt_incdirs"
7672         if test -z "$supports_multilib" ; then
7673             qt_libdirs="$QTDIR/lib $qt_libdirs"
7674         else
7675             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7676         fi
7677     fi
7678     if test -z "$supports_multilib" ; then
7679         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"
7680         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"
7681     else
7682         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"
7683         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"
7684     fi
7685     if test -n "$KDEDIR" ; then
7686         kde_incdirs="$KDEDIR/include $kde_incdirs"
7687         if test -z "$supports_multilib" ; then
7688             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7689         else
7690             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7691         fi
7692     fi
7694     dnl What to test
7695     qt_test_include="qstyle.h"
7696     kde_test_include="kapp.h"
7698     if test "$_os" != "OpenBSD"; then
7699         qt_test_library="libqt-mt.so"
7700         kde_test_library="libDCOP.so"
7701     else
7702         qt_test_library="libqt-mt.so*"
7703         kde_test_library="libDCOP.so*"
7704     fi
7706     dnl Check for Qt3 headers
7707     AC_MSG_CHECKING([for Qt3 headers])
7708     qt_incdir="no"
7709     for kde_check in $qt_incdirs ; do
7710         if test -r "$kde_check/$qt_test_include" ; then
7711             qt_incdir="$kde_check"
7712             break
7713         fi
7714     done
7715     AC_MSG_RESULT([$qt_incdir])
7716     if test "x$qt_incdir" = "xno" ; then
7717         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
7718 your Qt3 installation by exporting QTDIR before running "configure".])
7719     fi
7721     dnl Check for Qt3 libraries
7722     AC_MSG_CHECKING([for Qt3 libraries])
7723     qt_libdir="no"
7724     for qt_check in $qt_libdirs ; do
7725         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`" ; then
7726             qt_libdir="$qt_check"
7727             break
7728         fi
7729     done
7730     AC_MSG_RESULT([$qt_libdir])
7731     if test "x$qt_libdir" = "xno" ; then
7732         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
7733 your Qt3 installation by exporting QTDIR before running "configure".])
7734     fi
7736     dnl Check for Meta Object Compiler
7737     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
7738     if test "$MOC" = "no" ; then
7739         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
7740 the root of your Qt3 installation by exporting QTDIR before running "configure".])
7741     fi
7743     dnl Check for KDE3 headers
7744     AC_MSG_CHECKING([for KDE3 headers])
7745     kde_incdir="no"
7746     for kde_check in $kde_incdirs ; do
7747         if test -r "$kde_check/$kde_test_include" ; then
7748             kde_incdir="$kde_check"
7749             break
7750         fi
7751     done
7752     AC_MSG_RESULT([$kde_incdir])
7753     if test "x$kde_incdir" = "xno" ; then
7754         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
7755 your KDE3 installation by exporting KDEDIR before running "configure".])
7756     fi
7758     dnl Check for KDE3 libraries
7759     AC_MSG_CHECKING([for KDE3 libraries])
7760     kde_libdir="no"
7761     for kde_check in $kde_libdirs ; do
7762         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`" ; then
7763             kde_libdir="$kde_check"
7764             break
7765         fi
7766     done
7767     AC_MSG_RESULT([$kde_libdir])
7768     if test "x$kde_libdir" = "xno" ; then
7769         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
7770 your KDE3 installation by exporting KDEDIR before running "configure".])
7771     fi
7773     dnl Set the variables
7774     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7775     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
7777 AC_SUBST(KDE_CFLAGS)
7778 AC_SUBST(KDE_LIBS)
7779 AC_SUBST(MOC)
7781 dnl ===================================================================
7782 dnl KDE4 Integration
7783 dnl ===================================================================
7785 KDE4_CFLAGS=""
7786 KDE4_LIBS=""
7787 QMAKE4="qmake"
7788 MOC4="moc"
7789 KDE_GLIB_CFLAGS=""
7790 KDE_GLIB_LIBS=""
7791 KDE_HAVE_GLIB=""
7792 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
7793     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
7794     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
7796     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
7797     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
7799     if test -n "$supports_multilib" ; then
7800         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
7801         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
7802     fi
7804     if test -n "$QTDIR" ; then
7805         qt_incdirs="$QTDIR/include $qt_incdirs"
7806         if test -z "$supports_multilib" ; then
7807             qt_libdirs="$QTDIR/lib $qt_libdirs"
7808         else
7809             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7810         fi
7811     fi
7812     if test -n "$QT4DIR" ; then
7813         qt_incdirs="$QT4DIR/include $qt_incdirs"
7814         if test -z "$supports_multilib" ; then
7815             qt_libdirs="$QT4DIR/lib $qt_libdirs"
7816         else
7817             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
7818         fi
7819     fi
7821     if test -n "$KDEDIR" ; then
7822         kde_incdirs="$KDEDIR/include $kde_incdirs"
7823         if test -z "$supports_multilib" ; then
7824             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7825         else
7826             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7827         fi
7828     fi
7829     if test -n "$KDE4DIR" ; then
7830         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
7831         if test -z "$supports_multilib" ; then
7832             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
7833         else
7834             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
7835         fi
7836     fi
7838     qt_test_include="Qt/qobject.h"
7839     qt_test_library="libQtCore.so"
7840     kde_test_include="kwindowsystem.h"
7841     kde_test_library="libsolid.so"
7843     AC_MSG_CHECKING([for Qt4 headers])
7844     qt_header_dir="no"
7845     for inc_dir in $qt_incdirs ; do
7846         if test -r "$inc_dir/$qt_test_include" ; then
7847             qt_header_dir="$inc_dir"
7848             break
7849         fi
7850     done
7852     AC_MSG_RESULT([$qt_header_dir])
7853     if test "x$qt_header_dir" = "xno" ; then
7854         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7855     fi
7857     dnl Check for qmake
7858     AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7859     QMAKE4="$QMAKEQT4"
7860     if test "$QMAKE4" = "no" ; then
7861         AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7862         if test "$QMAKE4" = "no" ; then
7863             AC_MSG_ERROR([Qmake not found.  Please specify
7864 the root of your Qt installation by exporting QT4DIR before running "configure".])
7865         fi
7866     fi
7868     qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
7869     AC_MSG_CHECKING([for Qt4 libraries])
7870     qt_lib_dir="no"
7871     for lib_dir in $qt_libdirs ; do
7872         if test -r "$lib_dir/$qt_test_library" ; then
7873             qt_lib_dir="$lib_dir"
7874             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
7875             break
7876         fi
7877     done
7879     AC_MSG_RESULT([$qt_lib_dir])
7881     if test "x$qt_lib_dir" = "xno" ; then
7882         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7883     fi
7885     dnl Check for Meta Object Compiler
7887     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7888     MOC4="$MOCQT4"
7889     if test "$MOC4" = "no" ; then
7890         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7891         if test "$MOC4" = "no" ; then
7892             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
7893 the root of your Qt installation by exporting QT4DIR before running "configure".])
7894         fi
7895     fi
7897     dnl Check for KDE4 headers
7898     AC_MSG_CHECKING([for KDE4 headers])
7899     kde_incdir="no"
7900     for kde_check in $kde_incdirs ; do
7901         if test -r "$kde_check/$kde_test_include" ; then
7902             kde_incdir="$kde_check"
7903             break
7904         fi
7905     done
7906     AC_MSG_RESULT([$kde_incdir])
7907     if test "x$kde_incdir" = "xno" ; then
7908         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7909     fi
7911     dnl Check for KDE4 libraries
7912     AC_MSG_CHECKING([for KDE4 libraries])
7913     kde_libdir="no"
7914     for kde_check in $kde_libdirs ; do
7915         if test -r "$kde_check/$kde_test_library" ; then
7916             kde_libdir="$kde_check"
7917             break
7918         fi
7919     done
7921     AC_MSG_RESULT([$kde_libdir])
7922     if test "x$kde_libdir" = "xno" ; then
7923         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7924     fi
7926     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7927     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
7929     AC_LANG_PUSH([C++])
7930     save_CXXFLAGS=$CXXFLAGS
7931     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
7932     AC_MSG_CHECKING([whether KDE is >= 4.2])
7933        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7934 #include <kdeversion.h>
7936 int main(int argc, char **argv) {
7937        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
7938        else return 1;
7940        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
7941     CXXFLAGS=$save_CXXFLAGS
7942     AC_LANG_POP([C++])
7944    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
7945     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
7946         [KDE_HAVE_GLIB=1],
7947         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
7949 AC_SUBST(KDE4_CFLAGS)
7950 AC_SUBST(KDE4_LIBS)
7951 AC_SUBST(MOC4)
7952 AC_SUBST(KDE_GLIB_CFLAGS)
7953 AC_SUBST(KDE_GLIB_LIBS)
7954 AC_SUBST(KDE_HAVE_GLIB)
7956 dnl ===================================================================
7957 dnl Test for the enabling the lockdown pieces
7958 dnl ===================================================================
7959 AC_MSG_CHECKING([whether to enable the lockdown pieces])
7960 ENABLE_LOCKDOWN=""
7961 if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
7962     ENABLE_LOCKDOWN=YES
7963     AC_MSG_RESULT([yes])
7964 else
7965     AC_MSG_RESULT([no])
7967 AC_SUBST(ENABLE_LOCKDOWN)
7969 dnl ===================================================================
7970 dnl Test whether to include Evolution 2 support
7971 dnl ===================================================================
7972 AC_MSG_CHECKING([whether to enable evolution 2 support])
7973 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
7974     AC_MSG_RESULT([yes])
7975     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
7976     ENABLE_EVOAB2="TRUE"
7977 else
7978     ENABLE_EVOAB2=""
7979     AC_MSG_RESULT([no])
7981 AC_SUBST(ENABLE_EVOAB2)
7982 AC_SUBST(GOBJECT_CFLAGS)
7983 AC_SUBST(GOBJECT_LIBS)
7985 dnl ===================================================================
7986 dnl Test whether to include KDE AB support
7987 dnl ===================================================================
7988 AC_MSG_CHECKING([whether to enable KDE address book support])
7989 if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then
7990     AC_MSG_RESULT([yes])
7991     AC_LANG_PUSH([C++])
7992     save_CXXFLAGS=$CXXFLAGS
7993     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
7994     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
7995        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7996 #include <kdeversion.h>
7998 int main(int argc, char **argv) {
7999        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
8000        else return 1;
8002        ]])],[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])],[])
8003     CXXFLAGS=$save_CXXFLAGS
8004     AC_LANG_POP([C++])
8005     ENABLE_KAB=TRUE
8006 else
8007     AC_MSG_RESULT([no])
8008     ENABLE_KAB=
8010 AC_SUBST(ENABLE_KAB)
8012 dnl ===================================================================
8013 dnl Test whether to include MathMLDTD
8014 dnl ===================================================================
8015 AC_MSG_CHECKING([whether to include MathMLDTD])
8016 if test -n "$enable_mathmldtd"; then
8017     if test "$enable_mathmldtd" = "no"; then
8018         AC_MSG_RESULT([no])
8019         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
8020     else
8021         AC_MSG_RESULT([yes])
8022         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
8023     fi
8024 else
8025     AC_MSG_RESULT([no])
8026     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
8029 dnl ===================================================================
8030 dnl Test which themes to include
8031 dnl ===================================================================
8032 AC_MSG_CHECKING([which themes to include])
8033 # if none given, use all available themes
8034 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
8035     with_theme="default crystal hicontrast oxygen tango"
8038 WITH_THEMES=""
8039 for theme in $with_theme; do
8040     case $theme in
8041         default|crystal|hicontrast|oxygen|tango|human) : ;;
8042         *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
8043     esac
8044     WITH_THEMES="$WITH_THEMES $theme"
8045     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
8046 done
8047 AC_MSG_RESULT([$WITH_THEMES])
8048 AC_SUBST([WITH_THEMES])
8050 dnl ===================================================================
8051 dnl Test whether to integrate helppacks into the product's installer
8052 dnl ===================================================================
8053 AC_MSG_CHECKING([for helppack integration])
8054 if test "z$with_helppack_integration" = "zno" ; then
8055     WITH_HELPPACK_INTEGRATION=NO
8056     AC_MSG_RESULT([no integration])
8057 else
8058     WITH_HELPPACK_INTEGRATION=YES
8059     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
8060     AC_MSG_RESULT([integration])
8062 AC_SUBST(WITH_HELPPACK_INTEGRATION)
8064 ###############################################################################
8065 # Extensions checking
8066 ###############################################################################
8067 dnl ===================================================================
8068 dnl Test whether to integrate extensions into the product's installer
8069 dnl ===================================================================
8070 AC_MSG_CHECKING([for extensions integration])
8071 if test "x$enable_extension_integration" != "xno"; then
8072     WITH_EXTENSION_INTEGRATION=YES
8073     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
8074     AC_MSG_RESULT([yes, use integration])
8075 else
8076     WITH_EXTENSION_INTEGRATION=NO
8077     AC_MSG_RESULT([no, do not integrate])
8079 AC_SUBST(WITH_EXTENSION_INTEGRATION)
8081 dnl ===================================================================
8082 dnl Test whether to include Watch Window extension
8083 dnl ===================================================================
8084 AC_MSG_CHECKING([for Watch Window extension integration])
8085 WATCH_WINDOW_EXTENSION_PACK=
8086 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8087     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
8088     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
8089     AC_MSG_RESULT([yes])
8090 else
8091     AC_MSG_RESULT([no])
8093 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
8095 dnl ===================================================================
8096 dnl Test whether to include SmART Gallery (Diagram) extension
8097 dnl ===================================================================
8098 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
8099 DIAGRAM_EXTENSION_PACK=
8100 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8101     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
8102     DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
8103     AC_MSG_RESULT([yes])
8104 else
8105     AC_MSG_RESULT([no])
8107 AC_SUBST(DIAGRAM_EXTENSION_PACK)
8109 dnl ===================================================================
8110 dnl Test whether to include Validator extension
8111 dnl ===================================================================
8112 AC_MSG_CHECKING([for Validator extension integration])
8113 VALIDATOR_EXTENSION_PACK=
8114 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8115     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
8116     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
8117     AC_MSG_RESULT([yes])
8118 else
8119     AC_MSG_RESULT([no])
8121 AC_SUBST(VALIDATOR_EXTENSION_PACK)
8123 dnl ===================================================================
8124 dnl Test whether to include Barcode extension
8125 dnl ===================================================================
8126 AC_MSG_CHECKING([for Barcode extension integration])
8127 BARCODE_EXTENSION_PACK=
8128 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8129     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
8130     BARCODE_EXTENSION_PACK="3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt"
8131     AC_MSG_RESULT([yes])
8132 else
8133     AC_MSG_RESULT([no])
8135 AC_SUBST([BARCODE_EXTENSION_PACK])
8137 dnl ===================================================================
8138 dnl Test whether to include ConvertTextToNumber extension
8139 dnl ===================================================================
8140 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
8141 CT2N_EXTENSION_PACK=
8142 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8143     BUILD_TYPE="$BUILD_TYPE CT2N"
8144     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
8145     CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber_1.3.2.oxt"
8146     AC_MSG_RESULT([yes])
8147 else
8148     AC_MSG_RESULT([no])
8150 AC_SUBST(CT2N_EXTENSION_PACK)
8152 dnl ===================================================================
8153 dnl Test whether to include Numbertext extension
8154 dnl ===================================================================
8155 AC_MSG_CHECKING([for Numbertext extension integration])
8156 NUMBERTEXT_EXTENSION_PACK=
8157 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8158     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
8159     NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt"
8160     AC_MSG_RESULT([yes])
8161 else
8162     AC_MSG_RESULT([no])
8164 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
8166 dnl ===================================================================
8167 dnl Test whether to include Hungarian Cross-reference Toolbar extension
8168 dnl ===================================================================
8169 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
8170 HUNART_EXTENSION_PACK=
8171 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8172     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
8173     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
8174     AC_MSG_RESULT([yes])
8175 else
8176     AC_MSG_RESULT([no])
8178 AC_SUBST(HUNART_EXTENSION_PACK)
8180 dnl ===================================================================
8181 dnl Test whether to include Typography Toolbar extension
8182 dnl ===================================================================
8183 AC_MSG_CHECKING([for Typography Toolbar extension integration])
8184 TYPO_EXTENSION_PACK=
8185 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8186     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
8187     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
8188     AC_MSG_RESULT([yes])
8189 else
8190     AC_MSG_RESULT([no])
8192 AC_SUBST(TYPO_EXTENSION_PACK)
8194 dnl ===================================================================
8195 dnl Test whether to include Google Docs extension
8196 dnl ===================================================================
8197 AC_MSG_CHECKING([for Google Docs extension integration])
8198 GOOGLE_DOCS_EXTENSION_PACK=
8199 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8200     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
8201     GOOGLE_DOCS_EXTENSION_PACK="cea0f63d5985ba4fcbd882031df44346-gdocs_3.0.0_modified.oxt"
8202     AC_MSG_RESULT([yes])
8203 else
8204     AC_MSG_RESULT([no])
8206 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
8208 dnl ===================================================================
8209 dnl Test whether to include NLPSolver extension
8210 dnl ===================================================================
8211 AC_MSG_CHECKING([for NLPSolver extension integration])
8212 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
8213     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
8214     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
8215     AC_MSG_RESULT([yes])
8216 else
8217     AC_MSG_RESULT([no])
8220 dnl ===================================================================
8221 dnl Test whether to include LanguageTool extension
8222 dnl ===================================================================
8223 AC_MSG_CHECKING([for LanguageTool extension integration])
8224 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8225     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
8226     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
8227     AC_MSG_RESULT([yes])
8228 else
8229     AC_MSG_RESULT([no])
8232 dnl ===================================================================
8233 dnl Test whether to include oooblogger extension
8234 dnl ===================================================================
8235 AC_MSG_CHECKING([for oooblogger extension integration])
8236 OOOBLOGGER_EXTENSION_PACK=
8237 if test "x$enable_ext_oooblogger" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8238     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_OOOBLOGGER"
8239     OOOBLOGGER_EXTENSION_PACK="b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt"
8240     AC_MSG_RESULT([yes])
8241 else
8242     AC_MSG_RESULT([no])
8244 AC_SUBST(OOOBLOGGER_EXTENSION_PACK)
8245 ###############################################################################
8247 dnl ===================================================================
8248 dnl Test whether to include Sun Professional Template Pack
8249 dnl ===================================================================
8250 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
8251 if test "z$with_sun_templates" = "z" -o "z$with_sun_templates" = "zno" ; then
8252     SUNTEMPLATES_LANG=""
8253     AC_MSG_RESULT([no integration])
8254 else
8255     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
8256     sun_supported_langs="en-US de it fr es hu"
8257     if test "z$with_sun_templates" = "zyes" ; then
8258         wanted_sun_templates="$sun_supported_langs"
8259     else
8260         # check whether the langs are supported by Sun
8261         wanted_sun_templates=
8262         for lang in $with_sun_templates ; do
8263             if test -n "`echo $sun_supported_langs | grep "$lang"`" ; then
8264                 wanted_sun_templates="$wanted_sun_templates $lang"
8265             fi
8266         done
8267     fi
8268     SUNTEMPLATES_LANG=
8269     SUNTEMPLATES_DE_PACK=
8270     SUNTEMPLATES_EN_US_PACK=
8271     SUNTEMPLATES_ES_PACK=
8272     SUNTEMPLATES_FR_PACK=
8273     SUNTEMPLATES_HU_PACK=
8274     SUNTEMPLATES_IT_PACK=
8275     # check whether the langs are requested at all
8276     for lang in $wanted_sun_templates ; do
8277     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`" ; then
8278         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
8279         case $lang in
8280         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
8281         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
8282         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
8283         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
8284         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
8285         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
8286         esac
8287     fi
8288     done
8289     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
8291 AC_SUBST(SUNTEMPLATES_LANG)
8292 AC_SUBST(SUNTEMPLATES_DE_PACK)
8293 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
8294 AC_SUBST(SUNTEMPLATES_ES_PACK)
8295 AC_SUBST(SUNTEMPLATES_FR_PACK)
8296 AC_SUBST(SUNTEMPLATES_HU_PACK)
8297 AC_SUBST(SUNTEMPLATES_IT_PACK)
8299 dnl ===================================================================
8300 dnl Test whether to include fonts
8301 dnl ===================================================================
8302 AC_MSG_CHECKING([whether to include third-party fonts])
8303 if test "$with_fonts" != "no" ; then
8304     AC_MSG_RESULT([yes])
8305     WITH_FONTS=YES
8306     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
8307 else
8308     AC_MSG_RESULT([no])
8309     WITH_FONTS=NO
8310     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
8312 AC_SUBST(WITH_FONTS)
8314 AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
8315 if test "$with_agfa_monotype_fonts" = "yes" ; then
8316     AC_MSG_RESULT([yes])
8317     WITH_AGFA_MONOTYPE_FONTS=YES
8318     SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
8319     BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
8320 else
8321     AC_MSG_RESULT([no])
8322     WITH_AGFA_MONOTYPE_FONTS=NO
8324 AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
8326 dnl ===================================================================
8327 dnl Test whether to include ppds
8328 dnl ===================================================================
8329 AC_MSG_CHECKING([whether to include PPDs])
8330 if test "$with_ppds" != "no"; then
8331     AC_MSG_RESULT([yes])
8332 else
8333     AC_MSG_RESULT([no])
8334     WITHOUT_PPDS=YES
8335     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
8337 AC_SUBST(WITHOUT_PPDS)
8339 dnl ===================================================================
8340 dnl Test whether to include afms
8341 dnl ===================================================================
8342 AC_MSG_CHECKING([whether to include AFMs])
8343 if test "$with_afms" != "no"; then
8344     AC_MSG_RESULT([yes])
8345     BUILD_TYPE="$BUILD_TYPE AFMS"
8346 else
8347     AC_MSG_RESULT([no])
8348     WITHOUT_AFMS=YES
8349     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
8351 AC_SUBST(WITHOUT_AFMS)
8353 dnl ===================================================================
8354 dnl Test whether to include extra galleries
8355 dnl ===================================================================
8356 AC_MSG_CHECKING([whether to include extra galleries])
8357 if test "z$enable_extra_gallery" = "z" -o "z$enable_extra_gallery" = "zno" ; then
8358     AC_MSG_RESULT([no])
8359     WITH_EXTRA_GALLERY=NO
8360     OOOP_GALLERY_PACK=""
8361 else
8362     AC_MSG_RESULT([yes])
8363     WITH_EXTRA_GALLERY=YES
8364     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
8365     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
8366     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
8368 AC_SUBST(WITH_EXTRA_GALLERY)
8369 AC_SUBST(OOOP_GALLERY_PACK)
8371 dnl ===================================================================
8372 dnl Test whether to include extra templates
8373 dnl ===================================================================
8374 AC_MSG_CHECKING([whether to include extra templates])
8375 if test "z$enable_extra_template" = "z" -o "z$enable_extra_template" = "zno" ; then
8376     AC_MSG_RESULT([no])
8377     WITH_EXTRA_TEMPLATE=NO
8378     OOOP_TEMPLATES_PACK=""
8379 else
8380     AC_MSG_RESULT([yes])
8381     WITH_EXTRA_TEMPLATE=YES
8382     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
8383     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
8384     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
8386 AC_SUBST(WITH_EXTRA_TEMPLATE)
8387 AC_SUBST(OOOP_TEMPLATES_PACK)
8389 dnl ===================================================================
8390 dnl Test whether to include extra samples
8391 dnl ===================================================================
8392 AC_MSG_CHECKING([whether to include extra samples])
8393 if test "z$enable_extra_sample" = "z" -o "z$enable_extra_sample" = "zno" ; then
8394     AC_MSG_RESULT([no])
8395     WITH_EXTRA_SAMPLE=NO
8396     OOOP_SAMPLES_PACK=""
8397 else
8398     AC_MSG_RESULT([yes])
8399     WITH_EXTRA_SAMPLE=YES
8400     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
8401     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
8402     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
8404 AC_SUBST(WITH_EXTRA_SAMPLE)
8405 AC_SUBST(OOOP_SAMPLES_PACK)
8407 dnl ===================================================================
8408 dnl Test whether to include extra fonts
8409 dnl ===================================================================
8410 AC_MSG_CHECKING([whether to include extra fonts])
8411 if test "z$enable_extra_font" = "z" -o "z$enable_extra_font" = "zno" ; then
8412     AC_MSG_RESULT([no])
8413     WITH_EXTRA_FONT=NO
8414     OOOP_FONTS_PACK=""
8415 else
8416     AC_MSG_RESULT([yes])
8417     WITH_EXTRA_FONT=YES
8418     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
8419     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
8420     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
8422 AC_SUBST(WITH_EXTRA_FONT)
8423 AC_SUBST(OOOP_FONTS_PACK)
8425 dnl ===================================================================
8426 dnl Test whether to download OxygenOffice branding and set custom settings
8427 dnl ===================================================================
8428 AC_MSG_CHECKING([whether to download OxygenOffice branding and set custom settings])
8429 if test "z$enable_oxygenoffice" = "z" -o "z$enable_oxygenoffice" = "zno" ; then
8430     AC_MSG_RESULT([no])
8431     ENABLE_OXYGENOFFICE=NO
8432 else
8433     AC_MSG_RESULT([yes])
8434     ENABLE_OXYGENOFFICE=YES
8435     OXYGENOFFICE_PACK="18bf204479ff641d99a88cd71f6f25f7-oxygenoffice-001.zip"
8436     BUILD_TYPE="$BUILD_TYPE OXYGENOFFICE"
8438 AC_SUBST(ENABLE_OXYGENOFFICE)
8439 AC_SUBST(OXYGENOFFICE_PACK)
8441 dnl ===================================================================
8442 dnl Test whether to build global menu support
8443 dnl ===================================================================
8444 AC_MSG_CHECKING([whether to build global menu support])
8445 if test "z$enable_lomenubar" = "z" -o "z$enable_lomenubar" = "zno" ; then
8446     AC_MSG_RESULT([no])
8447     ENABLE_LOMENUBAR="FALSE"
8448 else
8449     AC_MSG_RESULT([yes])
8450     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]))
8451     ENABLE_LOMENUBAR="TRUE"
8453 AC_SUBST(ENABLE_LOMENUBAR)
8455 dnl ===================================================================
8456 dnl Test whether to enable online update service
8457 dnl ===================================================================
8458 AC_MSG_CHECKING([whether to enable online update])
8459 ENABLE_ONLINE_UPDATE=
8460 if test "z$enable_online_update" = "z" ; then
8461     if test "$_os" = "WINNT" -o "$_os" = "Darwin" ; then
8462         AC_MSG_RESULT([yes])
8463         ENABLE_ONLINE_UPDATE="TRUE"
8464     else
8465         AC_MSG_RESULT([no])
8466     fi
8467 else
8468     if test "z$enable_online_update" = "zyes" ; then
8469         AC_MSG_RESULT([yes])
8470         ENABLE_ONLINE_UPDATE="TRUE"
8471     else
8472         AC_MSG_RESULT([no])
8473     fi
8475 AC_SUBST(ENABLE_ONLINE_UPDATE)
8477 dnl ===================================================================
8478 dnl Test whether build target is Release Build
8479 dnl ===================================================================
8480 AC_MSG_CHECKING([whether build target is Release Build])
8481 if test "z$enable_release_build" = "z" -o "z$enable_release_build" = "zno" ; then
8482     AC_MSG_RESULT([no])
8483     ENABLE_RELEASE_BUILD="FALSE"
8484 else
8485     AC_MSG_RESULT([yes])
8486     ENABLE_RELEASE_BUILD="TRUE"
8488 AC_SUBST(ENABLE_RELEASE_BUILD)
8490 dnl ===================================================================
8491 dnl Test whether to create MSI with LIMITUI=1 (silent install)
8492 dnl ===================================================================
8493 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
8494 if test "z$enable_silent_msi" = "z" -o "z$enable_silent_msi" = "zno" ; then
8495     AC_MSG_RESULT([no])
8496     ENABLE_SILENT_MSI="FALSE"
8497 else
8498     AC_MSG_RESULT([yes])
8499     ENABLE_SILENT_MSI="TRUE"
8500     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
8502 AC_SUBST(ENABLE_SILENT_MSI)
8504 dnl ===================================================================
8505 dnl Test whether to enable ActiveX embedding
8506 dnl ===================================================================
8507 if test "$_os" = "WINNT"; then
8508     AC_MSG_CHECKING([whether to enable ActiveX embedding of LibreOffice components])
8509     if test "$enable_activex_component" = "yes" -o "$enable_activex_component" = "TRUE" -o "$enable_activex_component" = ""; then
8510         ENABLE_ACTIVEX_COMPONENT="TRUE"
8511         AC_MSG_RESULT([yes])
8512         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
8513     else
8514         ENABLE_ACTIVEX_COMPONENT=""
8515         AC_MSG_RESULT([no])
8516     fi
8517     AC_SUBST(ENABLE_ACTIVEX_COMPONENT)
8518     AC_SUBST(SCPDEFS)
8521 AC_MSG_CHECKING([whether and how to use Xinerama])
8522 if test "$_os" = "Darwin"; then
8523     USE_XINERAMA=YES
8524     XINERAMA_LINK=dynamic
8525     AC_MSG_RESULT([yes])
8526 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
8527     if test "$x_libraries" = "default_x_libraries"; then
8528         XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
8529         if test "x$XINERAMALIB" = x; then
8530            XINERAMALIB="/usr/lib"
8531         fi
8532     else
8533         XINERAMALIB="$x_libraries"
8534     fi
8535     if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
8536         # we have both versions, let the user decide but use the dynamic one
8537         # per default
8538         USE_XINERAMA=YES
8539         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
8540             XINERAMA_LINK=dynamic
8541         else
8542             XINERAMA_LINK=static
8543         fi
8544     elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
8545         # we have only the dynamic version
8546         USE_XINERAMA=YES
8547         XINERAMA_LINK=dynamic
8548     elif test -e "$XINERAMALIB/libXinerama.a"; then
8549         # static version
8550         if echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
8551             USE_XINERAMA=YES
8552             XINERAMA_LINK=static
8553         else
8554             USE_XINERAMA=NO
8555             XINERAMA_LINK=none
8556         fi
8557     else
8558         # no Xinerama
8559         USE_XINERAMA=NO
8560         XINERAMA_LINK=none
8561     fi
8562     if test "$USE_XINERAMA" = "YES"; then
8563         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
8564         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
8565             [AC_MSG_ERROR(Xinerama header not found.)], [])
8566         XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
8567         if test "x$XEXTLIB" = x; then
8568            XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
8569         fi
8570         XINERAMA_EXTRA_LIBS="$XEXTLIBS"
8571         if test "$_os" = "FreeBSD"; then
8572             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
8573         fi
8574         if test "$_os" = "Linux"; then
8575             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
8576         fi
8577         AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
8578             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
8579     else
8580         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
8581     fi
8582 else
8583     USE_XINERAMA=NO
8584     XINERAMA_LINK=none
8585     AC_MSG_RESULT([no])
8587 AC_SUBST(USE_XINERAMA)
8588 AC_SUBST(XINERAMA_LINK)
8590 dnl ===================================================================
8591 dnl Checks for librsvg
8592 dnl ===================================================================
8594 dnl ENABLE_LIBRSVG is set to "" (for NO), SYSTEM or INTERNAL. The
8595 dnl SYSTEM_LIBRSVG, SYSTEM_GDKPIXBUF etc are redundant.
8597 ENABLE_LIBRSVG=""
8598 LIBRSVG_CFLAGS=""
8599 LIBRSVG_LIBS=""
8601 AC_MSG_CHECKING([what librsvg to use])
8603 case "$enable_librsvg" in
8604 no|disable)
8605     AC_MSG_RESULT([none])
8606     enable_librsvg=no
8607     ;;
8609 ""|yes|auto)
8610     if test $build_os = cygwin -o \
8611            $_os = Darwin; then
8612         dnl When building on/for these OSes always use the internal one,
8613         dnl if at all. Add more OSes above as needed.
8614         AC_MSG_RESULT([internal])
8615         enable_librsvg=internal
8616     elif test  $_os = iOS -o $_os = Android; then
8617         AC_MSG_RESULT([none])
8618         enable_librsvg=no
8619     else
8620         if test "$with_system_libs" = yes; then
8621             AC_MSG_RESULT([system])
8622             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8623             enable_librsvg=system
8624         elif test "$with_system_libs" = no; then
8625             AC_MSG_RESULT([internal])
8626             enable_librsvg=internal
8627         else
8628             AC_MSG_RESULT([checking further])
8629             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14,, [:])
8630             if test -z "$LIBRSVG_PKG_ERRORS"; then
8631                 enable_librsvg=system
8632             else
8633                 enable_librsvg=internal
8634             fi
8635         fi
8636     fi
8637     ;;
8639 internal)
8640     AC_MSG_RESULT([internal])
8641     ;;
8643 system)
8644     if test $_os = WINNT -a "$WITH_MINGW" != yes; then
8645         AC_MSG_ERROR([Must use internal librsvg when building with MSVC])
8646     fi
8647     AC_MSG_RESULT([system])
8648     PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8649     ;;
8652     AC_MSG_ERROR([Incorrect --enable-librsvg option])
8653     ;;
8654 esac
8656 dnl By now enable_librsvg should be "system", "internal" or "no"
8657 case $enable_librsvg in
8658 system)
8659     ENABLE_LIBRSVG=SYSTEM
8660     SYSTEM_LIBRSVG=YES
8661     ;;
8663 internal)
8664     ENABLE_LIBRSVG=INTERNAL
8665     SYSTEM_LIBRSVG=NO
8666     BUILD_TYPE="$BUILD_TYPE LIBRSVG"
8667     ;;
8670     ENABLE_LIBRSVG=NO
8671     SYSTEM_LIBRSVG=NO
8672     ;;
8675     AC_MSG_ERROR([Internal configure script error, invalid enable_librsvg value "$enable_librsvg"])
8676     ;;
8677 esac
8679 AC_SUBST(ENABLE_LIBRSVG)
8680 AC_SUBST(LIBRSVG_CFLAGS)
8681 AC_SUBST(LIBRSVG_LIBS)
8682 AC_SUBST(SYSTEM_LIBRSVG)
8684 dnl ===================================================================
8685 dnl Test whether to build cairo or rely on the system version
8686 dnl ===================================================================
8689 SYSTEM_CAIRO=""
8691 AC_MSG_CHECKING([whether to use the system cairo])
8693 if test "$with_system_cairo" = "yes"; then
8694     SYSTEM_CAIRO=YES
8695     AC_MSG_RESULT([yes])
8697     PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
8699     if test "$test_xrender" = "yes"; then
8700         if test "$with_system_xextensions_headers" != "no"; then
8701             AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
8702             AC_LANG_PUSH([C])
8703             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
8704 #ifdef PictStandardA8
8705 #else
8706       return fail;
8707 #endif
8708 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
8710             AC_LANG_POP([C])
8711         fi
8712     fi
8713     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libfontconfig-1.dll libfreetype-6.dll libpixman-1-0.dll libpng15-15.dll libcairo-2.dll"
8714 else
8715     AC_MSG_RESULT([no])
8717     if test $_os = Android; then
8718         dnl For Android cairo isn't
8719         dnl buildable yet.
8720         :
8721     elif test $_os = WINNT; then
8722         dnl We only need cairo for Windows if we
8723         dnl build librsvg or directx disabled
8724         if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
8725             BUILD_TYPE="$BUILD_TYPE CAIRO"
8726         fi
8727     else
8728         BUILD_TYPE="$BUILD_TYPE CAIRO"
8729     fi
8732 AC_SUBST(SYSTEM_CAIRO)
8733 AC_SUBST(CAIRO_CFLAGS)
8734 AC_SUBST(CAIRO_LIBS)
8737 dnl ===================================================================
8738 dnl Test whether to build gdk-pixbuf or rely on the system version
8739 dnl ===================================================================
8741 AC_MSG_CHECKING([whether to use the system gdk-pixbuf])
8743 dnl As long as the only thing we need gdk-pixbuf for is below
8744 dnl librsvg, use the same --enable-librsvg (possibly implied
8745 dnl by --with-system-libs) to override this.
8747 if test "$SYSTEM_LIBRSVG" = YES; then
8748     SYSTEM_GDKPIXBUF=YES
8749     AC_MSG_RESULT([yes])
8750 else
8751     case "$_os" in
8752     WINNT|Darwin|iOS|Android)
8753         SYSTEM_GDKPIXBUF=NO
8754         AC_MSG_RESULT([no])
8755         ;;
8756     *)
8757         SYSTEM_GDKPIXBUF=YES
8758         AC_MSG_RESULT([yes])
8759         ;;
8760     esac
8762 AC_SUBST(SYSTEM_GDKPIXBUF)
8764 dnl ===================================================================
8765 dnl Test whether to build GLib or rely on the system version
8766 dnl ===================================================================
8768 AC_MSG_CHECKING([whether to use the system GLib])
8770 dnl As long as the only thing we need GLib for is below
8771 dnl librsvg, use the same --enable-librsvg (possibly implied
8772 dnl by --with-system-libs) to override this.
8774 if test "$SYSTEM_LIBRSVG" = YES; then
8775     SYSTEM_GLIB=YES
8776     AC_MSG_RESULT([yes])
8777 else
8778     case "$_os" in
8779     WINNT|Darwin|iOS|Android)
8780         SYSTEM_GLIB=NO
8781         AC_MSG_RESULT([no])
8782         ;;
8783     *)
8784         SYSTEM_GLIB=YES
8785         AC_MSG_RESULT([yes])
8786         ;;
8787     esac
8789 AC_SUBST(SYSTEM_GLIB)
8791 dnl ===================================================================
8792 dnl Test whether to build gettext runtime (libintl) or rely on the
8793 dnl system version
8794 dnl ===================================================================
8796 AC_MSG_CHECKING([whether to use the system gettext runtime])
8798 if test "$with_system_gettext" = yes; then
8799     SYSTEM_GETTEXT=YES
8800     AC_MSG_RESULT([yes])
8801 else
8802     case "$_os" in
8803     WINNT|Darwin|iOS|Android)
8804         SYSTEM_GETTEXT=NO
8805         AC_MSG_RESULT([no])
8806         ;;
8807     *)
8808         SYSTEM_GETTEXT=YES
8809         AC_MSG_RESULT([yes])
8810         ;;
8811     esac
8813 AC_SUBST(SYSTEM_GETTEXT)
8815 dnl ===================================================================
8816 dnl Test whether to build libcroco or rely on the system version
8817 dnl ===================================================================
8819 AC_MSG_CHECKING([whether to use the system libcroco])
8821 dnl As long as the only thing we need libcroco for is below
8822 dnl librsvg, use the same --enable-librsvg (possibly implied
8823 dnl by --with-system-libs) to override this.
8825 if test "$SYSTEM_LIBRSVG" = YES; then
8826     SYSTEM_LIBCROCO=YES
8827     AC_MSG_RESULT([yes])
8828 else
8829     case "$_os" in
8830     WINNT|Darwin|iOS|Android)
8831         SYSTEM_LIBCROCO=NO
8832         AC_MSG_RESULT([no])
8833         ;;
8834     *)
8835         SYSTEM_LIBCROCO=YES
8836         AC_MSG_RESULT([yes])
8837         ;;
8838     esac
8840 AC_SUBST(SYSTEM_LIBCROCO)
8842 dnl ===================================================================
8843 dnl Test whether to build Pango or rely on the system version
8844 dnl ===================================================================
8846 AC_MSG_CHECKING([whether to use the system pango])
8848 dnl As long as the only thing we need Pango for is below
8849 dnl librsvg, use the same --enable-librsvg (possibly implied
8850 dnl by --with-system-libs) to override this.
8852 if test "$SYSTEM_LIBRSVG" = YES; then
8853     SYSTEM_PANGO=YES
8854     AC_MSG_RESULT([yes])
8855 else
8856     case "$_os" in
8857     WINNT|Darwin|iOS|Android)
8858         SYSTEM_PANGO=NO
8859         AC_MSG_RESULT([no])
8860         ;;
8861     *)
8862         SYSTEM_PANGO=YES
8863         AC_MSG_RESULT([yes])
8864         ;;
8865     esac
8867 AC_SUBST(SYSTEM_PANGO)
8869 dnl ===================================================================
8870 dnl Test whether to build libgsf or rely on the system version
8871 dnl ===================================================================
8873 AC_MSG_CHECKING([whether to use the system libgsf])
8875 dnl As long as the only thing we need libgsf for is below librsvg (is
8876 dnl it?), use the same --enable-librsvg (possibly implied by
8877 dnl --with-system-libs) to override this.
8879 if test "$SYSTEM_LIBRSVG" = YES; then
8880     SYSTEM_LIBGSF=YES
8881     AC_MSG_RESULT([yes])
8882 else
8883     case "$_os" in
8884     WINNT|Darwin|iOS|Android)
8885         SYSTEM_LIBGSF=NO
8886         AC_MSG_RESULT([no])
8887         ;;
8888     *)
8889         SYSTEM_LIBGSF=YES
8890         AC_MSG_RESULT([yes])
8891         ;;
8892     esac
8894 AC_SUBST(SYSTEM_LIBGSF)
8896 dnl ===================================================================
8897 dnl Test whether to build libpng or rely on the system version
8898 dnl ===================================================================
8900 AC_MSG_CHECKING([whether to use the system libpng])
8902 dnl How should and does this interact with the checks for libpng
8903 dnl related to use of libpng in the quickstarter above? This needs to
8904 dnl be unified.
8906 if test "$with_system_libpng" = yes; then
8907     SYSTEM_LIBPNG=YES
8908     AC_MSG_RESULT([yes])
8909 else
8910     case "$_os" in
8911     WINNT|Darwin|iOS|Android)
8912         SYSTEM_LIBPNG=NO
8913         AC_MSG_RESULT([no])
8914         ;;
8915     *)
8916         SYSTEM_LIBPNG=YES
8917         AC_MSG_RESULT([yes])
8918         ;;
8919     esac
8921 AC_SUBST(SYSTEM_LIBPNG)
8923 dnl ===================================================================
8924 dnl Test whether to build libjpeg or rely on the system version
8925 dnl ===================================================================
8926 dnl FIXME: this is currently because we have jpeg-6b for our filters
8927 dnl        and jpeg-8 as dependency for librsvg
8928 dnl        this should be unified into using only one version for both
8930 AC_MSG_CHECKING([whether to use the system libjpeg])
8932 if test "$SYSTEM_JPEG" == "YES"; then
8933     SYSTEM_LIBJPEG=YES
8934     AC_MSG_RESULT([yes])
8935 else
8936     case "$_os" in
8937     WINNT|Darwin|iOS|Android)
8938         SYSTEM_LIBJPEG=NO
8939         AC_MSG_RESULT([no])
8940         ;;
8941     *)
8942         SYSTEM_LIBJPEG=YES
8943         AC_MSG_RESULT([yes])
8944         ;;
8945     esac
8947 AC_SUBST(SYSTEM_LIBJPEG)
8949 dnl ===================================================================
8950 dnl Check for runtime JVM search path
8951 dnl ===================================================================
8952 if test "$SOLAR_JAVA" != ""; then
8953     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
8954     if test -n "$with_jvm_path" && test "$with_jvm_path" != "no"; then
8955         AC_MSG_RESULT([yes])
8956         if ! test -d "$with_jvm_path"; then
8957             AC_MSG_ERROR(["$with_jvm_path" not a directory])
8958         fi
8959         if ! test -d "$with_jvm_path"jvm; then
8960             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
8961         fi
8962         JVM_ONE_PATH_CHECK="$with_jvm_path"
8963         AC_SUBST(JVM_ONE_PATH_CHECK)
8964     else
8965         AC_MSG_RESULT([no])
8966     fi
8969 dnl ===================================================================
8970 dnl Test for the presence of Ant and that it works
8971 dnl ===================================================================
8973 if test "$SOLAR_JAVA" != ""; then
8974     ANT_HOME=; export ANT_HOME
8975     WITH_ANT_HOME=; export WITH_ANT_HOME
8976     if test -z "$with_ant_home"; then
8977         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
8978     else
8979         if test "$_os" = "WINNT"; then
8980             with_ant_home=`cygpath -u "$with_ant_home"`
8981         fi
8982         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
8983         WITH_ANT_HOME=$with_ant_home
8984         ANT_HOME=$with_ant_home
8985     fi
8987     if test -z "$ANT"; then
8988         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
8989     else
8990         # resolve relative or absolute symlink
8991         while test -h "$ANT"; do
8992             a_cwd=`pwd`
8993             a_basename=`basename "$ANT"`
8994             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
8995             cd "`dirname "$ANT"`"
8996             cd "`dirname "$a_script"`"
8997             ANT="`pwd`"/"`basename "$a_script"`"
8998             cd "$a_cwd"
8999         done
9001         AC_MSG_CHECKING([if $ANT works])
9002         cat > conftest.java << EOF
9003         public class conftest {
9004             int testmethod(int a, int b) {
9005                     return a + b;
9006             }
9007         }
9010         cat > conftest.xml << EOF
9011         <project name="conftest" default="conftest">
9012         <target name="conftest">
9013             <javac srcdir="." includes="conftest.java">
9014             </javac>
9015         </target>
9016         </project>
9019         oldJAVA_HOME=$JAVA_HOME
9020         if test "$JAVACISGCJ" = "yes"; then
9021             JAVA_HOME=; export JAVA_HOME
9022             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
9023         else
9024             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
9025         fi
9026         AC_TRY_EVAL(ant_cmd)
9027         if test $? = 0 && test -f ./conftest.class ; then
9028             AC_MSG_RESULT([Ant works])
9029             if test -z "$WITH_ANT_HOME"; then
9030                 ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
9031                 if test -z "$ANT_HOME"; then
9032                     ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
9033                 fi
9034             else
9035                 ANT_HOME="$WITH_ANT_HOME"
9036             fi
9037         else
9038             echo "configure: Ant test failed" >&5
9039             cat conftest.java >&5
9040             cat conftest.xml >&5
9041             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
9042             ANT_HOME=""
9043             echo "Ant does not work - Some Java projects will not build!" >>warn
9044         fi
9045         JAVA_HOME=$oldJAVA_HOME
9046         rm -f conftest* core core.* *.core
9047     fi
9048     if test -z "$ANT_HOME"; then
9049         ANT_HOME="NO_ANT_HOME"
9050     fi
9051     AC_SUBST(ANT_HOME)
9053     dnl Checking for ant.jar
9054     if test "$ANT_HOME" != "NO_ANT_HOME"; then
9055         AC_MSG_CHECKING([Ant lib directory])
9056         if test -f $ANT_HOME/lib/ant.jar; then
9057             ANT_LIB="$ANT_HOME/lib"
9058         else
9059             if test -f $ANT_HOME/ant.jar; then
9060                 ANT_LIB="$ANT_HOME"
9061             else
9062                 if test -f /usr/share/java/ant.jar; then
9063                     ANT_LIB=/usr/share/java
9064                 else
9065                     if test -f /usr/share/ant-core/lib/ant.jar; then
9066                         ANT_LIB=/usr/share/ant-core/lib
9067                     else
9068                         if test -f $ANT_HOME/lib/ant/ant.jar; then
9069                             ANT_LIB="$ANT_HOME/lib/ant"
9070                         else
9071                             if test -f /usr/share/lib/ant/ant.jar; then
9072                                 ANT_LIB=/usr/share/lib/ant
9073                             else
9074                                 AC_MSG_ERROR([Ant libraries not found!])
9075                             fi
9076                         fi
9077                     fi
9078                 fi
9079             fi
9080         fi
9081         AC_MSG_RESULT([Ant lib directory found.])
9082     fi
9083     AC_SUBST(ANT_LIB)
9085     ant_minver=1.6.0
9086     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
9088     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
9089     ant_version=`$ANT -version | $AWK '{ print $4; }'`
9090     ant_version_major=`echo $ant_version | cut -d. -f1`
9091     ant_version_minor=`echo $ant_version | cut -d. -f2`
9092     echo "configure: ant_version $ant_version " >&5
9093     echo "configure: ant_version_major $ant_version_major " >&5
9094     echo "configure: ant_version_minor $ant_version_minor " >&5
9095     if test "$ant_version_major" -ge "2"; then
9096         AC_MSG_RESULT([yes, $ant_version])
9097     elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
9098         AC_MSG_RESULT([yes, $ant_version])
9099     else
9100         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
9101     fi
9103     if test "$ENABLE_MEDIAWIKI" = "YES"; then
9104         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
9105         rm -rf confdir
9106         mkdir confdir
9107         cat > conftest.java << EOF
9108             public class conftest {
9109                 int testmethod(int a, int b) {
9110                     return a + b;
9111                 }
9112             }
9115         cat > conftest.xml << EOF
9116             <project name="conftest" default="conftest">
9117             <target name="conftest" depends="copytest">
9118                 <javac srcdir="." includes="conftest.java">
9119                 </javac>
9120             </target>
9121             <target name="copytest">
9122                  <copy todir="confdir">
9123                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
9124                  <filterset/>
9125                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
9126                  </copy>
9127             </target>
9128             </project>
9131         if test "$JAVACISGCJ" = "yes"; then
9132             JAVA_HOME=; export JAVA_HOME
9133             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
9134         else
9135             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
9136         fi
9137         AC_TRY_EVAL(ant_cmd)
9138         if test $? = 0 && test -f ./conftest.class ; then
9139             AC_MSG_RESULT([yes])
9140             rm -rf confdir
9141         else
9142             echo "configure: Ant test failed" >&5
9143             cat conftest.java >&5
9144             cat conftest.xml >&5
9145             rm -rf confdir
9146             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
9147         fi
9148     fi
9149     rm -f conftest* core core.* *.core
9152 OOO_JUNIT_JAR=
9153 if test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
9154     AC_MSG_CHECKING([for JUnit 4])
9155     if test "$with_junit" = "yes"; then
9156         if test -e /usr/share/java/junit4.jar; then
9157             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
9158         else
9159            if test -e /usr/share/lib/java/junit.jar; then
9160               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
9161            else
9162               OOO_JUNIT_JAR=/usr/share/java/junit.jar
9163            fi
9164         fi
9165     else
9166         OOO_JUNIT_JAR=$with_junit
9167     fi
9168     if test "$_os" = "WINNT"; then
9169         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
9170     fi
9171     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
9172         grep org/junit/Before.class > /dev/null 2>&5
9173     if test $? -eq 0; then
9174         # check if either class-path entry is available for hamcrest or
9175         # it's bundled
9176         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
9177             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
9178             AC_MSG_RESULT([$OOO_JUNIT_JAR])
9179         else
9180             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
9181 provide a full junit jar or use --without-junit])
9182         fi
9183     else
9184         AC_MSG_RESULT([no])
9185         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
9186 location (/usr/share/java), specify its pathname via
9187 --with-junit=..., or disable it via --without-junit])
9188     fi
9189     if test $OOO_JUNIT_JAR != ""; then
9190         BUILD_TYPE="$BUILD_TYPE QADEVOOO"
9191     fi
9193 AC_SUBST(OOO_JUNIT_JAR)
9195 dnl ===================================================================
9196 dnl Product version
9197 dnl ===================================================================
9198 AC_MSG_CHECKING([for product version])
9199 PRODUCTVERSION=AC_PACKAGE_VERSION
9200 AC_MSG_RESULT([$PRODUCTVERSION])
9201 AC_SUBST(PRODUCTVERSION)
9203 dnl ===================================================================
9204 dnl Dealing with l10n options
9205 dnl ===================================================================
9206 AC_MSG_CHECKING([which languages to be built])
9207 # get list of all languages
9208 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
9209 # the sed command does the following:
9210 #   + if a line ends with a backslash, append the next line to it
9211 #   + adds " on the beginning of the value (after =)
9212 #   + adds " at the end of the value
9213 #   + removes en-US; we want to put it on the beginning
9214 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
9215 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
9216 ALL_LANGS="en-US $completelangiso"
9217 # check the configured localizations
9218 WITH_LANG="$with_lang"
9219 if test -z "$WITH_LANG"; then
9220     AC_MSG_RESULT([en-US])
9221 else
9222     AC_MSG_RESULT([$WITH_LANG])
9223     GIT_REPO_NAMES="$GIT_REPO_NAMES translations"
9225 # check that the list is valid
9226 for lang in $WITH_LANG ; do
9227     test "$lang" = "ALL" && continue;
9228     # need to check for the exact string, so add space before and after the list of all languages
9229     for vl in $ALL_LANGS ; do
9230         if test "$vl" = "$lang" ; then
9231            break;
9232         fi
9233     done
9234     if test "$vl" != "$lang" ; then
9235         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
9236     fi
9237 done
9238 # list with substituted ALL
9239 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
9240 # this variable is used only by bin/distro-install-* helper scripts
9241 # they need a real list of languages
9242 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
9243 AC_SUBST(ALL_LANGS)
9244 AC_SUBST(WITH_LANG)
9245 AC_SUBST(WITH_LANG_LIST)
9246 AC_SUBST(GIT_REPO_NAMES)
9248 dnl git-new-workdir
9249 dnl ===================================================================
9250 if test -n "${GIT_LINK_SRC}"; then
9251     for repo in ${GIT_REPO_NAMES}; do
9252         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
9253             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
9254         fi
9255     done
9257 AC_SUBST(GIT_LINK_SRC)
9259 AC_MSG_CHECKING([for custom 'intro' progress bar color])
9260 PROGRESSBARCOLOR=
9261 if test -z "$with_intro_progressbar_color" ; then
9262    PROGRESSBARCOLOR="126,170,23"
9263    AC_MSG_RESULT([none])
9264 else
9265    PROGRESSBARCOLOR="$with_intro_progressbar_color"
9266    AC_MSG_RESULT([$PROGRESSBARCOLOR])
9268 AC_SUBST(PROGRESSBARCOLOR)
9270 AC_MSG_CHECKING([for custom 'intro' progress bar size])
9271 PROGRESSSIZE=
9272 if test -z "$with_intro_progressbar_size" ; then
9273    PROGRESSSIZE="319,10"
9274    AC_MSG_RESULT([none])
9275 else
9276    PROGRESSSIZE="$with_intro_progressbar_size"
9277    AC_MSG_RESULT([$PROGRESSSIZE])
9279 AC_SUBST(PROGRESSSIZE)
9281 AC_MSG_CHECKING([for custom 'intro' progress bar position])
9282 PROGRESSPOSITION=
9283 if test -z "$with_intro_progressbar_position" ; then
9284    PROGRESSPOSITION="164,225"
9285    AC_MSG_RESULT([none])
9286 else
9287    PROGRESSPOSITION="$with_intro_progressbar_position"
9288    AC_MSG_RESULT([$PROGRESSPOSITION])
9290 AC_SUBST(PROGRESSPOSITION)
9292 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
9293 PROGRESSFRAMECOLOR=
9294 if test -z "$with_intro_progressbar_frame_color" ; then
9295    PROGRESSFRAMECOLOR="207,208,211"
9296    AC_MSG_RESULT([none])
9297 else
9298    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
9299    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
9301 AC_SUBST(PROGRESSFRAMECOLOR)
9303 AC_MSG_CHECKING([for alternative branding images directory])
9304 INTRO_BITMAP=
9305 ABOUT_BITMAP=
9306 STARTCENTER_LEFT_BITMAP=
9307 STARTCENTER_RIGHT_BITMAP=
9308 STARTCENTER_RTL_LEFT_BITMAP=
9309 STARTCENTER_RTL_RIGHT_BITMAP=
9310 STARTCENTER_SPACE_BITMAP=
9311 if test -z "$with_branding" -o "$with_branding" = "no" ; then
9312     AC_MSG_RESULT([none])
9313 else
9314     INTRO_BITMAP="$with_branding/intro.png"
9315     ABOUT_BITMAP="$with_branding/about.png"
9316     STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
9317     STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
9318     STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
9319     STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
9320     STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
9321     for i in $INTRO_BITMAP \
9322              $ABOUT_BITMAP \
9323              $STARTCENTER_LEFT_BITMAP \
9324              $STARTCENTER_RIGHT_BITMAP \
9325              $STARTCENTER_RTL_LEFT_BITMAP \
9326              $STARTCENTER_RTL_RIGHT_BITMAP \
9327              $STARTCENTER_SPACE_BITMAP; do
9328         if test ! -f $i; then
9329             AC_MSG_WARN([Required file $i does not exist!])
9330         fi
9331     done
9332     AC_MSG_RESULT([$with_branding])
9335 AC_MSG_CHECKING([for yet another 'intro' bitmap])
9336 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no" ; then
9337     if test "$with_intro_bitmap" = "no" ; then
9338         INTRO_BITMAP=
9339     fi
9340     AC_MSG_RESULT([none])
9341 else
9342     case "$with_intro_bitmap" in
9343     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
9344     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
9345     esac
9346     AC_MSG_RESULT([$INTRO_BITMAP])
9348 AC_SUBST(INTRO_BITMAP)
9350 AC_MSG_CHECKING([for yet another 'about' bitmap])
9351 if test -z "$with_about_bitmap" -o "$with_about_bitmap" = "no" ; then
9352     if test "$with_about_bitmap" = "no" ; then
9353         ABOUT_BITMAP=
9354     fi
9355     AC_MSG_RESULT([none])
9356 else
9357    case "$with_about_bitmap" in
9358    *.png) ABOUT_BITMAP="$with_about_bitmap" ;;
9359    *)     AC_MSG_WARN([About bitmap should be a .png file!]) ;;
9360    esac
9361    AC_MSG_RESULT([$ABOUT_BITMAP])
9363 AC_SUBST(ABOUT_BITMAP)
9365 AC_MSG_CHECKING([for yet another 'start center left' bitmap])
9366 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no" ; then
9367    if test "$with_startcenter_left_bitmap" = "no" ; then
9368       STARTCENTER_LEFT_BITMAP=
9369    fi
9370    AC_MSG_RESULT([none])
9371 else
9372    case "$with_startcenter_left_bitmap" in
9373       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
9374       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9375    esac
9376    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
9378 AC_SUBST(STARTCENTER_LEFT_BITMAP)
9380 AC_MSG_CHECKING([for yet another 'start center right' bitmap])
9381 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no" ; then
9382    if test "$with_startcenter_right_bitmap" = "no" ; then
9383       STARTCENTER_RIGHT_BITMAP=
9384    fi
9385    AC_MSG_RESULT([none])
9386 else
9387    case "$with_startcenter_right_bitmap" in
9388       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
9389       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
9390    esac
9391    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
9393 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
9395 AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
9396 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no" ; then
9397    if test "$with_startcenter_rtl_left_bitmap" = "no" ; then
9398       STARTCENTER_RTL_LEFT_BITMAP=
9399    fi
9400    AC_MSG_RESULT([none])
9401 else
9402    case "$with_startcenter_rtl_left_bitmap" in
9403       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
9404       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
9405    esac
9406    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
9408 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
9410 AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
9411 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no" ; then
9412    if test "$with_startcenter_rtl_right_bitmap" = "no" ; then
9413       STARTCENTER_RTL_RIGHT_BITMAP=
9414    fi
9415    AC_MSG_RESULT([none])
9416 else
9417    case "$with_startcenter_rtl_right_bitmap" in
9418       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
9419       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
9420    esac
9421    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
9423 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
9425 AC_MSG_CHECKING([for yet another 'start center space' bitmap])
9426 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no" ; then
9427    if test "$with_startcenter_space_bitmap" = "no" ; then
9428       STARTCENTER_SPACE_BITMAP=
9429    fi
9430    AC_MSG_RESULT([none])
9431 else
9432    case "$with_startcenter_space_bitmap" in
9433       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
9434       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9435    esac
9436    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
9438 AC_SUBST(STARTCENTER_SPACE_BITMAP)
9440 OOO_VENDOR=
9441 AC_MSG_CHECKING([for vendor])
9442 if test -z "$with_vendor" -o "$with_vendor" = "no" ; then
9443     AC_MSG_RESULT([not set])
9444 else
9445     OOO_VENDOR="$with_vendor"
9446     AC_MSG_RESULT([$OOO_VENDOR])
9448 AC_SUBST(OOO_VENDOR)
9450 UNIXWRAPPERNAME=
9451 AC_MSG_CHECKING([for UNIX wrapper name])
9452 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes" ; then
9453     AC_MSG_RESULT([not set])
9454 else
9455     UNIXWRAPPERNAME="$with_unix_wrapper"
9456     AC_MSG_RESULT([$UNIXWRAPPERNAME])
9458 AC_SUBST(UNIXWRAPPERNAME)
9460 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
9461 if test "$with_compat_oowrappers" = "yes" ; then
9462     WITH_COMPAT_OOWRAPPERS=YES
9463     AC_MSG_RESULT(yes)
9464 else
9465     WITH_COMPAT_OOWRAPPERS=
9466     AC_MSG_RESULT(no)
9468 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
9470 AC_MSG_CHECKING([for product name])
9471 PRODUCTNAME=AC_PACKAGE_NAME
9472 AC_MSG_RESULT([$PRODUCTNAME])
9473 AC_SUBST(PRODUCTNAME)
9475 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
9476 AC_MSG_CHECKING([for install dirname])
9477 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes" ; then
9478    INSTALLDIRNAME="$with_install_dirname"
9480 AC_MSG_RESULT([$INSTALLDIRNAME])
9481 AC_SUBST(INSTALLDIRNAME)
9483 AC_MSG_CHECKING([for prefix])
9484 test "x$prefix" = xNONE && prefix=$ac_default_prefix
9485 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
9486 PREFIXDIR="$prefix"
9487 AC_MSG_RESULT([$PREFIXDIR])
9488 AC_SUBST(PREFIXDIR)
9490 AC_MSG_CHECKING([for libdir])
9491 LIBDIR=[$(eval echo $(eval echo $libdir))]
9492 AC_MSG_RESULT([$LIBDIR])
9493 AC_SUBST(LIBDIR)
9495 AC_MSG_CHECKING([for data dir])
9496 DATADIR=[$(eval echo $(eval echo $datadir))]
9497 AC_MSG_RESULT([$DATADIR])
9498 AC_SUBST(DATADIR)
9500 AC_MSG_CHECKING([for man dir])
9501 MANDIR=[$(eval echo $(eval echo $mandir))]
9502 AC_MSG_RESULT([$MANDIR])
9503 AC_SUBST(MANDIR)
9505 AC_MSG_CHECKING([for doc dir])
9506 DOCDIR=[$(eval echo $(eval echo $docdir))]
9507 AC_MSG_RESULT([$DOCDIR])
9508 AC_SUBST(DOCDIR)
9510 AC_MSG_CHECKING([for install dir])
9511 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
9512 AC_MSG_RESULT([$INSTALLDIR])
9513 AC_SUBST(INSTALLDIR)
9515 AC_MSG_CHECKING([whether to statically link to Gtk])
9516 if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
9517     ENABLE_STATIC_GTK="TRUE"
9518     AC_MSG_RESULT([yes])
9519 else
9520     ENABLE_STATIC_GTK="FALSE"
9521     AC_MSG_RESULT([no])
9523 AC_SUBST(ENABLE_STATIC_GTK)
9525 # ===================================================================
9526 # De- or increase default verbosity of build process
9527 # ===================================================================
9528 AC_MSG_CHECKING([build verbosity])
9529 if test -n "$enable_verbose"; then
9530     if test "$enable_verbose" = "yes"; then
9531         VERBOSE="TRUE"
9532         AC_MSG_RESULT([high])
9533     fi
9534     if test "$enable_verbose" = "no"; then
9535         VERBOSE="FALSE"
9536         AC_MSG_RESULT([low])
9537     fi
9538 else
9539     AC_MSG_RESULT([not set])
9541 AC_SUBST(VERBOSE)
9543 dnl ===================================================================
9544 dnl Use zenity during build
9545 dnl ===================================================================
9546 AC_MSG_CHECKING([whether to use zenity during build])
9547 if test "$enable_zenity" = "yes"; then
9548     AC_MSG_RESULT([yes])
9549     AC_PATH_PROGS( ZNTY, zenity )
9550     if test -z "$ZNTY"; then
9551         ENABLE_ZENITY=FALSE
9552     else
9553         ENABLE_ZENITY=TRUE
9554     fi
9555 else
9556     ENABLE_ZENITY=FALSE
9557     AC_MSG_RESULT([no])
9559 AC_SUBST(ENABLE_ZENITY)
9562 dnl ===================================================================
9563 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
9564 dnl --enable-dependency-tracking configure option
9565 dnl ===================================================================
9566 AC_MSG_CHECKING([whether to enable dependency tracking])
9567 if test "$enable_dependency_tracking" = "no"; then
9568     nodep=TRUE
9569     AC_MSG_RESULT([no])
9570 else
9571     AC_MSG_RESULT([yes])
9573 AC_SUBST(nodep)
9575 dnl ===================================================================
9576 dnl Number of CPUs to use during the build
9577 dnl ===================================================================
9578 AC_MSG_CHECKING([for number of processors to use])
9579 if test -n "$with_num_cpus"; then
9580     BUILD_NCPUS=$with_num_cpus
9581 else
9582     case `uname -s` in
9584     Darwin|FreeBSD|NetBSD|OpenBSD)
9585         BUILD_NCPUS=`sysctl -n hw.ncpu`
9586         ;;
9588     Linux)
9589         BUILD_NCPUS=`getconf _NPROCESSORS_ONLN`
9590         ;;
9591     # what else than above does profit here *and* has /proc?
9592     *)
9593         BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
9594         ;;
9595     esac
9597     # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
9598     # unexpected format, 'wc -l' will have returned 0.
9599     if test "$BUILD_NCPUS" -eq 0; then
9600         BUILD_NCPUS=1
9601     fi
9603 AC_MSG_RESULT([$BUILD_NCPUS])
9604 AC_SUBST(BUILD_NCPUS)
9606 # ===================================================================
9607 # Creating bigger shared library to link against
9608 # ===================================================================
9609 AC_MSG_CHECKING([whether to create a big library for better performance])
9610 MERGELIBS=
9611 if test "$enable_mergelibs" = "yes"; then
9612     MERGELIBS="TRUE"
9613     AC_MSG_RESULT([yes])
9614 else
9615     AC_MSG_RESULT([no])
9617 AC_SUBST(MERGELIBS)
9619 dnl ===================================================================
9620 dnl Number of parallel jobs to be executed by dmake
9621 dnl ===================================================================
9622 AC_MSG_CHECKING([for maximum of jobs per processor])
9623 BUILD_MAX_JOBS="1"
9624 if test "z$with_max_jobs" != "z"; then
9625     BUILD_MAX_JOBS="$with_max_jobs"
9626 else
9627     if test "$enable_icecream" = "yes" ; then
9628         BUILD_MAX_JOBS="10"
9629     fi
9631 AC_MSG_RESULT([$BUILD_MAX_JOBS])
9632 AC_SUBST(BUILD_MAX_JOBS)
9634 # =====================================================================
9635 # determine the parallelism for gnu make
9636 # =====================================================================
9637 AC_MSG_CHECKING([for maximum parallelism for gmake])
9638 if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS ; then
9639     GMAKE_PARALLELISM="$BUILD_MAX_JOBS"
9640 else
9641     GMAKE_PARALLELISM="$BUILD_NCPUS"
9643 GMAKE_MODULE_PARALLELISM="$BUILD_MAX_JOBS"
9644 if test "$no_parallelism_make" = "YES" ; then
9645     if test -z "$with_num_cpus"; then
9646         GMAKE_PARALLELISM="1";
9647         if test $GMAKE_MODULE_PARALLELISM -gt 1 ; then
9648             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
9649             if test -z "$with_num_cpus"; then
9650                 echo "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this." >> warn
9651             fi
9652             GMAKE_MODULE_PARALLELISM="1"
9653         fi
9654     else
9655         GMAKE_PARALLELISM="$BUILD_NCPUS";
9656         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
9657     fi
9660 # GMAKE_PARALLELISM is used in tail_build
9661 # GMAKE_MODULE_PARALLELISM is used when building individual gbuildified module
9662 AC_MSG_RESULT([per module:$GMAKE_MODULE_PARALLELISM, for tail_build:$GMAKE_PARALLELISM])
9663 AC_SUBST(GMAKE_PARALLELISM)
9664 AC_SUBST(GMAKE_MODULE_PARALLELISM)
9666 dnl ===================================================================
9667 dnl Setting up the environment.
9668 dnl ===================================================================
9669 echo "setting up the build environment variables..."
9671 if test -z "$COMPATH"; then
9672     AC_MSG_ERROR([No compiler found.])
9674 AC_SUBST(COMPATH)
9676 AC_MSG_CHECKING([solver path])
9677 if test -z "$with_local_solver"; then
9678     LOCAL_SOLVER="DEFAULT"
9679     AC_MSG_RESULT([default])
9680 else
9681     LOCAL_SOLVER=$with_local_solver
9682     AC_MSG_RESULT([$with_local_solver])
9684 AC_SUBST(LOCAL_SOLVER)
9686 AC_SUBST(BUILD_TYPE)
9688 if test "$WITH_MINGW" != "yes" ; then
9689     MINGW_EXTERNAL_DLLS=
9690 else
9691     mingw_dlldir=`$CC -print-sysroot`/mingw/bin
9692     for DLL in $MINGW_EXTERNAL_DLLS ; do
9693         AC_MSG_CHECKING([for $DLL])
9694         if ! test -f "$mingw_dlldir/$DLL" ; then
9695             AC_MSG_ERROR([Could not find $DLL, install the appropriate mingw32-<package>, not only mingw32-<package>-devel.])
9696         fi
9697         AC_MSG_RESULT([$mingw_dlldir/$DLL])
9698     done
9700 AC_SUBST(MINGW_EXTERNAL_DLLS)
9702 # make sure config.guess is +x; we execute config.guess, so it has to be so;
9703 chmod +x ./config.guess
9705 dnl Setting up the post_download check script
9706 dnl Using autoconf here, so that the migration from the previous state
9707 dnl (checks for the additional Windows downloads were directly in
9708 dnl configure.in) is as easy as possible
9709 echo "setting up the post_download check script"
9710 autoconf post_download.in > post_download
9711 chmod +x post_download
9713 # Generate a configuration timestamp we can use for deps
9714 if test -f set_soenv; then
9715     mv -f set_soenv set_soenv.last
9716 else
9717     echo > set_soenv.last
9720 AC_CONFIG_FILES([ooo.lst set_soenv bin/repo-list desktop/scripts/soffice.sh build_env])
9721 AC_OUTPUT
9723 # make sure this is executable
9724 chmod +x desktop/scripts/soffice.sh
9726 # touch the config timestamp file set_soenv.stamp
9727 if test ! -f set_soenv.stamp; then
9728     echo > set_soenv.stamp
9729 elif diff set_soenv set_soenv.last >/dev/null 2>&1; then
9730     echo "Configuration unchanged - avoiding scp2 stamp update"
9731 else
9732     echo > set_soenv.stamp
9735 dnl Run the set_soenv script to setup the Env.Host.sh script that sets
9736 dnl environment variables for the build.
9737 chmod +x set_soenv
9739 ./set_soenv
9741 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: