Add ARM Thumb mutex implementation from a "arm-thumb-mutex.patch"
[LibreOffice.git] / configure.in
blob9292e140dd35235d0c8ce28bd99f787636bd30d5
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 else
44     EXEEXT_FOR_BUILD=
46 AC_SUBST(EXEEXT_FOR_BUILD)
48 cat /dev/null > warn
50 if test "z$EUID" = "z0" -a "z`uname -o 2>/dev/null`" = "zCygwin"; then
51     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
54 # need sed in os checks...
55 AC_PATH_PROGS(SED, sed)
56 if test -z "$SED"; then
57     AC_MSG_ERROR([install sed to run this script])
60 dnl ===================================================================
61 dnl The following is a list of supported systems.
62 dnl Sequential to keep the logic very simple
63 dnl These values may be checked and reset later.
64 dnl ===================================================================
65 #defaults unless the os test overrides this:
66 test_randr=yes
67 test_cups=yes
68 test_fontconfig=yes
70 case "$host_os" in
72 solaris*)
73     test_gtk=yes
74     build_gstreamer=yes
75     test_kde=yes
76     test_freetype=yes
77     test_gstreamer=yes
78     _os=SunOS
80     dnl ===========================================================
81     dnl Check whether we're using Solaris 10 - SPARC or Intel.
82     dnl ===========================================================
83     AC_MSG_CHECKING([the Solaris operating system release])
84     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
85     if test "$_os_release" -lt "10"; then
86         AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
87     else
88         AC_MSG_RESULT([ok ($_os_release)])
89     fi
91     dnl Check whether we're using a SPARC or i386 processor
92     AC_MSG_CHECKING([the processor type])
93     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
94         AC_MSG_RESULT([ok ($host_cpu)])
95     else
96         AC_MSG_ERROR([only SPARC and i386 processors are supported])
97     fi
98     ;;
100 linux-gnu*|k*bsd*-gnu*)
101     test_gtk=yes
102     build_gstreamer=yes
103     test_kde=yes
104     test_kde4=yes
105     test_freetype=yes
106     test_unix_quickstarter=yes
107     _os=Linux
108     ;;
110 gnu)
111     test_randr=no
112     _os=GNU
113      ;;
115 cygwin*|interix*|mingw32*)
117     # When building on Windows normally with MSVC under Cygwin,
118     # configure thinks that the host platform (the platform the
119     # built code will run on) is Cygwin, even if it obviously is
120     # Windows, which in Autoconf terminology is called
121     # "mingw32". (Which is misleading as MinGW is the name of the
122     # tool-chain, not an operating system.)
124     # Somewhat confusing, yes. But this configure script doesn't
125     # look at $host etc that much, it mostly uses its own $_os
126     # variable, set here in this case statement.
128     # When cross-compiling to Windows from Unix, the host platform
129     # is "mingw32" (because in that case it is the MinGW
130     # tool-chain that is used).
132     test_cups=no
133     test_randr=no
134     test_freetype=no
135     test_fontconfig=no
136     _os=WINNT
138     # If the host OS matches "mingw32*", that means we are using the
139     # MinGW cross-compiler, because we don't see the point in building
140     # LibreOffice using MinGW on Windows. If you want to build on
141     # Windows, use MSVC. If you want to use MinGW, surely you want to
142     # cross-compile (from Linux or some other Unix).
144     case "$host_os" in
145     mingw32*)
146         WITH_MINGW=yes
147         if test -z "$CC" ; then
148             CC="$host_cpu-$host_vendor-$host_os-gcc"
149         fi
150         if test -z "$CXX" ; then
151             CXX="$host_cpu-$host_vendor-$host_os-g++"
152         fi
153         ;;
154     esac
155     ;;
157 darwin*) # Mac OS X or iOS
158     test_gtk=yes
159     test_randr=no
160     test_freetype=no
161     test_fontconfig=no
162     if test "$host_cpu" = "arm"; then
163         _os=iOS
164         test_gtk=no
165         test_cups=no
166     else
167         _os=Darwin
168     fi
169     enable_systray=no
172 freebsd*)
173     test_gtk=yes
174     build_gstreamer=yes
175     test_kde=yes
176     test_kde4=yes
177     test_freetype=yes
178     AC_MSG_CHECKING([the FreeBSD operating system release])
179     if test -n "$with_os_version"; then
180         OSVERSION="$with_os_version"
181     else
182         OSVERSION=`/sbin/sysctl -n kern.osreldate`
183     fi
184     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
185     AC_MSG_CHECKING([which thread library to use])
186     if test "$OSVERSION" -lt "500016"; then
187         PTHREAD_CFLAGS="-D_THREAD_SAFE"
188         PTHREAD_LIBS="-pthread"
189     elif test "$OSVERSION" -lt "502102"; then
190         PTHREAD_CFLAGS="-D_THREAD_SAFE"
191         PTHREAD_LIBS="-lc_r"
192     else
193         PTHREAD_CFLAGS=""
194         PTHREAD_LIBS="-pthread"
195     fi
196     AC_MSG_RESULT([$PTHREAD_LIBS])
197     _os=FreeBSD
198     ;;
200 *netbsd*)
201     test_gtk=yes
202     build_gstreamer=yes
203     test_kde=no
204     test_kde4=yes
205     test_freetype=yes
206     PTHREAD_LIBS="-pthread -lpthread"
207     _os=NetBSD
208     ;;
210 aix*)
211     test_randr=no
212     test_freetype=yes
213     PTHREAD_LIBS=-pthread
214     _os=AIX
215     ;;
217 openbsd*)
218     test_gtk=yes
219     test_kde=yes
220     test_freetype=yes
221     PTHREAD_CFLAGS="-D_THREAD_SAFE"
222     PTHREAD_LIBS="-pthread"
223     _os=OpenBSD
224     ;;
226 dragonfly*)
227     test_gtk=yes
228     build_gstreamer=yes
229     test_kde=yes
230     test_kde4=yes
231     test_freetype=yes
232     PTHREAD_LIBS="-pthread"
233     _os=DragonFly
234     ;;
236 linux-androideabi*)
237     build_gstreamer=no
238     test_cups=no
239     test_fontconfig=no
240     test_freetype=no
241     test_gtk=no
242     test_kde=no
243     test_kde4=no
244     test_randr=no
245     test_unix_quickstarter=no
246     _os=Android
248     # Make sure env vars pointing to where to find the cross-build
249     # toolchain are set. There aren't really any sensible
250     # guesstimates.
251     for var in CC CXX AR NM OBJDUMP RANLIB STRIP; do
252         if test -z `eval echo '$'$var`; then
253             AC_MSG_ERROR([You need to set the $var environment variable in a cross-compilation for Android. See README.cross for an example.])
254         fi
255     done
256     ;;
259     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
260     ;;
261 esac
263 if test "$_os" = "AIX"; then
264     AC_PATH_PROG(GAWK, gawk)
265     if test -z "$GAWK"; then
266         AC_MSG_ERROR([gawk not found in \$PATH])
267     fi
270 AC_SUBST(WITH_MINGW)
271 AC_SUBST(OSVERSION)
272 AC_SUBST(PTHREAD_CFLAGS)
273 AC_SUBST(PTHREAD_LIBS)
276 ###############################################################################
277 # Extensions switches --enable/--disable
278 ###############################################################################
279 # By default these should be enabled unless having extra dependencies.
280 # If there is extra dependency over configure options then the enable should
281 # be automagic based on wether the requiring feature is enabled or not.
282 # All this options change anything only with --enable-extension-integration.
283 AC_ARG_ENABLE(extension-integration,
284     AS_HELP_STRING([--disable-extension-integration],
285         [Disable integration of the builded extensions to the installer of the
286          product. Use this switch to disable the integration.])
289 AC_ARG_ENABLE(ext-barcode,
290     AS_HELP_STRING([--enable-ext-barcode],
291         [Enable the Barcode extension.])
294 AC_ARG_ENABLE(ext-diagram,
295     AS_HELP_STRING([--enable-ext-diagram],
296         [Enable the SmART Gallery (Diagram) extension.])
299 AC_ARG_ENABLE(ext-google-docs,
300     AS_HELP_STRING([--enable-ext-google-docs],
301         [Enable the Google Documents extension.])
304 AC_ARG_ENABLE(ext-hunart,
305     AS_HELP_STRING([--enable-ext-hunart],
306         [Enable the Hungarian Cross-reference Toolbar extension.])
309 AC_ARG_ENABLE(ext-languagetool,
310     AS_HELP_STRING([--enable-ext-languagetool],
311         [Enable the LanguageTool extension.])
314 AC_ARG_ENABLE(ext-lightproof,
315     AS_HELP_STRING([--enable-ext-lightproof],
316         [Enable the Lightproof extension. The enable switch can contain only
317          the desired languages: --enable-lightproof="en hu ru"]),
318     [enable_ext_lightproof="$enableval"],
319     [enable_ext_lightproof=no]
322 AC_ARG_ENABLE(ext-mysql-connector,
323     AS_HELP_STRING([--enable-ext-mysql-connector],
324         [Enable the build of the MySQL Connector extension.])
327 AC_ARG_ENABLE(ext-nlpsolver,
328     AS_HELP_STRING([--enable-ext-nlpsolver],
329         [Enable the NLPSolver extension.])
332 AC_ARG_ENABLE(ext-ct2n,
333     AS_HELP_STRING([--enable-ext-ct2n],
334         [Enable the ConvertTextToNumber extension.])
337 AC_ARG_ENABLE(ext-numbertext,
338     AS_HELP_STRING([--enable-ext-numbertext],
339         [Enable the Numbertext extension.])
342 AC_ARG_ENABLE(ext-oooblogger,
343     AS_HELP_STRING([--enable-ext-oooblogger],
344         [Enable the OOo Blogger extension.])
347 AC_ARG_ENABLE(ext-pdfimport,
348     AS_HELP_STRING([--disable-ext-pdfimport],
349         [Disable the PDF Import extension.])
352 AC_ARG_ENABLE(ext-presenter-console,
353     AS_HELP_STRING([--disable-ext-presenter-console],
354         [Disable the Presenter Console extension.])
357 AC_ARG_ENABLE(ext-presenter-minimizer,
358     AS_HELP_STRING([--disable-ext-presenter-minimizer],
359         [Disable the Presentation Minimizer extension.])
362 AC_ARG_ENABLE(ext-report-builder,
363     AS_HELP_STRING([--disable-ext-report-builder],
364         [Disable the Report Builder extension.])
367 AC_ARG_ENABLE(ext-scripting-beanshell,
368     AS_HELP_STRING([--enable-ext-scripting-beanshell],
369         [Enable support for scripts in BeanShell.])
372 AC_ARG_ENABLE(ext-scripting-javascript,
373     AS_HELP_STRING([--enable-ext-scripting-javascript],
374         [Enable support for scripts in JavaScript.])
377 AC_ARG_ENABLE(ext-typo,
378     AS_HELP_STRING([--enable-ext-typo],
379         [Enable the Typography Toolbar extension.])
382 AC_ARG_ENABLE(ext-validator,
383     AS_HELP_STRING([--enable-ext-validator],
384         [Enable the Validator extension.])
387 AC_ARG_ENABLE(ext-watch-window,
388     AS_HELP_STRING([--enable-ext-watch-window],
389         [Enable the Watch Window extension to Calc.])
392 AC_ARG_ENABLE(ext-wiki-publisher,
393     AS_HELP_STRING([--enable-ext-wiki-publisher],
394         [Enable the Wiki Publisher extension.])
396 ###############################################################################
398 dnl ---------- *** ----------
400 AC_ARG_ENABLE(mergelibs,
401     AS_HELP_STRING([--enable-mergelibs],
402         [Enables linking of big merged library used for better performance.])
405 AC_ARG_ENABLE(graphite,
406     AS_HELP_STRING([--enable-graphite],
407         [Enables the compilation of Graphite smart font rendering.])
410 AC_ARG_ENABLE(ldap,
411     AS_HELP_STRING([--disable-ldap],
412         [Disables the use of LDAP backend via Netscape/Mozilla or OpenLDAP LDAP SDK])
415 AC_ARG_ENABLE(fetch-external,
416     AS_HELP_STRING([--disable-fetch-external],
417         [Disables fetching external tarballs from web sources.])
420 AC_ARG_ENABLE(lockdown,
421     AS_HELP_STRING([--disable-lockdown],
422         [Disables the gconf integration work in LibreOffice.]),
425 AC_ARG_ENABLE(vba,
426     AS_HELP_STRING([--disable-vba],
427         [Disables the vba compatibility feature.])
430 AC_ARG_ENABLE(pch,
431     AS_HELP_STRING([--enable-pch],
432         [EXPERIMENTAL: Enables precompiled header support for C++.])
435 AC_ARG_ENABLE(mozilla,
436     AS_HELP_STRING([--disable-mozilla],
437         [LibreOffice usually includes a strangely hacked up Mozilla binary for your
438          platform, to build without this version, use this option.])
441 AC_ARG_ENABLE(epm,
442     AS_HELP_STRING([--enable-epm],
443         [LibreOffice includes self-packaging code, that requires epm, however epm is
444          useless for large scale package building.])
447 AC_ARG_ENABLE(activex_component,
448     AS_HELP_STRING([--disable-activex-component],
449         [Remove support for ActiveX embedding of LibreOffice.])
452 AC_ARG_ENABLE(odk,
453     AS_HELP_STRING([--disable-odk],
454         [LibreOffice includes an ODK, office development kit which some packagers may
455          wish to build without.])
458 AC_ARG_ENABLE(mathmldtd,
459     AS_HELP_STRING([--disable-mathmldtd],
460         [Disable mathmldtd (useful for distributions that want to avoid
461          packaging it).])
464 AC_ARG_ENABLE(evolution2,
465     AS_HELP_STRING([--enable-evolution2],
466         [Allows the built-in evolution 2 addressbook connectivity build to be
467          enabled.])
470 AC_ARG_ENABLE(directx,
471     AS_HELP_STRING([--disable-directx],
472         [Remove DirectX implementation for the new XCanvas interface.
473          The DirectX support requires more stuff installed on Windows to
474          compile. (DirectX SDK, GDI+ libs)])
477 AC_ARG_ENABLE(activex,
478     AS_HELP_STRING([--disable-activex],
479         [Disable the use of ActiveX for a Windows build.
480         This switch is mandatory when using VC++ 2008 Express.])
483 AC_ARG_ENABLE(atl,
484     AS_HELP_STRING([--disable-atl],
485         [Disable the use of ATL for a Windows build.])
486     [
487                           This switch is mandatory when using VC++ 2008 Express.
488     ],
491 AC_ARG_ENABLE(symbols,
492     AS_HELP_STRING([--enable-symbols],
493         [Include debugging symbols in output. WARNING - a complete build needs
494          8 Gb of space and takes much longer (enables -g compiler flag).])
495     [
496                           Enabling symbols disables the stripping of the solver
497                           (--disable-strip-solver).
498     ],
501 AC_ARG_ENABLE(strip-solver,
502     AS_HELP_STRING([--disable-strip-solver],
503         [Disable the stripping of the solver. By default the solver is stripped
504          unless a build with debugging symbols (--enable-symbols) is requested.])
505     [
506                           This switch allows to override this setting.
507     ],
510 AC_ARG_ENABLE(werror,
511     AS_HELP_STRING([--enable-werror],
512         [Turn warnings to errors. (Has no effect in modules where the treating
513          of warnings as errors is disabled explicitly.)]),
516 AC_ARG_ENABLE(debug,
517     AS_HELP_STRING([--enable-debug],
518         [Include debugging symbols from --enable-symbols plus extra debugging
519          code. Extra large build! (enables -g compiler flag and dmake debug=true)
520          If you need even more verbose output, build a module with
521          "build -- debug=true dbglevel=2".]))
523 AC_ARG_ENABLE(dbgutil,
524     AS_HELP_STRING([--enable-dbgutil],
525         [Include additional debugging utilities, such as assertions, object
526          counting, etc. Larger build. Independent from --enable-debug]))
528 AC_ARG_ENABLE(linkoo,
529     AS_HELP_STRING([--disable-linkoo],
530         [Disable linkoo for the smoketest installation.]))
532 AC_ARG_ENABLE(lto,
533     AS_HELP_STRING([--enable-lto],
534         [Enable link-time optimization. Suitable for product builds.
535          Building takes longer but libraries are optimized for speed.
536          (possible only with gcc-4.5 or later,
537           better to use gcc-4.6 and 'gold' as linker)]))
539 AC_ARG_ENABLE(crashdump,
540     AS_HELP_STRING([--enable-crashdump],
541         [Enable the crashdump feature.]))
543 AC_ARG_ENABLE(python,
544     AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
545         [Enables or disables Python support at run-time and build-time.
546          Also specifies what Python to use. 'auto' is the
547          default. Note that Python can be disabled with
548          --disable-python or --enable-python=no only if no
549          translations are required.]))
551 AC_ARG_ENABLE(gtk,
552     AS_HELP_STRING([--disable-gtk],
553         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
554 ,enable_gtk=yes)
556 AC_ARG_ENABLE(gtk3,
557     AS_HELP_STRING([--disable-gtk3],
558         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
559 ,enable_gtk3=no)
561 AC_ARG_ENABLE(systray,
562     AS_HELP_STRING([--disable-systray],
563         [Determines whether to build the systray quickstarter.]),
564 ,enable_systray=yes)
566 AC_ARG_ENABLE(split-app-modules,
567     AS_HELP_STRING([--enable-split-app-modules],
568         [Split file lists for app modules, e.g. base, calc.
569          Has effect only with make distro-pack-install]),
572 AC_ARG_ENABLE(split-opt-features,
573     AS_HELP_STRING([--enable-split-opt-features],
574         [Split file lists for some optional features, .e.g. pyuno, testtool.
575          Has effect only with make distro-pack-install]),
578 AC_ARG_ENABLE(cairo-canvas,
579 [  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
580                           platforms where Cairo is available.
581 ],,enable_cairo_canvas=yes)
583 AC_ARG_ENABLE(librsvg,
584     AS_HELP_STRING([--enable-librsvg=<no/auto/system/internal>],
585         [Enables or disables use of librsvg to render SVG at run-time.
586          Also specificed what librsvg to use. 'auto' is the default.]))
588 AC_ARG_ENABLE(opengl,
589     AS_HELP_STRING([--disable-opengl],
590         [Determines whether to build the OpenGL 3D slide transitions component.]),
591 ,enable_opengl=yes)
593 AC_ARG_ENABLE(dbus,
594     AS_HELP_STRING([--enable-dbus],
595         [Determines whether to enable presentation mode screensaver control
596          under GNOME via DBUS.]),
597 ,enable_dbus=no)
599 AC_ARG_ENABLE(gconf,
600     AS_HELP_STRING([--disable-gconf],
601         [Determines whether to use the GConf support.]),
602 ,enable_gconf=yes)
604 AC_ARG_ENABLE(gnome-vfs,
605     AS_HELP_STRING([--disable-gnome-vfs],
606         [Determines whether to use the Gnome Virtual Filing System on platforms
607          where that VFS is available.]),
608 ,enable_gnome_vfs=yes)
610 AC_ARG_ENABLE(gio,
611     AS_HELP_STRING([--enable-gio],
612         [Determines whether to use the GIO support.]),
613 ,enable_gio=no)
615 AC_ARG_ENABLE(static-gtk,
616     AS_HELP_STRING([--enable-static-gtk],
617         [Modules that are linked against GTK+ libraries use the static libraries
618          instead of the dynamic ones. (Enables -Bstatic linker flag for GTK+ libraries.)]),
621 AC_ARG_ENABLE(layout,
622     AS_HELP_STRING([--enable-layout],
623         [Enable the compilation and use of layout dialogs.]),
626 AC_ARG_ENABLE(build-mozilla,
627     AS_HELP_STRING([--disable-build-mozilla],
628         [Use this option if you do not want to build the Mozilla components from
629          the Mozilla source code but take precompiled zips.]),
632 AC_ARG_ENABLE(xmlsec,
633     AS_HELP_STRING([--disable-xmlsec],
634         [Whether to enable XMLsec for open document signing.]),
637 AC_ARG_ENABLE(kde,
638     AS_HELP_STRING([--enable-kde],
639         [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
640          KDE3 are available.]),
643 AC_ARG_ENABLE(kdeab,
644     AS_HELP_STRING([--disable-kdeab],
645         [Disable the KDE3 address book support.]),
647     if test "$enable_kde" = "yes"; then
648         enable_kdeab=yes;
649     fi
652 AC_ARG_ENABLE(kde4,
653     AS_HELP_STRING([--enable-kde4],
654         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
655          KDE4 are available. May be used with --enable-kde if you want to support
656          both KDE3 and KDE4.]),
659 AC_ARG_ENABLE(unix-qstart-libpng,
660     AS_HELP_STRING([--disable-unix-qstart-libpng],
661         [On UNIX systems, we have a faster splash app, that can use libpng to
662          render its splash, if we can safely link to the system libpng then
663          enabling this is a good idea (ie. for Linux Distro packaging).]),
664 ,enable_unix_libpng=yes)
666 AC_ARG_ENABLE(binfilter,
667     AS_HELP_STRING([--enable-binfilter],
668         [Enable legacy binary file formats filters build.]),
669 ,enable_binfilter=no
672 AC_ARG_ENABLE(ugly,
673     AS_HELP_STRING([--enable-ugly],
674         [Enables ugly pieces of functionality.]),
675 ,enable_ugly=no
678 AC_ARG_ENABLE(rpath,
679     AS_HELP_STRING([--disable-rpath],
680         [Disable the use of relative paths in shared libraries.]),
683 AC_ARG_ENABLE(xrender-link,
684     AS_HELP_STRING([--enable-xrender-link],
685         [Link with libXrender instead of dynamically open it.]),
688 AC_ARG_ENABLE(randr,
689     AS_HELP_STRING([--disable-randr],
690         [Disable RandR support in the vcl project.]),
691 ,enable_randr=yes)
693 AC_ARG_ENABLE(randr-link,
694     AS_HELP_STRING([--disable-randr-link],
695         [Disable linking with libXrandr, instead dynamically open it at runtime.]),
696 ,enable_randr_link=yes)
698 AC_ARG_ENABLE(gstreamer,
699     AS_HELP_STRING([--disable-gstreamer],
700         [Disable building the gstreamer avmedia backend.]),
701 ,enable_gstreamer=yes)
703 AC_ARG_ENABLE(neon,
704     AS_HELP_STRING([--disable-neon],
705         [Disable neon and the compilation of webdav binding.]),
708 AC_ARG_ENABLE(build-unowinreg,
709     AS_HELP_STRING([--enable-build-unowinreg],
710         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
711          compiler is needed on Linux.])
712     [
713                           Usage:     --enable-build-unowinreg
714     ],
717 AC_ARG_ENABLE(verbose,
718     AS_HELP_STRING([--enable-verbose],
719         [Increase build verbosity.])[
720   --disable-verbose       Decrease build verbosity.],
723 AC_ARG_ENABLE(dependency-tracking,
724     AS_HELP_STRING([--enable-dependency-tracking],
725         [Do not reject slow dependency extractors.])[
726   --disable-dependency-tracking
727                           Disables generation of dependency information.
728                           Speed up one-time builds.],
731 AC_ARG_ENABLE(icecream,
732     AS_HELP_STRING([--enable-icecream],
733         [Use the 'icecream' distributed compiling tool to speedup the compilation.
734          It defaults to /opt/icecream for the location of the icecream gcc/g++
735          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
738 AC_ARG_ENABLE(zenity,
739     AS_HELP_STRING([--disable-zenity],
740         [Do not display a build icon in the notification area (on unix) during build.]),
741 ,enable_zenity=yes)
743 AC_ARG_ENABLE(nsplugin,
744     AS_HELP_STRING([--disable-nsplugin],
745         [Do not build nsplugin extension for browser embedding.])
748 AC_ARG_ENABLE(ccache,
749     AS_HELP_STRING([--disable-ccache],
750         [Do not try to use ccache automatically.
751          By default, we will try to detect if ccache is available; in that case if
752          CC/CXX are not yet set, and --enable-icecream is not given, we
753          attempt to use ccache. --disable-ccache disables ccache completely.
757 AC_ARG_ENABLE(cl-x64,
758     AS_HELP_STRING([--enable-cl-x64],
759         [Build a 64-bit LibreOffice using the Microsoft C/C++ x64 compiler.]),
762 AC_ARG_ENABLE(extra-gallery,
763     AS_HELP_STRING([--enable-extra-gallery],
764         [Add extra gallery content.]),
767 AC_ARG_ENABLE(extra-template,
768     AS_HELP_STRING([--enable-extra-template],
769         [Add extra template content.]),
772 AC_ARG_ENABLE(extra-sample,
773     AS_HELP_STRING([--enable-extra-sample],
774         [Add extra sample content.]),
777 AC_ARG_ENABLE(extra-font,
778     AS_HELP_STRING([--enable-extra-font],
779         [Add extra font content.]),
782 AC_ARG_ENABLE(lomenubar,
783     AS_HELP_STRING([--enable-lomenubar],
784         [Enable global menu support.]),
787 AC_ARG_ENABLE(online-update,
788     AS_HELP_STRING([--enable-online-update],
789         [Enable the online update service that will check for new versions of
790          LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
793 AC_ARG_ENABLE(release-build,
794     AS_HELP_STRING([--enable-release-build],
795         [Enable release build.
796          See http://wiki.documentfoundation.org/DevBuild]),
799 dnl ===================================================================
800 dnl Optional Packages (--with/without-)
801 dnl ===================================================================
802 AC_ARG_WITH(gnu-patch,
803     AS_HELP_STRING([--with-gnu-patch],
804         [Specify location of GNU patch on Solaris or FreeBSD.]),
807 AC_ARG_WITH(gnu-cp,
808     AS_HELP_STRING([--with-gnu-cp],
809         [Specify location of GNU cp on Solaris or FreeBSD.]),
812 AC_ARG_WITH(external-tar,
813     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
814         [Specify path to tarfiles manually.]),
815     TARFILE_LOCATION=$withval ,
818 AC_ARG_WITH(linked-git,
819     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
820         [Specify another checkout's clonedir to re-use. This makes use of
821                  git-new-workdir, and saves a lot of diskspace when having multiple
822                  trees side-by-side.]),
823     GIT_LINK_SRC=$withval ,
826 AC_ARG_WITH(openldap,
827     AS_HELP_STRING([--with-openldap],
828         [Enables the use of the OpenLDAP LDAP SDK instead of the Netscape/Mozilla one.]),
831 AC_ARG_WITH(vba-package-format,
832     AS_HELP_STRING([--with-vba-package-format],
833         [Specify package format for vba compatibility api. Specifying  "builtin"
834          means the api component and associated type library are  part of the
835          installation set. Specifying "extn" creates an uno extension that is
836          part of the installation set (located in the program directory) that
837          MUST be optionly registered using either the unopkg executeable or the
838          extension manager gui.])
839     [
840                           Note: "builtin" is the default, "extn" can cause
841                           problems.
843                           Usage:     --with-vba-package-format="builtin" or
844                                      --with-vba-package-format="extn"
845     ],
848 AC_ARG_WITH(theme,
849     AS_HELP_STRING([--with-theme="theme1 theme2..."],
850         [Choose which themes to include. By default those themes with an '*' are included.
851          Possible choices: *default, *crystal, *hicontrast, *oxygen, *tango, classic, industrial.]),
854 AC_ARG_WITH(helppack-integration,
856   --without-helppack-integration      It will not integrate the helppacks to the installer
857                           of the product.
858                           Please use this switch to use the online help or separate help packages.],
861 AC_ARG_WITH(fonts,
862     AS_HELP_STRING([--without-fonts],
863         [LibreOffice includes some third-party fonts to provide a reliable basis for
864          help content, templates, samples, etc. When these fonts are already
865          known to be available on the system then you should use this option.]),
868 AC_ARG_WITH(ppds,
869     AS_HELP_STRING([--without-ppds],
870         [Removes Postscript Printer definition files from LibreOffice
871          installation set, for people building for specific distributions where
872          PPDs are known to be already available (every recent distro with CUPS backend).]),
875 AC_ARG_WITH(afms,
876     AS_HELP_STRING([--without-afms],
877         [Removes bitmap font files from LibreOffice installation set, for people
878          building for specific distributions where AFM files or TrueType Fonts
879          are known to be available.]),
882 AC_ARG_WITH(agfa-monotype-fonts,
883      AS_HELP_STRING([--with-agfa-monotype-fonts],
884           [This switch should only be enabled for those who have the right
885            to use or distribute the proprietary Agfa Monotype
886            fonts.])
889 AC_ARG_WITH(epm,
890     AS_HELP_STRING([--with-epm],
891         [Decides which epm to use. Default is to use the one from the system if
892          one is built. When either this is not there or you say =internal epm
893          will be built.]),
896 AC_ARG_WITH(package-format,
897     AS_HELP_STRING([--with-package-format],
898         [Specify package format(s) for LibreOffice installsets. Default is the
899          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
900          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
901           installed, msi. Example: --with-package-format="deb dmg"]),
904 AC_ARG_WITH(system-libs,
905     AS_HELP_STRING([--with-system-libs],
906         [Use libraries already on system -- enables all --with-system-* flags except
907          mozilla.]),
910 AC_ARG_WITH(system-headers,
911     AS_HELP_STRING([--with-system-headers],
912         [Use headers already on system -- enables all --with-system-* flags for
913          external packages whose headers are the only entities used i.e.
914          boost/vigra/odbc/sane/xrender-header(s).]),
917 AC_ARG_WITH(system-jars,
918     AS_HELP_STRING([--without-system-jars],
919         [When building with --with-system-libs, also the needed jars are expected
920          on the system. Use this to disable that (except for the db case where
921          --with-system-db *has to* imply using the db.jar from there, too).]),
924 AC_ARG_WITH(system-stdlibs,
925     AS_HELP_STRING([--with-system-stdlibs],
926         [Use libstdc++/libgcc_s already on system.]),,
927     [with_system_stdlibs="$with_system_libs"])
929 AC_ARG_WITH(system-cairo,
930     AS_HELP_STRING([--with-system-cairo],
931         [Use Cairo libraries already on system.]),,
932     [with_system_cairo="$with_system_libs"])
934 AC_ARG_WITH(system-graphite,
935     AS_HELP_STRING([--with-system-graphite],
936         [Use graphite library already installed on system.]),,
937     [with_system_graphite="$with_system_libs"])
939 AC_ARG_WITH(system-nss,
940     AS_HELP_STRING([--with-system-nss],
941         [Use NSS/nspr libraries already on system.]),,
942     [with_system_nss="$with_system_libs"])
944 AC_ARG_WITH(mozilla-version,
945     AS_HELP_STRING([--with-mozilla-version],
946         [Choose which version of Mozilla to use while building Mozilla.
947          (default=1.7.5) Note that not all versions are supported.]),
950 AC_ARG_WITH(mozilla-toolkit,
951     AS_HELP_STRING([--with-mozilla-toolkit],
952         [Choose which GUI toolkit to use while building Mozilla components. (default=gtk2)]),
955 AC_ARG_WITH(myspell-dicts,
956     AS_HELP_STRING([--without-myspell-dicts],
957         [Removes myspell dictionaries from LibreOffice installation set, for
958          people building for specific distributions where the myspell dictionaries
959          are installed from other sources.]),
962 AC_ARG_WITH(system-dicts,
963     AS_HELP_STRING([--with-system-dicts],
964         [Use dictionaries from system paths- Specify them via
965          --with-{dict,hyph,thes}-path=/path if you want to override the default ones.]),
968 AC_ARG_WITH(external-dict-dir,
969     AS_HELP_STRING([--with-external-dict-dir],
970         [Specify external dictionary dir.]),
973 AC_ARG_WITH(external-hyph-dir,
974     AS_HELP_STRING([--with-external-hyph-dir],
975         [Specify external hyphenation pattern dir.]),
978 AC_ARG_WITH(external-thes-dir,
979     AS_HELP_STRING([--with-external-thes-dir],
980         [Specify external thesaurus dir.]),
983 AC_ARG_WITH(system-zlib,
984     AS_HELP_STRING([--with-system-zlib],
985         [Use zlib already on system.]),,
986  [if test "$_os" != "WINNT"; then
987     with_system_zlib=yes
988   else
989     with_system_zlib="$with_system_libs"
990   fi])
992 AC_ARG_WITH(system-openssl,
993     AS_HELP_STRING([--with-system-openssl],
994         [Use OpenSSL already on system.]),,
995     [with_system_openssl="$with_system_libs"])
997 AC_ARG_WITH(system-jpeg,
998     AS_HELP_STRING([--with-system-jpeg],
999         [Use jpeg already on system.]),,
1000  [if test "$_os" = "Linux"; then
1001     with_system_jpeg=yes
1002   else
1003     with_system_jpeg="$with_system_libs"
1004   fi])
1006 AC_ARG_WITH(system-expat,
1007     AS_HELP_STRING([--with-system-expat],
1008         [Use expat already on system.]),,
1009     [with_system_expat="$with_system_libs"])
1011 AC_ARG_WITH(system-libcmis,
1012     AS_HELP_STRING([--with-system-libcmis],
1013         [Use libcmis already on system.]),,
1014     [with_system_libcmis="$with_system_libs"])
1016 AC_ARG_WITH(system-libvisio,
1017     AS_HELP_STRING([--with-system-libvisio],
1018         [Use libvisio already on system.]),,
1019     [with_system_libvisio="$with_system_libs"])
1021 AC_ARG_WITH(system-libwpd,
1022     AS_HELP_STRING([--with-system-libwpd],
1023         [Use libwpd already on system.]),,
1024     [with_system_libwpd="$with_system_libs"])
1026 AC_ARG_WITH(system-libwps,
1027     AS_HELP_STRING([--with-system-libwps],
1028         [Use libwps already on system.]),,
1029     [with_system_libwps="$with_system_libs"])
1031 AC_ARG_WITH(system-libwpg,
1032     AS_HELP_STRING([--with-system-libwpg],
1033         [Use libwpg already on system.]),,
1034     [with_system_libwpg="$with_system_libs"])
1036 AC_ARG_WITH(system-libxml,
1037     AS_HELP_STRING([--with-system-libxml],
1038         [Use libxml/libxslt already on system.]),,
1039  [if test "$_os" = "Darwin"; then
1040     with_system_libxml=yes
1041   else
1042     with_system_libxml="$with_system_libs"
1043   fi])
1045 AC_ARG_WITH(system-icu,
1046     AS_HELP_STRING([--with-system-icu],
1047         [Use icu already on system.]),,
1048     [with_system_icu="$with_system_libs"])
1050 AC_ARG_WITH(system-poppler,
1051     AS_HELP_STRING([--with-system-poppler],
1052         [Use system poppler. (only needed for pdfimport extension)]),,
1053     [with_system_poppler="$with_system_libs"])
1055 AC_ARG_WITH(system-db,
1056     AS_HELP_STRING([--with-system-db],
1057         [Use Berkeley db already on system.]),,
1058     [with_system_db="$with_system_libs"])
1060 AC_ARG_WITH(system-lucene,
1061     AS_HELP_STRING([--with-system-lucene],
1062         [Use Lucene already on system.]),,
1063     [with_system_lucene="$with_system_jars"])
1065 AC_ARG_WITH(system-apache-commons,
1066     AS_HELP_STRING([--with-system-apache-commons],
1067         [Use Apache commons libraries already on system.]),,
1068     [with_system_apache_commons="$with_system_jars"])
1070 AC_ARG_WITH(lucene-core-jar,
1071     AS_HELP_STRING([--with-lucene-core-jar=JARFILE],
1072         [Specify path to jarfile manually.]),
1073     LUCENE_CORE_JAR=$withval)
1075 AC_ARG_WITH(lucene-analyzers-jar,
1076     AS_HELP_STRING([--with-lucene-analyzers-jar=JARFILE],
1077         [Specify path to jarfile manually.]),
1078     LUCENE_ANALYZERS_JAR=$withval ,)
1080 AC_ARG_WITH(system-mysql,
1081     AS_HELP_STRING([--with-system-mysql],
1082         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
1083          extension. Requires MYSQLCONFIG to point to the mysql_config executable.]),,
1084     [with_system_mysql="$with_system_libs"])
1086 AC_ARG_WITH(libmysql-path,
1087     AS_HELP_STRING([--with-libmysql-path],
1088         [Use Connector/C (libmysql) installation for building the MySQL
1089          Connector/LibreOffice extension.])
1090     [
1091                           Usage:     --with-libmysql-path=<absolute path to
1092                                                   your Connector/C installation>
1093     ],
1096 AC_ARG_WITH(system-mysql-cppconn,
1097     AS_HELP_STRING([--with-system-mysql-cppconn],
1098         [Use MySQL C++ Connector libraries already on system.]),,
1099     [with_system_mysql_cppconn="$with_system_libs"])
1101 AC_ARG_WITH(system-hsqldb,
1102     AS_HELP_STRING([--with-system-hsqldb],
1103         [Use hsqldb already on system.]),,
1104     [with_system_hsqldb="$with_system_jars"])
1106 AC_ARG_WITH(hsqldb-jar,
1107     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1108         [Specify path to jarfile manually.]),
1109     HSQLDB_JAR=$withval)
1111 AC_ARG_WITH(system-beanshell,
1112     AS_HELP_STRING([--with-system-beanshell],
1113         [Use beanshell already on system.]),,
1114     [with_system_beanshell="$with_system_jars"])
1116 AC_ARG_WITH(beanshell-jar,
1117     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1118         [Specify path to jarfile manually.]),
1119     BSH_JAR=$withval)
1121 AC_ARG_WITH(commons-codec-jar,
1122     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1123         [Specify path to jarfile manually.]),
1124     COMMONS_CODEC_JAR=$withval)
1126 AC_ARG_WITH(commons-lang-jar,
1127     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1128         [Specify path to jarfile manually.]),
1129     COMMONS_LANG_JAR=$withval)
1131 AC_ARG_WITH(commons-httpclient-jar,
1132     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1133         [Specify path to jarfile manually.]),
1134     COMMONS_HTTPCLIENT_JAR=$withval)
1136 AC_ARG_WITH(commons-logging-jar,
1137     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1138         [Specify path to jarfile manually.]),
1139     COMMONS_LOGGING_JAR=$withval)
1141 AC_ARG_WITH(system-servlet-api,
1142     AS_HELP_STRING([--with-system-servlet-api],
1143         [Use servlet-api already on system.]),,
1144     [with_system_servlet_api="$with_system_jars"])
1146 AC_ARG_WITH(servlet-api-jar,
1147     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
1148         [Specify path to jarfile manually.]),
1149     SERVLETAPI_JAR=$withval)
1151 AC_ARG_WITH(system-jfreereport,
1152     AS_HELP_STRING([--with-system-jfreereport],
1153         [Use JFreeReport already on system.]),,
1154     [with_system_jfreereport="$with_system_jars"])
1156 AC_ARG_WITH(sac-jar,
1157     AS_HELP_STRING([--with-sac-jar=JARFILE],
1158         [Specify path to jarfile manually.]),
1159     SAC_JAR=$withval)
1161 AC_ARG_WITH(libxml-jar,
1162     AS_HELP_STRING([--with-libxml-jar=JARFILE],
1163         [Specify path to jarfile manually.]),
1164     LIBXML_JAR=$withval)
1166 AC_ARG_WITH(flute-jar,
1167     AS_HELP_STRING([--with-flute-jar=JARFILE],
1168         [Specify path to jarfile manually.]),
1169     FLUTE_JAR=$withval)
1171 AC_ARG_WITH(jfreereport-jar,
1172     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1173         [Specify path to jarfile manually.]),
1174     JFREEREPORT_JAR=$withval)
1176 AC_ARG_WITH(liblayout-jar,
1177     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1178         [Specify path to jarfile manually.]),
1179     LIBLAYOUT_JAR=$withval)
1181 AC_ARG_WITH(libloader-jar,
1182     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1183         [Specify path to jarfile manually.]),
1184     LIBLOADER_JAR=$withval)
1186 AC_ARG_WITH(libloader-jar,
1187     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1188         [Specify path to jarfile manually.]),
1189     LIBLOADER_JAR=$withval)
1191 AC_ARG_WITH(libformula-jar,
1192     AS_HELP_STRING([--with-libformula-jar=JARFILE],
1193         [Specify path to jarfile manually.]),
1194     LIBFORMULA_JAR=$withval)
1196 AC_ARG_WITH(librepository-jar,
1197     AS_HELP_STRING([--with-librepository-jar=JARFILE],
1198         [Specify path to jarfile manually.]),
1199     LIBREPOSITORY_JAR=$withval)
1201 AC_ARG_WITH(libfonts-jar,
1202     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1203         [Specify path to jarfile manually.]),
1204     LIBFONTS_JAR=$withval)
1206 AC_ARG_WITH(libserializer-jar,
1207     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1208         [Specify path to jarfile manually.]),
1209     LIBSERIALIZER_JAR=$withval)
1211 AC_ARG_WITH(libbase-jar,
1212     AS_HELP_STRING([--with-libbase-jar=JARFILE],
1213         [Specify path to jarfile manually.]),
1214     LIBBASE_JAR=$withval)
1216 AC_ARG_WITH(system-saxon,
1217     AS_HELP_STRING([--with-system-saxon],
1218         [Use saxon already on system.]),,
1219     [with_system_saxon="$with_system_jars"])
1221 AC_ARG_WITH(saxon-jar,
1222     AS_HELP_STRING([--with-saxon-jar=JARFILE],
1223         [Specify path to jarfile manually.]),
1224     SAXON_JAR=$withval)
1226 AC_ARG_WITH(system-odbc,
1227     AS_HELP_STRING([--with-system-odbc],
1228         [Use the odbc headers already on system.]),,
1229     [with_system_odbc="$with_system_headers"])
1231 AC_ARG_WITH(system-sane,
1232     AS_HELP_STRING([--with-system-sane],
1233         [Use sane.h already on system.]),,
1234     [with_system_sane="$with_system_headers"])
1236 AC_ARG_WITH(system-xrender-headers,
1237     AS_HELP_STRING([--with-system-xrender-headers],
1238         [Use XRender headers already on system.]),
1239     [with_system_xrender_headers="$with_system_headers"])
1241 AC_ARG_WITH(system-mesa-headers,
1242     AS_HELP_STRING([--with-system-mesa-headers],
1243         [Use Mesa headers already on system.]),,
1244     [with_system_mesa_headers="$with_system_headers"])
1246 AC_ARG_WITH(system-curl,
1247     AS_HELP_STRING([--with-system-curl],
1248         [Use curl already on system.]),,
1249  [if test "$_os" = "Darwin"; then
1250     with_system_curl=yes
1251   else
1252     with_system_curl="$with_system_libs"
1253   fi])
1255 AC_ARG_WITH(system-boost,
1256     AS_HELP_STRING([--with-system-boost],
1257         [Use boost already on system.]),,
1258     [with_system_boost="$with_system_headers"])
1260 AC_ARG_WITH(system-mdds,
1261     AS_HELP_STRING([--with-system-mdds],
1262         [Use mdds already on system.]),,
1263     [with_system_mdds="$with_system_headers"])
1265 AC_ARG_WITH(system-vigra,
1266     AS_HELP_STRING([--with-system-vigra],
1267         [Use vigra already on system.]),,
1268     [with_system_vigra="$with_system_headers"])
1270 AC_ARG_WITH(system-neon,
1271     AS_HELP_STRING([--with-system-neon],
1272         [Use neon already on system.]),,
1273     [with_system_neon="$with_system_libs"])
1275 AC_ARG_WITH(system-hunspell,
1276     AS_HELP_STRING([--with-system-hunspell],
1277         [Use libhunspell already on system.]),,
1278     [with_system_hunspell="$with_system_libs"])
1280 AC_ARG_WITH(system-mythes,
1281     AS_HELP_STRING([--with-system-mythes],
1282         [Use mythes already on system.]),,
1283     [with_system_mythes="$with_system_libs"])
1285 AC_ARG_WITH(system-altlinuxhyph,
1286     AS_HELP_STRING([--with-system-altlinuxhyph],
1287         [Use ALTLinuxhyph already on system.]),,
1288     [with_system_altlinuxhyph="$with_system_libs"])
1290 AC_ARG_WITH(system-lpsolve,
1291     AS_HELP_STRING([--with-system-lpsolve],
1292         [Use lpsolve already on system.]),,
1293     [with_system_lpsolve="$with_system_libs"])
1295 AC_ARG_WITH(system-libexttextcat,
1296     AS_HELP_STRING([--with-system-libexttextcat],
1297         [Use libexttextcat already on system.]),,
1298     [with_system_libexttextcat="$with_system_libs"])
1300 AC_ARG_WITH(system-cppunit,
1301     AS_HELP_STRING([--with-system-cppunit],
1302         [Use cppunit already on system.]),,
1303     [with_system_cppunit="$with_system_libs"])
1305 AC_ARG_WITH(system-redland,
1306     AS_HELP_STRING([--with-system-redland],
1307         [Use redland library already on system.]),,
1308     [with_system_redland="$with_system_libs"])
1310 AC_ARG_WITH(system-mozilla,
1311     AS_HELP_STRING([--with-system-mozilla],
1312         [Use Mozilla already on system. Note that some components cannot be built
1313          against a contemporary Mozilla. The flavour used can be specified by
1314          --with-system-mozilla=<flavour>. Supported are: libxul (default),
1315          xulrunner, firefox, seamonkey, mozilla.]),
1316     WITH_SYSTEM_MOZILLA=$withval ,
1317 WITH_SYSTEM_MOZILLA=no)
1319 AC_ARG_WITH(system-mozilla-headers,
1320     AS_HELP_STRING([--with-system-mozilla-headers],
1321         [Use mozilla headers provided by system instead of bundled ones. Used in
1322          nsplugin]),,
1323     [with_system_mozilla_headers="$with_system_headers"]
1326 AC_ARG_WITH(system-gettext,
1327     AS_HELP_STRING([--with-system-gettext],
1328         [Use gettext runtime library already on system.]),,
1329     [with_system_gettext="$with_system_libs"])
1331 AC_ARG_WITH(system-libpng,
1332     AS_HELP_STRING([--with-system-libpng],
1333         [Use libpng already on system.]),,
1334     [with_system_libpng="$with_system_libs"])
1336 AC_ARG_WITH(linker-hash-style,
1337     AS_HELP_STRING([--with-linker-hash-style],
1338         [Use linker with --hash-style=<style> when linking shared objects.
1339          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1340          if supported on the build system, and "sysv" otherwise.]))
1342 AC_ARG_WITH(stlport,
1343     AS_HELP_STRING([--with-stlport],
1344         [Build the STLPort library for compatibility with old extensions for
1345          architectures where STLPort used to be used.]),
1346     with_stlport=$withval ,
1347 with_stlport=auto)
1349 AC_ARG_WITH(jdk-home,
1350     AS_HELP_STRING([--with-jdk-home],
1351         [If you have installed JDK 1.3 or later on your system please supply the
1352          path here. Note that this is not the location of the java command but the
1353          location of the entire distribution.])
1354     [
1355                           Usage:     --with-jdk-home=<absolute path to JDK home>
1356     ],
1359 AC_ARG_WITH(gxx_include_path,
1360     AS_HELP_STRING([--with-gxx-include-path],
1361         [If you want to override the autodetected g++ include path.])
1362     [
1363                           Usage:     --with-gxx-include-path=<absolute path to
1364                                                                 g++ include dir>
1365     ],
1368 AC_ARG_WITH(help,
1369     AS_HELP_STRING([--with-help],
1370         [Enable the build of help.
1372          To build without help, use --without-help.]))
1374 AC_ARG_WITH(java,
1375     AS_HELP_STRING([--with-java],
1376         [Specify the name of the Java interpreter command. Typically "java"
1377          which is the default.
1379          To build without support for Java components, applets, accessibility
1380          or the XML filters written in Java, use --without-java or --with-java=no.])
1381     [
1382                           Usage:     --with-java==<java command>
1383                                      --without-java
1384     ],
1385     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1386     [ with_java=java ]
1389 AC_ARG_WITH(java_target_version,
1390     AS_HELP_STRING([--with-java-target-version],
1391         [Generate class files that will work on JVMs with the specified version.
1392          For example, use --with-java-target-version=1.4 to make sure that the
1393          application will work with JVM 1.4 even when compiled with JDK 1.5.])
1394     [
1395                           This option is ignored when you compile with gcj/gij.
1397                           Usage:     --with-java-target-version=<jvm version>
1398     ],
1401 AC_ARG_WITH(jvm-path,
1402     AS_HELP_STRING([--with-jvm-path],
1403         [Use a specific JVM search path at runtime.])
1404     [
1405                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1407                           e. g.: --with-jvm-path=/usr/lib/
1408                                  to find JRE/JDK in /usr/lib/jvm/
1409     ],
1412 AC_ARG_WITH(ant-home,
1413     AS_HELP_STRING([--with-ant-home],
1414         [If you have installed Jakarta Ant on your system, please supply the path here.
1415          Note that this is not the location of the Ant binary but the location
1416          of the entire distribution.])
1417     [
1418                           Usage:     --with-ant-home=<absolute path to Ant home>
1419     ],
1422 AC_ARG_WITH(junit,
1423     AS_HELP_STRING([--with-junit],
1424         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1425          --without-junit disables those tests. Not relevant in the --without-java case.])
1426     [
1427                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1428     ],
1429 ,with_junit=yes)
1431 AC_ARG_WITH(perl-home,
1432     AS_HELP_STRING([--with-perl-home],
1433         [If you have installed Perl 5 Distribution, on your system, please
1434          supply the path here. Note that this is not the location of the Perl
1435          binary but the location of the entire distribution.])
1436     [
1437                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1438     ],
1441 AC_ARG_WITH(cl-home,
1442     AS_HELP_STRING([--with-cl-home],
1443         [For Windows NT users, please supply the path for the Microsoft C/C++
1444          compiler. Note that this is not the location of the compiler binary but
1445          the location of the entire distribution.])
1446     [
1447                           Usage:     --with-cl-home=<absolute path to Microsoft
1448                                                             C/C++ compiler home>
1449     ],
1452 AC_ARG_WITH(mspdb-path,
1453     AS_HELP_STRING([--with-mspdb-path],
1454         [For Microsoft C/C++ compiler users, please supply the path pointing to
1455          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1456          Visual Studio 2010).])
1457     [
1458                           Usage:     --with-mspdb-path=<path to
1459                                                        mspdb80.dll/mspdb100.dll>
1460     ],
1463 AC_ARG_WITH(midl-path,
1464     AS_HELP_STRING([--with-midl-path],
1465         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1466     [
1467                           Usage:     --with-midl-path=<abs. path to midl.exe>
1468     ],
1471 AC_ARG_WITH(csc-path,
1472     AS_HELP_STRING([--with-csc-path],
1473         [For Windows builds, please supply the path pointing to the csc.exe.
1474          Usually found automatically when building on Windows.])
1475     [
1476                           Usage:     --with-csc-path=<abs. path to csc.exe>
1477     ],
1480 AC_ARG_WITH(nsis-path,
1481     AS_HELP_STRING([--with-nsis-path],
1482         [For Windows builds, please supply the directory where makensis
1483          is located. If makensis is found in PATH or this option is
1484          properly supplied a self-contained executable installer for
1485          LibreOffice will be created.])
1486     [
1487                           Usage:     --with-nsis-path=<path to directory containing makensis>
1488     ],
1491 AC_ARG_WITH(dotnet-framework-home,
1492     AS_HELP_STRING([--with-dotnet-framework-home],
1493         [For Microsoft compiler users, please supply the path pointing to
1494          lib/mscoree.lib, usually something like:
1495          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1496     [
1497                           Note that in most cases it will be automatically
1498                           found, though.
1500                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1501                                                           Framework>
1502     ],
1505 AC_ARG_WITH(windows-sdk-home,
1506     AS_HELP_STRING([--with-windows-sdk-home],
1507         [For Windows builds, please supply the path to the Windows SDK.
1508          Usually found automatically when building on Windows.])
1509     [
1510                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1511     ],
1514 AC_ARG_WITH(directx-home,
1515     AS_HELP_STRING([--with-directx-home],
1516         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1517     [
1518                           Usage:     --with-directx-home=<absolute path to
1519                                                           Microsoft DirectX SDK>
1520     ],
1523 AC_ARG_WITH(mozilla-build,
1524     AS_HELP_STRING([--with-mozilla-build],
1525         [For Windows users, please supply the path to the Mozilla build tools.])
1526     [
1527                           Usage:     --with-mozilla-build=<absolute path to
1528                                                           Mozilla build tools>
1530                           At the moment of this writing, an installer for the
1531                           mozilla build tools can be obtained from http://ftp.
1532                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1533     ],
1534     MOZILLABUILD=$withval ,
1537 AC_ARG_WITH(local-solver,
1538     AS_HELP_STRING([--with-local-solver],
1539         [If you have solver in a location other than ./solver, please supply the path here.])
1540     [
1541                           Usage:     --with-local-solver=<abs. path to solver>
1542     ],
1545 AC_ARG_WITH(lang,
1546     AS_HELP_STRING([--with-lang],
1547         [Use this option to build LibreOffice with additional language support.
1548          English (US) is always included by default.
1549          Separate multiple languages with space.
1550          For all languages, use --with-lang=ALL.])
1551     [
1552                           Usage:     --with-lang="es sw tu cs sk"
1553     ],
1556 dnl ===================================================================
1557 dnl Branding
1558 dnl ===================================================================
1560 AC_ARG_WITH(intro-bitmap,
1561 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1562                           the default one.
1564                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1565 ],,)
1567 AC_ARG_WITH(intro-progressbar-color,
1568 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1569                                      Comma separated RGB values in decimal format.
1571                           Usage: --with-intro-progressbar-color=126,170,23
1572 ],,)
1574 AC_ARG_WITH(intro-progressbar-size,
1575 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1576                                      Comma separated values in decimal format.
1578                           Usage: --with-intro-progressbar-size=319,10
1579 ],,)
1581 AC_ARG_WITH(intro-progressbar-position,
1582 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1583                                      Comma separated values in decimal format.
1585                           Usage: --with-intro-progressbar-position=164,225
1586 ],,)
1588 AC_ARG_WITH(intro-progressbar-frame-color,
1589 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1590                                            Comma separated RGB values in decimal format.
1592                           Usage: --with-intro-progressbar-frame-color=207,208,211
1593 ],,)
1595 AC_ARG_WITH(about-bitmap,
1596 [  --with-about-bitmap    Similarly to --with-intro-bitmap, this allows
1597                           specification of bitmap for the About box.
1599                           Usage:     --with-about-bitmap=/path/my_ooo_about.png
1600 ],,)
1602 AC_ARG_WITH(startcenter-left-bitmap,
1603 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1604                                      specification of bitmap for the Start center.
1606                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1607 ],,)
1609 AC_ARG_WITH(startcenter-right-bitmap,
1610 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1611                                       specification of bitmap for the Start center.
1613                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1614 ],,)
1616 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1617 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1618                                          specification of bitmap for the Start center.
1620                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1621 ],,)
1623 AC_ARG_WITH(startcenter-rtl-right-bitmap,
1624 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
1625                                           specification of bitmap for the Start center.
1627                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
1628 ],,)
1630 AC_ARG_WITH(startcenter-space-bitmap,
1631 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
1632                                       specification of bitmap for the Start center.
1634                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
1635 ],,)
1637 AC_ARG_WITH(vendor,
1638     AS_HELP_STRING([--with-vendor],
1639         [Set vendor of the build.])
1640     [
1641                           Usage:     --with-vendor="John the Builder"
1642     ],
1645 AC_ARG_WITH(unix-wrapper,
1646     AS_HELP_STRING([--with-unix-wrapper],
1647         [Redefines the name of the UNIX wrapper that will be used in the desktop
1648          files and in the desktop-integration RPMs.])
1649     [
1650                           Usage:     --with-unix-wrapper=ooffice
1651     ],
1654 AC_ARG_WITH(compat-oowrappers,
1655     AS_HELP_STRING([--with-compat-oowrappers],
1656         [Install oo* wrappers in parallel with
1657          lo* ones to keep backward compatibility.
1658          Has effect only with make distro-pack-install]),
1661 AC_ARG_WITH(asm-home,
1662     AS_HELP_STRING([--with-asm-home],
1663         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
1664     [
1665                           Usage:     --with-asm-home=<path to assembler directory>
1666     ],
1669 AC_ARG_WITH(os-version,
1670     AS_HELP_STRING([--with-os-version],
1671         [For FreeBSD users, use this option option to override the detected OSVERSION.])
1672     [
1673                           Usage:     --with-os-version=<OSVERSION>
1674     ],
1677 AC_ARG_WITH(mingw-cross-compiler,
1678     AS_HELP_STRING([--with-mingw-cross-compiler],
1679         [Specify the MinGW cross-compiler to use.])
1680     [
1681                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
1683                           When building on the ODK on Unix and building unowinreg.dll,
1684                           specify the MinGW C++ cross-compiler.
1685     ],
1688 AC_ARG_WITH(build-version,
1689     AS_HELP_STRING([--with-build-version],
1690         [Allows the builder to add a custom version tag that will appear in the
1691          Help/About box for QA purposes.])
1692     [
1693                           Usage:     --with-build-version="Built by Jim"
1694     ],
1695     with_build_version=$withval ,
1698 AC_ARG_WITH(alloc,
1699     AS_HELP_STRING([--with-alloc],
1700         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
1701          Note that on FreeBSD/NetBSD system==jemalloc]),
1704 AC_ARG_WITH(sun-templates,
1705     AS_HELP_STRING([--with-sun-templates],
1706         [Integrate Sun template packages.]),
1709 AC_ARG_WITH(num-cpus,
1710     AS_HELP_STRING([--with-num-cpus],
1711         [Number of build processes/cpus to use (number of projects that will build at the same time).
1712          Multi-process/multi-cpu builds can save a lot of time on multi-cpu machines.
1713          Defaults to the number of CPUs on the machine.]),
1716 AC_ARG_WITH(max-jobs,
1717     AS_HELP_STRING([--with-max-jobs],
1718         [Maximum number of jobs per one CPU that will be issued at the same time by dmake.
1719          The real number of the jobs is affected by the --with-num-cpus too, it can get up to CPUS*max_jobs.
1720          Defaults to 1, unless you configure --enable-icecream - then to 10.]),
1723 dnl ===================================================================
1724 dnl MacOSX build and runtime environment options
1725 dnl ===================================================================
1727 AC_ARG_WITH(macosx-sdk,
1728     AS_HELP_STRING([--with-macosx-sdk],
1729         [Use a specific SDK for building.])
1730     [
1731                           Usage:     --with-macosx-sdk=<version>
1733                           e. g.: --with-macosx-sdk=10.4
1735                           there are 3 options to controle the MacOSX build:
1736                           --with-macosx-sdk (refered as 'sdl' below)
1737                           --with-macosx-version-min-required (refered as 'min' below)
1738                           --with-macosx-version-max-allowed (refered as 'max' below)
1740                           the connection between these value and the default they take is as follow:
1741                           ( ? means not specified on the command line, constraint: x <= y <= z)
1743                           ==========================================
1744                            command line      || config result
1745                           ==========================================
1746                           min  | max  | sdk  || min  | max  | sdk  |
1747                           ?    | ?    | ?    || 10.4 | 10.4 | 10.4 |
1748                           ?    | ?    | 10.x || 10.4 | 10.4 | 10.x |
1749                           ?    | 10.x | ?    || 10.4 | 10.x | 10.x |
1750                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
1751                           10.x | ?    | ?    || 10.x | 10.x | 10.x |
1752                           10.x | ?    | 10.y || 10.x | 10.x | 10.y |
1753                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
1754                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
1757                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
1758                           for a detailled technical explanation of these variables
1760                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
1762     ],
1765 AC_ARG_WITH(macosx-version-min-required,
1766     AS_HELP_STRING([--with-macosx-version-min-required],
1767         [set the minimum OS version needed to run the built LibreOffice])
1768     [
1769                           Usage:     --with-macosx-version-min-required=<version>
1771                           e. g.: --with-macos-version-min-required=10.4
1772                           see --with-macosx-sdk for more info
1773     ],
1776 AC_ARG_WITH(macosx-version-max-allowed,
1777     AS_HELP_STRING([--with-macosx-version-max-allowed],
1778         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
1779     [
1780                           Usage:     --with-macosx-version-max-allowed=<version>
1782                           e. g.: --with-macos-version-max-allowed=10.6
1783                           see --with-macosx-sdk for more info
1784     ],
1788 dnl ===================================================================
1789 dnl check for required programs (grep, awk, sed, bash)
1790 dnl ===================================================================
1791 AC_PROG_EGREP
1792 AC_PROG_AWK
1793 AC_PATH_PROG( AWK, $AWK)
1794 if test -z "$AWK"; then
1795     AC_MSG_ERROR([install awk to run this script])
1798 AC_PATH_PROG(BASH, bash)
1799 if test -z "$BASH"; then
1800     AC_MSG_ERROR([bash not found in \$PATH])
1802 AC_SUBST(BASH)
1804 AC_MSG_CHECKING([for GNU or BSD tar])
1805 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
1806     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
1807     if test $? -eq 0;  then
1808         GNUTAR=$a
1809         break
1810     fi
1811 done
1812 AC_MSG_RESULT($GNUTAR)
1813 if test -z "$GNUTAR"; then
1814     AC_MSG_ERROR([not found. install GNU or BSD tar.])
1816 AC_SUBST(GNUTAR)
1818 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
1819 dnl desktop OSes from "mobile" ones.
1821 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
1822 dnl In other words, that when building for an OS that is not a
1823 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
1825 dnl Note the direction of the implication; there is no assumption that
1826 dnl cross-compiling would imply a non-desktop OS.
1828 if test $_os != iOS -a $_os != Android; then
1829     BUILD_TYPE="$BUILD_TYPE DESKTOP"
1832 dnl ===================================================================
1833 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
1834 dnl although MSVC is used to build other build-time tools and 
1835 dnl LibreOffice itself.
1836 dnl ===================================================================
1837 if test "$build_os" = "cygwin" ; then
1838     AC_MSG_CHECKING([for Cygwin gcc/g++])
1839     if which gcc > /dev/null && which g++ > /dev/null ; then
1840         AC_MSG_RESULT([found])
1841     else
1842         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
1843     fi
1848 dnl ===================================================================
1849 dnl  Checks if ccache is available
1850 dnl ===================================================================
1851 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \) ; then
1852     if test -z "$CC" ; then
1853         if test -z "$CXX" ; then
1854             AC_PATH_PROG([CCACHE],[ccache],[not found])
1855             if test "$CCACHE" = "not found" ; then
1856                 CCACHE=""
1857             else
1858                 CCACHE="ccache"
1859                 # need to check for ccache version: otherwise prevents
1860                 # caching of the results (like "-x objective-c++" for Mac)
1861                 if test $_os = Darwin -o $_os = iOS; then
1862                     # check ccache version
1863                     AC_MSG_CHECKING([whether version of ccache is suitable])
1864                     CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
1865                     CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1866                     if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
1867                         AC_MSG_RESULT([yes])
1868                     else
1869                         AC_MSG_RESULT([no])
1870                         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.])
1871                         CCACHE=""
1872                     fi
1873                 fi
1874             fi
1875         else
1876             AC_MSG_NOTICE([Automatic ccache detection ingored: CXX is pre-defined])
1877             CCACHE=""
1878         fi
1879     else
1880         AC_MSG_NOTICE([Automatic ccache detection ingored: CC is pre-defined])
1881         CCACHE=""
1882     fi
1883 else
1884     CCACHE=""
1887 if test "$CCACHE" != "" ; then
1888     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
1889     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
1890     if test "$ccache_size" = "" ; then
1891         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
1892         if test "$ccache_size" = "" ; then
1893             ccache_size=0
1894         fi
1895         # we could not determine the size or it was less than 1GB -> disable auto-ccache
1896         if test $ccache_size -lt 1024 ; then
1897             CCACHE=""
1898             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
1899             echo "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled" >> warn
1900         else
1901             # warn that ccache may be too small for debug build
1902             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1903             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1904         fi
1905     else
1906         if test $ccache_size -lt 5  ; then
1907             #warn that ccache may be too small for debug build
1908             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1909             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1910         fi
1911     fi
1914 dnl ===================================================================
1915 dnl  Checks for C compiler,
1916 dnl  The check for the C++ compiler is later on.
1917 dnl ===================================================================
1918 GCC_HOME_SET="true"
1919 AC_MSG_CHECKING([gcc home])
1920 if test -z "$with_gcc_home"; then
1921     if test "$enable_icecream" = "yes" ; then
1922         GCC_HOME="/opt/icecream"
1923     else
1924         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
1925         GCC_HOME_SET="false"
1926     fi
1927 else
1928     GCC_HOME="$with_gcc_home"
1930 AC_MSG_RESULT($GCC_HOME)
1931 AC_SUBST(GCC_HOME)
1933 if test "$GCC_HOME_SET" = "true" ; then
1934     if test -z "$CC"; then
1935         CC="$GCC_HOME/bin/gcc"
1936     fi
1937     if test -z "$CXX"; then
1938         CXX="$GCC_HOME/bin/g++"
1939     fi
1942 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1943 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
1944     AC_PROG_CC
1947 COMPATH=`dirname "$CC"`
1948 if test "$COMPATH" = "." ; then
1949     AC_PATH_PROGS(COMPATH, $CC)
1950     dnl double square bracket to get single because of M4 quote...
1951     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
1953 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
1958 dnl ===================================================================
1959 dnl  Test MacOSX sdk and version requirement
1960 dnl ===================================================================
1961 if test "$_os" = "Darwin" ; then
1963     if test "$with_macosx_version_min_required" = "" ; then
1964         with_macosx_version_min_required="10.4"
1965     fi
1967     if test "$with_macosx_version_max_allowed" = "" ; then
1968         with_macosx_version_max_allowed="$with_macosx_version_min_required"
1969     fi
1971     if test "$with_macosx_sdk" = "" ; then
1972         with_macosx_sdk="$with_macosx_version_max_allowed"
1973     fi
1975     case "$with_macosx_sdk" in
1977     10.4)
1978         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.4u.sdk"
1979         if test ! -d "$MACOSX_SDK_PATH"; then
1980           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.4u.sdk"
1981         fi
1982         macosx_sdk_value="1040"
1983         ;;
1984     10.5)
1985         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.5.sdk"
1986         if test ! -d "$MACOSX_SDK_PATH"; then
1987           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.5.sdk"
1988         fi
1989         macosx_sdk_value="1050"
1990         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
1991         echo "Building with a SDK > 10.4 is experimental" >> warn
1992         ;;
1993     10.6)
1994         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"
1995         macosx_sdk_value="1060"
1996         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
1997         echo "Building with a SDK > 10.4 is experimental" >> warn
1998         ;;
1999     10.7)
2000         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.7.sdk"
2001         macosx_sdk_value="1070"
2002         AC_MSG_WARN([Building with SDK 10.7 is known to fail in vcl])
2003         echo "Building with SDK 10.7 is known to fail in vcl" >> warn
2004         ;;
2005     *)
2006         AC_MSG_ERROR([$with_macosx_sdk is not a supported SDK value, supported value are 10.4, 10.5, 10.6 and 10.7])
2007         ;;
2008     esac
2009     AC_MSG_CHECKING([the presence of the SDK $with_macosx_sdk])
2010     if test -d "$MACOSX_SDK_PATH" ; then
2011         AC_MSG_RESULT([$MACOSX_SDK_PATH ok])
2012     else
2013         AC_MSG_ERROR([$MACOSX_SDK_PATH not found])
2014     fi
2015     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2017     case "$with_macosx_version_min_required" in
2019     10.4)
2020         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
2021         ;;
2022     10.5)
2023         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2024         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2025         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2026         if test -z "$save_CC" ; then
2027             CC="gcc-4.2 -m32"
2028             CXX="g++-4.2 -m32"
2029         fi
2030         ;;
2031     10.6)
2032         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2033         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2034         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2035         if test -z "$save_CC" ; then
2036             CC="gcc-4.2 -m32"
2037             CXX="g++-4.2 -m32"
2038         fi
2039         ;;
2040     10.7)
2041         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2042         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2043         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2044         if test -z "$save_CC" ; then
2045             CC="gcc-4.2 -m32"
2046             CXX="g++-4.2 -m32"
2047         fi
2048         ;;
2049     *)
2050         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])
2051         ;;
2052     esac
2054     case "$with_macosx_version_max_allowed" in
2056     10.4)
2057         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
2058         ;;
2059     10.5)
2060         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2061         ;;
2062     10.6)
2063         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2064         ;;
2065     10.7)
2066         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2067         ;;
2068     *)
2069         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])
2070         ;;
2071     esac
2073     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2074     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED ; then
2075         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2076     else
2077         AC_MSG_RESULT([ok])
2078     fi
2080     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent macos-with-sdk])
2081     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $macosx_sdk_value ; then
2082         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2083     else
2084         AC_MSG_RESULT([ok])
2085     fi
2086     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2087     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2089 AC_SUBST(MACOSX_SDK_PATH)
2090 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2091 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2092 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2094 dnl ===================================================================
2095 dnl  Test the gcc version,  3 is OK
2096 dnl ===================================================================
2097 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
2098     AC_MSG_CHECKING([the GNU C compiler version])
2099     _gcc_version=`$CC -dumpversion`
2100     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2101     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2103     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100" ; then
2104         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0" ; then
2105             export CC="$GCC_HOME/bin/gcc-4.0"
2106             #  export CC to have it available in set_soenv -> config.guess
2107             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2108             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100" ; then
2109                 GCCVER=$GCCVER2
2110             fi
2111         fi
2112         if test "$GCCVER" -ge "040100" ; then
2113             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])
2114         else
2115             AC_MSG_RESULT([implicitly using CC=$CC])
2116         fi
2117     else
2118         AC_MSG_RESULT([checked (gcc $_gcc_version)])
2119     fi
2124 # prefix C with ccache if needed
2126 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" ; then
2127     if test "$CCACHE" != "" ; then
2128         AC_MSG_CHECKING([whether $CC is already ccached])
2131         AC_LANG_PUSH([C])
2132         save_CFLAGS=$CFLAGS
2133         CFLAGS="$CFLAGS --ccache-skip -O2"
2134         dnl an empty program will do, we're checking the compiler flags
2135         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2136                           [use_ccache=yes], [use_ccache=no])
2137         if test $use_ccache = yes ; then
2138             AC_MSG_RESULT([yes])
2139         else
2140             CC="$CCACHE $CC"
2141             AC_MSG_RESULT([no])
2142         fi
2143         CFLAGS=$save_CFLAGS
2144         AC_LANG_POP([C])
2145     fi
2149 HAVE_LD_BSYMBOLIC_FUNCTIONS=
2150 if test "$GCC" = "yes"; then
2151     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
2152     bsymbolic_functions_ldflags_save=$LDFLAGS
2153     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
2154     AC_LINK_IFELSE([AC_LANG_PROGRAM([
2155 #include <stdio.h>
2156         ],[
2157 printf ("hello world\n");
2158         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
2159     if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
2160         AC_MSG_RESULT( found )
2161     else
2162         AC_MSG_RESULT( not found )
2163     fi
2164     LDFLAGS=$bsymbolic_functions_ldflags_save
2166 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
2168 dnl ===================================================================
2169 dnl Set up a different compiler to produce tools to run on the build
2170 dnl machine when doing cross-compilation
2171 dnl ===================================================================
2173 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
2174 if test "$cross_compiling" = "yes"; then
2175     AC_MSG_CHECKING([for BUILD platform configuration])
2176     echo
2177     rm -rf CONF-FOR-BUILD Env.Build.sh
2178     mkdir CONF-FOR-BUILD
2179     tar cf - \
2180         Makefile.in \
2181         bin/repo-list.in \
2182         config.guess \
2183         configure \
2184         ooo.lst.in \
2185         oowintool \
2186         post_download.in \
2187         set_soenv.in \
2188         solenv/inc/langlist.mk \
2189         solenv/inc/postset.mk \
2190         desktop/scripts/soffice.sh.in \
2191     | (cd CONF-FOR-BUILD && tar xf -)
2192     (
2193     unset COM GUI GUIBASE OS CPU CPUNAME
2194     unset CC CXX SYSBASE CFLAGS
2195     unset PYTHON_CFLAGS PYTHON_LIBS
2196     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
2197     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
2198     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
2199     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
2200     cd CONF-FOR-BUILD
2201     sub_conf_opts=""
2202     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
2203     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
2204     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
2205     ./configure \
2206         --disable-mozilla \
2207         --disable-build-mozilla \
2208         --disable-zenity \
2209         --with-num-cpus="$with_num_cpus" \
2210         --with-max-jobs="$with_max_jobs" \
2211         $sub_conf_opts \
2212         2>&1 | sed -e 's/^/    /'
2213     test -f ./Env.Host.sh 2>/dev/null || exit
2214     cp Env.Host.sh ../Env.Build.sh
2215     . ./Env.Host.sh
2216     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
2217              SYSTEM_LIBXSLT; do
2218         VV='$'$V
2219         VV=`eval "echo $VV"`
2220         if test -n "$VV"; then
2221             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
2222             echo "$line" >>build-config
2223         fi
2224     done
2226     for V in OUTDIR PATH SOLARINC SOLARLIB WORKDIR; do
2227         VV='$'$V
2228         VV=`eval "echo $VV"`
2229         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
2230         if test -n "$VV"; then
2231             line="${V}_FOR_BUILD='$VV'"
2232             echo "$line" >>build-config
2233         fi
2234     done
2235     )
2236     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
2237     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])
2238     perl -pi -e 's,/CONF-FOR-BUILD,,g' Env.Build.sh
2239     eval `cat CONF-FOR-BUILD/build-config`
2240     AC_MSG_RESULT([checking for BUILD platform configuration... done])
2241     rm -rf CONF-FOR-BUILD
2242 else
2243     CC_FOR_BUILD="$CC"
2244     CXX_FOR_BUILD="$CXX"
2246 AC_SUBST(COM_FOR_BUILD)
2247 AC_SUBST(GUI_FOR_BUILD)
2248 AC_SUBST(GUIBASE_FOR_BUILD)
2249 AC_SUBST(OS_FOR_BUILD)
2250 AC_SUBST(CPU_FOR_BUILD)
2251 AC_SUBST(CPUNAME_FOR_BUILD)
2252 AC_SUBST(CC_FOR_BUILD)
2253 AC_SUBST(CXX_FOR_BUILD)
2254 AC_SUBST(GXX_INCLUDE_PATH_FOR_BUILD)
2255 AC_SUBST(INPATH_FOR_BUILD)
2256 AC_SUBST(OUTPATH_FOR_BUILD)
2257 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
2258 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
2260 AC_SUBST(OUTDIR_FOR_BUILD)
2261 AC_SUBST(PATH_FOR_BUILD)
2262 AC_SUBST(SOLARINC_FOR_BUILD)
2263 AC_SUBST(SOLARLIB_FOR_BUILD)
2264 AC_SUBST(WORKDIR_FOR_BUILD)
2266 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
2267 SOURCEVERSION="OOO$UPD"
2268 AC_SUBST(UPD)
2269 AC_SUBST(SOURCEVERSION)
2271 dnl ===================================================================
2272 dnl Set the ENABLE_CRASHDUMP variable.
2273 dnl ===================================================================
2274 AC_MSG_CHECKING([whether to enable crashdump feature])
2275 if test "$enable_crashdump" = "yes"; then
2276     ENABLE_CRASHDUMP="TRUE"
2277     BUILD_TYPE="$BUILD_TYPE CRASHREP"
2278     AC_MSG_RESULT([yes])
2279 else
2280     ENABLE_CRASHDUMP=""
2281     AC_MSG_RESULT([no])
2283 AC_SUBST(ENABLE_CRASHDUMP)
2286 dnl ===================================================================
2287 dnl Windows specific tests and stuff
2288 dnl ===================================================================
2289 if test "$_os" = "WINNT"; then
2291     dnl Include twain scanners
2292     BUILD_TYPE="$BUILD_TYPE TWAIN"
2294     dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice.
2295     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2296     if test "z$enable_cl_x64" = "z" -o "$enable_cl_x64" = "no"; then
2297         CL_X64=""
2298         AC_MSG_RESULT([no])
2299     else
2300         CL_X64="TRUE"
2301         AC_MSG_RESULT([yes])
2302     fi
2303     AC_SUBST(CL_X64)
2305     AC_MSG_CHECKING([whether to use DirectX])
2306     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2307         ENABLE_DIRECTX="TRUE"
2308         AC_MSG_RESULT([yes])
2309     else
2310         ENABLE_DIRECTX=""
2311         AC_MSG_RESULT([no])
2312     fi
2313     AC_SUBST(ENABLE_DIRECTX)
2315     AC_MSG_CHECKING([whether to use ActiveX])
2316     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2317         DISABLE_ACTIVEX=""
2318         AC_MSG_RESULT([yes])
2319     else
2320         DISABLE_ACTIVEX="TRUE"
2321         AC_MSG_RESULT([no])
2322     fi
2323     AC_SUBST(DISABLE_ACTIVEX)
2325     AC_MSG_CHECKING([whether to use ATL])
2326     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE"; then
2327         DISABLE_ATL=""
2328         AC_MSG_RESULT([yes])
2329     elif test "$enable_atl" = ""; then
2330         if test "$WITH_MINGW" = "yes"; then
2331             DISABLE_ATL="TRUE"
2332             AC_MSG_RESULT([no])
2333         else
2334             DISABLE_ATL=""
2335             AC_MSG_RESULT([yes])
2336         fi
2337     else
2338         DISABLE_ATL="TRUE"
2339         AC_MSG_RESULT([no])
2340     fi
2341     AC_SUBST(DISABLE_ATL)
2344 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
2345 dnl ===================================================================
2346 AC_MSG_CHECKING([whether to turn warnings to errors])
2347 if test -n "$enable_werror" && test "$enable_werror" != "no"; then
2348     ENABLE_WERROR="TRUE"
2349     AC_MSG_RESULT([yes])
2350 else
2351     ENABLE_WERROR="FALSE"
2352     AC_MSG_RESULT([no])
2354 AC_SUBST(ENABLE_WERROR)
2356 dnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
2357 dnl ===================================================================
2358 AC_MSG_CHECKING([whether to do a debug build])
2359 if test -n "$enable_debug" && test "$enable_debug" != "no"; then
2360     ENABLE_DEBUG="TRUE"
2361     enable_symbols="yes"
2362     AC_MSG_RESULT([yes])
2363 else
2364     ENABLE_DEBUG="FALSE"
2365     AC_MSG_RESULT([no])
2367 AC_SUBST(ENABLE_DEBUG)
2369 dnl Set the ENABLE_DBGUTIL variable
2370 dnl ===================================================================
2371 AC_MSG_CHECKING([whether to build with additional debug utilities])
2372 if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
2373     PROEXT=""
2374     PRODUCT=""
2376     # Compiling with MSVC using --enable-dbgutil (i.e. using the
2377     # debugging runtime, and defining _DEBUG when compiling) just
2378     # causes too many compilation errors. After having spent some
2379     # months slowly fixing them one by one, having reached sw, I give
2380     # up. Feel free to try again.
2381     if test "$_os" = WINNT -a "$WITH_MINGW" != yes; then
2382         AC_MSG_ERROR([Sorry, --enable-dbgutil won't work with MSVC])
2383     fi
2385     AC_MSG_RESULT([yes])
2386     # cppunit and graphite expose STL in public headers
2387     if test "$with_system_cppunit" = "yes"; then
2388         AC_MSG_ERROR([--with-system-cppunit conflicts with DBG_UTIL build])
2389     else
2390         with_system_cppunit=no
2391     fi
2392     if test "$with_system_graphite" = "yes"; then
2393         AC_MSG_ERROR([--with-system-graphite conflicts with DBG_UTIL build])
2394     else
2395         with_system_graphite=no
2396     fi
2397     if test "$with_system_mysql_cppconn" = "yes"; then
2398         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with DBG_UTIL build])
2399     else
2400         with_system_mysql_cppconn=no
2401     fi
2402     if test $_os = WINNT -a \
2403             \( "$enable_mozilla" != no -o \
2404                "$enable_build_mozilla" != no \); then
2405         # We can't build against the Mozilla stuff if using _DEBUG, will get linking errors
2406         # See connectivity/drivers/mozab
2407         AC_MSG_WARN([Also disabling Mozilla stuff then])
2408         enable_mozilla=no
2409         enable_build_mozilla=no
2410     fi
2411 else
2412     PRODUCT="full"
2413     PROEXT=".pro"
2414     AC_MSG_RESULT([no, full product build])
2416 AC_SUBST(PRODUCT)
2417 AC_SUBST(PROEXT)
2419 dnl Determine whether to use linkoo for the smoketest installation
2420 dnl ===================================================================
2421 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
2422 if test "$enable_linkoo" = "no"; then
2423     DISABLE_LINKOO="TRUE"
2424     AC_MSG_RESULT([no])
2425 else
2426     DISABLE_LINKOO=
2427     AC_MSG_RESULT([yes])
2429 AC_SUBST(DISABLE_LINKOO)
2431 # Set the ENABLE_LTO variable
2432 # ===================================================================
2433 AC_MSG_CHECKING([whether to use link-time optimization])
2434 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
2435     ENABLE_LTO="TRUE"
2436     AC_MSG_RESULT([yes])
2437 else
2438     ENABLE_LTO=""
2439     AC_MSG_RESULT([no])
2441 AC_SUBST(ENABLE_LTO)
2443 dnl whether to include symbols into final build.
2444 dnl ===================================================================
2445 AC_MSG_CHECKING([whether to include symbols])
2446 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
2447     ENABLE_SYMBOLS="TRUE"
2448     AC_MSG_RESULT([yes])
2449 else
2450     ENABLE_SYMBOLS=
2451     AC_MSG_RESULT([no])
2453 AC_SUBST(ENABLE_SYMBOLS)
2455 dnl Determine if the solver is to be stripped or not.
2456 dnl ===================================================================
2457 AC_MSG_CHECKING([whether to strip the solver or not.])
2458 if test "z$enable_strip_solver" = "zno"; then
2459     DISABLE_STRIP="TRUE"
2460     AC_MSG_RESULT([no])
2461 else
2462     if test -n "$ENABLE_SYMBOLS"; then
2463         DISABLE_STRIP="TRUE"
2464         AC_MSG_RESULT([no])
2465     else
2466         DISABLE_STRIP=
2467         AC_MSG_RESULT([yes])
2468     fi
2470 AC_SUBST(DISABLE_STRIP)
2472 dnl check for cups support
2473 dnl ===================================================================
2474 if test "$test_cups" = "yes"; then
2475     AC_MSG_CHECKING([whether cups support is present])
2476     AC_CHECK_LIB(cups, cupsPrintFiles)
2477     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
2478     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
2479         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
2480     fi
2484 # check for fontconfig support
2485 AC_MSG_CHECKING([whether we need fontconfig])
2486 if test "z$test_fontconfig" = "zyes"; then
2487     ENABLE_FONTCONFIG="TRUE"
2488     AC_MSG_RESULT([yes])
2489     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
2490 else
2491     ENABLE_FONTCONFIG=""
2492     AC_MSG_RESULT([no])
2494 AC_SUBST(ENABLE_FONTCONFIG)
2495 AC_SUBST(FONTCONFIG_CFLAGS)
2496 AC_SUBST(FONTCONFIG_LIBS)
2498 dnl whether to find & fetch external tarballs?
2499 dnl ===================================================================
2500 if test -z "$TARFILE_LOCATION"; then
2501     TARFILE_LOCATION="DEFAULT"
2503 AC_SUBST(TARFILE_LOCATION)
2505 if test "z$enable_fetch_external" != "zno" ; then
2506     DO_FETCH_TARBALLS="YES"
2508 AC_SUBST(DO_FETCH_TARBALLS)
2511 dnl Disable legacy binary file formats filters
2512 dnl ===================================================================
2513 AC_MSG_CHECKING([whether to enable filters for legacy binary file formats (StarOffice 5.2)])
2514 if test "$enable_binfilter" = "no"; then
2515     WITH_BINFILTER="NO"
2516     AC_MSG_RESULT([no])
2517 else
2518     WITH_BINFILTER="YES"
2519     BUILD_TYPE="$BUILD_TYPE BINFILTER"
2520     GIT_REPO_NAMES="$GIT_REPO_NAMES binfilter"
2521     AC_MSG_RESULT([yes])
2523 AC_SUBST(WITH_BINFILTER)
2525 AC_MSG_CHECKING([whether to build help])
2526 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
2527     AC_MSG_RESULT([yes])
2528     BUILD_TYPE="$BUILD_TYPE HELP"
2529     SCPDEFS="$SCPDEFS -DWITH_HELP"
2530     GIT_REPO_NAMES="$GIT_REPO_NAMES help"
2531 else
2532     AC_MSG_RESULT([no])
2535 dnl Enable ugly pieces of code we're better off without
2536 dnl ===================================================================
2537 if test "$enable_ugly" = "yes"; then
2538     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2539     SCPDEFS="$SCPDEFS -DWITH_UGLY"
2540     ENABLE_UGLY=YES
2541 else
2542     ENABLE_UGLY=NO
2544 AC_SUBST(ENABLE_UGLY)
2546 dnl ===================================================================
2547 dnl Disable rpath in shared libraries?
2548 dnl ===================================================================
2549 AC_MSG_CHECKING([whether to use RPATH in shared libraries])
2550 if test "$enable_rpath" = "no"; then
2551     ENABLE_RPATH="no"
2552 else
2553     ENABLE_RPATH="yes"
2555 AC_MSG_RESULT([$ENABLE_RPATH])
2556 AC_SUBST(ENABLE_RPATH)
2558 dnl Test whether to include MySpell dictionaries
2559 dnl ===================================================================
2560 AC_MSG_CHECKING([whether to include MySpell dictionaries])
2561 if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then
2562     AC_MSG_RESULT([yes])
2563     WITH_MYSPELL_DICTS=YES
2564     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2565     GIT_REPO_NAMES="$GIT_REPO_NAMES dictionaries"
2566 else
2567     AC_MSG_RESULT([no])
2568     WITH_MYSPELL_DICTS=NO
2570 AC_SUBST(WITH_MYSPELL_DICTS)
2572 AC_MSG_CHECKING([whether to use dicts from external paths])
2573 if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
2574     AC_MSG_RESULT([yes])
2575     SYSTEM_DICTS=YES
2576     AC_MSG_CHECKING([for spelling dictionary directory])
2577     if test -n "$with_external_dict_dir"; then
2578         DICT_SYSTEM_DIR=file://$with_external_dict_dir
2579     else
2580         DICT_SYSTEM_DIR=file:///usr/share/hunspell
2581     fi
2582     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
2583     AC_MSG_CHECKING([for hyphenation patterns directory])
2584     if test -n "$with_external_hyph_dir"; then
2585         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
2586     else
2587         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
2588     fi
2589     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
2590     AC_MSG_CHECKING([for thesaurus directory])
2591     if test -n "$with_external_thes_dir"; then
2592         THES_SYSTEM_DIR=file://$with_external_thes_dir
2593     else
2594         THES_SYSTEM_DIR=file:///usr/share/mythes
2595     fi
2596     AC_MSG_RESULT([$THES_SYSTEM_DIR])
2597 else
2598     AC_MSG_RESULT([no])
2599     SYSTEM_DICTS=NO
2601 AC_SUBST(SYSTEM_DICTS)
2602 AC_SUBST(DICT_SYSTEM_DIR)
2603 AC_SUBST(HYPH_SYSTEM_DIR)
2604 AC_SUBST(THES_SYSTEM_DIR)
2606 dnl ===================================================================
2607 dnl Set the ENABLE_PCH variable. (Activate --enable-pch)
2608 dnl ===================================================================
2609 AC_MSG_CHECKING([whether to enable pch feature])
2610 if test -n "$enable_pch" && test "$enable_pch" != "no"; then
2611     if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
2612         ENABLE_PCH="TRUE"
2613         AC_MSG_RESULT([yes])
2614 dnl There is no PCH support in GCC versions prior to this
2615     elif test "$GCC" = "yes"; then
2616         ENABLE_PCH="TRUE"
2617         AC_MSG_RESULT([yes])
2618     else
2619         ENABLE_PCH=""
2620         AC_MSG_WARN([Precompiled header not yet supported for your platform/compiler])
2621     fi
2622 else
2623     ENABLE_PCH=""
2624     AC_MSG_RESULT([no])
2626 AC_SUBST(ENABLE_PCH)
2628 dnl ===================================================================
2629 dnl Search all the common names for GNU make
2630 dnl ===================================================================
2631 AC_MSG_CHECKING([for GNU make])
2633 # try to use our own make if it is available and GNUMAKE was not already defined
2634 if test -z "$GNUMAKE"; then
2635     if test -x "/opt/lo/bin/make"; then
2636         GNUMAKE="/opt/lo/bin/make"
2637     fi
2640 for a in "$MAKE" $GNUMAKE make gmake gnumake; do
2641     $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
2642     if test $? -eq 0;  then
2643         GNUMAKE=$a
2644         break
2645     fi
2646 done
2647 AC_MSG_RESULT($GNUMAKE)
2648 if test -z "$GNUMAKE"; then
2649     AC_MSG_ERROR([not found. install GNU make.])
2652 AC_MSG_CHECKING([the GNU make version])
2653 _make_version=`$GNUMAKE --version | grep GNU | grep -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
2654 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2655 if test "$_make_longver" -ge "038200" ; then
2656     AC_MSG_RESULT([$GNUMAKE $_make_version])
2658 elif test "$_make_longver" -ge "038100" ; then
2659     AC_MSG_RESULT([$GNUMAKE $_make_version])
2660     AC_MSG_CHECKING([for GNU make bug 20033])
2661     TESTGMAKEBUG20033=`mktemp -d`
2662     cat > $TESTGMAKEBUG20033/Makefile << EOF
2663 A := \$(wildcard *.a)
2665 .PHONY: all
2666 all: \$(A:.a=.b)
2667         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
2669 .PHONY: setup
2670 setup:
2671         @touch 1.a 2.a 3.a 4.a 5.a 6.a
2673 define d1
2674 @echo lala \$(1)
2675 @sleep 1
2676 endef
2678 define d2
2679 @echo tyty \$(1)
2680 @sleep 1
2681 endef
2683 %.b : %.a
2684         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | sha1sum))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
2685         \$(call d1,\$(CHECKSUM)),\
2686         \$(call d2,\$(CHECKSUM)))
2688     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
2689         no_parallelism_make="YES"
2690         AC_MSG_RESULT([yes, disable parallelism])
2691     else
2692         AC_MSG_RESULT([no, keep parallelism enabled])
2693     fi
2694     rm -rf $TESTGMAKEBUG20033
2695 else
2696     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
2698 AC_SUBST(GNUMAKE)
2700 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`;
2701 STALE_MAKE=
2702 make_warning=
2703 if test "z$_make_ver_check" = "z"; then
2704    STALE_MAKE=TRUE
2706 AC_SUBST(STALE_MAKE)
2708 dnl ===================================================================
2709 dnl  Test the Solaris compiler version
2710 dnl ===================================================================
2711 if test "$_os" = "SunOS"; then
2712     if test "$CC" = "cc"; then
2713         AC_PATH_PROGS(_cc, cc)
2714         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2715         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2716         dnl cc -V outputs to standard error!!!!
2717         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2718         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2719         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2720         if test "$_sunstudio_major" != "5"; then
2721             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2722         else
2723             _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" }'`
2724             if test "$_sunstudio_minor" = "false"; then
2725                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2726             else
2727                 dnl compiler will do
2728                 AC_MSG_RESULT([checked])
2729             fi
2730         fi
2731     fi
2734 HAVE_LD_HASH_STYLE=FALSE
2735 WITH_LINKER_HASH_STYLE=
2736 AC_MSG_CHECKING( for --hash-style gcc linker support )
2737 if test "$GCC" = "yes" ; then
2738     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes" ; then
2739         hash_styles="gnu sysv"
2740     elif test "$with_linker_hash_style" = "no" ; then
2741         hash_styles=
2742     else
2743         hash_styles="$with_linker_hash_style"
2744     fi
2746     for hash_style in $hash_styles ; do
2747         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
2748         hash_style_ldflags_save=$LDFLAGS
2749         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
2751         AC_LINK_IFELSE([AC_LANG_PROGRAM(
2752             [
2753 #include <stdio.h>
2754             ],[
2755 printf ("");
2756             ])],
2757             [ if ./conftest$EXEEXT; then
2758                   HAVE_LD_HASH_STYLE=TRUE
2759                   WITH_LINKER_HASH_STYLE=$hash_style
2760               fi],
2761             [HAVE_LD_HASH_STYLE=FALSE])
2762         LDFLAGS=$hash_style_ldflags_save
2763     done
2765     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
2766         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
2767     else
2768         AC_MSG_RESULT( no )
2769     fi
2770     LDFLAGS=$hash_style_ldflags_save
2771 else
2772     AC_MSG_RESULT( no )
2774 AC_SUBST(HAVE_LD_HASH_STYLE)
2775 AC_SUBST(WITH_LINKER_HASH_STYLE)
2777 dnl ===================================================================
2778 dnl Check whether there's a Perl version available.
2779 dnl ===================================================================
2780 if test -z "$with_perl_home"; then
2781     AC_PATH_PROG(PERL, perl)
2782 else
2783     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
2784     _perl_path="$with_perl_home/bin/perl"
2785     if test -x "$_perl_path"; then
2786         PERL=$_perl_path
2787     else
2788         AC_MSG_ERROR([$_perl_path not found])
2789     fi
2792 dnl ===================================================================
2793 dnl Testing for Perl version 5 or greater.
2794 dnl $] is the Perl version variable, it is returned as an integer
2795 dnl ===================================================================
2796 if test "$PERL"; then
2797     AC_MSG_CHECKING([the Perl version])
2798     ${PERL} -e "exit($]);"
2799     _perl_version=$?
2800     if test "$_perl_version" -lt 5; then
2801         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
2802     fi
2803     AC_MSG_RESULT([checked (perl $_perl_version)])
2804 else
2805     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
2807 AC_SUBST(PERL)
2809 dnl ===================================================================
2810 dnl Testing for required Perl modules
2811 dnl ===================================================================
2813 AC_MSG_CHECKING([for required Perl modules])
2814 if `$PERL -e 'use Archive::Zip; use Cwd;'`; then
2815     AC_MSG_RESULT([all modules found])
2816 else
2817     AC_MSG_ERROR([Failed to find some modules])
2820 dnl ===================================================================
2821 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2822 dnl ===================================================================
2823 SHOWINCLUDES_PREFIX=
2824 if test "$_os" = "WINNT"; then
2825     if test "$WITH_MINGW" != "yes"; then
2826         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
2827         if test -z "$with_cl_home"; then
2828             vctest=`./oowintool --msvc-productdir`;
2829             if test "$CL_X64" = ""; then
2830                 if test -x "$vctest/bin/cl.exe"; then
2831                     with_cl_home=$vctest;
2832                 fi
2833             else
2834                 if test -x "$vctest/bin/amd64/cl.exe"; then
2835                     with_cl_home=$vctest;
2836                 fi
2837             fi
2838         else
2839             with_cl_home=`cygpath -u "$with_cl_home"`
2840         fi
2841         with_cl_home=`cygpath -d "$with_cl_home"`
2842         with_cl_home=`cygpath -u "$with_cl_home"`
2843         AC_MSG_RESULT([$with_cl_home])
2845         dnl ===========================================================
2846         dnl  Check for mspdb80.dll/mspdb100.dll
2847         dnl ===========================================================
2848         dnl MSVS 2008/10 Compiler
2849         if test -n "$with_mspdb_path";then
2850             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2851         fi
2852         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll"; then
2853             MSPDB_PATH="$with_mspdb_path"
2854         fi
2855         dnl MSVS 2008 case
2856         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2857             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2858         fi
2859         dnl Windows SDK 6.0 case
2860         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2861             MSPDB_PATH="$with_cl_home/bin"
2862         fi
2863         dnl MSVS 2010 case
2864         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
2865             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2866         fi
2868         if test -z "$MSPDB_PATH";then
2869             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2870             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2871             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
2872             MSPDB_PATH=`dirname "$MSPDB_PATH"`
2873         fi
2875         if test -z "$MSPDB_PATH"; then
2876             AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path])
2877         fi
2878         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2879         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2880         dnl The path needs to be added before cl is called
2881         PATH="$MSPDB_PATH:$PATH"
2883         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2884         if test -z "$CC"; then
2885             if test "$CL_X64" = ""; then
2886                 if test -x "$with_cl_home/bin/cl.exe"; then
2887                     CC="$with_cl_home/bin/cl.exe"
2888                 fi
2889             else
2890                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
2891                     CC="$with_cl_home/bin/amd64/cl.exe"
2892                 fi
2893             fi
2894             if test -z "$CC"; then
2895                 AC_PATH_PROG(CC, cl.exe)
2896             fi
2897             # This gives us a posix path with 8.3 filename restrictions
2898             CC=`cygpath -d "$CC"`
2899             CC=`cygpath -u "$CC"`
2900         fi
2902         if test -n "$CC"; then
2903             # Remove /cl.exe from CC case insensitive
2904             AC_MSG_RESULT([found ($CC)])
2905             if test "$CL_X64" = ""; then
2906                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
2907             else
2908                 if test -n "$with_cl_home"; then
2909                     COMPATH=`echo $with_cl_home`
2910                 fi
2911             fi
2912             export INCLUDE=`cygpath -d "$COMPATH/Include"`
2913             dnl  Check which Microsoft C/C++ compiler is found
2914             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2915             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
2916             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
2917                             x = match( \\\$0, /..\\...\\...../ )
2918                             CCversion = substr( \\\$0, RSTART, RLENGTH)
2919                             tokencount = split (CCversion,vertoken,\".\")
2920                             for ( i = 1 ; i <= tokencount ; i++ ) {
2921                                 printf (\"%04d\",vertoken[[i]] )
2922                             }
2923                             }"`
2924             if test "$CCNUMVER" -ge "001600000000"; then
2925                 COMEX=13
2926                 MSVSVER=2010
2927             elif test "$CCNUMVER" -ge "001500000000"; then
2928                 COMEX=12
2929                 MSVSVER=2008
2930             else
2931                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
2932             fi
2933             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
2934         else
2935             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
2936         fi
2938         dnl We need to guess the prefix of the -showIncludes output, it can be
2939         dnl localized
2940         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
2941         echo "#include <stdlib.h>" > conftest.c
2942         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
2943             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
2944         rm -f conftest.c conftest.obj
2945         if test -z "$SHOWINCLUDES_PREFIX" ; then
2946             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
2947         else
2948             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
2949         fi
2951         # Check for 64-bit (cross-)compiler to use to build the 64-bit
2952         # version of the Explorer extension (and maybe other small
2953         # bits, too) needed when installing a 32-bit LibreOffice on a
2954         # 64-bit OS. The 64-bit Explorer extension is a feature that
2955         # has been present since long in OOo. Don't confuse it with
2956         # building LibreOffice itself as 64-bit code, which is
2957         # unfished work and highly experimental.
2959         BUILD_X64=
2960         CC_X64_BINARY=
2961         LINK_X64_BINARY=
2962         LIBMGR_X64_BINARY=
2964         AC_MSG_CHECKING([for a x64 compiler and libraries for 64bit ActiveX component])
2965         if test "$CL_X64" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
2966             # Prefer native x64 compiler to cross-compiler, in case we are running
2967             # the build on a 64-bit OS.
2968             if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2969                 BUILD_X64=TRUE
2970                 CC_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2971                 CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2972                 LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
2973                 LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
2974             elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2975                 BUILD_X64=TRUE
2976                 CC_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
2977                 CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
2978                 LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
2979                 LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
2980             fi
2981         fi
2982         if test "$BUILD_X64" = TRUE; then
2983             AC_MSG_RESULT([found])
2984         else
2985             AC_MSG_RESULT([not found])
2986             AC_MSG_WARN([Installation set will not contain the 64-bit Explorer extension])
2987         fi
2988         AC_SUBST(BUILD_X64)
2990         # These are passed to the environment through set_soenv.in as usual, and then
2991         # used in set_wntx64.mk
2992         AC_SUBST(CC_X64_BINARY)
2993         AC_SUBST(CXX_X64_BINARY)
2994         AC_SUBST(LINK_X64_BINARY)
2995         AC_SUBST(LIBMGR_X64_BINARY)
2997     else
2998         AC_MSG_CHECKING([the compiler is MinGW])
2999         MACHINE_PREFIX=`$CC -dumpmachine`
3000         if echo $MACHINE_PREFIX | grep -q mingw32; then
3001             AC_MSG_RESULT([yes])
3002         else
3003             AC_MSG_ERROR([Compiler is not MinGW.])
3004         fi
3005     fi
3007 AC_SUBST(COMEX)
3008 AC_SUBST(MSPDB_PATH)
3009 AC_SUBST(SHOWINCLUDES_PREFIX)
3011 dnl ===================================================================
3012 dnl Check for pkg-config
3013 dnl ===================================================================
3014 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3015     PKG_PROG_PKG_CONFIG
3018 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3020     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
3021     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
3022     # explicitly. Or put /path/to/compiler in PATH yourself.
3024     AC_CHECK_TOOL(AR,ar)
3025     AC_CHECK_TOOL(NM,nm)
3026     AC_CHECK_TOOL(OBJDUMP,objdump)
3027     AC_CHECK_TOOL(RANLIB,ranlib)
3028     AC_CHECK_TOOL(STRIP,strip)
3029     if test "$_os" = "WINNT"; then
3030         AC_CHECK_TOOL(DLLTOOL,dlltool)
3031         AC_CHECK_TOOL(WINDRES,windres)
3032     fi
3034 AC_SUBST(AR)
3035 AC_SUBST(DLLTOOL)
3036 AC_SUBST(NM)
3037 AC_SUBST(OBJDUMP)
3038 AC_SUBST(PKG_CONFIG)
3039 AC_SUBST(RANLIB)
3040 AC_SUBST(STRIP)
3041 AC_SUBST(WINDRES)
3043 dnl ===================================================================
3044 dnl pkg-config checks on Mac OS X
3045 dnl ===================================================================
3047 if test $_os = Darwin; then
3048     AC_MSG_CHECKING([for bogus pkg-config])
3049     if test -n "$PKG_CONFIG"; then
3050         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | grep -q Mono.framework; then
3051             AC_MSG_RESULT([yes, from Mono])
3052         else
3053             AC_MSG_RESULT([yes, from unknown origin])
3054         fi
3055         AC_MSG_WARN([This might have unexpected consequences, please consider hiding $PKG_CONFIG])
3056         echo "Having a $PKG_CONFIG might have unexpected consequences, please consider hiding it" >>warn
3057     else
3058         AC_MSG_RESULT([no])
3059     fi
3062 dnl ===================================================================
3063 dnl  .NET needs special treatment
3064 dnl (does the above comment really mean .NET, or is it misusing
3065 dnl that to mean Visual Studio .NET 2003 ? And does this also
3066 dnl in fact apply equally to what we actually support, i.e.
3067 dnl Visual Studio 2008 and 2010?)
3068 dnl ===================================================================
3069 if test "$build_os" = "cygwin"; then
3070     dnl Check midl.exe
3071     AC_PATH_PROG(MIDL_PATH, midl.exe)
3072     if test -n "$MIDL_PATH";then
3073         MIDL_PATH=`dirname "$MIDL_PATH"`
3074     fi
3075     if test -n "$with_midl_path";then
3076         with_midl_path=`cygpath -u "$with_midl_path"`
3077     fi
3078     if test -x "$with_midl_path/midl.exe"; then
3079         MIDL_PATH="$with_midl_path"
3080     fi
3081     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
3082         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
3083     fi
3084     if test -z "$MIDL_PATH" ; then
3085         vstest=`./oowintool --msvs-productdir`;
3086         if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
3087             MIDL_PATH="$vstest/Common7/Tools/Bin"
3088         fi
3089     fi
3090     if test -z "$MIDL_PATH" ; then
3091         winsdktest=`./oowintool --windows-sdk-home`
3092         if test -x "$winsdktest/Bin/midl.exe" ; then
3093             MIDL_PATH="$winsdktest/Bin"
3094         fi
3095     fi
3096     if test ! -x "$MIDL_PATH/midl.exe"; then
3097         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
3098     fi
3099     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3100     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
3101     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
3103     dnl Check csc.exe
3104     AC_PATH_PROG(CSC_PATH, csc.exe)
3105     if test -n "$CSC_PATH";then
3106         CSC_PATH=`dirname "$CSC_PATH"`
3107     fi
3108     if test -n "$with_csc_path";then
3109         with_csc_path=`cygpath -u "$with_csc_path"`
3110     fi
3111     if test -x "$with_csc_path/csc.exe"; then
3112         CSC_PATH="$with_csc_path"
3113     else
3114        csctest=`./oowintool --csc-compilerdir`;
3115        if test -x "$csctest/csc.exe"; then
3116            CSC_PATH="$csctest"
3117        fi
3118     fi
3119     if test ! -x "$CSC_PATH/csc.exe"; then
3120         AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
3121     fi
3122     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3123     CSC_PATH=`cygpath -d "$CSC_PATH"`
3124     CSC_PATH=`cygpath -u "$CSC_PATH"`
3126     dnl Check mscoree.lib / .NET Framework dir
3127     AC_MSG_CHECKING(.NET Framework)
3128     if test -n "$with_dotnet_framework_home"; then
3129         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
3130     fi
3131     if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
3132         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
3133     fi
3134     if test -z "$DOTNET_FRAMEWORK_HOME" ; then
3135         frametest=`./oowintool --dotnetsdk-dir`
3136         if test -f "$frametest/lib/mscoree.lib"; then
3137             DOTNET_FRAMEWORK_HOME="$frametest"
3138         else
3139             frametest=`./oowintool --windows-sdk-home`
3140             if test -f "$frametest/lib/mscoree.lib"; then
3141                 DOTNET_FRAMEWORK_HOME="$frametest"
3142             fi
3143         fi
3144     fi
3145     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
3146         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
3147     fi
3148     AC_MSG_RESULT(found)
3149     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3150     DOTNET_FRAMEWORK_HOME=`cygpath -d "$DOTNET_FRAMEWORK_HOME"`
3151     DOTNET_FRAMEWORK_HOME=`cygpath -u "$DOTNET_FRAMEWORK_HOME"`
3152     AC_SUBST(MIDL_PATH)
3153     AC_SUBST(CSC_PATH)
3154     AC_SUBST(DOTNET_FRAMEWORK_HOME)
3157 dnl ===================================================================
3158 dnl Check if stdc headers are available excluding MSVC.
3159 dnl ===================================================================
3160 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3161     AC_HEADER_STDC
3164 dnl ===================================================================
3165 dnl Testing for C++ compiler and version...
3166 dnl ===================================================================
3168 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3169     AC_PROG_CXX
3170 else
3171     if test -n "$CC" -a -z "$CXX"; then
3172         CXX="$CC"
3173     fi
3176 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
3177 if test "$GXX" = "yes"; then
3178     AC_MSG_CHECKING([the GNU C++ compiler version])
3180     _gpp_version=`$CXX -dumpversion`
3181     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
3183     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401" ; then
3184         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0" ; then
3185             export CXX="$GCC_HOME/bin/g++-4.0"
3186             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
3187             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401" ; then
3188                 _gpp_majmin=$_gpp_majmin_2
3189             fi
3190         fi
3191         if test "$_gpp_majmin" -ge "401" ; then
3192             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])
3193         else
3194             AC_MSG_RESULT([implicitly using CXX=$CXX])
3195         fi
3196     else
3197         AC_MSG_RESULT([checked (g++ $_gpp_version)])
3198     fi
3200     if test "$_gpp_majmin" = "304"; then
3201         AC_MSG_CHECKING([whether $CXX has the enum bug])
3202         AC_RUN_IFELSE([AC_LANG_SOURCE([[
3203             extern "C" void abort (void);
3204             extern "C" void exit (int status);
3206             enum E { E0, E1, E2, E3, E4, E5 };
3208             void test (enum E e)
3209             {
3210                 if (e == E2 || e == E3 || e == E1)
3211                     exit (1);
3212             }
3214             int main (void)
3215             {
3216                 test (E4);
3217                 test (E5);
3218                 test (E0);
3219                 return 0;
3220             }
3221             ]])],[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])],[])
3222     fi
3226 # prefx CXX with ccache if needed
3228 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3229     if test "$CCACHE" != "" ; then
3230         AC_MSG_CHECKING([whether $CXX is already ccached])
3231         AC_LANG_PUSH([C++])
3232         save_CXXFLAGS=$CXXFLAGS
3233         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
3234         dnl an empty program will do, we're checking the compiler flags
3235         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3236                           [use_ccache=yes], [use_ccache=no])
3237         if test $use_ccache = yes ; then
3238             AC_MSG_RESULT([yes])
3239         else
3240             CXX="$CCACHE $CXX"
3241             AC_MSG_RESULT([no])
3242         fi
3243         CXXFLAGS=$save_CXXFLAGS
3244         AC_LANG_POP([C++])
3245     fi
3248 dnl ===================================================================
3249 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
3250 dnl ===================================================================
3252 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3253     AC_PROG_CXXCPP
3255     dnl Check whether there's a C pre-processor.
3256     dnl ===================================================================
3257     dnl When using SunStudio compiler, there is a bug with the cc
3258     dnl preprocessor, so use CC preprocessor as the cc preprocessor
3259     dnl See Issuezilla #445.
3260     dnl ===================================================================
3261     if test "$_os" = "SunOS"; then
3262         CPP=$CXXCPP
3263     else
3264         AC_PROG_CPP
3265     fi
3269 dnl ===================================================================
3270 dnl Find integral type sizes and alignments
3271 dnl ===================================================================
3273 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3275     AC_CHECK_SIZEOF(long)
3276     AC_CHECK_SIZEOF(short)
3277     AC_CHECK_SIZEOF(int)
3278     AC_CHECK_SIZEOF(long long)
3279     AC_CHECK_SIZEOF(double)
3280     AC_CHECK_SIZEOF(void*)
3282     SIZEOF_SHORT=$ac_cv_sizeof_short
3283     SIZEOF_INT=$ac_cv_sizeof_int
3284     SIZEOF_LONG=$ac_cv_sizeof_long
3285     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
3286     SIZEOF_DOUBLE=$ac_cv_sizeof_double
3287     SIZEOF_POINTER=$ac_cv_sizeof_voidp
3289     dnl Allow build without AC_CHECK_ALIGNOF, grrr
3290     m4_pattern_allow([AC_CHECK_ALIGNOF])
3291     m4_ifdef([AC_CHECK_ALIGNOF],
3292       ,
3293       [
3294          dnl We know that the ALIGNOF_ variables are used only when cross-compiling
3295          dnl in sal/typesconfig/makefile.mk...
3296          if test "$cross_compiling" = "yes"; then
3297             AC_MSG_ERROR([When cross-compiling you must use a recent Autoconf with [AC_][CHECK_ALIGNOF]])
3298          fi
3299          m4_define([AC_CHECK_ALIGNOF],
3300             [
3301                AC_MSG_WARN([Cannot determine alignment of $1])
3302                AS_TR_SH([ac_cv_alignof_$3])=unknown
3303             ])
3304       ])
3306     AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
3307     AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
3308     AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
3309     AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
3311     ALIGNOF_SHORT=$ac_cv_alignof_short
3312     ALIGNOF_INT=$ac_cv_alignof_int
3313     ALIGNOF_LONG=$ac_cv_alignof_long
3314     ALIGNOF_DOUBLE=$ac_cv_alignof_double
3316     AC_C_BIGENDIAN
3317     WORDS_BIGENDIAN=$ac_cv_c_bigendian
3319     dnl Check for large file support
3320     AC_SYS_LARGEFILE
3321     if test -n "$ac_cv_sys_file_offset_bits"; then
3322         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
3323     fi
3324     if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
3325         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
3326     fi
3327 else
3328     # Hardcode for MSVC
3329     SIZEOF_SHORT=2
3330     SIZEOF_INT=4
3331     SIZEOF_LONG=4
3332     SIZEOF_LONGLONG=8
3333     if test "$CL_X64" = ""; then
3334         SIZEOF_POINTER=4
3335     else
3336         SIZEOF_POINTER=8
3337     fi
3338     ALIGNOF_SHORT=2
3339     ALIGNOF_INT=4
3340     ALIGNOF_LONG=4
3341     ALIGNOF_DOUBLE=8
3342     WORDS_BIGENDIAN=no
3343     LFS_CFLAGS=''
3345 AC_SUBST(WORDS_BIGENDIAN)
3346 AC_SUBST(LFS_CFLAGS)
3348 AC_SUBST(SIZEOF_SHORT)
3349 AC_SUBST(SIZEOF_INT)
3350 AC_SUBST(SIZEOF_LONG)
3351 AC_SUBST(SIZEOF_LONGLONG)
3352 AC_SUBST(SIZEOF_DOUBLE)
3353 AC_SUBST(SIZEOF_POINTER)
3354 AC_SUBST(ALIGNOF_SHORT)
3355 AC_SUBST(ALIGNOF_INT)
3356 AC_SUBST(ALIGNOF_LONG)
3357 AC_SUBST(ALIGNOF_DOUBLE)
3359 dnl ===================================================================
3360 dnl Check if valgrind.h is available
3361 dnl ===================================================================
3362 if test "$cross_compiling" != "yes" -a "$enable_dbgutil" != "no" -a \
3363         -z "$VALGRIND_CFLAGS"; then
3364     dnl Test $prefix (currently only testing for /usr and /usr/local)
3365     dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
3366     prev_cppflags=$CPPFLAGS
3367     CPPFLAGS="-I/usr/include/valgrind"
3368     AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
3369     if test -z "$VALGRIND_CFLAGS"; then
3370         CPPFLAGS="-I/usr/local/include/valgrind"
3371         AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
3372     fi
3373     if test -n "$VALGRIND_CFLAGS"; then
3374         CPPFLAGS=$VALGRIND_CFLAGS
3375         AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
3376     fi
3377     CPPFLAGS=$prev_cppflags
3379 AC_SUBST([VALGRIND_CFLAGS])
3381 dnl ===================================================================
3382 dnl Set the gcc/gxx include directories
3383 dnl ===================================================================
3384 # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
3385 # often contains an i386 which is expanded as a macro.
3386 if test "$GXX" = "yes"; then
3387     AC_MSG_CHECKING([for g++ include path])
3388     if test -z "$with_gxx_include_path"; then
3389         with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
3390         if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
3391             with_gxx_include_path="/usr/include"
3392         fi
3393         if echo $with_gxx_include_path | grep -q linux; then
3394             # workaround for Mandriva - issue 100049
3395             with_gxx_include_path=`cd $with_gxx_include_path && pwd`
3396         fi
3397     fi
3398     dnl This is the original code...
3399     dnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
3400     if test -z "$with_gxx_include_path"; then
3401         with_gxx_include_path="NO_GXX_INCLUDE"
3402         AC_MSG_RESULT([none])
3403     else
3404         AC_MSG_RESULT([$with_gxx_include_path])
3405     fi
3406 else
3407     with_gxx_include_path="NO_GXX_INCLUDE"
3409 GXX_INCLUDE_PATH="$with_gxx_include_path"
3410 AC_SUBST(GXX_INCLUDE_PATH)
3412 dnl ===================================================================
3413 dnl Set the MinGW include directories
3414 dnl ===================================================================
3415 if test "$WITH_MINGW" = "yes"; then
3416     AC_MSG_CHECKING([for MinGW include path])
3417     cat >conftest.$ac_ext <<_ACEOF
3418 #include <stddef.h>
3419 #include <bits/c++config.h>
3420 _ACEOF
3421     _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`
3422     rm conftest.$ac_ext
3423     if test -z "$_mingw_lib_include_path"; then
3424         _mingw_lib_include_path="NO_LIB_INCLUDE"
3425         AC_MSG_RESULT([no MinGW include path])
3426     else
3427         AC_MSG_RESULT([$_mingw_lib_include_path])
3428     fi
3429     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
3430     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
3432     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
3433     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
3435     AC_LANG_PUSH([C++])
3437     AC_MSG_CHECKING([for dynamic libgcc])
3438     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3439 #include <iostream>
3440 using namespace std;
3441 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[   
3442             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
3443             if test -n "$MINGW_GCCDLL"; then
3444                 MINGW_SHARED_GCCLIB=YES
3445                 AC_MSG_RESULT([ $MINGW_GCCDLL])
3446             else
3447                 MINGW_SHARED_GCCLIB=NO
3448                 AC_MSG_RESULT([no])
3449             fi
3450        ],[ AC_MSG_RESULT([no])
3451        
3452     ])
3454     AC_MSG_CHECKING([for dynamic libstdc++])
3455     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3456 #include <iostream>
3457 using namespace std;
3458 ]], [[ cout << "Hello there." << endl; ]])],[   
3459             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
3460             if test -n "$MINGW_GXXDLL"; then
3461                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
3462                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
3463                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
3464                 MINGW_SHARED_GXXLIB=YES
3465                 AC_MSG_RESULT([$MINGW_GXXDLL])
3466             else
3467                 MINGW_SHARED_GXXLIB=NO
3468                 AC_MSG_RESULT([no])
3469             fi
3470        ],[ AC_MSG_RESULT([no])
3471        
3472     ])
3474     AC_LANG_POP([C++])
3476     AC_SUBST(MINGW_CLIB_DIR)
3477     AC_SUBST(MINGW_SHARED_GCCLIB)
3478     AC_SUBST(MINGW_SHARED_GXXLIB)
3479     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
3480     AC_SUBST(MINGW_GCCDLL)
3481     AC_SUBST(MINGW_GXXDLL)
3484 dnl ===================================================================
3485 dnl Extra checking for the SunOS compiler
3486 dnl ===================================================================
3487 if test "$_os" = "SunOS"; then
3488     dnl SunStudio C++ compiler packaged with SunStudio C compiler
3489     if test "$CC" = "cc"; then
3490     AC_MSG_CHECKING([SunStudio C++ Compiler])
3491         if test "$CXX" != "CC"; then
3492             AC_MSG_WARN([SunStudio C++ was not found])
3493             echo "SunStudio C++ was not found" >> warn
3494         else
3495             AC_MSG_RESULT([checked])
3496         fi
3497     fi
3500 dnl *************************************************************
3501 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
3502 dnl *************************************************************
3503 if test "$WITH_MINGW" = "yes"; then
3504     AC_MSG_CHECKING([exception type])
3505     AC_LANG_PUSH([C++])
3506     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
3508         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
3510         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
3511     ])
3512     AC_MSG_RESULT($exceptions_type)
3513     AC_LANG_POP([C++])
3516 EXCEPTIONS="$exceptions_type"
3517 AC_SUBST(EXCEPTIONS)
3519 dnl ===================================================================
3520 dnl Checks for what the default STL should be
3521 dnl ===================================================================
3522 AC_MSG_CHECKING([Whether building STLPort library makes sense])
3523 BUILD_STLPORT="no"
3524 if test "$_os" = "Linux"; then
3525     case "$host_cpu" in
3526     i?86)
3527         case "$host_os" in
3528         k*bsd*-gnu*)
3529             BUILD_STLPORT="no"
3530             ;;
3531         *)
3532             BUILD_STLPORT="yes"
3533             ;;
3534         esac
3535         ;;
3536     *)
3537         BUILD_STLPORT="no"
3538         ;;
3539     esac
3540 elif test "$_os" = "SunOS"; then
3541     BUILD_STLPORT="yes"
3542 elif test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
3543     BUILD_STLPORT="yes"
3544 elif test "$_os" = "FreeBSD"; then
3545     BUILD_STLPORT="yes"
3547 if test "$BUILD_STLPORT" = "yes" ; then
3548     AC_MSG_RESULT([yes])
3549 else
3550     AC_MSG_RESULT([no])
3553 AC_MSG_CHECKING([Whether STLPort library will be actually built])
3554 if test "$with_stlport" = "auto" -o "$BUILD_STLPORT" = "no"; then
3555     with_stlport=$BUILD_STLPORT
3557 if test "$with_stlport" = "yes" ; then
3558     AC_MSG_RESULT([yes])
3559     WITH_STLPORT=YES
3560     SCPDEFS="$SCPDEFS -DWITH_STLPORT"
3561     BUILD_TYPE="$BUILD_TYPE STLPORT"
3562 else
3563     WITH_STLPORT=NO
3564     AC_MSG_RESULT([no])
3567 AC_SUBST(WITH_STLPORT)
3569 dnl ===================================================================
3570 dnl thread-safe statics
3571 dnl ===================================================================
3572 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
3573 unset HAVE_THREADSAFE_STATICS
3574 if test "$GCC" = "yes"; then
3575     save_CXXFLAGS=$CXXFLAGS
3576     CXXFLAGS="$CXXFLAGS -fthreadsafe-statics"
3577     AC_LANG_PUSH([C++])
3578     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],[HAVE_THREADSAFE_STATICS=TRUE],[])
3579     AC_LANG_POP([C++])
3580     CXXFLAGS=$save_CXXFLAGS
3581     if test "$HAVE_THREADSAFE_STATICS" = "TRUE"; then
3582         dnl Some C++ runtimes use a single lock for all static variables, which
3583         dnl can cause deadlock in multi-threaded applications.  This is not
3584         dnl easily tested here; for POSIX-based systems, if executing the
3585         dnl following C++ program does not terminate then the tool chain
3586         dnl apparently has this problem:
3587         dnl
3588         dnl   #include <pthread.h>
3589         dnl   int h() { return 0; }
3590         dnl   void * g(void * unused) {
3591         dnl     static int n = h();
3592         dnl     return &n;
3593         dnl   }
3594         dnl   int f() {
3595         dnl     pthread_t t;
3596         dnl     pthread_create(&t, 0, g, 0);
3597         dnl     pthread_join(t, 0);
3598         dnl     return 0;
3599         dnl   }
3600         dnl   int main() {
3601         dnl     static int n = f();
3602         dnl     return n;
3603         dnl   }
3604         dnl
3605         dnl Mac OS X up to at least 10.7.1 is known to have this problem:
3606         if test "$_os" = "Darwin"; then
3607             unset HAVE_THREADSAFE_STATICS
3608             AC_MSG_RESULT([broken (i.e., no)])
3609         else
3610             AC_MSG_RESULT([yes])
3611         fi
3612     else
3613         AC_MSG_RESULT([no])
3614     fi
3615 else
3616     AC_MSG_RESULT([unknown (assuming no)])
3618 AC_SUBST(HAVE_THREADSAFE_STATICS)
3620 dnl ===================================================================
3621 dnl visibility and c++0x features
3622 dnl ===================================================================
3623 if test "$GCC" = "yes"; then
3624     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
3625     save_CFLAGS=$CFLAGS
3626     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
3627     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
3628     CFLAGS=$save_CFLAGS
3629     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3630         AC_MSG_RESULT([yes])
3631     else
3632         AC_MSG_RESULT([no])
3633     fi
3635     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
3636     save_CFLAGS=$CFLAGS
3637     CFLAGS="$CFLAGS -Werror -Wno-long-double"
3638     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
3639     CFLAGS=$save_CFLAGS
3640     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
3641         AC_MSG_RESULT([yes])
3642     else
3643         AC_MSG_RESULT([no])
3644     fi
3646     AC_MSG_CHECKING([whether $CC supports -mno-avx])
3647     save_CFLAGS=$CFLAGS
3648     CFLAGS="$CFLAGS -Werror -mno-avx"
3649     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
3650     CFLAGS=$save_CFLAGS
3651     if test "$HAVE_GCC_AVX" = "TRUE"; then
3652         AC_MSG_RESULT([yes])
3653     else
3654         AC_MSG_RESULT([no])
3655     fi
3657     AC_MSG_CHECKING([whether $CC supports -std=c++0x without Language Defect 757])
3658     save_CXXFLAGS=$CXXFLAGS
3659     CXXFLAGS="$CXXFLAGS -std=c++0x"
3660     AC_LANG_PUSH([C++])
3662     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3663 #include <stddef.h>
3665 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
3667 namespace
3669         struct b
3670         {
3671                 int i;
3672                 int j;
3673         };
3675 ]], [[
3676 struct a
3678         int i;
3679         int j;
3681 a thinga[]={{0,0}, {1,1}};
3682 b thingb[]={{0,0}, {1,1}};
3683 size_t i = sizeof(sal_n_array_size(thinga));
3684 size_t j = sizeof(sal_n_array_size(thingb));
3685 return !(i != 0 && j != 0);
3686 ]])],[HAVE_CXX0X=TRUE],[])
3688     AC_LANG_POP([C++])
3689     CXXFLAGS=$save_CXXFLAGS
3690     if test "$HAVE_CXX0X" = "TRUE"; then
3691         AC_MSG_RESULT([yes])
3692     else
3693         AC_MSG_RESULT([no])
3694     fi
3697 AC_SUBST(HAVE_CXX0X)
3698 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
3699 AC_SUBST(HAVE_GCC_AVX)
3701 dnl ===================================================================
3702 dnl system stl sanity tests
3703 dnl ===================================================================
3704 HAVE_GCC_VISIBILITY_BROKEN=
3705 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) ; then
3707     AC_LANG_PUSH([C++])
3709     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3710         AC_MSG_CHECKING([if STL headers are visibility safe])
3711         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
3712         AC_MSG_RESULT([$stlvisok])
3713         if test "$stlvisok" = "no"; then
3714             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
3715             echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
3716             unset HAVE_GCC_VISIBILITY_FEATURE
3717         fi
3718     fi
3720     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3721         sharedlink_ldflags_save=$LDFLAGS
3722         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
3724         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
3725         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3726 #include <sstream>
3727 using namespace std;
3728             ]], [[
3729 istringstream strm( "test" ); return 0;
3730             ]])],[$EGREP -q  unresolvable conftest.err;
3731             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
3732         ])
3733         AC_MSG_RESULT([$gccvisok])
3734         if test "$gccvisok" = "no"; then
3735             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
3736             echo "Your gcc is not -fvisibility-inlines-hidden safe, disabling that." >> warn
3737             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
3738         fi
3740         LDFLAGS=$sharedlink_ldflags_save
3741     fi
3743     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3744         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
3745         cat >visibility.cxx <<_ACEOF
3746 #pragma GCC visibility push(hidden)
3747 struct __attribute__ ((visibility ("default"))) TestStruct {
3748   static void Init();
3750 __attribute__ ((visibility ("default"))) void TestFunc() {
3751   TestStruct::Init();
3753 _ACEOF
3754         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
3755             gccvisbroken=yes
3756         else
3757             case "$host_cpu" in
3758             i?86|x86_64)
3759                 if test "$_os" = "Darwin"; then
3760                     gccvisbroken=no
3761                 else
3762                     if $EGREP -q '@PLT' visibility.s; then
3763                         gccvisbroken=no
3764                     else
3765                         gccvisbroken=yes
3766                     fi
3767                 fi
3768                 ;;
3769             *)
3770                 gccvisbroken=no
3771                 ;;
3772             esac
3773         fi
3774         rm -f visibility.s visibility.cxx
3776         AC_MSG_RESULT([$gccvisbroken])
3777         if test "$gccvisbroken" = "yes"; then
3778             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
3779             echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
3780             unset HAVE_GCC_VISIBILITY_FEATURE
3781         fi
3782     fi
3784     AC_LANG_POP([C++])
3787 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
3788 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
3790 dnl ===================================================================
3791 dnl allocator
3792 dnl ===================================================================
3793 AC_MSG_CHECKING([which memory allocator to use])
3794 if test "$with_alloc" = "system"; then
3795     AC_MSG_RESULT([system])
3796     ALLOC="SYS_ALLOC";
3797     AC_CHECK_FUNCS([malloc realloc calloc free])
3799 if test "$with_alloc" = "tcmalloc"; then
3800     AC_MSG_RESULT(tcmalloc)
3801     if ! echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
3802         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
3803     fi
3804     AC_CHECK_LIB(tcmalloc, malloc, [],
3805         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
3806     ALLOC="TCMALLOC";
3808 if test "$with_alloc" = "jemalloc"; then
3809     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
3810         AC_MSG_RESULT(jemalloc)
3811         save_CFLAGS=$CFLAGS
3812         CFLAGS="$CFLAGS -pthread"
3813         AC_CHECK_LIB(jemalloc, malloc, [],
3814             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
3815         ALLOC="JEMALLOC";
3816         CFLAGS=$save_CFLAGS
3817     else
3818         AC_MSG_RESULT([system])
3819         ALLOC="SYS_ALLOC";
3820         AC_CHECK_FUNCS([malloc realloc calloc free])
3821     fi
3823 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
3824     AC_MSG_RESULT([internal])
3826 AC_SUBST(ALLOC)
3828 dnl ===================================================================
3829 dnl Custom build version
3830 dnl ===================================================================
3832 AC_MSG_CHECKING([whether to add custom build version])
3833 if test "z$with_build_version" != "z"; then
3834     BUILD_VER_STRING=$with_build_version
3835     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
3836 else
3837     BUILD_VER_STRING=
3838     AC_MSG_RESULT([no])
3840 AC_SUBST(BUILD_VER_STRING)
3842 dnl ===================================================================
3843 dnl Java support enable
3844 dnl ===================================================================
3845 AC_MSG_CHECKING([whether to build with Java support])
3846 if test "$with_java" != "no"; then
3847     AC_MSG_RESULT([yes])
3848     SOLAR_JAVA="TRUE"
3849 else
3850     AC_MSG_RESULT([no])
3851     SOLAR_JAVA=""
3854 AC_SUBST(SOLAR_JAVA)
3856 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
3857 dnl want there to be *run-time* (and build-time) support for Java extensions in the
3858 dnl built LibreOffice.
3859 dnl SOLAR_JAVA="BUILD" indicate build-time only support (no runtime support)
3860 dnl SOLAR_JAVA="" indicate no java support at all
3862 if test "$_os" = "Linux" && test "$host_cpu" = "powerpc"; then
3863     # IBMs JDK needs this...
3864     JITC_PROCESSOR_TYPE=6
3865     export JITC_PROCESSOR_TYPE
3867 AC_SUBST([JITC_PROCESSOR_TYPE])
3869 if test $_os = "WINNT"; then
3870     WITH_VC_REDIST="TRUE"
3872 AC_SUBST(WITH_VC_REDIST)
3874 dnl ===================================================================
3875 dnl Checks for Java
3876 dnl ===================================================================
3877 if test "$SOLAR_JAVA" != ""; then
3879     # Windows-specific tests
3880     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3881         if test "$CL_X64" != ""; then
3882             bitness="64-bit"
3883             otherbitness="32-bit"
3884         else
3885             bitness="32-bit"
3886             otherbitness="64-bit"
3887         fi
3889         if test -z "$with_jdk_home"; then
3891             # Unfortunately apparently no way to find, if needed, the 64-bit
3892             # JDK in the Registry from the 32-bit Perl oowintool
3894             _jdk_home=`./oowintool --jdk-home`
3895             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
3896                 with_jdk_home="$_jdk_home"
3897                 howfound="found by oowintool"
3898             else
3899                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
3900             fi
3901         else
3902             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
3903             howfound="you passed"
3904         fi
3905     fi
3907     JAVA_HOME=; export JAVA_HOME
3908     if test -z "$with_jdk_home"; then
3909         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
3910     else
3911         _java_path="$with_jdk_home/bin/$with_java"
3912         dnl Check if there is a Java interpreter at all.
3913         if test -x "$_java_path"; then
3914             JAVAINTERPRETER=$_java_path
3915         else
3916             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
3917         fi
3918     fi
3920     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3921         # Check that the JDK found is correct architecture
3922         # Why is this necessary, we don't link with any library from the JDK I think,
3924         shortjdkhome=`cygpath -d "$with_jdk_home"`
3925         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
3926             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
3927             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
3928         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
3929             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
3930             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
3931         fi
3933         if test x`echo "$JAVAINTERPRETER" | grep -i '\.exe$'` = x; then
3934             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
3935         fi
3936         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
3937         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
3938     elif test "$_os" = "Darwin"; then
3939         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
3940         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
3941         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
3942         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
3943         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
3944             AC_MSG_RESULT([yes])
3945             JAVAIFLAGS=-d32
3946         else
3947             AC_MSG_RESULT([no])
3948         fi
3949     fi
3952 dnl ===================================================================
3953 dnl Checks for JDK.
3954 dnl ===================================================================
3955 if test "$SOLAR_JAVA" != ""; then
3956     _gij_longver=0
3957     AC_MSG_CHECKING([the installed JDK])
3958     if test -n "$JAVAINTERPRETER"; then
3959         dnl java -version sends output to stderr!
3960         if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
3961             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3962         elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then
3963             JDK=gcj
3964             AC_MSG_RESULT([checked (gcj)])
3965             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
3966             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3968         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "BEA"` -gt 0; then
3969             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3970         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "IBM"` -gt 0; then
3971             JDK=ibm
3973             dnl IBM JDK specific tests
3974             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3975             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3977             if test "$_jdk_ver" -lt 10500; then
3978                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
3979             fi
3981             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
3983             if test "$with_jdk_home" = ""; then
3984                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
3985 you must use the "--with-jdk-home" configure option explicitly])
3986             fi
3988            JAVA_HOME=$with_jdk_home
3990         else
3991             JDK=sun
3993             dnl Sun JDK specific tests
3994             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3995             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3997             if test "$_jdk_ver" -lt 10500; then
3998                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
3999             fi
4000             AC_MSG_RESULT([checked (JDK $_jdk)])
4001             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
4002             if test "$_os" = "WINNT"; then
4003                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
4004             fi
4005         fi
4006     else
4007         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
4008     fi
4009 else
4010     dnl Java disabled
4011     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
4014 _java_target_ver="1.5"
4015 dnl ===================================================================
4016 dnl Check for target Java bytecode version
4017 dnl ===================================================================
4018 if test "$SOLAR_JAVA" != ""; then
4019     AC_MSG_CHECKING([for target Java bytecode version])
4020     if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
4021     AC_MSG_RESULT([default by $JDK])
4022     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
4023         AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
4024     fi
4025     else
4026     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
4027         _java_target_ver="$with_java_target_version"
4028         AC_MSG_RESULT([$_java_target_ver])
4029     elif test $_jdk_ver -gt 10000 ; then
4030         _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
4031         AC_MSG_RESULT([$_java_target_ver])
4032     else
4033         AC_MSG_ERROR([Unable to guess Java bytecode version from Java version!])
4034     fi
4035     fi
4037     if ! test -z "$_java_target_ver" -o \
4038         "$_java_target_ver" = "1.1" -o \
4039             "$_java_target_ver" = "1.2" -o \
4040         "$_java_target_ver" = "1.3" -o \
4041         "$_java_target_ver" = "1.4" -o \
4042         "$_java_target_ver" = "1.5" -o \
4043         "$_java_target_ver" = "1.6" -o \
4044         "$_java_target_ver" = "5" ; then
4045         AC_MSG_ERROR([$_java_target_ver is not a supported Java bytecode version!])
4046     fi
4048     JAVA_SOURCE_VER="$_java_target_ver"
4049     JAVA_TARGET_VER="$_java_target_ver"
4052 dnl ===================================================================
4053 dnl Checks for javac
4054 dnl ===================================================================
4055 if test "$SOLAR_JAVA" != ""; then
4056     if test "$JDK" = "gcj"; then
4057         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
4058     else
4059         javacompiler="javac"
4060     fi
4061     if test -z "$with_jdk_home"; then
4062         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
4063     else
4064         _javac_path="$with_jdk_home/bin/$javacompiler"
4065         dnl Check if there is a Java compiler at all.
4066         if test -x "$_javac_path"; then
4067             JAVACOMPILER=$_javac_path
4068         fi
4069     fi
4070     if test -z "$JAVACOMPILER"; then
4071         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
4072     fi
4073     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4074         if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then
4075             JAVACOMPILER="${JAVACOMPILER}.exe"
4076         fi
4077         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
4078         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
4079     fi
4081     if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then
4082         AC_MSG_CHECKING([re-checking JDK])
4083         JDK=gcj
4084         AC_MSG_RESULT([checked (ecj)])
4085         #TODO: what's to do here? some switch to do 1.5 compiling?
4086         JAVAFLAGS="-source 1.5 -target 1.5"
4087         _gij_longver="40200"
4088     fi
4091 JAVACISGCJ=""
4092 dnl ===================================================================
4093 dnl Checks that javac is gcj
4094 dnl ===================================================================
4095 if test "$SOLAR_JAVA" != ""; then
4096     if test `$JAVACOMPILER --version 2>&1 | grep -c "GCC"` -gt 0; then
4097         JAVACISGCJ="yes"
4098     fi
4100 AC_SUBST(JAVACISGCJ)
4102 JAVACISKAFFE=""
4103 dnl ===================================================================
4104 dnl Checks that javac is kaffe
4105 dnl ===================================================================
4106 if test "$SOLAR_JAVA" != ""; then
4107     if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
4108         JAVACISKAFFE="yes"
4109     fi
4111 AC_SUBST(JAVACISKAFFE)
4113 dnl ===================================================================
4114 dnl Checks for javadoc
4115 dnl ===================================================================
4116 if test "$SOLAR_JAVA" != ""; then
4117     if test -z "$with_jdk_home"; then
4118         AC_PATH_PROG(JAVADOC, javadoc)
4119     else
4120         _javadoc_path="$with_jdk_home/bin/javadoc"
4121         dnl Check if there is a javadoc at all.
4122         if test -x "$_javadoc_path"; then
4123             JAVADOC=$_javadoc_path
4124         else
4125             AC_PATH_PROG(JAVADOC, javadoc)
4126         fi
4127     fi
4128     if test -z "$JAVADOC"; then
4129         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
4130     fi
4131     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4132         if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then
4133             JAVADOC="${JAVADOC}.exe"
4134         fi
4135         JAVADOC=`cygpath -d "$JAVADOC"`
4136         JAVADOC=`cygpath -u "$JAVADOC"`
4137     fi
4140 if test "$SOLAR_JAVA" != ""; then
4141     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
4142     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
4143         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
4144            # try to recover first by looking whether we have a alternatives
4145            # system as in Debian or newer SuSEs where following /usr/bin/javac
4146            # over /etc/alternatives/javac leads to the right bindir where we
4147            # just need to strip a bit away to get a valid JAVA_HOME
4148            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
4149         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
4150             # maybe only one level of symlink (e.g. on Mac)
4151             JAVA_HOME=$(readlink $JAVACOMPILER)
4152             if test "$(dirname $JAVA_HOME)" = "."; then
4153                 # we've got no path to trim back
4154                 JAVA_HOME=""
4155             fi
4156         else
4157             # else warn
4158             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
4159             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
4160             echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
4161             echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
4162         fi
4163         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
4164         if test "$JAVA_HOME" != "/usr"; then
4165             if test "$_os" = "Darwin"; then
4166                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
4167                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
4168                 dnl Tiger already returns a JDK path..
4169                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
4170             else
4171                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
4172             fi
4173         fi
4174     fi
4175     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
4177     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
4178     if test -z "$JAVA_HOME"; then
4179         if test "x$with_jdk_home" = "x"; then
4180             cat > findhome.java <<_ACEOF
4181 [import java.io.File;
4183 class findhome
4185     public static void main(String args[])
4186     {
4187         String jrelocation = System.getProperty("java.home");
4188         File jre = new File(jrelocation);
4189         System.out.println(jre.getParent());
4190     }
4192 _ACEOF
4193             AC_MSG_CHECKING([if javac works])
4194             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
4195             AC_TRY_EVAL(javac_cmd)
4196             if test $? = 0 && test -f ./findhome.class ; then
4197                 AC_MSG_RESULT([javac works])
4198             else
4199                 echo "configure: javac test failed" >&5
4200                 cat findhome.java >&5
4201                 AC_MSG_ERROR([javac does not work - java projects will not build!])
4202             fi
4203             AC_MSG_CHECKING([if gij knows its java.home])
4204             JAVA_HOME=`$JAVAINTERPRETER findhome`
4205             if test $? = 0 && test "$JAVA_HOME" != "" ; then
4206                 AC_MSG_RESULT([$JAVA_HOME])
4207             else
4208                 echo "configure: java test failed" >&5
4209                 cat findhome.java >&5
4210                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
4211             fi
4212             # clean-up after ourselves
4213             rm -f ./findhome.java ./findhome.class
4214         else
4215             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
4216         fi
4217     fi
4219     dnl second sanity check JAVA_HOME if possible
4220     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
4221         # now check if $JAVA_HOME is really valid
4222         if test "$_os" = "Darwin"; then
4223             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
4224                 JAVA_HOME_OK="NO"
4225             fi
4226         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
4227             JAVA_HOME_OK="NO"
4228         fi
4229         if test "$JAVA_HOME_OK" = "NO"; then
4230             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
4231             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
4232             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
4233             echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
4234             echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
4235             echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
4236         fi
4237     fi
4240 AWTLIB=
4242 if test "$SOLAR_JAVA" != ""; then
4243     AC_MSG_CHECKING([for jawt lib name])
4244     if test "$JDK" = "gcj"; then
4245         save_CFLAGS=$CFLAGS
4246         save_LDFLAGS=$LDFLAGS
4247         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4248         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
4249         exec 6>/dev/null # no output
4250         AC_CHECK_HEADER(jni.h, [],
4251                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
4252         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
4253         exec 6>&1 # output on again
4254         CFLAGS=$save_CFLAGS
4255         LDFLAGS=$save_LDFLAGS
4256     fi
4257     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
4258     # A workaround is to link also against libpmawt.so
4259     if test "$JDK" = "ibm" ; then
4260         save_CFLAGS=$CFLAGS
4261         save_LDFLAGS=$LDFLAGS
4262         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
4263         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4264         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
4265         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
4266         export LD_LIBRARY_PATH
4267         exec 6>/dev/null # no output
4268         AC_CHECK_HEADER(jni.h, [],
4269                     [AC_MSG_ERROR([jni.h could not be found.])], [])
4270         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
4271         if test -z "$AWTLIB"; then
4272             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
4273             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
4274         fi
4275         exec 6>&1 # output on again
4276         CFLAGS=$save_CFLAGS
4277         LDFLAGS=$save_LDFLAGS
4278         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
4279     fi
4280     if test -z "$AWTLIB"; then
4281         AWTLIB=-ljawt
4282     fi
4283     AC_MSG_RESULT([$AWTLIB])
4284     AC_SUBST(AWTLIB)
4287 AC_SUBST(JAVA_HOME)
4288 AC_SUBST(JDK)
4289 AC_SUBST(JAVAFLAGS)
4290 AC_SUBST(JAVA_SOURCE_VER)
4291 AC_SUBST(JAVA_TARGET_VER)
4292 AC_SUBST(JAVAINTERPRETER)
4293 AC_SUBST(JAVAIFLAGS)
4294 AC_SUBST(JAVACOMPILER)
4295 AC_SUBST(JAVADOC)
4297 dnl ===================================================================
4298 dnl Checks for specific files.
4299 dnl ===================================================================
4301 dnl ===================================================================
4302 dnl Checks for programs.
4303 dnl ===================================================================
4305 dnl ===================================================================
4306 dnl Check whether we already have dmake
4307 dnl ===================================================================
4308 AC_PATH_PROG(DMAKE, dmake, no)
4309 if test "$DMAKE" = "no"; then
4310     BUILD_DMAKE=YES
4311     echo "dmake will be built on ./bootstrap"
4312 else
4313     AC_MSG_CHECKING([whether the found dmake is the right dmake])
4314     # we need to find out whether that dmake we found is "our" dmake
4315     # or the dmake from Sun's SunStudio Compiler which is something
4316     # different
4317     # This test _should_ work because the one accepts -V (ours) and one
4318     # (the other) not...
4319     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
4320     if test $? -eq 0; then
4321         BUILD_DMAKE=NO
4322         AC_MSG_RESULT([yes])
4323         AC_MSG_CHECKING([the dmake version])
4324         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
4325         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
4326             AC_MSG_RESULT([OK, >= 4.11])
4327         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
4328             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
4329             AC_MSG_RESULT([OK, >= 4.11])
4330         else
4331             AC_MSG_RESULT([too old. >= 4.11 is needed])
4332             echo "A newer dmake will be built on ./bootstrap"
4333             BUILD_DMAKE=YES
4334         fi
4335     else
4336         AC_MSG_RESULT([no])
4337         echo "dmake will be built on ./bootstrap"
4338         BUILD_DMAKE=YES
4339     fi
4341 AC_SUBST(BUILD_DMAKE)
4343 AC_MSG_CHECKING([whether to enable EPM for packing])
4344 BUILD_EPM=NO
4345 if test "$enable_epm" = "yes"; then
4346     AC_MSG_RESULT([yes])
4347     dnl ===================================================================
4348     dnl Check for epm - not needed for Windows
4349     dnl ===================================================================
4350     if test "$_os" != "WINNT"; then
4351         if test -n "$with_epm"; then
4352             EPM=$with_epm
4353         else
4354             AC_PATH_PROG(EPM, epm, no)
4355         fi
4356         if test "$EPM" = "no" || test "$EPM" = "internal"; then
4357             echo "EPM will be built."
4358             BUILD_EPM=YES
4359             BUILD_TYPE="$BUILD_TYPE EPM"
4360         else
4361             # Gentoo has some epm which is something different...
4362             AC_MSG_CHECKING([whether the found epm is the right epm])
4363             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
4364                 AC_MSG_RESULT([yes])
4365             else
4366                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
4367             fi
4368             AC_MSG_CHECKING([epm version])
4369             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
4370             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
4371                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
4372                 AC_MSG_RESULT([OK, >= 3.7])
4373                 BUILD_EPM=NO
4374                 if test "$_os" = "Darwin"; then
4375                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
4376                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
4377                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4378                         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)])
4379                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4380                         AC_MSG_RESULT([$_pm, ok])
4381                     else # we never should get here, but go safe
4382                         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)])
4383                     fi
4384                 fi
4385             else
4386                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
4387                 echo "EPM will be built."
4388                 BUILD_EPM=YES
4389                 BUILD_TYPE="$BUILD_TYPE EPM"
4390             fi
4391         fi
4392     fi
4394     # test which package format to use
4395     AC_MSG_CHECKING([which package format to use])
4397     # defaults
4398     case "$_os" in
4399     Darwin)
4400         PKGFORMAT=dmg
4401         ;;
4402     SunOS)
4403         PKGFORMAT=pkg
4404         ;;
4405     Linux)
4406         # if building on Debian, default should be deb...
4407         if test -e /etc/debian_version; then
4408             PKGFORMAT=deb
4409         else
4410             PKGFORMAT=rpm
4411         fi
4412         ;;
4413     AIX)
4414         PKGFORMAT=rpm
4415         ;;
4416     OpenBSD|DragonFly)
4417         PKGFORMAT=portable
4418         ;;
4419     *BSD)
4420         PKGFORMAT=bsd
4421         ;;
4422     WINNT)
4423         PKGFORMAT=msi
4424         ;;
4425     # we never should get here since we check the arciecture/os at the beginning,
4426     # but go sure...
4427     *)
4428         AC_MSG_ERROR([unknown system])
4429     esac
4430     if test -n "$with_package_format"; then
4431         for i in $with_package_format; do
4432             case "$i" in
4433             aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
4434                 ;;
4435             *)
4436                 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4437 aix - AIX software distribution
4438 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4439 deb - Debian software distribution
4440 inst or tardist - IRIX software distribution
4441 osx - MacOS X software distribution
4442 pkg - Solaris software distribution
4443 rpm - RedHat software distribution
4444 setld - Tru64 (setld) software distribution
4445 native - "Native" software distribution for the platform
4446 portable - Portable software distribution
4447 LibreOffice additionally supports:
4448 archive - .tar.gz or .zip
4449 dmg - Mac OS X .dmg
4450 installed - installation tree
4451 msi - Windows .msi
4452             ])
4453                 ;;
4454             esac
4455         done
4456         PKGFORMAT="$with_package_format"
4457     fi
4458     AC_MSG_RESULT([$PKGFORMAT])
4459     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
4460         AC_MSG_CHECKING([for rpm])
4461         for a in "$RPM" rpmbuild rpm; do
4462             $a --usage >/dev/null 2> /dev/null
4463             if test $? -eq 0; then
4464                 RPM=$a
4465                 break
4466             else
4467                 $a --version >/dev/null 2> /dev/null
4468                 if test $? -eq 0; then
4469                     RPM=$a
4470                     break
4471                 fi
4472             fi
4473         done
4474         if test -z "$RPM" ; then
4475             AC_MSG_ERROR([not found])
4476         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
4477             RPM_PATH=`which $RPM`
4478             AC_MSG_RESULT([$RPM_PATH])
4479         else
4480             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
4481         fi
4482     fi
4483     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
4484         AC_PATH_PROG(DPKG, dpkg, no)
4485         if test "$DPKG" = "no"; then
4486             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
4487         fi
4488     fi
4489     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
4490         if test "$_os" = "Darwin"; then
4491             AC_MSG_CHECKING([for PackageMaker availability])
4492             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
4493                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
4494             else
4495                 AC_MSG_RESULT([ok])
4496             fi
4497         else
4498             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
4499         fi
4500     fi
4501     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
4502        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4503         if test "$EPM" != "no" && test "$EPM" != "internal"; then
4504             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
4505                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
4506                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
4507                     AC_MSG_RESULT([yes])
4508                 else
4509                     AC_MSG_RESULT([no])
4510                     if echo "$PKGFORMAT" | grep -q rpm; then
4511                         _pt="rpm"
4512                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
4513                         echo "the rpms will need to be installed with --nodeps" >> warn
4514                     else
4515                         _pt="pkg"
4516                     fi
4517                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
4518                     echo "the ${_pt}s will not be relocateable" >> warn
4519                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
4520                                  relocation will work, you need to patch your epm with the
4521                                  patch in epm/epm-3.7.patch or build with
4522                                  --with-epm=internal which will build a suitable epm])
4523                 fi
4524             fi
4525         fi
4526     fi
4527     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4528         AC_PATH_PROG(PKGMK, pkgmk, no)
4529         if test "$PKGMK" = "no"; then
4530             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
4531         fi
4532     fi
4533     AC_SUBST(RPM)
4534     AC_SUBST(DPKG)
4535     AC_SUBST(PKGMK)
4536 else
4537     AC_MSG_RESULT([no])
4538     EPM=NO
4539     PKGFORMAT=native
4541 AC_SUBST(EPM)
4542 AC_SUBST(BUILD_EPM)
4543 AC_SUBST(PKGFORMAT)
4545 dnl ===================================================================
4546 dnl Check for gperf
4547 dnl ===================================================================
4548 AC_PATH_PROG(GPERF, gperf)
4549 if test -z "$GPERF"; then
4550     AC_MSG_ERROR([gperf not found but needed. Install it.])
4552 AC_MSG_CHECKING([gperf version])
4553 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
4554     AC_MSG_RESULT([OK])
4555 else
4556     AC_MSG_ERROR([too old, you need at least 3.0.0])
4558 AC_SUBST(GPERF)
4560 dnl ===================================================================
4561 dnl Check for building ODK
4562 dnl ===================================================================
4563 AC_MSG_CHECKING([whether to build the ODK])
4564 if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
4565     AC_MSG_RESULT([yes])
4567     if test "$with_java" != "no"; then
4568         AC_MSG_CHECKING([whether to build unowinreg.dll])
4569         if test "$_os" = "WINNT" -a "z$enable_build_unowinreg" = "z" ; then
4570             # build on Win by default
4571             enable_build_unowinreg=yes
4572         fi
4573         if test "z$enable_build_unowinreg" = "z" -o "$enable_build_unowinreg" = "no"; then
4574             AC_MSG_RESULT([no])
4575             BUILD_UNOWINREG=NO
4576         else
4577             AC_MSG_RESULT([yes])
4578             BUILD_UNOWINREG=YES
4579         fi
4580         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
4581             if test -z "$with_mingw_cross_compiler"; then
4582                 dnl Guess...
4583                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
4584             elif test -x "$with_mingw_cross_compiler"; then
4585                  MINGWCXX="$with_mingw_cross_compiler"
4586             else
4587                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
4588             fi
4590             if test "$MINGWCXX" = "false"; then
4591                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
4592             fi
4594             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
4595             if test -x "$mingwstrip_test"; then
4596                 MINGWSTRIP="$mingwstrip_test"
4597             else
4598                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
4599             fi
4601             if test "$MINGWSTRIP" = "false"; then
4602                 AC_MSG_ERROR(MinGW32 binutils not found.)
4603             fi
4604         fi
4605     fi
4606     BUILD_TYPE="$BUILD_TYPE ODK"
4607 else
4608     AC_MSG_RESULT([no])
4609     BUILD_UNOWINREG=NO
4611 AC_SUBST(BUILD_UNOWINREG)
4612 AC_SUBST(MINGWCXX)
4613 AC_SUBST(MINGWSTRIP)
4615 dnl ===================================================================
4616 dnl Check for system stdlibs
4617 dnl ===================================================================
4618 AC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
4619 if test "$with_system_stdlibs" = "yes"; then
4620     AC_MSG_RESULT([no])
4621     SYSTEM_STDLIBS=YES
4622 else
4623     AC_MSG_RESULT([yes])
4624     SYSTEM_STDLIBS=NO
4626 AC_SUBST(SYSTEM_STDLIBS)
4628 dnl ===================================================================
4629 dnl Check for system zlib
4630 dnl ===================================================================
4631 AC_MSG_CHECKING([which zlib to use])
4632 if test "$with_system_zlib" = "yes"; then
4633     AC_MSG_RESULT([external])
4634     SYSTEM_ZLIB=YES
4635     AC_CHECK_HEADER(zlib.h, [],
4636         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
4637     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
4638         [AC_MSG_ERROR(zlib not found or functional)], [])
4639 else
4640     AC_MSG_RESULT([internal])
4641     SYSTEM_ZLIB=NO
4642     BUILD_TYPE="$BUILD_TYPE ZLIB"
4644 AC_SUBST(SYSTEM_ZLIB)
4646 dnl ===================================================================
4647 dnl Check for system jpeg
4648 dnl ===================================================================
4649 AC_MSG_CHECKING([which jpeg to use])
4650 if test "$with_system_jpeg" = "yes"; then
4651     AC_MSG_RESULT([external])
4652     SYSTEM_JPEG=YES
4653     AC_CHECK_HEADER(jpeglib.h, [],
4654         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
4655     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
4656     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
4657 else
4658     AC_MSG_RESULT([internal])
4659     SYSTEM_JPEG=NO
4660     BUILD_TYPE="$BUILD_TYPE JPEG"
4662 AC_SUBST(SYSTEM_JPEG)
4664 dnl ===================================================================
4665 dnl Check for system expat
4666 dnl ===================================================================
4667 AC_MSG_CHECKING([which expat to use])
4668 if test "$with_system_expat" = "yes"; then
4669     AC_MSG_RESULT([external])
4670     SYSTEM_EXPAT=YES
4671     AC_CHECK_HEADER(expat.h, [],
4672         [AC_MSG_ERROR(expat.h not found. install expat)], [])
4673     AC_CHECK_LIB(expat, XML_ParserCreate, [],
4674     [AC_MSG_RESULT(expat library not found or functional.)], [])
4675     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libexpat-1.dll"
4676 else
4677     AC_MSG_RESULT([internal])
4678     SYSTEM_EXPAT=NO
4679     BUILD_TYPE="$BUILD_TYPE EXPAT"
4681 AC_SUBST(SYSTEM_EXPAT)
4683 dnl ===================================================================
4684 dnl Check for system libvisio
4685 dnl ===================================================================
4686 AC_MSG_CHECKING([which libvisio to use])
4687 if test "$with_system_libvisio" = "yes"; then
4688     AC_MSG_RESULT([external])
4689     SYSTEM_LIBVISIO=YES
4690     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
4691 else
4692     AC_MSG_RESULT([internal])
4693     SYSTEM_LIBVISIO=NO
4694     BUILD_TYPE="$BUILD_TYPE LIBVISIO"
4696 AC_SUBST(SYSTEM_LIBVISIO)
4697 AC_SUBST(VISIO_CFLAGS)
4698 AC_SUBST(VISIO_LIBS)
4700 dnl ===================================================================
4701 dnl Check for system libcmis
4702 dnl ===================================================================
4703 AC_MSG_CHECKING([which libcmis to use])
4704 if test "$with_system_libcmis" = "yes"; then
4705     AC_MSG_RESULT([external])
4706     SYSTEM_LIBCMIS=YES
4707     PKG_CHECK_MODULES( LIBCMIS, libcmis-0.2 )
4708 else
4709     AC_MSG_RESULT([internal])
4710     SYSTEM_LIBCMIS=NO
4711     BUILD_TYPE="$BUILD_TYPE LIBCMIS"
4713 AC_SUBST(SYSTEM_LIBCMIS)
4714 AC_SUBST(LIBCMIS_CFLAGS)
4715 AC_SUBST(LIBCMIS_LIBS)
4718 dnl ===================================================================
4719 dnl Check for system libwpd
4720 dnl ===================================================================
4721 AC_MSG_CHECKING([which libwpd to use])
4722 if test "$with_system_libwpd" = "yes"; then
4723     AC_MSG_RESULT([external])
4724     SYSTEM_LIBWPD=YES
4725     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
4726 else
4727     AC_MSG_RESULT([internal])
4728     SYSTEM_LIBWPD=NO
4729     BUILD_TYPE="$BUILD_TYPE LIBWPD"
4731 AC_SUBST(SYSTEM_LIBWPD)
4732 AC_SUBST(WPD_CFLAGS)
4733 AC_SUBST(WPD_LIBS)
4735 dnl ===================================================================
4736 dnl Check for system cppunit
4737 dnl ===================================================================
4738 AC_MSG_CHECKING([which cppunit to use])
4739 if test "$with_system_cppunit" = "yes"; then
4740     AC_MSG_RESULT([external])
4741     SYSTEM_CPPUNIT=YES
4742     # might work for earlier, too but go sure:
4743     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
4744 else
4745     AC_MSG_RESULT([internal])
4746     SYSTEM_CPPUNIT=NO
4747     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
4749 AC_SUBST(SYSTEM_CPPUNIT)
4750 AC_SUBST(CPPUNIT_CFLAGS)
4751 AC_SUBST(CPPUNIT_LIBS)
4753 dnl ===================================================================
4754 dnl Check whether freetype is available
4755 dnl ===================================================================
4756 if test  "$test_freetype" = "yes"; then
4757     AC_MSG_CHECKING([whether freetype is available])
4758     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
4760 AC_SUBST(FREETYPE_CFLAGS)
4761 AC_SUBST(FREETYPE_LIBS)
4763 dnl ===================================================================
4764 dnl Check for system libwps
4765 dnl ===================================================================
4766 AC_MSG_CHECKING([which libwps to use])
4767 if test "$with_system_libwps" = "yes"; then
4768     AC_MSG_RESULT([external])
4769     SYSTEM_LIBWPS=YES
4770     PKG_CHECK_MODULES( WPS, libwps-0.2 )
4771 else
4772     AC_MSG_RESULT([internal])
4773     SYSTEM_LIBWPS=NO
4774     BUILD_TYPE="$BUILD_TYPE LIBWPS"
4776 AC_SUBST(SYSTEM_LIBWPS)
4777 AC_SUBST(WPS_CFLAGS)
4778 AC_SUBST(WPS_LIBS)
4780 dnl ===================================================================
4781 dnl Check for system libwpg
4782 dnl ===================================================================
4783 AC_MSG_CHECKING([which libwpg to use])
4784 if test "$with_system_libwpg" = "yes"; then
4785     AC_MSG_RESULT([external])
4786     SYSTEM_LIBWPG=YES
4787     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
4788 else
4789     AC_MSG_RESULT([internal])
4790     SYSTEM_LIBWPG=NO
4791     BUILD_TYPE="$BUILD_TYPE LIBWPG"
4793 AC_SUBST(SYSTEM_LIBWPG)
4794 AC_SUBST(WPG_CFLAGS)
4795 AC_SUBST(WPG_LIBS)
4797 dnl ===================================================================
4798 dnl Check whether freetype2 supports emboldening
4799 dnl ===================================================================
4800 if test  "$test_freetype" = "yes"; then
4801     save_CPPFLAGS="$CPPFLAGS"
4802     save_LDFLAGS="$LDFLAGS"
4803     save_LIBS="$LIBS"
4804     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
4805     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
4806     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
4807                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
4808     LDFLAGS="$save_LDFLAGS"
4809     CPPFLAGS="$save_CPPFLAGS"
4810     LIBS="$save_LIBS"
4812 AC_SUBST(USE_FT_EMBOLDEN)
4814 # ===================================================================
4815 # Check for system libxslt
4816 # to prevent incompatibilities between internal libxml2 and external libxslt,
4817 # or vice versa, use with_system_libxml here
4818 # ===================================================================
4819 AC_MSG_CHECKING([which libxslt to use])
4820 if test "$with_system_libxml" = "yes"; then
4821     AC_MSG_RESULT([external])
4822     SYSTEM_LIBXSLT=YES
4823     if test "$_os" = "Darwin"; then
4824         dnl make sure to use SDK path
4825         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4826         dnl omit -L/usr/lib
4827         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
4828     else
4829         PKG_CHECK_MODULES(LIBXSLT, libxslt)
4830     fi
4832     dnl Check for xsltproc
4833     AC_PATH_PROG(XSLTPROC, xsltproc, no)
4834     if test "$XSLTPROC" = "no"; then
4835         AC_MSG_ERROR([xsltproc is required])
4836     fi
4838     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libxslt-1.dll"
4839 else
4840     AC_MSG_RESULT([internal])
4841     SYSTEM_LIBXSLT=NO
4842     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
4844     if test "$cross_compiling" = "yes"; then
4845         AC_PATH_PROG(XSLTPROC, xsltproc, no)
4846         if test "$XSLTPROC" = "no"; then
4847             AC_MSG_ERROR([xsltproc is required])
4848         fi
4849     fi
4851 AC_SUBST(SYSTEM_LIBXSLT)
4852 AC_SUBST(LIBXSLT_CFLAGS)
4853 AC_SUBST(LIBXSLT_LIBS)
4854 AC_SUBST(XSLTPROC)
4856 # ===================================================================
4857 # Check for system libxml
4858 # ===================================================================
4859 AC_MSG_CHECKING([which libxml to use])
4860 if test "$with_system_libxml" = "yes"; then
4861     AC_MSG_RESULT([external])
4862     SYSTEM_LIBXML=YES
4863     if test "$_os" = "Darwin"; then
4864         dnl make sure to use SDK path
4865         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4866         dnl omit -L/usr/lib
4867         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
4868     elif test $_os = iOS; then
4869         dnl make sure to use SDK path
4870         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
4871         LIBXML_CFLAGS="-I$usr/include/libxml2"
4872         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
4873     else
4874         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
4875     fi
4876     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS zlib1.dll libxml2-2.dll"
4877 else
4878     AC_MSG_RESULT([internal])
4879     SYSTEM_LIBXML=NO
4880     BUILD_TYPE="$BUILD_TYPE LIBXML2"
4882 AC_SUBST(SYSTEM_LIBXML)
4883 AC_SUBST(LIBXML_CFLAGS)
4884 AC_SUBST(LIBXML_LIBS)
4886 dnl ===================================================================
4887 dnl Checks for Python
4888 dnl ===================================================================
4890 AC_MSG_CHECKING([which Python to use])
4892 case "$enable_python" in
4893 no|disable)
4894     enable_python=no
4895     AC_MSG_RESULT([none])
4896     DISABLE_PYTHON=TRUE
4897     ;;
4898 ""|yes|auto)
4899     if test $build_os = cygwin; then
4900         dnl When building on Windows we don't attempt to use any installed
4901         dnl "system"  Python.
4902         dnl
4903         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
4904         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
4905         dnl MinGW cross-compilation setups.)
4906         AC_MSG_RESULT([internal])
4907         enable_python=internal
4908     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4909         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4910         enable_python=internal
4911     else
4912         AC_MSG_RESULT([checking below])
4913         enable_python=auto
4914     fi
4915     ;;
4916 internal)
4917     AC_MSG_RESULT([internal])
4918     ;;
4919 system)
4920     if test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4921         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4922     fi
4923     AC_MSG_RESULT([system])
4924     ;;
4926     AC_MSG_ERROR([Incorrect --enable-python option])
4927     ;;
4928 esac
4930 AC_SUBST(DISABLE_PYTHON)
4932 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
4933     AC_MSG_ERROR([Must use internal Python when building with MSVC])
4936 if test $enable_python != no; then
4937     BUILD_TYPE="$BUILD_TYPE PYUNO"
4940 if test "$cross_compiling" = yes; then
4941     if test $enable_python = auto; then
4942         enable_python=system
4943     fi
4944 else
4945     if test $enable_python = system; then
4946         # This causes an error if no python command is found
4947         # Note that this takes the system python called just "python",
4948         # which isn't actually what we want on MacOSX when building
4949         # against the 10.6 SDK. But that shouldn't matter, we
4950         # select the correct python command manually below anyway.
4951         AM_PATH_PYTHON([2.6])
4952     elif test $enable_python = auto; then
4953         dnl This allows lack of system Python
4954         AM_PATH_PYTHON([2.6],, [:])
4956         if test "$PYTHON" = :; then
4957             enable_python=internal
4958         else
4959             enable_python=system
4960         fi
4961     fi
4964 if test $enable_python = system; then
4965     if test $_os = Darwin; then
4966         # We already have logic above to make sure the system Python
4967         # is used only when building against SDK 10.6 or newer.
4969         # Make sure we use the 2.6 Python when building against the
4970         # 10.6 SDK.
4971         case $with_macosx_sdk in
4972         10.6)
4973             python_version=2.6;;
4974         10.7)
4975             python_version=2.7;;
4976         *)
4977             # ???
4978             python_version=2.7;;
4979         esac
4980         PYTHON=python$python_version
4982         PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
4983         PYTHON_LIBS="-framework Python"
4984     fi
4985     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
4986         # Fallback: Accept these in the environment, or as set above
4987         # for MacOSX.
4988         :
4989     elif test "$cross_compiling" != yes; then
4990         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
4991         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
4992         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
4993         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
4994         if $PKG_CONFIG --exists python-$python_version; then
4995             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
4996             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version`"
4997         else
4998             PYTHON_CFLAGS="-I$python_include"
4999             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
5000         fi
5001     elif test "$cross_compiling" = yes; then
5002         dnl How to find out the cross-compilation Python installation path?
5003         dnl Let's hardocode what we know for different distributions for now...
5005         for python_sysroot in /usr/i686-w64-mingw32/sys-root/mingw ; do
5006             for python_version in 2.6 ; do
5007                 if test -f ${python_sysroot}/include/python${python_version}/Python.h; then
5008                     PYTHON_CFLAGS="-I ${python_sysroot}/include/python$python_version"
5009                     PYTHON_LIBS="-L ${python_sysroot}lib -lpython$python_version $python_libs"
5010                     break
5011                 fi
5012             done
5013             test -n "$PYTHON_CFLAGS" && break
5014         done
5015     fi
5018 dnl By now enable_python should be "system", "internal" or "no"
5019 case $enable_python in
5020 system)
5021     SYSTEM_PYTHON=YES
5023     dnl Check if the headers really work
5024     save_CPPFLAGS="$CPPFLAGS"
5025     CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
5026     AC_CHECK_HEADER(Python.h, [],
5027        [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
5028        [])
5029     CPPFLAGS="$save_CPPFLAGS"
5031     dnl FIXME Check if the Python library can be linked with, too?
5032     ;;
5034 internal)
5035     SYSTEM_PYTHON=NO
5036     BUILD_TYPE="$BUILD_TYPE PYTHON"
5037     # Embedded Python dies without Home set
5038     if test "z$HOME" = "z"; then
5039         export HOME="";
5040     fi
5041     # bz2 tarball and bzip2 is not standard
5042     if test -z "$BZIP2"; then
5043         AC_PATH_PROG( BZIP2, bzip2)
5044         if test -z "$BZIP2"; then
5045             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
5046         fi
5047     fi
5048     ;;
5050     SYSTEM_PYTHON=NO
5051     ;;
5053     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
5054     ;;
5055 esac
5057 AC_SUBST(SYSTEM_PYTHON)
5058 AC_SUBST(PYTHON_CFLAGS)
5059 AC_SUBST(PYTHON_LIBS)
5061 dnl ===================================================================
5062 dnl Check for system Berkeley db
5063 dnl ===================================================================
5064 AC_MSG_CHECKING([which db to use])
5065 if test "$with_system_db" = "yes"; then
5066     SYSTEM_DB=YES
5067     AC_MSG_RESULT([external])
5069     db_header=
5070     for dbver in 5.1 5.0 5 4.8 4.7 4; do
5071         for dash in - ''; do
5072             AC_CHECK_HEADER([db$dash$dbver/db.h],
5073                 [ db_header="db$dash$dbver/db.h"; break 2 ])
5074         done
5075     done
5077     if test -z "$db_header"; then
5078         AC_CHECK_HEADER([db/db.h], [db_header='db/db.h'; dbver=''])
5079     fi
5081     if test -z "$db_header"; then
5082        AC_CHECK_HEADER(db.h, [ db_header='db.h'; dbver='' ])
5083     fi
5085     if test -z "$db_header"; then
5086         AC_MSG_ERROR([db.h not found. Use the correct -I flag, or install the Berkeley db development package.])
5087     fi
5089     AC_MSG_CHECKING([whether db is at least 4.1])
5090     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])])
5092     SYSTEM_DB_CFLAGS="-DSYSTEM_DB_HEADER='<$db_header>'"
5094     DB_LIB=
5095     dnl At least on OpenBSD dbver is not appended to the library
5096     if test "$_os" = "OpenBSD"; then
5097         dbver=''
5098     fi
5099     for dash in - ''; do
5100         AC_CHECK_LIB(db$dash$dbver, dbopen,
5101             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5102         AC_CHECK_LIB(db$dash$dbver, __db185_open,
5103             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5104     done
5106     if test -z "$DB_LIB" ; then
5107         AC_MSG_ERROR([db library not found. Use the correct -L flag,
5108 or install the Berkeley db development package.])
5109     fi
5111     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
5112     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libdb-4.8.dll"
5113 else
5114     AC_MSG_RESULT([internal])
5115     SYSTEM_DB=NO
5116     BUILD_TYPE="$BUILD_TYPE BERKELEYDB"
5118 AC_SUBST(SYSTEM_DB)
5119 AC_SUBST(SYSTEM_DB_CFLAGS)
5120 AC_SUBST(DB_LIB)
5121 AC_SUBST(DB_CPPLIB)
5123 dnl ===================================================================
5124 dnl Check for system lucene
5125 dnl ===================================================================
5126 if test "$with_java" != "no"; then
5127 AC_MSG_CHECKING([which lucene to use])
5128 if test "$with_system_lucene" = "yes"; then
5129     AC_MSG_RESULT([external])
5130     SYSTEM_LUCENE=YES
5131     if test -z $LUCENE_CORE_JAR; then
5132          AC_CHECK_FILE(/usr/share/java/lucene-core-2.3.jar,
5133             [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar ],
5134             [
5135               AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
5136                 [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
5137                 [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
5138                    [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
5139                    [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
5140                   )
5141                 ]
5142               )
5143             ]
5144          )
5145     else
5146         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5147                [AC_MSG_ERROR(lucene-core.jar not found.)], [])
5148     fi
5150     if test -z $LUCENE_ANALYZERS_JAR; then
5151         AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
5152             [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
5153             [
5154               AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
5155                 [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
5156                 [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
5157               )
5158             ]
5159         )
5160     else
5161         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5162                [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
5163     fi
5164     AC_MSG_CHECKING([whether lucene is version 2.x])
5165     export LUCENE_CORE_JAR
5166     if $PERL -e 'use Archive::Zip;
5167             my $file = "$ENV{'LUCENE_CORE_JAR'}";
5168             my $zip = Archive::Zip->new( $file );
5169             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5170             if ( $mf =~ m/Specification-Version: 2.*/ ) {
5171                 exit 0;
5172             } else {
5173                 exit 1;
5174             }'; then
5175         AC_MSG_RESULT([yes])
5176     else
5177         AC_MSG_ERROR([no, you need lucene 2])
5178     fi
5180 else
5181     AC_MSG_RESULT([internal])
5182     SYSTEM_LUCENE=NO
5183     BUILD_TYPE="$BUILD_TYPE LUCENE"
5186 AC_SUBST(SYSTEM_LUCENE)
5187 AC_SUBST(LUCENE_CORE_JAR)
5188 AC_SUBST(LUCENE_ANALYZERS_JAR)
5190 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
5191 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
5192     AC_MSG_RESULT([yes])
5193     ENABLE_MYSQLC=YES
5194     BUILD_TYPE="$BUILD_TYPE MYSQLC"
5195 else
5196     AC_MSG_RESULT([no])
5197     ENABLE_MYSQLC=NO
5199 AC_SUBST(ENABLE_MYSQLC)
5201 if test "$ENABLE_MYSQLC" = "YES"; then
5203     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
5205     dnl ===================================================================
5206     dnl Check for system MySQL
5207     dnl ===================================================================
5208     AC_MSG_CHECKING([for mysql pre-requisites])
5209     if test "$with_system_mysql" = "yes"; then
5210         AC_MSG_RESULT([external MySQL])
5211         SYSTEM_MYSQL=YES
5212         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
5213         AC_MSG_CHECKING([MySQL version])
5214         MYSQL_VERSION=`$MYSQLCONFIG --version`
5215         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
5216         if test "$MYSQL_MAJOR" -ge "5"; then
5217             AC_MSG_RESULT([OK])
5218         else
5219             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
5220         fi
5221         AC_MSG_CHECKING([for MySQL Client library])
5222         MYSQL_INC=`$MYSQLCONFIG --include`
5223         MYSQL_LIB=`$MYSQLCONFIG --libs`
5224         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
5225         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
5226     else
5227         SYSTEM_MYSQL=NO
5228         if test -n "$with_libmysql_path"; then
5229             AC_MSG_RESULT([external Connector/C (libmysql)])
5230             LIBMYSQL=libmysql.so
5231             if test "$_os" = "Darwin"; then
5232                 LIBMYSQL=libmysql.dylib
5233             elif test "$_os" = "WINNT"; then
5234                 LIBMYSQL=libmysql.dll
5235             fi
5236             AC_MSG_CHECKING([for $LIBMYSQL])
5237             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
5238                 AC_MSG_RESULT([found.])
5239                 LIBMYSQL_PATH=$with_libmysql_path
5240             else
5241                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
5242             fi
5243         else
5244             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
5245         fi
5246     fi
5247     AC_SUBST(SYSTEM_MYSQL)
5248     AC_SUBST(MYSQL_INC)
5249     AC_SUBST(MYSQL_LIB)
5250     AC_SUBST(MYSQL_DEFINES)
5251     AC_SUBST(LIBMYSQL_PATH)
5253     AC_LANG_PUSH([C++])
5254     dnl ===================================================================
5255     dnl Check for system MySQL C++ Connector
5256     dnl ===================================================================
5257     # FIXME!
5258     # who thought this too-generic cppconn dir was a good idea?
5259     AC_MSG_CHECKING([MySQL Connector/C++])
5260     if test "$with_system_mysql_cppconn" = "yes"; then
5261         AC_MSG_RESULT([external])
5262         SYSTEM_MYSQL_CPPCONN=YES
5263         AC_LANG_PUSH([C++])
5264         AC_CHECK_HEADER(mysql_driver.h, [],
5265                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
5266         AC_CHECK_LIB(mysqlcppconn, main, [],
5267                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
5268         AC_MSG_CHECKING([version])
5269         AC_RUN_IFELSE([AC_LANG_SOURCE([[
5270 #include <mysql_driver.h>
5272 int main(int argc, char **argv) {
5273     sql::Driver *driver;
5274     driver = get_driver_instance();
5275     if (driver->getMajorVersion() > 1 || \
5276        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
5277        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
5278         return 0;
5279       else
5280         return 1;
5282       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
5284         AC_LANG_POP([C++])
5286     else
5287         AC_MSG_RESULT([internal])
5288         AC_MSG_CHECKING([for mysqlcppconn module])
5289         if test -d mysqlcppconn; then
5290             AC_MSG_RESULT([OK])
5291         else
5292             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
5293         fi
5294         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
5295         SYSTEM_MYSQL_CPPCONN=NO
5296     fi
5297     AC_LANG_POP([C++])
5298     AC_SUBST(SYSTEM_MYSQL_CPPCONN)
5301 dnl ===================================================================
5302 dnl Check for system hsqldb
5303 dnl ===================================================================
5304 if test "$with_java" != "no"; then
5305 AC_MSG_CHECKING([which hsqldb to use])
5306 if test "$with_system_hsqldb" = "yes"; then
5307     AC_MSG_RESULT([external])
5308     SYSTEM_HSQLDB=YES
5309     if test -z $HSQLDB_JAR; then
5310         HSQLDB_JAR=/usr/share/java/hsqldb.jar
5311     fi
5312     AC_CHECK_FILE($HSQLDB_JAR, [],
5313                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
5314     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
5315     export HSQLDB_JAR
5316     if $PERL -e 'use Archive::Zip;
5317             my $file = "$ENV{'HSQLDB_JAR'}";
5318             my $zip = Archive::Zip->new( $file );
5319             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5320             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
5321                push @l, split(/\n/, $mf);
5322                foreach my $line (@l) {
5323                   if ($line =~ m/Specification-Version:/) {
5324                       ($t, $version) = split (/:/,$line);
5325                       $version =~ s/^\s//;
5326                       ($a, $b, $c, $d) = split (/\./,$version);
5327                       if ($c == "0" && $d > "8")  {
5328                           exit 0;
5329                       } else {
5330                           exit 1;
5331                       }
5332                   }
5333                }
5334             } else {
5335                 exit 1;
5336             }'; then
5337         AC_MSG_RESULT([yes])
5338     else
5339         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
5340     fi
5341 else
5342     AC_MSG_RESULT([internal])
5343     SYSTEM_HSQLDB=NO
5344     BUILD_TYPE="$BUILD_TYPE HSQLDB"
5346 AC_SUBST(SYSTEM_HSQLDB)
5347 AC_SUBST(HSQLDB_JAR)
5350 dnl ===================================================================
5351 dnl Check for system beanshell
5352 dnl ===================================================================
5353 if test "$with_java" != "no"; then
5354 AC_MSG_CHECKING([which beanshell to use])
5355 if test "$with_system_beanshell" = "yes"; then
5356     AC_MSG_RESULT([external])
5357     SYSTEM_BSH=YES
5358     if test -z $BSH_JAR; then
5359         BSH_JAR=/usr/share/java/bsh.jar
5360     fi
5361     AC_CHECK_FILE($BSH_JAR, [],
5362                [AC_MSG_ERROR(bsh.jar not found.)], [])
5363 else
5364     AC_MSG_RESULT([internal])
5365     SYSTEM_BSH=NO
5366     BUILD_TYPE="$BUILD_TYPE BSH"
5369 AC_SUBST(SYSTEM_BSH)
5370 AC_SUBST(BSH_JAR)
5373 dnl ===================================================================
5374 dnl Check for system saxon
5375 dnl ===================================================================
5376 if test "$with_java" != "no"; then
5377 AC_MSG_CHECKING([which saxon to use])
5378 if test "$with_system_saxon" = "yes"; then
5379     AC_MSG_RESULT([external])
5380     SYSTEM_SAXON=YES
5381     if test -z $SAXON_JAR; then
5382         AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5383             [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5384             [
5385               AC_CHECK_FILE(/usr/share/java/saxon.jar,
5386                 [ SAXON_JAR=/usr/share/java/saxon.jar ],
5387                 [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5388                     [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5389                     [ AC_MSG_ERROR(saxon.jar replacement not found)]
5390                   )
5391                 ]
5392               )
5393             ]
5394           )
5395     else
5396         AC_CHECK_FILE($SAXON_JAR, [],
5397                [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
5398     fi
5399     if test -n "$SERIALIZER_JAR"; then
5400         AC_CHECK_FILE($SERIALIZER_JAR, [],
5401                [AC_MSG_ERROR(serializer.jar not found.)], [])
5402         AC_SUBST(SERIALIZER_JAR)
5403     fi
5405     dnl Saxon comes in two practically available versions, the out-of-date saxonb which
5406     dnl supports the Java extensions that LibreOffice uses, and the up-to-date saxon he
5407     dnl "home edition" version, which is crippled to not support those Java extensions.
5408     dnl And as an aside the he one also needs to be tweaked to include
5409     dnl a META-INF/services to broadcast that it supports the jaxp transform factory
5411     AC_MSG_CHECKING([if saxon works])
5412     cat > saxontest.java <<_ACEOF
5413 [import javax.xml.transform.TransformerFactory;
5414 import javax.xml.transform.Transformer;
5415 import javax.xml.transform.stream.StreamSource;
5416 import java.io.*;
5418 import net.sf.saxon.FeatureKeys;
5420 class saxontest {
5421     public static void main(String[] args) {
5422       System.setProperty("javax.xml.transform.TransformerFactory",
5423         "net.sf.saxon.TransformerFactoryImpl");
5424       try {
5425         TransformerFactory tfactory = TransformerFactory.newInstance();
5426     // some external saxons (Debian, Ubuntu, ...) have this disabled
5427     // per default
5428     tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
5429         System.out.println("TransformerFactory is" +
5430           tfactory.getClass().getName());
5431         Transformer transformer = tfactory.newTransformer(
5432           new StreamSource(new File(args[0])));
5433       } catch(Exception e){
5434         e.printStackTrace(System.err);
5435         System.exit(-1);
5436       }
5437       System.exit(0);
5438     }
5441 _ACEOF
5443     cat > saxontest.xsl<<_ACEOF
5444 [<?xml version="1.0" encoding="UTF-8"?>
5445 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5446  <xsl:template match="/">
5447   <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
5448  </xsl:template>
5449 </xsl:stylesheet>
5451 _ACEOF
5453     javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
5454     AC_TRY_EVAL(javac_cmd)
5455     if test $? = 0 && test -f ./saxontest.class ; then
5456         java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
5457         AC_TRY_EVAL(java_cmd)
5458         if test $? = 0; then
5459             AC_MSG_RESULT([yes])
5460         else
5461             cat saxontest.java >&5
5462             AC_MSG_RESULT([no])
5463             AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
5464         fi
5465     else
5466         AC_MSG_RESULT([no])
5467         cat saxontest.java >&5
5468         AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
5469     fi
5470 else
5471     AC_MSG_RESULT([internal])
5472     SYSTEM_SAXON=NO
5473     NEED_SAXON=TRUE
5476 AC_SUBST(SYSTEM_SAXON)
5477 AC_SUBST(SAXON_JAR)
5479 if test -n "$NEED_SAXON"; then
5480     BUILD_TYPE="$BUILD_TYPE SAXON"
5483 # ===================================================================
5484 # Check whether to build stax
5485 # ===================================================================
5486 AC_MSG_CHECKING([whether building the stax is required])
5487 BUILD_STAX=NO
5488 if test -z "$SOLAR_JAVA"; then
5489     AC_MSG_RESULT([no (java disabled)])
5490 elif test "$SYSTEM_SAXON" = "YES"; then
5491     AC_MSG_RESULT([no (already provided by system saxon)])
5492 elif test -f "./stax/download/jsr173_1.0_api.jar"; then
5493     AC_MSG_RESULT([no (will use the prebuilt stax/download/jsr173_1.0_api.jar)])
5494 else
5495     BUILD_STAX=YES
5496     AC_MSG_RESULT([yes (no system saxon and no prebuilt copy)])
5498 AC_SUBST(BUILD_STAX)
5500 dnl ===================================================================
5501 dnl Check for system curl
5502 dnl ===================================================================
5503 AC_MSG_CHECKING([which libcurl to use])
5504 if test "$with_system_curl" = "yes"; then
5505     AC_MSG_RESULT([external])
5506     SYSTEM_CURL=YES
5508     curl_version=""
5509     if test "$cross_compiling" = "yes"; then
5510         dnl At least the OBS mingw32-libcurl-devel package
5511         dnl comes with a proper .pc file
5512         PKG_CHECK_MODULES(CURL, libcurl,, [:])
5513         if test -n "$CURL_PKG_ERRORS"; then
5514             AC_MSG_RESULT([no])
5515         else
5516             curl_version=`$PKG_CONFIG --modversion libcurl`
5517         fi
5518     fi
5519     if test -z "$curl_version"; then
5520         AC_PATH_PROG(CURLCONFIG, curl-config)
5521         if test -z "$CURLCONFIG"; then
5522             AC_MSG_ERROR([install the libcurl development package])
5523         fi
5524         CURL_LIBS=`$CURLCONFIG --libs`
5525         CURL_CFLAGS=`$CURLCONFIG --cflags`
5526         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
5527     fi
5529     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
5531     case $curl_version in
5532     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
5533     dnl so they need to be doubled to end up in the configure script
5534     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
5535         AC_MSG_RESULT([yes, you have $curl_version])
5536         ;;
5537     *)
5538         AC_MSG_ERROR([no, you have $curl_version])
5539         ;;
5540     esac
5542     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"
5543 else
5544     AC_MSG_RESULT([internal])
5545     SYSTEM_CURL=NO
5546     BUILD_TYPE="$BUILD_TYPE CURL"
5548 AC_SUBST(SYSTEM_CURL)
5549 AC_SUBST(CURL_CFLAGS)
5550 AC_SUBST(CURL_LIBS)
5552 dnl ===================================================================
5553 dnl Check for system boost
5554 dnl ===================================================================
5555 AC_MSG_CHECKING([which boost to use])
5556 if test "$with_system_boost" = "yes"; then
5557     AC_MSG_RESULT([external])
5558     SYSTEM_BOOST=YES
5559     AC_LANG_PUSH([C++])
5560     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
5561        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
5562     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
5563        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
5564     AC_CHECK_HEADER(boost/function.hpp, [],
5565        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
5566     AC_CHECK_HEADER([boost/unordered_map.hpp], [HAVE_BOOST_UNORDERED_MAP=TRUE],
5567                    [AC_MSG_WARN([boost/unordered_map.hpp not found])], [])
5569     save_CXXFLAGS=$CXXFLAGS
5570     CXXFLAGS="$CXXFLAGS -fno-exceptions"
5571     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
5572     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
5573 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
5575     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
5576         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
5577     else
5578         AC_MSG_RESULT([yes])
5579     fi
5580     CXXFLAGS=$save_CXXFLAGS
5581     AC_LANG_POP([C++])
5582 else
5583     AC_MSG_RESULT([internal])
5584     BUILD_TYPE="$BUILD_TYPE BOOST"
5585     SYSTEM_BOOST=NO
5586     HAVE_BOOST_UNORDERED_MAP=TRUE
5588 AC_SUBST([HAVE_BOOST_UNORDERED_MAP])
5589 AC_SUBST(SYSTEM_BOOST)
5591 dnl ===================================================================
5592 dnl Check for system mdds
5593 dnl ===================================================================
5594 AC_MSG_CHECKING([which mdds to use])
5595 if test "$with_system_mdds" = "yes"; then
5596     AC_MSG_RESULT([external])
5597     SYSTEM_MDDS=YES
5599     dnl ===================================================================
5600     dnl Determine which hash container mdds shall use
5601     dnl ===================================================================
5602     AC_MSG_CHECKING([which hash container mdds shall use])
5603     if test "x$HAVE_CXX0X" = "xTRUE"; then
5604         MDDS_CPPFLAGS="-std=c++0x"
5605         AC_MSG_RESULT([std::unordered_map])
5606     else
5607         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5608         AC_MSG_RESULT([boost::unordered_map])
5609     fi
5611     AC_LANG_PUSH([C++])
5612     save_CPPFLAGS="$CPPFLAGS"
5613     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
5614     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
5615         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
5616     AC_CHECK_HEADER(mdds/mixed_type_matrix.hpp, [],
5617         [AC_MSG_ERROR(mdds/mixed_type_matrix.hpp not found. install mdds >= 0.4.0)], [])
5618     CPPFLAGS="$save_CPPFLAGS"
5619     save_CXXFLAGS="$CXXFLAGS"
5620     CXXFLAGS="$CXXFLAGS $MDDS_CPPFLAGS"
5621     AC_MSG_CHECKING([for correct signature of ::mdds::flat_segment_tree])
5622     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mdds/flat_segment_tree.hpp>
5624     int main(int argc, char **argv) {
5625         ::mdds::flat_segment_tree<long, short> db(0, 100, 0);
5626         short val;
5627         if (!db.search(5, val).second)
5628             return 1;
5629         return 0;
5630     }
5631 ]])],[ac_cv_cxx_mdds_flat_segment_tree_correct=yes],[ac_cv_cxx_mdds_flat_segment_tree_correct=no],[])
5633     if test "$ac_cv_cxx_mdds_flat_segment_tree_correct" = "yes"; then
5634         AC_MSG_RESULT([yes])
5635     else
5636         AC_MSG_ERROR([no, install mdds >= 0.5.0])
5637     fi
5638     CXXFLAGS=$save_CXXFLAGS
5639     AC_LANG_POP([C++])
5640 else
5641     AC_MSG_RESULT([internal])
5642     BUILD_TYPE="$BUILD_TYPE MDDS"
5643     SYSTEM_MDDS=NO
5645     dnl ===================================================================
5646     dnl Determine which hash container mdds shall use
5647     dnl ===================================================================
5648     AC_MSG_CHECKING([which hash container mdds shall use])
5649     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5650     AC_MSG_RESULT([boost::unordered_map])
5652 AC_SUBST(SYSTEM_MDDS)
5653 AC_SUBST([MDDS_CPPFLAGS])
5655 dnl ===================================================================
5656 dnl Check for system vigra
5657 dnl ===================================================================
5658 AC_MSG_CHECKING([which vigra to use])
5659 if test "$with_system_vigra" = "yes"; then
5660     AC_MSG_RESULT([external])
5661     SYSTEM_VIGRA=YES
5662     AC_LANG_PUSH([C++])
5663     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
5664        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
5665     AC_LANG_POP([C++])
5666 else
5667     AC_MSG_RESULT([internal])
5668     BUILD_TYPE="$BUILD_TYPE VIGRA"
5669     SYSTEM_VIGRA=NO
5671 AC_SUBST(SYSTEM_VIGRA)
5673 dnl ===================================================================
5674 dnl Check for system odbc
5675 dnl ===================================================================
5676 AC_MSG_CHECKING([which odbc headers to use])
5677 if test "$with_system_odbc" = "yes"; then
5678     AC_MSG_RESULT([external])
5679     SYSTEM_ODBC_HEADERS=YES
5681     AC_CHECK_HEADER(sqlext.h, [],
5682       [AC_MSG_ERROR(odbc not found. install odbc)], [])
5683 else
5684     AC_MSG_RESULT([internal])
5685     SYSTEM_ODBC_HEADERS=NO
5686     BUILD_TYPE="$BUILD_TYPE UNIXODBC"
5688 AC_SUBST(SYSTEM_ODBC_HEADERS)
5690 AC_MSG_CHECKING([whether to enable build of Mozilla])
5691 if test "$enable_mozilla" = "no"; then
5692     AC_MSG_RESULT([no])
5693     WITH_MOZILLA=NO
5694 else
5695     AC_MSG_RESULT([yes])
5696     WITH_MOZILLA=YES
5698 AC_SUBST(WITH_MOZILLA)
5700 AC_MSG_CHECKING([whether to build Mozilla addressbook connectivity])
5701 if test "$enable_mozilla" = "no"; then
5702     AC_MSG_RESULT([no])
5703 elif test "$with_system_mozilla" = "yes"; then
5704     AC_MSG_RESULT([no, not possible with system-mozilla])
5705 else
5706     AC_MSG_RESULT([yes])
5709 AC_MSG_CHECKING([whether to build XML Security support])
5710 if test "$enable_xmlsec" = "no"; then
5711     AC_MSG_RESULT([no])
5712     ENABLE_XMLSEC=
5713 else
5714     ENABLE_XMLSEC="YES"
5715     BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
5716     AC_MSG_RESULT([yes])
5718 AC_SUBST(ENABLE_XMLSEC)
5720 AC_MSG_CHECKING([whether to build LDAP configuration backend])
5721 if test "$enable_ldap" != "no"; then
5722     WITH_OPENLDAP=NO
5723     WITH_LDAP=NO
5724     if test "$with_openldap" = "yes"; then
5725         WITH_LDAP=YES
5726         AC_MSG_RESULT([OpenLDAP])
5727         WITH_OPENLDAP=YES
5728         AC_CHECK_HEADERS(ldap.h, [],
5729             [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
5730         AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
5731             [AC_MSG_ERROR(openldap lib not found or functional)], [])
5732         AC_CHECK_LIB(ldap, ldap_set_option, [],
5733             [AC_MSG_ERROR(openldap lib not found or functional)], [])
5734     elif test "$enable_mozilla" != "no"; then
5735         AC_MSG_RESULT([Mozilla])
5736         WITH_LDAP=YES
5737         WITH_OPENLDAP=NO
5738     else
5739         AC_MSG_RESULT([no. Either Mozilla or OpenLDAP required])
5740     fi
5741 else
5742     AC_MSG_RESULT([no])
5743     WITH_LDAP=NO
5745 AC_SUBST(WITH_LDAP)
5746 AC_SUBST(WITH_OPENLDAP)
5748 dnl ===================================================================
5749 dnl Check for system mozilla
5750 dnl ===================================================================
5751 AC_MSG_CHECKING([which Mozilla to use])
5752 if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then
5753     AC_MSG_RESULT([external])
5754     SYSTEM_MOZILLA=YES
5755     AC_MSG_CHECKING([which Mozilla flavour to use])
5756     if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then
5757         MOZ_FLAVOUR=libxul
5758     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then
5759         MOZ_FLAVOUR=xulrunner
5760     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "seamonkey"; then
5761         MOZ_FLAVOUR=seamonkey
5762     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "firefox"; then
5763         MOZ_FLAVOUR=firefox
5764     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "mozilla"; then
5765         MOZ_FLAVOUR=mozilla
5766     else
5767         MOZ_FLAVOUR=libxul
5768     fi
5769     tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst(<STDIN>);'`
5770     AC_MSG_RESULT($tmp)
5772     if test "$MOZ_FLAVOUR" != "libxul"; then
5773         PKG_CHECK_MODULES( MOZILLAXPCOM, $MOZ_FLAVOUR-xpcom, HASXPCOM="TRUE", HASXPCOM="" )
5774         MOZ_INC=`$PKG_CONFIG --variable=includedir $MOZ_FLAVOUR-xpcom`
5775         MOZ_LIB=`$PKG_CONFIG --variable=libdir $MOZ_FLAVOUR-xpcom`
5776     fi
5778     if test -z "$HASXPCOM"; then
5779         PKG_CHECK_MODULES( MOZILLAXPCOM, libxul )
5780         MOZ_INC=`$PKG_CONFIG --variable=includedir libxul`
5781         MOZ_LIB=`$PKG_CONFIG --variable=libdir libxul`
5782         if ! test -e "$MOZ_LIB/libxul.so"; then
5783             MOZ_LIB=`$PKG_CONFIG --variable=sdkdir libxul`
5784             if test -e "$MOZ_LIB/sdk/lib/libxul.so"; then
5785                 MOZ_LIB="$MOZ_LIB/sdk/lib"
5786             fi
5787         fi
5788     fi
5790     MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS
5791     if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then
5792         AC_MSG_CHECKING([whether $tmp was compiled with --enable-ldap])
5793         if test -d "$MOZ_INC/ldap"; then
5794             AC_MSG_RESULT([yes])
5795             MOZ_LDAP_CFLAGS="-I$MOZ_INC"
5796         else
5797             AC_MSG_ERROR([no.
5798 Could not find LDAP header include files in $MOZ_INC/ldap.
5799 Please recompile $tmp with --enable-ldap or use --with-openldap.])
5800         fi
5801     fi
5803     #e.g. http://fedoraproject.org/wiki/Releases/FeatureXULRunnerAPIChanges
5804     #the plugin pkg-config etc. reverts to "mozilla-plugin" with libxul
5805     if test "$MOZ_FLAVOUR" = "libxul"; then
5806         MOZ_FLAVOUR="mozilla"
5807     fi
5809 elif test "$enable_mozilla" = "no"; then
5810     AC_MSG_RESULT([none])
5811     WITH_MOZILLA=NO
5812 else
5813     AC_MSG_RESULT([internal])
5814     SYSTEM_MOZILLA=NO
5815     BUILD_TYPE="$BUILD_TYPE MOZ"
5816 if test -z "$with_mozilla_version"; then
5817     MOZILLA_VERSION=
5818 else
5819     AC_MSG_CHECKING([which Mozilla version to build])
5820     MOZILLA_VERSION=$with_mozilla_version
5821     enable_build_mozilla=1
5822     AC_MSG_RESULT([$MOZILLA_VERSION])
5825 AC_SUBST(MOZILLA_VERSION)
5827 AC_MSG_CHECKING([for toolkit Mozilla should use])
5828 if test -z "$with_mozilla_toolkit"; then
5829     if test "$_os" != "WINNT" ; then
5830         if test "$_os" = "Darwin" ; then
5831             MOZILLA_TOOLKIT=mac
5832             AC_MSG_RESULT([mac])
5833         else
5834             MOZILLA_TOOLKIT=gtk2
5835             AC_MSG_RESULT([gtk2])
5836         fi
5837     fi
5838 else
5839     MOZILLA_TOOLKIT=$with_mozilla_toolkit
5840     enable_build_mozilla=1
5841     AC_MSG_RESULT([$MOZILLA_TOOLKIT])
5844 AC_SUBST(MOZILLA_TOOLKIT)
5846 # default to enabling build mozilla
5847 if test "$enable_build_mozilla" != "no"; then
5848     enable_build_mozilla=yes
5849 else
5850     enable_build_mozilla=
5853 AC_MSG_CHECKING([whether to build Mozilla/SeaMonkey])
5854 if test -n "$enable_build_mozilla"; then
5855     BUILD_MOZAB="TRUE"
5856     AC_MSG_RESULT([yes])
5857 else
5858     BUILD_MOZAB=""
5859     AC_MSG_RESULT([no])
5862 if test "$BUILD_MOZAB" = "TRUE"; then
5863     if test "$_os" = "WINNT"; then
5864         if test "$WITH_MINGW" != "yes"; then
5865             # compiling with MSVC. Only supported platform here is MSVS2005 at the moment.
5866             if test "$MSVSVER" != "2005"; then
5867                 AC_MSG_ERROR([Building SeaMonkey is supported with Microsoft Visual Studio 2005 only.])
5868             fi
5869         else
5870             AC_MSG_WARN([Building SeaMonkey with MinGW is not tested, and likely to break.])
5871             echo "Building SeaMonkey with MinGW is not tested, and likely to break." >> warn
5872         fi
5873     fi
5875     if test -z "$MOZILLA_VERSION"; then
5876         MOZILLA_VERSION=1.1.14
5877     fi
5878     MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"
5879     MOZILLA_FETCH_FILE=`grep $MOZILLA_SOURCE_VERSION ooo.lst.in`
5880     AC_MSG_CHECKING([for Mozilla sources])
5881     if test -z "$MOZILLA_FETCH_FILE"; then
5882         AC_MSG_RESULT([not found])
5883         HAVE_MOZILLA_TARBALL=n
5884     else
5885         AC_MSG_CHECKING([for $MOZILLA_FETCH_FILE])
5886         if test ! -e "$TARFILE_LOCATION/$MOZILLA_FETCH_FILE"; then
5887             if test -z "$DO_FETCH"; then
5888                 AC_MSG_RESULT([will be fetched])
5889                 HAVE_MOZILLA_TARBALL=y
5890             else
5891                 AC_MSG_RESULT([not found])
5892                 HAVE_MOZILLA_TARBALL=n
5893             fi
5894         else
5895             AC_MSG_RESULT([found])
5896             HAVE_MOZILLA_TARBALL=y
5897         fi
5898     fi
5899     if test "$HAVE_MOZILLA_TARBALL" != "y"; then
5900         AC_MSG_ERROR([Mozilla/SeaMonkey source archive not found.
5901 Use "./download" to download.])
5902     fi
5903     if test "$_os" = "WINNT"; then
5904         AC_MSG_CHECKING([for moztools binaries])
5905         if test ! -e "$TARFILE_LOCATION/vc8-moztools.zip" ; then
5906             AC_MSG_ERROR([The following file is missing in $TARFILE_LOCATION: vc8-moztools.zip
5907 (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)])
5908         else
5909             AC_MSG_RESULT([ok])
5910         fi
5911     elif test "$_os" = "Darwin"; then
5912         PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.6.3,  MOZIDL="TRUE", MOZIDL="")
5913         if test -z "$MOZIDL"; then
5914             AC_MSG_ERROR([libIDL 0.6.3 or newer is needed to build Mozilla with Mac toolkit.])
5915         fi
5916     else
5917         # Generic Unix/Linux section
5918         if test "$MOZILLA_TOOLKIT" = "gtk2"; then
5919             PKG_CHECK_MODULES(MOZLIBREQ, gtk+-2.0, MOZGTK="TRUE", MOZGTK="")
5920             if test -z "$MOZGTK"; then
5921                 AC_MSG_ERROR([GTK2 is needed to build Mozilla.])
5922             fi
5923             PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.8.0, MOZIDL="TRUE", MOZIDL="")
5924             if test -z "$MOZIDL"; then
5925                 AC_MSG_ERROR([libIDL >= 0.8.0 is needed when using GTK2 to build Mozilla.])
5926             fi
5927         else
5928             PKG_CHECK_MODULES(MOZLIBREQ, gtk+ >= 1.2.3, MOZGTK="TRUE", MOZGTK="")
5929             if test -z "$MOZGTK"; then
5930                 AC_MSG_ERROR([GTK+ 1.2 is needed when not using GTK2 to build Mozilla.])
5931             fi
5932             PKG_CHECK_MODULES(MOZLIBREQ, libidl >= 0.6.3 libidl <= 0.6.8, MOZIDL="TRUE", MOZIDL="")
5933             if test -z "$MOZIDL"; then
5934                 AC_MSG_ERROR([libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build Mozilla.])
5935             fi
5936         fi
5937     fi
5940 AC_SUBST(BUILD_MOZAB)
5943 AC_SUBST(MOZILLABUILD)
5944 AC_SUBST(SYSTEM_MOZILLA)
5945 AC_SUBST(MOZ_FLAVOUR)
5946 AC_SUBST(MOZ_INC)
5947 AC_SUBST(MOZ_LIB)
5948 AC_SUBST(MOZ_LIB_XPCOM)
5949 AC_SUBST(MOZ_LDAP_CFLAGS)
5951 dnl ===================================================================
5952 dnl Check for system NSS only with xmlsec or mozilla build enabled
5953 dnl ===================================================================
5954 if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" != "xno"; then
5955 AC_MSG_CHECKING([which NSS to use])
5956 if test "$with_system_nss" = "yes"; then
5957     AC_MSG_RESULT([external])
5958     SYSTEM_NSS="YES"
5959     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
5960 else
5961     SYSTEM_NSS="NO"
5962     BUILD_TYPE="$BUILD_TYPE NSS"
5963     AC_MSG_RESULT([internal])
5964     if test "$build_os" = "cygwin"; then
5965         AC_MSG_CHECKING([for Mozilla build tooling])
5966         if test -z "$MOZILLABUILD" ; then
5967             AC_MSG_ERROR([Mozilla build tooling not found.
5968 Use the --with-mozilla-build option after installing the tools obtained
5969 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
5970         else
5971             if test \( "$WITH_MINGW" = "yes" \) ; then
5972                 if test ! -d "$MOZILLABUILD" ; then
5973                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
5974                 else
5975                     AC_MSG_RESULT([ok])
5976                 fi
5977             else
5978                 if test ! -d "$MOZILLABUILD/moztools" \
5979                         -o ! -d "$MOZILLABUILD/msys" ; then
5980                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
5981                 else
5982                     AC_MSG_RESULT([ok])
5983                 fi
5984             fi
5985         fi
5986     fi
5987 fi # system nss
5988 fi # enable xmlsec || enable mozilla
5989 AC_SUBST(SYSTEM_NSS)
5990 AC_SUBST(NSS_CFLAGS)
5991 AC_SUBST(NSS_LIBS)
5993 dnl ===================================================================
5994 dnl Check for system mozilla headers
5995 dnl ===================================================================
5996 AC_MSG_CHECKING([which mozilla headers to use])
5997 if test "$with_system_mozilla_headers" = "yes"; then
5998     AC_MSG_RESULT([external])
5999     SYSTEM_MOZILLA_HEADERS=YES
6000     # First try npapi-sdk:
6001     PKG_CHECK_MODULES(MOZILLA_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
6002     # Then go with libxul:
6003     if test "x$LOCATED" != "xyes"; then
6004         PKG_CHECK_MODULES(MOZILLA_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
6005     fi
6006     # if still not found bail out
6007     if test "x$LOCATED" != "xyes"; then
6008         AC_MSG_ERROR([npapi.h header file not found])
6009     fi
6010 else
6011     AC_MSG_RESULT([internal])
6012     SYSTEM_MOZILLA_HEADERS=NO
6014 AC_SUBST(MOZILLA_HEADERS_CFLAGS)
6015 AC_SUBST(SYSTEM_MOZILLA_HEADERS)
6017 dnl ===================================================================
6018 dnl Check for system sane
6019 dnl ===================================================================
6020 AC_MSG_CHECKING([which sane header to use])
6021 if test "$with_system_sane" = "yes"; then
6022     AC_MSG_RESULT([external])
6023     SYSTEM_SANE_HEADER=YES
6024     AC_CHECK_HEADER(sane/sane.h, [],
6025       [AC_MSG_ERROR(sane not found. install sane)], [])
6026 else
6027     AC_MSG_RESULT([internal])
6028     SYSTEM_SANE_HEADER=NO
6029     BUILD_TYPE="$BUILD_TYPE SANE"
6031 AC_SUBST(SYSTEM_SANE_HEADER)
6033 dnl ===================================================================
6034 dnl Check for system icu
6035 dnl ===================================================================
6036 SYSTEM_GENBRK=
6037 SYSTEM_GENCCODE=
6038 SYSTEM_GENCMN=
6039 ICU_MAJOR=
6040 ICU_MINOR=
6041 ICU_MICRO=
6042 ICU_RECLASSIFIED_CLOSE_PARENTHESIS=
6043 AC_MSG_CHECKING([which icu to use])
6044 if test "$with_system_icu" = "yes"; then
6045     AC_MSG_RESULT([external])
6046     SYSTEM_ICU=YES
6047     AC_LANG_PUSH([C++])
6048     AC_MSG_CHECKING([for unicode/rbbi.h])
6049     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
6050     AC_LANG_POP([C++])
6052     ICUPATH="$PATH"
6053     if test "$WITH_MINGW" = "yes" ; then
6054         ICUPATH="/usr/i686-w64-mingw32/sys-root/mingw/bin:$ICUPATH"
6055     fi
6056     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
6058     AC_MSG_CHECKING([ICU version])
6059     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
6060     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
6061     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
6062     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
6064     if test "$ICU_MAJOR" -ge "4"; then
6065         AC_MSG_RESULT([OK, $ICU_VERSION])
6066     else
6067         AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
6068     fi
6070     if test "$cross_compiling" != "yes"; then
6071         # using the system icu tools can lead to version confusion, use the
6072         # ones from the build environment when cross-compiling
6073         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
6074         if test -z "$SYSTEM_GENBRK"; then
6075             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
6076         fi
6077         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6078         if test -z "$SYSTEM_GENCCODE"; then
6079             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
6080         fi
6081         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6082         if test -z "$SYSTEM_GENCMN"; then
6083             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
6084         fi
6085         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4"; then
6086             ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6087         fi
6088     fi
6090     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS icui18n$ICU_MAJOR$ICU_MINOR.dll icuuc$ICU_MAJOR$ICU_MINOR.dll icudata$ICU_MAJOR$ICU_MINOR.dll"
6091 else
6092     AC_MSG_RESULT([internal])
6093     SYSTEM_ICU="NO"
6094     ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6095     BUILD_TYPE="$BUILD_TYPE ICU"
6097 AC_SUBST(SYSTEM_ICU)
6098 AC_SUBST(SYSTEM_GENBRK)
6099 AC_SUBST(SYSTEM_GENCCODE)
6100 AC_SUBST(SYSTEM_GENCMN)
6101 AC_SUBST(ICU_MAJOR)
6102 AC_SUBST(ICU_MINOR)
6103 AC_SUBST(ICU_MICRO)
6104 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
6106 dnl ===================================================================
6107 dnl Graphite
6108 dnl ===================================================================
6110 AC_MSG_CHECKING([whether to enable graphite support])
6111 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" = "z" -o "$enable_graphite" != "no" ; then
6112     AC_MSG_RESULT([yes])
6113     ENABLE_GRAPHITE="TRUE"
6114     AC_MSG_CHECKING([which graphite to use])
6115     if test "$with_system_graphite" = "yes"; then
6116         AC_MSG_RESULT([external])
6117         SYSTEM_GRAPHITE=YES
6118         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
6119         MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libgraphite2.dll"
6120     else
6121         AC_MSG_RESULT([internal])
6122         SYSTEM_GRAPHITE=NO
6123         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
6124     fi
6125 else
6126     AC_MSG_RESULT([no])
6128 AC_SUBST(ENABLE_GRAPHITE)
6129 AC_SUBST(SYSTEM_GRAPHITE)
6130 AC_SUBST(GRAPHITE_LIBS)
6131 AC_SUBST(GRAPHITE_CFLAGS)
6133 dnl ===================================================================
6134 dnl Checks for libraries.
6135 dnl ===================================================================
6136 dnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
6137 dnl See if we have the AppKit framework for building with Quartz graphics.
6139 if test  "$_os" = "Darwin"; then
6140     if test "x$with_x" = "xyes"; then
6141         AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
6142     else
6143         AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
6144         if test -d "/System/Library/Frameworks/AppKit.framework/"; then
6145             AC_MSG_RESULT([yes])
6146             x_includes="no_x_includes"
6147             x_libraries="no_x_libraries"
6148             dnl disable some things used on other Unix versions but not on the aqua build
6149             enable_gtk=no
6150         else
6151             AC_MSG_ERROR([No AppKit.framewrok found])
6152         fi
6153     fi
6156 if test $_os = iOS -o $_os = Android; then
6157     enable_gtk=no
6160 dnl ===================================================================
6161 dnl Check for nsplugin
6162 dnl ===================================================================
6163 AC_MSG_CHECKING([wether to build nsplugin extension])
6164 ENABLE_NSPLUGIN=NO
6165 if test "$enable_nsplugin" != "no"; then
6166     if test "$enable_gtk" != "no"; then
6167         AC_MSG_RESULT([yes])
6168         ENABLE_NSPLUGIN=YES
6169     else
6170         AC_MSG_RESULT([no, disabled gtk2])
6171     fi
6172 else
6173     AC_MSG_RESULT([no])
6175 AC_SUBST(ENABLE_NSPLUGIN)
6177 dnl ***************************************
6178 dnl testing for X libraries and includes...
6179 dnl ***************************************
6180 if test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
6181     dnl Mac OS X using Aqua graphics. Don't check for X11.
6182     :
6183 elif test "$_os" != "WINNT" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6184     AC_PATH_X
6185     AC_PATH_XTRA
6186     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6188     if test "x$x_includes" = "x"; then
6189         x_includes="default_x_includes"
6190     fi
6191     if test "x$x_libraries" = "x"; then
6192         x_libraries="default_x_libraries"
6193     fi
6194     dnl The variables $x_libraries and $x_includes are set.
6195     if test -z "$x_libraries"; then
6196         AC_MSG_ERROR([No X libraries found]) # Exit
6197     fi
6198     if test -z "$x_includes"; then
6199         AC_MSG_ERROR([No X includes found]) # Exit
6200     fi
6201     CFLAGS="$CFLAGS $X_CFLAGS"
6202     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
6203     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
6204     dnl Check if the XauDisposeAuth symbol is provided by libXau.
6205     AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
6206 else
6207     x_includes="no_x_includes"
6208     x_libraries="no_x_libraries"
6210 if test -z "$x_includes"; then
6211     x_includes="no_x_includes"
6213 if test -z "$x_libraries"; then
6214     x_libraries="no_x_libraries"
6216 if test "$x_includes" = "default_x_includes"; then
6217     XINC="/usr/include"
6218 else
6219     XINC="$x_includes"
6221 AC_SUBST(XINC)
6222 if test "$x_libraries" = "default_x_libraries"; then
6223     XLIB=`$PKG_CONFIG --variable=libdir x11`
6224     if test "x$XLIB" = x; then
6225         XLIB="/usr/lib"
6226     fi
6227 else
6228     XLIB="$x_libraries"
6230 AC_SUBST(XLIB)
6231 AC_SUBST(XAU_LIBS)
6233 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6234     dnl ===================================================================
6235     dnl Check for Composite.h for Mozilla plugin
6236     dnl ===================================================================
6237     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
6238      [#include <X11/Intrinsic.h>])
6242 dnl ===================================================================
6243 dnl Check for system Xrender
6244 dnl ===================================================================
6245 AC_MSG_CHECKING([whether to link to Xrender])
6246 if test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then
6247     AC_MSG_RESULT([yes])
6248     XRENDER_LINK=YES
6249     with_system_xrender_headers=yes
6250 else
6251     AC_MSG_RESULT([no, dynamically open it])
6252     XRENDER_LINK=NO
6254 AC_MSG_CHECKING([which Xrender headers to use])
6255 if test "$with_system_xrender_headers" = "yes"; then
6256     AC_MSG_RESULT([external])
6257     SYSTEM_XRENDER_HEADERS=YES
6258     AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
6259       [AC_MSG_ERROR(Xrender not found. install X)], [])
6260 else
6261     AC_MSG_RESULT([internal])
6262     SYSTEM_XRENDER_HEADERS=NO
6263     BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
6265 if test "$XRENDER_LINK" = "YES"; then
6266     AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
6267       [AC_MSG_ERROR(libXrender not found or functional)], [])
6269 AC_SUBST(SYSTEM_XRENDER_HEADERS)
6270 AC_SUBST(XRENDER_LINK)
6272 dnl ===================================================================
6273 dnl Check for XRandr
6274 dnl ===================================================================
6275 AC_MSG_CHECKING([whether to enable RandR support])
6276 if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
6277     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
6278         XRANDR_DLOPEN="TRUE"
6279         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
6280     else
6281         AC_MSG_RESULT([yes])
6282         XRANDR_DLOPEN="FALSE"
6283         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
6284         if test "$ENABLE_RANDR" != "TRUE"; then
6285             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
6286                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
6287             XRANDR_CFLAGS=" "
6288             AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
6289               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
6290             XRANDR_LIBS="-lXrandr "
6291             ENABLE_RANDR="TRUE"
6292         fi
6293     fi
6294 else
6295     ENABLE_RANDR=""
6296     AC_MSG_RESULT([no])
6298 AC_SUBST(XRANDR_DLOPEN)
6299 AC_SUBST(XRANDR_CFLAGS)
6300 AC_SUBST(XRANDR_LIBS)
6301 AC_SUBST(ENABLE_RANDR)
6303 dnl ===================================================================
6304 dnl Check for building neon
6305 dnl ===================================================================
6306 AC_MSG_CHECKING([whether to use neon])
6307 if test "$enable_neon" = "no"; then
6308     AC_MSG_RESULT([no])
6309     DISABLE_NEON=TRUE
6310     AC_SUBST(DISABLE_NEON)
6311 else
6312     AC_MSG_RESULT([yes])
6313 dnl ===================================================================
6314 dnl Check for system neon
6315 dnl ===================================================================
6316 AC_MSG_CHECKING([which neon to use])
6317 if test "$with_system_neon" = "yes"; then
6318     AC_MSG_RESULT([external])
6319     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
6320     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
6321     NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1"
6322     SYSTEM_NEON=YES
6323     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libtasn1-3.dll libgnutls-26.dll libneon-27.dll"
6324 else
6325     AC_MSG_RESULT([internal])
6326     SYSTEM_NEON=NO
6327     NEON_LIBS=-lneon
6328     NEON_CFLAGS=
6329     BUILD_TYPE="$BUILD_TYPE NEON"
6331 AC_SUBST(SYSTEM_NEON)
6332 AC_SUBST(NEON_VERSION)
6333 AC_SUBST(NEON_LIBS)
6334 AC_SUBST(NEON_CFLAGS)
6337 dnl ===================================================================
6338 dnl Check for system openssl
6339 dnl ===================================================================
6340 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6341         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
6342     with_system_openssl=yes
6344 AC_MSG_CHECKING([which libssl to use])
6345 if test "$with_system_openssl" = "yes"; then
6346     AC_MSG_RESULT([external])
6347     # Mac OS builds should get out without extra stuff is the Mac porters'
6348     # wish. And pkg-config is although Xcode ships a .pc for openssl
6349     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6350             "$_os" = "DragonFly"; then
6351         OPENSSL_CFLAGS=
6352         OPENSSL_LIBS="-lssl -lcrypto"
6353     else
6354         PKG_CHECK_MODULES( OPENSSL, openssl )
6355     fi
6356     SYSTEM_OPENSSL=YES
6357     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libssl-8.dll libcrypto-8.dll"
6358 else
6359     AC_MSG_RESULT([internal])
6360     SYSTEM_OPENSSL=NO
6361     BUILD_TYPE="$BUILD_TYPE OPENSSL"
6363 AC_SUBST(SYSTEM_OPENSSL)
6364 AC_SUBST(OPENSSL_CFLAGS)
6365 AC_SUBST(OPENSSL_LIBS)
6367 dnl ===================================================================
6368 dnl Check for system redland
6369 dnl ===================================================================
6370 AC_MSG_CHECKING([which redland library to use])
6371 if test "$with_system_redland" = "yes"; then
6372     AC_MSG_RESULT([external])
6373     SYSTEM_REDLAND=YES
6374     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
6375     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
6376     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libraptor-1.dll librasqal-2.dll libsqlite3-0.dll librdf-0.dll"
6377 else
6378     AC_MSG_RESULT([internal])
6379     BUILD_TYPE="$BUILD_TYPE REDLAND"
6380     SYSTEM_REDLAND=NO
6382 AC_SUBST(SYSTEM_REDLAND)
6383 AC_SUBST(REDLAND_CFLAGS)
6384 AC_SUBST(REDLAND_LIBS)
6386 dnl ===================================================================
6387 dnl Check for system hunspell
6388 dnl ===================================================================
6389 AC_MSG_CHECKING([which libhunspell to use])
6390 if test "$with_system_hunspell" = "yes"; then
6391     AC_MSG_RESULT([external])
6392     SYSTEM_HUNSPELL=YES
6393     AC_LANG_PUSH([C++])
6394     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
6395     if test "$HUNSPELL_PC" != "TRUE"; then
6396         AC_CHECK_HEADER(hunspell.hxx, [],
6397             [
6398             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
6399             [AC_MSG_ERROR(hunspell headers not found.)], [])
6400             ], [])
6401         AC_CHECK_LIB(hunspell, main, [],
6402            [ AC_MSG_ERROR(hunspell library not found.) ], [])
6403         HUNSPELL_LIBS=-lhunspell
6404     fi
6405     AC_LANG_POP([C++])
6406     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhunspell-1.3-0.dll"
6407 else
6408     AC_MSG_RESULT([internal])
6409     SYSTEM_HUNSPELL=NO
6410     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
6412 AC_SUBST(SYSTEM_HUNSPELL)
6413 AC_SUBST(HUNSPELL_CFLAGS)
6414 AC_SUBST(HUNSPELL_LIBS)
6416 dnl ===================================================================
6417 dnl Checking for altlinuxhyph
6418 dnl ===================================================================
6419 AC_MSG_CHECKING([which altlinuxhyph to use])
6420 if test "$with_system_altlinuxhyph" = "yes"; then
6421     AC_MSG_RESULT([external])
6422     SYSTEM_HYPH=YES
6423     AC_CHECK_HEADER(hyphen.h, [],
6424        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
6425     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
6426        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
6427        [#include <hyphen.h>])
6428     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
6429         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6430     if test -z "$HYPHEN_LIB"; then
6431         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
6432            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6433     fi
6434     if test -z "$HYPHEN_LIB"; then
6435         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
6436            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6437     fi
6438     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhyphen-0.dll"
6439 else
6440     AC_MSG_RESULT([internal])
6441     SYSTEM_HYPH=NO
6442     BUILD_TYPE="$BUILD_TYPE HYPHEN"
6444 AC_SUBST(SYSTEM_HYPH)
6445 AC_SUBST(HYPHEN_LIB)
6447 dnl ===================================================================
6448 dnl Checking for mythes
6449 dnl ===================================================================
6450 AC_MSG_CHECKING([which mythes to use])
6451 if test "$with_system_mythes" = "yes"; then
6452     AC_MSG_RESULT([external])
6453     SYSTEM_MYTHES=YES
6454     AC_LANG_PUSH([C++])
6455     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
6456     if test "$MYTHES_PKGCONFIG" = "no"; then
6457         AC_CHECK_HEADER(mythes.hxx, [],
6458             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
6459         AC_CHECK_LIB(mythes-1.2, main, [],
6460             [ MYTHES_FOUND=no], [])
6461     if test "$MYTHES_FOUND" = "no"; then
6462         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
6463                 [ MYTHES_FOUND=no], [])
6464     fi
6465     if test "$MYTHES_FOUND" = "no"; then
6466         AC_MSG_ERROR([mythes library not found!.])
6467     fi
6468     fi
6469     AC_LANG_POP([C++])
6470     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libmythes-1.2-0.dll"
6471 else
6472     AC_MSG_RESULT([internal])
6473     SYSTEM_MYTHES=NO
6474     BUILD_TYPE="$BUILD_TYPE MYTHES"
6476 AC_SUBST(SYSTEM_MYTHES)
6477 AC_SUBST(MYTHES_CFLAGS)
6478 AC_SUBST(MYTHES_LIBS)
6480 dnl ===================================================================
6481 dnl Checking for lpsolve
6482 dnl ===================================================================
6483 AC_MSG_CHECKING([which lpsolve to use])
6484 if test "$with_system_lpsolve" = "yes"; then
6485     AC_MSG_RESULT([external])
6486     SYSTEM_LPSOLVE=YES
6487     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
6488        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
6489     # some systems need this. Like Ubuntu....
6490     AC_CHECK_LIB(m, floor)
6491     AC_CHECK_LIB(dl, dlopen)
6492     AC_CHECK_LIB(lpsolve55, make_lp, ,
6493         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
6494     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS lpsolve55.dll"
6495 else
6496     AC_MSG_RESULT([internal])
6497     SYSTEM_LPSOLVE=NO
6498     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
6500 AC_SUBST(SYSTEM_LPSOLVE)
6502 dnl ===================================================================
6503 dnl Checking for libexttextcat
6504 dnl ===================================================================
6505 AC_MSG_CHECKING([which libexttextcat to use])
6506 if test "$with_system_libexttextcat" = "yes"; then
6507     AC_MSG_RESULT([external])
6508     SYSTEM_LIBEXTTEXTCAT=YES
6509     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
6510     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
6511 else
6512     AC_MSG_RESULT([internal])
6513     SYSTEM_LIBEXTTEXTCAT=NO
6514     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
6516 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
6517 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
6518 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
6519 AC_SUBST(LIBEXTTEXTCAT_LIBS)
6521 dnl ***************************************
6522 dnl testing libc version for Linux...
6523 dnl ***************************************
6524 if test "$_os" = "Linux"; then
6525     AC_MSG_CHECKING([whether libc is >= 2.1.1])
6526     exec 6>/dev/null # no output
6527     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
6528     exec 6>&1 # output on again
6529     if test "$HAVE_LIBC"; then
6530         AC_MSG_RESULT([yes])
6531     else
6532         AC_MSG_ERROR([no, upgrade libc])
6533     fi
6536 if test "$_os" != "WINNT"; then
6537     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
6538     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
6539     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
6540         SYSTEM_LIBC=YES
6541     fi
6542 else
6543     HAVE_GETOPT=NO
6544     HAVE_READDIR_R=NO
6545     SYSTEM_LIBC=YES
6547 AC_SUBST(HAVE_GETOPT)
6548 AC_SUBST(HAVE_READDIR_R)
6549 AC_SUBST(SYSTEM_LIBC)
6551 dnl =========================================
6552 dnl Check for the Windows  SDK.
6553 dnl =========================================
6554 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
6555 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
6556 if test "$_os" = "WINNT"; then
6557     AC_MSG_CHECKING([for Windows SDK])
6558     if test "$build_os" = "cygwin"; then
6559         if test -z "$with_windows_sdk_home"; then
6560             # This first line will detect a February 2003 Microsoft Platform SDK
6561             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
6562             # But there might be also an April 2005 PSDK, unfortunately MS changed
6563             # the registry entry. (we prefer the old version!?)
6564             if test -z "$WINDOWS_SDK_HOME"; then
6565                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
6566             fi
6567             # normalize if found
6568             if test -n "$WINDOWS_SDK_HOME"; then
6569                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
6570                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
6571             fi
6572         else
6573             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
6574         fi
6575     fi
6576     if test -n "$WINDOWS_SDK_HOME"; then
6577         # Remove a possible trailing backslash
6578         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6579         # Problem with current PSDK (iz 49865)
6580         # (What "current" does that mean?)
6581         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
6582             AC_MSG_ERROR([
6583 Some modules do not build correctly with MS Platform SDK - April 2005
6584 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
6585 Remove/rename/backup that file and restart configure. Details about this
6586 problem can be found in issue 49856.])
6587         fi
6589         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6590              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6591              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6592             HAVE_PSDK_H="yes"
6593         else
6594             HAVE_PSDK_H="no"
6595         fi
6596         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
6597             HAVE_PSDK_LIB="yes"
6598         else
6599             HAVE_PSDK_LIB="no"
6600         fi
6602         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
6603             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
6604 the  Windows SDK are installed.])
6605         fi
6607         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
6608              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
6609              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
6610              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe" ; then
6611             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
6612         fi
6613     fi
6615     if test -z "$WINDOWS_SDK_HOME"; then
6616         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6617     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
6618         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
6619     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
6620         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
6621     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
6622         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
6623     else
6624         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
6625     fi
6627 AC_SUBST(WINDOWS_SDK_HOME)
6629 dnl =========================================
6630 dnl Check for the Microsoft DirectX SDK.
6631 dnl =========================================
6632 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
6633     AC_MSG_CHECKING([for DirectX SDK])
6634     if test "$build_os" = "cygwin"; then
6635         if test -z "$with_directx_home"; then
6636             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
6637             if test -n "$DXSDK_DIR"; then
6638                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
6639                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
6640             fi
6641             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
6642             # the "DirectX SDK not found" error later
6643         else
6644             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
6645         fi
6646         # Remove a possible trailing backslash
6647         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
6648     elif test -n "$with_directx_home"; then
6649         DIRECTXSDK_HOME="$with_directx_home"
6650     fi
6652     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
6653         HAVE_DIRECTXSDK_H="yes"
6654     else
6655         HAVE_DIRECTXSDK_H="no"
6656     fi
6658     # MS changed the location of the libraries with Dec 2004 DirectX SDK
6659     if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
6660         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
6661     else
6662         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
6663     fi
6665     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
6666         HAVE_DIRECTXSDK_LIB="yes"
6667     else
6668         HAVE_DIRECTXSDK_LIB="no"
6669     fi
6671     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
6672         AC_MSG_RESULT([found])
6673     else
6674         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6675     fi
6677 AC_SUBST(DIRECTXSDK_HOME)
6678 AC_SUBST(DIRECTXSDK_LIB)
6680 dnl ============================================
6681 dnl Check for Nullsoft Scriptable Install System
6682 dnl ============================================
6683 NSIS_PATH=""
6684 if test "$_os" = "WINNT" ; then
6685     if test -z "$with_nsis_path"; then
6686         AC_PATH_PROG(NSIS_PATH, makensis)
6687         if test -n "$NSIS_PATH"; then
6688             NSIS_PATH=`dirname "$NSIS_PATH"`
6689         elif test "$build_os" = "cygwin"; then
6690             AC_MSG_CHECKING([for NSIS])
6691             nsistest=`./oowintool --nsis-dir`;
6692             nsistest=`cygpath -d -m "$nsistest"`
6693             nsistest=`cygpath -u "$nsistest"`
6694             if test -x "$nsistest/nsis.exe"; then
6695                 NSIS_PATH="$nsistest"
6696                 AC_MSG_RESULT([found ($NSIS_PATH)])
6697             else
6698                 AC_MSG_RESULT([no, no self-contained installer will be built.])
6699             fi
6700         fi
6701     else
6702         AC_MSG_CHECKING([for NSIS])
6703         if test "$build_os" = "cygwin"; then
6704             with_nsis_path=`cygpath -u "$with_nsis_path"`
6705         fi
6706         if test -e "$with_nsis_path/makensis$EXEEXT_FOR_BUILD"; then
6707             NSIS_PATH="$with_nsis_path"
6708         fi
6709         if test -z "$NSIS_PATH"; then
6710             AC_MSG_RESULT([no, no self-contained installer will be built.])
6711         else
6712             if test "$build_os" = "cygwin"; then
6713                 NSIS_PATH=`cygpath -d "$NSIS_PATH"`
6714                 NSIS_PATH=`cygpath -u "$NSIS_PATH"`
6715             fi
6716             AC_MSG_RESULT([found ($NSIS_PATH)])
6717         fi
6718     fi
6720 AC_SUBST(NSIS_PATH)
6722 dnl ***************************************
6723 dnl Checking for bison and flex
6724 dnl ***************************************
6725 AC_PATH_PROG(BISON, bison)
6726 if test -z "$BISON"; then
6727     AC_MSG_ERROR([no bison found in \$PATH, install it])
6728 else
6729     AC_MSG_CHECKING([the bison version])
6730     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
6731     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
6732     # Accept newer than 1.875 or older(equal) than 1.75
6733     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
6734         if test "$_bison_version" = "1.875" ; then
6735             AC_MSG_WARN([suspect ($BISON $_bison_version)])
6736             echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
6737         else
6738             AC_MSG_RESULT([checked ($BISON $_bison_version)])
6739         fi
6740     else
6741         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
6742     fi
6744 AC_PATH_PROG(FLEX, flex)
6745 if test -z "$FLEX"; then
6746     AC_MSG_ERROR([no flex found in \$PATH, install it])
6748 dnl ***************************************
6749 dnl Checking for patch
6750 dnl ***************************************
6751 AC_PATH_PROG(PATCH, patch)
6752 if test -z "$PATCH"; then
6753     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
6756 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
6757 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
6758     if test -z "$with_gnu_patch"; then
6759         GNUPATCH=$PATCH
6760     else
6761         if test -x "$with_gnu_patch"; then
6762             GNUPATCH=$with_gnu_patch
6763         else
6764             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
6765         fi
6766     fi
6768     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
6769     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
6770         AC_MSG_RESULT([yes])
6771     else
6772         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
6773     fi
6776 dnl We also need to check for --with-gnu-cp
6778 if test -z "$with_gnu_cp"; then
6779     # check the place where the good stuff is hidden on Solaris...
6780     if test -x /usr/gnu/bin/cp; then
6781         GNUCP=/usr/gnu/bin/cp
6782     else
6783         AC_PATH_PROGS(GNUCP, gnucp cp)
6784     fi
6785     if test -z $GNUCP; then
6786         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
6787     fi
6788 else
6789     if test -x "$with_gnu_cp"; then
6790         GNUCP=$with_gnu_cp
6791     else
6792         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
6793     fi
6796 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
6797 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
6798     AC_MSG_RESULT([yes])
6799 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
6800     AC_MSG_RESULT([yes])
6801 else
6802     case "$build_os" in
6803     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
6804         GNUCP=''
6805         AC_MSG_RESULT([no gnucp found - using the system's cp command])
6806         ;;
6807     *)
6808         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
6809         ;;
6810     esac
6813 AC_SUBST(GNUPATCH)
6814 AC_SUBST(GNUCP)
6816 dnl ***************************************
6817 dnl testing assembler path
6818 dnl ***************************************
6819 ML_EXE=""
6820 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
6821     if test "$CL_X64" = ""; then
6822         assembler=ml.exe
6823         assembler_bin=bin
6824     else
6825         assembler=ml64.exe
6826         assembler_bin=bin/amd64
6827     fi
6828     if test -n "$with_asm_home"; then
6829         with_asm_home=`cygpath -u "$with_asm_home"`
6830     fi
6831     if test -x "$with_asm_home/$assembler"; then
6832         AC_MSG_CHECKING([$assembler assembler path])
6833         AC_MSG_RESULT([$with_asm_home/$assembler])
6834         ML_EXE="$with_asm_home/$assembler"
6835     else
6836         AC_PATH_PROG(ML_EXE, $assembler)
6837         if test -z "$ML_EXE"; then
6838             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
6839             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
6840                 with_asm_home=$with_cl_home/$assembler_bin
6841                 AC_MSG_RESULT([found])
6842                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
6843             else
6844                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
6845             fi
6846         else
6847             with_asm_home="ASM_IN_PATH"
6848             ML_EXE="$assembler"
6849         fi
6850     fi
6851 else
6852     with_asm_home="NO_ASM_HOME"
6854 ASM_HOME="$with_asm_home"
6855 AC_SUBST(ASM_HOME)
6856 AC_SUBST(ML_EXE)
6858 dnl ===================================================================
6859 dnl We need zip and unzip
6860 dnl ===================================================================
6861 AC_PATH_PROG(ZIP, zip)
6862 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
6863 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
6864     AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
6867 AC_PATH_PROG(UNZIP, unzip)
6868 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
6870 dnl ===================================================================
6871 dnl Zip must be a specific type for different build types.
6872 dnl ===================================================================
6873 if test $build_os = cygwin; then
6874     if test -n "`$ZIP -h | grep -i WinNT`" ; then
6875         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
6876     fi
6879 dnl ===================================================================
6880 dnl Test which vclplugs have to be built.
6881 dnl ===================================================================
6882 R=""
6883 GTK3_CFLAGS=""
6884 GTK3_LIBS=""
6885 ENABLE_GTK3=""
6886 if test "x$enable_gtk3" = "xyes"; then
6887     if test "$with_system_cairo" != yes; then
6888         echo "System cairo required for gtk3 support, please use --with-system-cairo"
6889     fi
6890     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
6891     if test "x$ENABLE_GTK3" = "xTRUE"; then
6892         R="gtk3"
6893     else
6894         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
6895     fi
6897 AC_SUBST(GTK3_LIBS)
6898 AC_SUBST(GTK3_CFLAGS)
6899 AC_SUBST(ENABLE_GTK3)
6901 AC_MSG_CHECKING([which VCLplugs shall be built])
6902 ENABLE_GTK=""
6903 if test "x$enable_gtk" = "xyes"; then
6904     ENABLE_GTK="TRUE"
6905     R="gtk $R"
6907 AC_SUBST(ENABLE_GTK)
6909 ENABLE_KDE=""
6910 if test "x$enable_kde" = "xyes"; then
6911     ENABLE_KDE="TRUE"
6912     R="$R kde"
6914 AC_SUBST(ENABLE_KDE)
6916 ENABLE_KDE4=""
6917 if test "x$enable_kde4" = "xyes"; then
6918     ENABLE_KDE4="TRUE"
6919     R="$R kde4"
6921 AC_SUBST(ENABLE_KDE4)
6923 if test -z "$R"; then
6924     AC_MSG_RESULT([none])
6925 else
6926     AC_MSG_RESULT([$R])
6929 dnl ===================================================================
6930 dnl GCONF check
6931 dnl ===================================================================
6933 ENABLE_GCONF=""
6934 AC_MSG_CHECKING([whether to enable GConf support])
6935 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
6936     ENABLE_GCONF="TRUE"
6937     AC_MSG_RESULT([yes])
6938     PKG_CHECK_MODULES( GCONF, gconf-2.0 ORBit-2.0 )
6939 else
6940     AC_MSG_RESULT([no])
6942 AC_SUBST(ENABLE_GCONF)
6944 dnl ===================================================================
6945 dnl Gnome VFS check
6946 dnl ===================================================================
6948 ENABLE_GNOMEVFS=""
6949 AC_MSG_CHECKING([whether to enable GNOME VFS support])
6950 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
6951     ENABLE_GNOMEVFS="TRUE"
6952     AC_MSG_RESULT([yes])
6953     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
6954 else
6955     AC_MSG_RESULT([no])
6957 AC_SUBST(ENABLE_GNOMEVFS)
6959 dnl ===================================================================
6960 dnl Check whether the gtk 2.0 libraries are available.
6961 dnl ===================================================================
6963 GTK_CFLAGS=""
6964 GTK_LIBS=""
6965 ENABLE_SYSTRAY_GTK=""
6966 ENABLE_DBUS=""
6967 DBUS_CFLAGS=""
6968 DBUS_LIBS=""
6969 if test  "$test_gtk" = "yes"; then
6971     if test "$ENABLE_GTK" = "TRUE" ; then
6972         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]))
6973         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]))
6974         BUILD_TYPE="$BUILD_TYPE GTK"
6976         if test "x$enable_systray" = "xyes"; then
6977             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
6978                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
6979                             [ ENABLE_SYSTRAY_GTK="" ])
6980         fi
6982         AC_MSG_CHECKING([whether to enable DBUS support])
6983         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
6984             ENABLE_DBUS="TRUE"
6985             AC_MSG_RESULT([yes])
6986             PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
6987         else
6988             AC_MSG_RESULT([no])
6989         fi
6991         AC_MSG_CHECKING([whether to enable GIO support])
6992         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
6993             if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
6994                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
6995             fi
6996             ENABLE_GIO="TRUE"
6997             AC_MSG_RESULT([yes])
6998             PKG_CHECK_MODULES( GIO, gio-2.0 )
6999         else
7000             AC_MSG_RESULT([no])
7001         fi
7002     fi
7004 AC_SUBST(ENABLE_GIO)
7005 AC_SUBST(ENABLE_DBUS)
7006 AC_SUBST(ENABLE_SYSTRAY_GTK)
7007 AC_SUBST(GTK_CFLAGS)
7008 AC_SUBST(GTK_LIBS)
7009 AC_SUBST(GTHREAD_CFLAGS)
7010 AC_SUBST(GTHREAD_LIBS)
7011 AC_SUBST(DBUS_CFLAGS)
7012 AC_SUBST(DBUS_LIBS)
7014 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
7015 AC_SUBST(LIBPNG_LIBS)
7016 AC_SUBST(LIBPNG_CFLAGS)
7018 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
7019 if test "x$enable_unix_libpng" = "xyes"; then
7020     AC_MSG_RESULT([yes])
7021 else
7022     AC_MSG_RESULT([no])
7023     ENABLE_QUICKSTART_LIBPNG=""
7025 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
7027 SPLIT_APP_MODULES=""
7028 if test "$enable_split_app_modules" = "yes"; then
7029     SPLIT_APP_MODULES="YES"
7031 AC_SUBST(SPLIT_APP_MODULES)
7033 SPLIT_OPT_FEATURES=""
7034 if test "$enable_split_opt_features" = "yes"; then
7035     SPLIT_OPT_FEATURES="YES"
7037 AC_SUBST(SPLIT_OPT_FEATURES)
7039 ENABLE_CAIRO_CANVAS="FALSE"
7040 if test "$enable_cairo_canvas" = "yes" ; then
7041    ENABLE_CAIRO_CANVAS="TRUE"
7043 AC_SUBST(ENABLE_CAIRO_CANVAS)
7045 dnl ===================================================================
7046 dnl Check whether the GStreamer libraries are available.
7047 dnl ===================================================================
7049 ENABLE_GSTREAMER=""
7051 if test  "$build_gstreamer" = "yes"; then
7053     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
7054     if test "x$enable_gstreamer" != "xno" ; then
7055         ENABLE_GSTREAMER="TRUE"
7056         AC_MSG_RESULT([yes])
7057         PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 )
7058     else
7059         AC_MSG_RESULT([no])
7060     fi
7063 AC_SUBST(ENABLE_GSTREAMER)
7065 dnl ===================================================================
7066 dnl Check whether the OpenGL libraries are available
7067 dnl ===================================================================
7069 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
7070 ENABLE_OPENGL=
7072 if test "$_os" = "Darwin" ; then
7073     # We use frameworks on Mac OS X, no need for detail checks
7074     ENABLE_OPENGL=TRUE
7075     SYSTEM_MESA_HEADERS=YES
7076     AC_MSG_RESULT([yes])
7077 else
7078     if test "x$enable_opengl" != "xno" ; then
7079         if test "$_os" != "WINNT"; then
7080             save_LDFLAGS=$LDFLAGS
7081             LDFLAGS="$LDFLAGS -lm"
7082             AC_MSG_RESULT([yes])
7083             AC_CHECK_LIB(GL, main, [],
7084                       [AC_MSG_ERROR(libGL not installed or functional)], [])
7085             AC_CHECK_LIB(GLU, main, [],
7086                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
7087             ENABLE_OPENGL=TRUE
7088             LDFLAGS=$save_LDFLAGS
7090             dnl ===================================================================
7091             dnl Check for system Mesa
7092             dnl ===================================================================
7093             AC_MSG_CHECKING([which Mesa headers to use])
7094             if test "$with_system_mesa_headers" = "yes"; then
7095                 AC_MSG_RESULT([external])
7096                 SYSTEM_MESA_HEADERS=YES
7097                 AC_LANG_PUSH(C)
7098                 AC_CHECK_HEADER(GL/glxext.h, [],
7099                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
7100                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
7101                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
7102                 AC_LANG_POP(C)
7103             else
7104                 AC_MSG_RESULT([internal])
7105                 SYSTEM_MESA_HEADERS=NO
7106                 BUILD_TYPE="$BUILD_TYPE MESA"
7107             fi
7108         else
7109             AC_MSG_RESULT([not on Windows])
7110         fi
7111     else
7112        AC_MSG_RESULT([no])
7113     fi
7116 AC_SUBST(SYSTEM_MESA_HEADERS)
7117 AC_SUBST(ENABLE_OPENGL)
7119 # presenter minimizer extension?
7120 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
7121 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
7122    AC_MSG_RESULT([yes])
7123    ENABLE_MINIMIZER=YES
7124 else
7125    AC_MSG_RESULT([no])
7126    ENABLE_MINIMIZER=NO
7127    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
7129 AC_SUBST(ENABLE_MINIMIZER)
7131 # presenter console extension?
7132 AC_MSG_CHECKING([whether to build the Presenter Console extension])
7133 if test "x$enable_ext_presenter_console" != "xno" -a "x$enable_extension_integration" != "xno"; then
7134    AC_MSG_RESULT([yes])
7135    ENABLE_PRESENTER_SCREEN=YES
7136 else
7137    AC_MSG_RESULT([no])
7138    ENABLE_PRESENTER_SCREEN=NO
7139    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PRESENTER_SCREEN"
7141 AC_SUBST(ENABLE_PRESENTER_SCREEN)
7143 # pdf import extension?
7144 AC_MSG_CHECKING([whether to build the PDF Import extension])
7145 if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" != "xno"; then
7146   AC_MSG_RESULT([yes])
7147   ENABLE_PDFIMPORT=YES
7149   dnl ===================================================================
7150   dnl Check for system poppler
7151   dnl ===================================================================
7152   AC_MSG_CHECKING([which pdf backend to use])
7153   if test "$with_system_poppler" = "yes"; then
7154       AC_MSG_RESULT([external])
7155       SYSTEM_POPPLER=YES
7156       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
7157       AC_LANG_PUSH([C++])
7158       save_CXXFLAGS=$CXXFLAGS
7159       save_CPPFLAGS=$CPPFLAGS
7160       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
7161       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
7162       AC_CHECK_HEADER([cpp/poppler-version.h], [],
7163                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
7164       CXXFLAGS=$save_CXXFLAGS
7165       CPPFLAGS=$save_CPPFLAGS
7166       AC_LANG_POP([C++])
7167   else
7168       AC_MSG_RESULT([internal])
7169       SYSTEM_POPPLER=NO
7170       BUILD_TYPE="$BUILD_TYPE XPDF"
7171   fi
7172 else
7173   AC_MSG_RESULT([no])
7174   ENABLE_PDFIMPORT=NO
7175   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PDFIMPORT"
7177 AC_SUBST(ENABLE_PDFIMPORT)
7178 AC_SUBST(SYSTEM_POPPLER)
7179 AC_SUBST(POPPLER_CFLAGS)
7180 AC_SUBST(POPPLER_LIBS)
7183 if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then
7184    AC_MSG_CHECKING([for sdext module])
7185    BUILD_TYPE="$BUILD_TYPE SDEXT"
7188 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
7189 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7190   AC_MSG_RESULT([yes])
7191   AC_MSG_CHECKING([for swext module])
7192   ENABLE_MEDIAWIKI=YES
7193   BUILD_TYPE="$BUILD_TYPE SWEXT"
7194   if test  "x$with_java" = "xno"; then
7195     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
7196   fi
7197 else
7198   AC_MSG_RESULT([no])
7199   ENABLE_MEDIAWIKI=NO
7200   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
7202 AC_SUBST(ENABLE_MEDIAWIKI)
7204 if test "$ENABLE_MEDIAWIKI" = "YES"; then
7205     AC_MSG_CHECKING([which Servlet API Jar to use])
7206     if test "$with_system_servlet_api" = "yes"; then
7207         AC_MSG_RESULT([external])
7208         SYSTEM_SERVLETAPI=YES
7209         if test -z "$SERVLETAPI_JAR"; then
7210             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
7211         fi
7212         AC_CHECK_FILE($SERVLETAPI_JAR, [],
7213               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
7214     else
7215         AC_MSG_RESULT([internal])
7216         SYSTEM_SERVLETAPI=NO
7217         BUILD_TYPE="$BUILD_TYPE TOMCAT"
7218     fi
7220 AC_SUBST(SYSTEM_SERVLETAPI)
7221 AC_SUBST(SERVLETAPI_JAR)
7223 AC_MSG_CHECKING([whether to build the Report Builder extension])
7224 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7225     AC_MSG_RESULT([yes])
7226     ENABLE_REPORTBUILDER=YES
7227     AC_MSG_CHECKING([for reportbuilder module])
7228     AC_MSG_CHECKING([which jfreereport libs to use])
7229     if test "$with_system_jfreereport" = "yes"; then
7230         SYSTEM_JFREEREPORT=YES
7231         AC_MSG_RESULT([external])
7232         if test -z $SAC_JAR; then
7233             SAC_JAR=/usr/share/java/sac.jar
7234         fi
7235         AC_CHECK_FILE($SAC_JAR, [],
7236              [AC_MSG_ERROR(sac.jar not found.)], [])
7238         if test -z $LIBXML_JAR; then
7239             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
7240                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
7241                 [
7242                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
7243                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
7244                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
7245                     )
7246                 ]
7247             )
7248         else
7249             AC_CHECK_FILE($LIBXML_JAR, [],
7250                  [AC_MSG_ERROR(libxml.jar not found.)], [])
7251         fi
7253         if test -z $FLUTE_JAR; then
7254             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
7255                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
7256                 [
7257                     AC_CHECK_FILE(/usr/share/java/flute.jar,
7258                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
7259                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
7260                     )
7261                 ]
7262             )
7263         else
7264             AC_CHECK_FILE($FLUTE_JAR, [],
7265                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
7266         fi
7268         if test -z $JFREEREPORT_JAR; then
7269             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
7270                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
7271                 [
7272                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
7273                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
7274                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
7275                     )
7276                 ]
7277             )
7278         else
7279             AC_CHECK_FILE($JFREEREPORT_JAR, [],
7280                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
7281         fi
7283         if test -z $LIBLAYOUT_JAR; then
7284             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
7285                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
7286                 [
7287                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
7288                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
7289                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
7290                     )
7291                 ]
7292             )
7293         else
7294             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
7295                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
7296         fi
7298         if test -z $LIBLOADER_JAR; then
7299             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
7300                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
7301                 [
7302                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
7303                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
7304                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
7305                     )
7306                 ]
7307             )
7308         else
7309             AC_CHECK_FILE($LIBLOADER_JAR, [],
7310                 [AC_MSG_ERROR(libloader.jar not found.)], [])
7311         fi
7313         if test -z $LIBFORMULA_JAR; then
7314             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
7315                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
7316                  [
7317                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
7318                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
7319                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
7320                      )
7321                  ]
7322             )
7323         else
7324             AC_CHECK_FILE($LIBFORMULA_JAR, [],
7325                 [AC_MSG_ERROR(libformula.jar not found.)], [])
7326         fi
7328         if test -z $LIBREPOSITORY_JAR; then
7329             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
7330                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
7331                 [
7332                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
7333                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
7334                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
7335                     )
7336                 ]
7337             )
7338         else
7339             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
7340                 [AC_MSG_ERROR(librepository.jar not found.)], [])
7341         fi
7343         if test -z $LIBFONTS_JAR; then
7344             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
7345                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
7346                 [
7347                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
7348                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
7349                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
7350                     )
7351                 ]
7352             )
7353         else
7354             AC_CHECK_FILE($LIBFONTS_JAR, [],
7355                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
7356         fi
7358         if test -z $LIBSERIALIZER_JAR; then
7359             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
7360                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
7361                 [
7362                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
7363                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
7364                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
7365                     )
7366                 ]
7367             )
7368         else
7369             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
7370                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
7371         fi
7374         if test -z $LIBBASE_JAR; then
7375             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
7376                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
7377                 [
7378                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
7379                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
7380                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
7381                     )
7382                 ]
7383             )
7384         else
7385             AC_CHECK_FILE($LIBBASE_JAR, [],
7386                 [AC_MSG_ERROR(libbase.jar not found.)], [])
7387         fi
7389     else
7390         AC_MSG_RESULT([internal])
7391         AC_MSG_CHECKING([for jfreereport module])
7392         SYSTEM_JFREEREPORT=NO
7393         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
7394     fi
7395     BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
7396 else
7397     AC_MSG_RESULT([no])
7398     ENABLE_REPORTBUILDER=NO
7399     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
7400     SYSTEM_JFREEREPORT=NO
7402 AC_SUBST(ENABLE_REPORTBUILDER)
7403 AC_SUBST(SYSTEM_JFREEREPORT)
7404 AC_SUBST(SAC_JAR)
7405 AC_SUBST(LIBXML_JAR)
7406 AC_SUBST(FLUTE_JAR)
7407 AC_SUBST(JFREEREPORT_JAR)
7408 AC_SUBST(LIBBASE_JAR)
7409 AC_SUBST(LIBLAYOUT_JAR)
7410 AC_SUBST(LIBLOADER_JAR)
7411 AC_SUBST(LIBFORMULA_JAR)
7412 AC_SUBST(LIBREPOSITORY_JAR)
7413 AC_SUBST(LIBFONTS_JAR)
7414 AC_SUBST(LIBSERIALIZER_JAR)
7416 # this has to be here because both the Wiki Publisher and the SRB use
7417 # commons-logging
7418 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7419     AC_MSG_CHECKING([which Apache commons-* libs to use])
7420     if test "$with_system_apache_commons" = "yes"; then
7421         SYSTEM_APACHE_COMMONS=YES
7422         AC_MSG_RESULT([external])
7423         if test "$ENABLE_MEDIAWIKI" = "YES"; then
7424             if test -z $COMMONS_CODEC_JAR; then
7425                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
7426                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
7427                     [
7428                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
7429                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
7430                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
7431                         )
7432                     ]
7433                 )
7434             else
7435                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
7436                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
7437             fi
7439             if test -z $COMMONS_LANG_JAR; then
7440                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
7441                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
7442                     [
7443                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
7444                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
7445                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
7446                             )
7447                     ]
7448                 )
7449             else
7450                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
7451                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
7452             fi
7454             if test -z $COMMONS_HTTPCLIENT_JAR; then
7455                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
7456                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
7457                     [
7458                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
7459                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
7460                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
7461                         )
7462                     ]
7463                 )
7464             else
7465                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
7466                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
7467             fi
7468         fi
7469         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7470             if test -z $COMMONS_LOGGING_JAR; then
7471                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
7472                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
7473                    [
7474                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
7475                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
7476                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
7477                         )
7478                     ]
7479                 )
7480             else
7481                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
7482                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
7483             fi
7484         fi
7485     else
7486         AC_MSG_RESULT([internal])
7487         SYSTEM_APACHE_COMMONS=NO
7488         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
7489     fi
7491 AC_SUBST(SYSTEM_APACHE_COMMONS)
7492 AC_SUBST(COMMONS_CODEC_JAR)
7493 AC_SUBST(COMMONS_LANG_JAR)
7494 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
7495 AC_SUBST(COMMONS_LOGGING_JAR)
7497 # scripting provider for BeanShell extension?
7498 AC_MSG_CHECKING([whether to build extension for support of scripts in BeanShell])
7499 if test "x$enable_ext_scripting_beanshell" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7500    AC_MSG_RESULT([yes])
7501    ENABLE_SCRIPTING_BEANSHELL=YES
7502 else
7503    AC_MSG_RESULT([no])
7504    ENABLE_SCRIPTING_BEANSHELL=NO
7505    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_BEANSHELL"
7507 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
7509 # scripting provider for JavaScript extension?
7510 AC_MSG_CHECKING([whether to build extension for support of scripts in JavaScript])
7511 if test "x$enable_ext_scripting_javascript" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7512    AC_MSG_RESULT([yes])
7513    ENABLE_SCRIPTING_JAVASCRIPT=YES
7514 else
7515    AC_MSG_RESULT([no])
7516    ENABLE_SCRIPTING_JAVASCRIPT=NO
7517    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_JAVASCRIPT"
7519 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
7521 dnl Scripting provider for Python extension?
7522 dnl We always provide this unless we have disabled Python completely
7523 if test $enable_python = no; then
7524     ENABLE_SCRIPTING_PYTHON=NO
7525 else
7526     ENABLE_SCRIPTING_PYTHON=YES
7528 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
7530 supports_multilib=
7531 case "$host_cpu" in
7532 x86_64 | powerpc64 | s390x)
7533     if test "$SIZEOF_LONG" = "8"; then
7534         supports_multilib="yes"
7535     fi
7536     ;;
7538     ;;
7539 esac
7541 dnl ===================================================================
7542 dnl Check whether the Qt3 and KDE3 libraries are available.
7543 dnl ===================================================================
7545 KDE_CFLAGS=""
7546 KDE_LIBS=""
7547 if test "$_os" != "OpenBSD"; then
7548     MOC="moc"
7550 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
7551     dnl Search paths for Qt3 and KDE3
7552     if test -z "$supports_multilib" ; then
7553         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"
7554         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"
7555     else
7556         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"
7557         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"
7558     fi
7559     if test -n "$QTDIR" ; then
7560         qt_incdirs="$QTDIR/include $qt_incdirs"
7561         if test -z "$supports_multilib" ; then
7562             qt_libdirs="$QTDIR/lib $qt_libdirs"
7563         else
7564             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7565         fi
7566     fi
7567     if test -z "$supports_multilib" ; then
7568         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"
7569         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"
7570     else
7571         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"
7572         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"
7573     fi
7574     if test -n "$KDEDIR" ; then
7575         kde_incdirs="$KDEDIR/include $kde_incdirs"
7576         if test -z "$supports_multilib" ; then
7577             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7578         else
7579             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7580         fi
7581     fi
7583     dnl What to test
7584     qt_test_include="qstyle.h"
7585     kde_test_include="kapp.h"
7587     if test "$_os" != "OpenBSD"; then
7588         qt_test_library="libqt-mt.so"
7589         kde_test_library="libDCOP.so"
7590     else
7591         qt_test_library="libqt-mt.so*"
7592         kde_test_library="libDCOP.so*"
7593     fi
7595     dnl Check for Qt3 headers
7596     AC_MSG_CHECKING([for Qt3 headers])
7597     qt_incdir="no"
7598     for kde_check in $qt_incdirs ; do
7599         if test -r "$kde_check/$qt_test_include" ; then
7600             qt_incdir="$kde_check"
7601             break
7602         fi
7603     done
7604     AC_MSG_RESULT([$qt_incdir])
7605     if test "x$qt_incdir" = "xno" ; then
7606         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
7607 your Qt3 installation by exporting QTDIR before running "configure".])
7608     fi
7610     dnl Check for Qt3 libraries
7611     AC_MSG_CHECKING([for Qt3 libraries])
7612     qt_libdir="no"
7613     for qt_check in $qt_libdirs ; do
7614         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`" ; then
7615             qt_libdir="$qt_check"
7616             break
7617         fi
7618     done
7619     AC_MSG_RESULT([$qt_libdir])
7620     if test "x$qt_libdir" = "xno" ; then
7621         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
7622 your Qt3 installation by exporting QTDIR before running "configure".])
7623     fi
7625     dnl Check for Meta Object Compiler
7626     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
7627     if test "$MOC" = "no" ; then
7628         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
7629 the root of your Qt3 installation by exporting QTDIR before running "configure".])
7630     fi
7632     dnl Check for KDE3 headers
7633     AC_MSG_CHECKING([for KDE3 headers])
7634     kde_incdir="no"
7635     for kde_check in $kde_incdirs ; do
7636         if test -r "$kde_check/$kde_test_include" ; then
7637             kde_incdir="$kde_check"
7638             break
7639         fi
7640     done
7641     AC_MSG_RESULT([$kde_incdir])
7642     if test "x$kde_incdir" = "xno" ; then
7643         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
7644 your KDE3 installation by exporting KDEDIR before running "configure".])
7645     fi
7647     dnl Check for KDE3 libraries
7648     AC_MSG_CHECKING([for KDE3 libraries])
7649     kde_libdir="no"
7650     for kde_check in $kde_libdirs ; do
7651         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`" ; then
7652             kde_libdir="$kde_check"
7653             break
7654         fi
7655     done
7656     AC_MSG_RESULT([$kde_libdir])
7657     if test "x$kde_libdir" = "xno" ; then
7658         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
7659 your KDE3 installation by exporting KDEDIR before running "configure".])
7660     fi
7662     dnl Set the variables
7663     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7664     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
7666 AC_SUBST(KDE_CFLAGS)
7667 AC_SUBST(KDE_LIBS)
7668 AC_SUBST(MOC)
7670 dnl ===================================================================
7671 dnl KDE4 Integration
7672 dnl ===================================================================
7674 KDE4_CFLAGS=""
7675 KDE4_LIBS=""
7676 MOC4="moc"
7677 KDE_GLIB_CFLAGS=""
7678 KDE_GLIB_LIBS=""
7679 KDE_HAVE_GLIB=""
7680 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
7681     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
7682     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
7684     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
7685     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
7687     if test -n "$supports_multilib" ; then
7688         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
7689         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
7690     fi
7692     if test -n "$QTDIR" ; then
7693         qt_incdirs="$QTDIR/include $qt_incdirs"
7694         if test -z "$supports_multilib" ; then
7695             qt_libdirs="$QTDIR/lib $qt_libdirs"
7696         else
7697             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7698         fi
7699     fi
7700     if test -n "$QT4DIR" ; then
7701         qt_incdirs="$QT4DIR/include $qt_incdirs"
7702         if test -z "$supports_multilib" ; then
7703             qt_libdirs="$QT4DIR/lib $qt_libdirs"
7704         else
7705             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
7706         fi
7707     fi
7709     if test -n "$KDEDIR" ; then
7710         kde_incdirs="$KDEDIR/include $kde_incdirs"
7711         if test -z "$supports_multilib" ; then
7712             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7713         else
7714             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7715         fi
7716     fi
7717     if test -n "$KDE4DIR" ; then
7718         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
7719         if test -z "$supports_multilib" ; then
7720             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
7721         else
7722             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
7723         fi
7724     fi
7726     qt_test_include="Qt/qobject.h"
7727     qt_test_library="libQtCore.so"
7728     kde_test_include="kwindowsystem.h"
7729     kde_test_library="libsolid.so"
7731     AC_MSG_CHECKING([for Qt4 headers])
7732     qt_header_dir="no"
7733     for inc_dir in $qt_incdirs ; do
7734         if test -r "$inc_dir/$qt_test_include" ; then
7735             qt_header_dir="$inc_dir"
7736             break
7737         fi
7738     done
7740     AC_MSG_RESULT([$qt_header_dir])
7741     if test "x$qt_header_dir" = "xno" ; then
7742         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7743     fi
7745     AC_MSG_CHECKING([for Qt4 libraries])
7746     qt_lib_dir="no"
7747     for lib_dir in $qt_libdirs ; do
7748         if test -r "$lib_dir/$qt_test_library" ; then
7749             qt_lib_dir="$lib_dir"
7750             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
7751             break
7752         fi
7753     done
7755     AC_MSG_RESULT([$qt_lib_dir])
7757     if test "x$qt_lib_dir" = "xno" ; then
7758         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7759     fi
7761     dnl Check for Meta Object Compiler
7763     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7764     MOC4="$MOCQT4"
7765     if test "$MOC4" = "no" ; then
7766         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7767         if test "$MOC4" = "no" ; then
7768             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
7769 the root of your Qt installation by exporting QT4DIR before running "configure".])
7770         fi
7771     fi
7773     dnl Check for KDE4 headers
7774     AC_MSG_CHECKING([for KDE4 headers])
7775     kde_incdir="no"
7776     for kde_check in $kde_incdirs ; do
7777         if test -r "$kde_check/$kde_test_include" ; then
7778             kde_incdir="$kde_check"
7779             break
7780         fi
7781     done
7782     AC_MSG_RESULT([$kde_incdir])
7783     if test "x$kde_incdir" = "xno" ; then
7784         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7785     fi
7787     dnl Check for KDE4 libraries
7788     AC_MSG_CHECKING([for KDE4 libraries])
7789     kde_libdir="no"
7790     for kde_check in $kde_libdirs ; do
7791         if test -r "$kde_check/$kde_test_library" ; then
7792             kde_libdir="$kde_check"
7793             break
7794         fi
7795     done
7797     AC_MSG_RESULT([$kde_libdir])
7798     if test "x$kde_libdir" = "xno" ; then
7799         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7800     fi
7802     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7803     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
7805     AC_LANG_PUSH([C++])
7806     save_CXXFLAGS=$CXXFLAGS
7807     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
7808     AC_MSG_CHECKING([whether KDE is >= 4.2])
7809        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7810 #include <kdeversion.h>
7812 int main(int argc, char **argv) {
7813        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
7814        else return 1;
7816        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
7817     CXXFLAGS=$save_CXXFLAGS
7818     AC_LANG_POP([C++])
7820    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
7821     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
7822         [KDE_HAVE_GLIB=1],
7823         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
7825 AC_SUBST(KDE4_CFLAGS)
7826 AC_SUBST(KDE4_LIBS)
7827 AC_SUBST(MOC4)
7828 AC_SUBST(KDE_GLIB_CFLAGS)
7829 AC_SUBST(KDE_GLIB_LIBS)
7830 AC_SUBST(KDE_HAVE_GLIB)
7832 dnl ===================================================================
7833 dnl Test for the enabling the lockdown pieces
7834 dnl ===================================================================
7835 AC_MSG_CHECKING([whether to enable the lockdown pieces])
7836 ENABLE_LOCKDOWN=""
7837 if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
7838     ENABLE_LOCKDOWN=YES
7839     AC_MSG_RESULT([yes])
7840 else
7841     AC_MSG_RESULT([no])
7843 AC_SUBST(ENABLE_LOCKDOWN)
7845 dnl ===================================================================
7846 dnl Test whether to include Evolution 2 support
7847 dnl ===================================================================
7848 AC_MSG_CHECKING([whether to enable evolution 2 support])
7849 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
7850     AC_MSG_RESULT([yes])
7851     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
7852     ENABLE_EVOAB2="TRUE"
7853 else
7854     ENABLE_EVOAB2=""
7855     AC_MSG_RESULT([no])
7857 AC_SUBST(ENABLE_EVOAB2)
7858 AC_SUBST(GOBJECT_CFLAGS)
7859 AC_SUBST(GOBJECT_LIBS)
7861 dnl ===================================================================
7862 dnl Test whether to include KDE AB support
7863 dnl ===================================================================
7864 AC_MSG_CHECKING([whether to enable KDE address book support])
7865 if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then
7866     AC_MSG_RESULT([yes])
7867     AC_LANG_PUSH([C++])
7868     save_CXXFLAGS=$CXXFLAGS
7869     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
7870     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
7871        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7872 #include <kdeversion.h>
7874 int main(int argc, char **argv) {
7875        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
7876        else return 1;
7878        ]])],[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])],[])
7879     CXXFLAGS=$save_CXXFLAGS
7880     AC_LANG_POP([C++])
7881     ENABLE_KAB=TRUE
7882 else
7883     AC_MSG_RESULT([no])
7884     ENABLE_KAB=
7886 AC_SUBST(ENABLE_KAB)
7888 dnl ===================================================================
7889 dnl Test whether to include MathMLDTD
7890 dnl ===================================================================
7891 AC_MSG_CHECKING([whether to include MathMLDTD])
7892 if test -n "$enable_mathmldtd"; then
7893     if test "$enable_mathmldtd" = "no"; then
7894         AC_MSG_RESULT([no])
7895         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
7896     else
7897         AC_MSG_RESULT([yes])
7898         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
7899     fi
7900 else
7901     AC_MSG_RESULT([no])
7902     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
7905 dnl ===================================================================
7906 dnl Test which themes to include
7907 dnl ===================================================================
7908 AC_MSG_CHECKING([which themes to include])
7909 # if none given, use all available themes
7910 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
7911     with_theme="default crystal hicontrast oxygen tango"
7914 WITH_THEMES=""
7915 for theme in $with_theme; do
7916     case $theme in
7917         default|crystal|hicontrast|oxygen|tango) : ;;
7918         *) AC_MSG_ERROR([Unknown value for --with-themes: $theme]) ;;
7919     esac
7920     WITH_THEMES="$WITH_THEMES $theme"
7921     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
7922 done
7923 AC_MSG_RESULT([$WITH_THEMES])
7924 AC_SUBST([WITH_THEMES])
7926 dnl ===================================================================
7927 dnl Test whether to integrate helppacks into the product's installer
7928 dnl ===================================================================
7929 AC_MSG_CHECKING([for helppack integration])
7930 if test "z$with_helppack_integration" = "zno" ; then
7931     WITH_HELPPACK_INTEGRATION=NO
7932     AC_MSG_RESULT([no integration])
7933 else
7934     WITH_HELPPACK_INTEGRATION=YES
7935     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
7936     AC_MSG_RESULT([integration])
7938 AC_SUBST(WITH_HELPPACK_INTEGRATION)
7940 ###############################################################################
7941 # Extensions checking
7942 ###############################################################################
7943 dnl ===================================================================
7944 dnl Test whether to integrate extensions into the product's installer
7945 dnl ===================================================================
7946 AC_MSG_CHECKING([for extensions integration])
7947 if test "x$enable_extension_integration" != "xno"; then
7948     WITH_EXTENSION_INTEGRATION=YES
7949     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
7950     AC_MSG_RESULT([yes, use integration])
7951 else
7952     WITH_EXTENSION_INTEGRATION=NO
7953     AC_MSG_RESULT([no, do not integrate])
7955 AC_SUBST(WITH_EXTENSION_INTEGRATION)
7957 dnl ===================================================================
7958 dnl Test whether to include Lightproof extensions
7959 dnl ===================================================================
7960 AC_MSG_CHECKING([for Lightproof extensions integration (only supported languages displayed)])
7961 LIGHTPROOF_LANG=
7962 LIGHTPROOF_HU_PACK=
7963 LIGHTPROOF_RU_PACK=
7964 LIGHTPROOF_EN_US_PACK=
7965 if test "x$enable_ext_lightproof" = "xno" -o "x$enable_extension_integration" = "xno"; then
7966     AC_MSG_RESULT([no integration])
7967 else
7968     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LIGHTPROOF"
7969     if test "x$enable_ext_lightproof" = "xyes" -o "x$enable_ext_lightproof" = "x"; then
7970         wanted_lightproof="en-US hu ru"
7971     else
7972         for lang in $enable_ext_lightproof ; do
7973             case $lang in
7974                 en-US|hu|ru)
7975                     wanted_lightproof="$wanted_lightproof $lang"
7976                     ;;
7977                 *)
7978                     AC_MSG_ERROR([Unknown value for --enable-ext-lightproof: $lang])
7979                     ;;
7980                 esac
7981         done
7982     fi
7983     for lang in $wanted_lightproof ; do
7984         LIGHTPROOF_LANG="$LIGHTPROOF_LANG $lang"
7985         case $lang in
7986             en-US) LIGHTPROOF_EN_US_PACK="0ab55ac8e88f04258f1d3e79e984382f-lightproof-en_US-0.1.oxt" ;;
7987             hu) LIGHTPROOF_HU_PACK="76345f925e34fef2d29bade4f29108e9-lightproof-hu_1.3.oxt" ;;
7988             ru) LIGHTPROOF_RU_PACK="673860e8649cff2ebdc68bd46f2f7f1a-lightproof-ru_0.1.oxt" ;;
7989             *) AC_MSG_ERROR([Unknown value for --enable-ext-lightproof: $lang]) ;;
7990         esac
7991     done
7992     AC_MSG_RESULT([$LIGHTPROOF_LANG])
7994 AC_SUBST(LIGHTPROOF_LANG)
7995 AC_SUBST(LIGHTPROOF_HU_PACK)
7996 AC_SUBST(LIGHTPROOF_RU_PACK)
7997 AC_SUBST(LIGHTPROOF_EN_US_PACK)
7999 dnl ===================================================================
8000 dnl Test whether to include Watch Window extension
8001 dnl ===================================================================
8002 AC_MSG_CHECKING([for Watch Window extension integration])
8003 WATCH_WINDOW_EXTENSION_PACK=
8004 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8005     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
8006     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
8007     AC_MSG_RESULT([yes])
8008 else
8009     AC_MSG_RESULT([no])
8011 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
8013 dnl ===================================================================
8014 dnl Test whether to include SmART Gallery (Diagram) extension
8015 dnl ===================================================================
8016 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
8017 DIAGRAM_EXTENSION_PACK=
8018 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8019     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
8020     DIAGRAM_EXTENSION_PACK="4a433efb6d385264ebc1d5513782d51c-SmART_0.9.4.oxt"
8021     AC_MSG_RESULT([yes])
8022 else
8023     AC_MSG_RESULT([no])
8025 AC_SUBST(DIAGRAM_EXTENSION_PACK)
8027 dnl ===================================================================
8028 dnl Test whether to include Validator extension
8029 dnl ===================================================================
8030 AC_MSG_CHECKING([for Validator extension integration])
8031 VALIDATOR_EXTENSION_PACK=
8032 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8033     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
8034     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
8035     AC_MSG_RESULT([yes])
8036 else
8037     AC_MSG_RESULT([no])
8039 AC_SUBST(VALIDATOR_EXTENSION_PACK)
8041 dnl ===================================================================
8042 dnl Test whether to include Barcode extension
8043 dnl ===================================================================
8044 AC_MSG_CHECKING([for Barcode extension integration])
8045 BARCODE_EXTENSION_PACK=
8046 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8047     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
8048     BARCODE_EXTENSION_PACK="7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt"
8049     AC_MSG_RESULT([yes])
8050 else
8051     AC_MSG_RESULT([no])
8053 AC_SUBST([BARCODE_EXTENSION_PACK])
8055 dnl ===================================================================
8056 dnl Test whether to include ConvertTextToNumber extension
8057 dnl ===================================================================
8058 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
8059 CT2N_EXTENSION_PACK=
8060 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8061     BUILD_TYPE="$BUILD_TYPE CT2N"
8062     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
8063     CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber_1.3.2.oxt"
8064     AC_MSG_RESULT([yes])
8065 else
8066     AC_MSG_RESULT([no])
8068 AC_SUBST(CT2N_EXTENSION_PACK)
8070 dnl ===================================================================
8071 dnl Test whether to include Numbertext extension
8072 dnl ===================================================================
8073 AC_MSG_CHECKING([for Numbertext extension integration])
8074 NUMBERTEXT_EXTENSION_PACK=
8075 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8076     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
8077     NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt"
8078     AC_MSG_RESULT([yes])
8079 else
8080     AC_MSG_RESULT([no])
8082 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
8084 dnl ===================================================================
8085 dnl Test whether to include Hungarian Cross-reference Toolbar extension
8086 dnl ===================================================================
8087 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
8088 HUNART_EXTENSION_PACK=
8089 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8090     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
8091     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
8092     AC_MSG_RESULT([yes])
8093 else
8094     AC_MSG_RESULT([no])
8096 AC_SUBST(HUNART_EXTENSION_PACK)
8098 dnl ===================================================================
8099 dnl Test whether to include Typography Toolbar extension
8100 dnl ===================================================================
8101 AC_MSG_CHECKING([for Typography Toolbar extension integration])
8102 TYPO_EXTENSION_PACK=
8103 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8104     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
8105     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
8106     AC_MSG_RESULT([yes])
8107 else
8108     AC_MSG_RESULT([no])
8110 AC_SUBST(TYPO_EXTENSION_PACK)
8112 dnl ===================================================================
8113 dnl Test whether to include Google Docs extension
8114 dnl ===================================================================
8115 AC_MSG_CHECKING([for Google Docs extension integration])
8116 GOOGLE_DOCS_EXTENSION_PACK=
8117 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8118     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
8119     GOOGLE_DOCS_EXTENSION_PACK="cea0f63d5985ba4fcbd882031df44346-gdocs_3.0.0_modified.oxt"
8120     AC_MSG_RESULT([yes])
8121 else
8122     AC_MSG_RESULT([no])
8124 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
8126 dnl ===================================================================
8127 dnl Test whether to include NLPSolver extension
8128 dnl ===================================================================
8129 AC_MSG_CHECKING([for NLPSolver extension integration])
8130 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8131     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
8132     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
8133     AC_MSG_RESULT([yes])
8134 else
8135     AC_MSG_RESULT([no])
8138 dnl ===================================================================
8139 dnl Test whether to include LanguageTool extension
8140 dnl ===================================================================
8141 AC_MSG_CHECKING([for LanguageTool extension integration])
8142 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8143     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
8144     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
8145     AC_MSG_RESULT([yes])
8146 else
8147     AC_MSG_RESULT([no])
8150 dnl ===================================================================
8151 dnl Test whether to include oooblogger extension
8152 dnl ===================================================================
8153 AC_MSG_CHECKING([for oooblogger extension integration])
8154 OOOBLOGGER_EXTENSION_PACK=
8155 if test "x$enable_ext_oooblogger" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8156     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_OOOBLOGGER"
8157     OOOBLOGGER_EXTENSION_PACK="b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt"
8158     AC_MSG_RESULT([yes])
8159 else
8160     AC_MSG_RESULT([no])
8162 AC_SUBST(OOOBLOGGER_EXTENSION_PACK)
8163 ###############################################################################
8165 dnl ===================================================================
8166 dnl Test whether to include Sun Professional Template Pack
8167 dnl ===================================================================
8168 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
8169 if test "z$with_sun_templates" = "z" -o "z$with_sun_templates" = "zno" ; then
8170     SUNTEMPLATES_LANG=""
8171     AC_MSG_RESULT([no integration])
8172 else
8173     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
8174     sun_supported_langs="en-US de it fr es hu"
8175     if test "z$with_sun_templates" = "zyes" ; then
8176         wanted_sun_templates="$sun_supported_langs"
8177     else
8178         # check whether the langs are supported by Sun
8179         wanted_sun_templates=
8180         for lang in $with_sun_templates ; do
8181             if test -n "`echo $sun_supported_langs | grep "$lang"`" ; then
8182                 wanted_sun_templates="$wanted_sun_templates $lang"
8183             fi
8184         done
8185     fi
8186     SUNTEMPLATES_LANG=
8187     SUNTEMPLATES_DE_PACK=
8188     SUNTEMPLATES_EN_US_PACK=
8189     SUNTEMPLATES_ES_PACK=
8190     SUNTEMPLATES_FR_PACK=
8191     SUNTEMPLATES_HU_PACK=
8192     SUNTEMPLATES_IT_PACK=
8193     # check whether the langs are requested at all
8194     for lang in $wanted_sun_templates ; do
8195     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`" ; then
8196         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
8197         case $lang in
8198         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
8199         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
8200         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
8201         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
8202         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
8203         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
8204         esac
8205     fi
8206     done
8207     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
8209 AC_SUBST(SUNTEMPLATES_LANG)
8210 AC_SUBST(SUNTEMPLATES_DE_PACK)
8211 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
8212 AC_SUBST(SUNTEMPLATES_ES_PACK)
8213 AC_SUBST(SUNTEMPLATES_FR_PACK)
8214 AC_SUBST(SUNTEMPLATES_HU_PACK)
8215 AC_SUBST(SUNTEMPLATES_IT_PACK)
8217 dnl ===================================================================
8218 dnl Test whether to include fonts
8219 dnl ===================================================================
8220 AC_MSG_CHECKING([whether to include third-party fonts])
8221 if test "$with_fonts" != "no" ; then
8222     AC_MSG_RESULT([yes])
8223     WITH_FONTS=YES
8224     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
8225 else
8226     AC_MSG_RESULT([no])
8227     WITH_FONTS=NO
8228     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
8230 AC_SUBST(WITH_FONTS)
8232 AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
8233 if test "$with_agfa_monotype_fonts" = "yes" ; then
8234     AC_MSG_RESULT([yes])
8235     WITH_AGFA_MONOTYPE_FONTS=YES
8236     SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
8237     BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
8238 else
8239     AC_MSG_RESULT([no])
8240     WITH_AGFA_MONOTYPE_FONTS=NO
8242 AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
8244 dnl ===================================================================
8245 dnl Test whether to include ppds
8246 dnl ===================================================================
8247 AC_MSG_CHECKING([whether to include PPDs])
8248 if test "$with_ppds" != "no"; then
8249     AC_MSG_RESULT([yes])
8250 else
8251     AC_MSG_RESULT([no])
8252     WITHOUT_PPDS=YES
8253     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
8255 AC_SUBST(WITHOUT_PPDS)
8257 dnl ===================================================================
8258 dnl Test whether to include afms
8259 dnl ===================================================================
8260 AC_MSG_CHECKING([whether to include AFMs])
8261 if test "$with_afms" != "no"; then
8262     AC_MSG_RESULT([yes])
8263     BUILD_TYPE="$BUILD_TYPE AFMS"
8264 else
8265     AC_MSG_RESULT([no])
8266     WITHOUT_AFMS=YES
8267     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
8269 AC_SUBST(WITHOUT_AFMS)
8271 dnl ===================================================================
8272 dnl Test whether to include extra galleries
8273 dnl ===================================================================
8274 AC_MSG_CHECKING([whether to include extra galleries])
8275 if test "z$enable_extra_gallery" = "z" -o "z$enable_extra_gallery" = "zno" ; then
8276     AC_MSG_RESULT([no])
8277     WITH_EXTRA_GALLERY=NO
8278     OOOP_GALLERY_PACK=""
8279 else
8280     AC_MSG_RESULT([yes])
8281     WITH_EXTRA_GALLERY=YES
8282     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
8283     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
8284     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
8286 AC_SUBST(WITH_EXTRA_GALLERY)
8287 AC_SUBST(OOOP_GALLERY_PACK)
8289 dnl ===================================================================
8290 dnl Test whether to include extra templates
8291 dnl ===================================================================
8292 AC_MSG_CHECKING([whether to include extra templates])
8293 if test "z$enable_extra_template" = "z" -o "z$enable_extra_template" = "zno" ; then
8294     AC_MSG_RESULT([no])
8295     WITH_EXTRA_TEMPLATE=NO
8296     OOOP_TEMPLATES_PACK=""
8297 else
8298     AC_MSG_RESULT([yes])
8299     WITH_EXTRA_TEMPLATE=YES
8300     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
8301     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
8302     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
8304 AC_SUBST(WITH_EXTRA_TEMPLATE)
8305 AC_SUBST(OOOP_TEMPLATES_PACK)
8307 dnl ===================================================================
8308 dnl Test whether to include extra samples
8309 dnl ===================================================================
8310 AC_MSG_CHECKING([whether to include extra samples])
8311 if test "z$enable_extra_sample" = "z" -o "z$enable_extra_sample" = "zno" ; then
8312     AC_MSG_RESULT([no])
8313     WITH_EXTRA_SAMPLE=NO
8314     OOOP_SAMPLES_PACK=""
8315 else
8316     AC_MSG_RESULT([yes])
8317     WITH_EXTRA_SAMPLE=YES
8318     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
8319     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
8320     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
8322 AC_SUBST(WITH_EXTRA_SAMPLE)
8323 AC_SUBST(OOOP_SAMPLES_PACK)
8325 dnl ===================================================================
8326 dnl Test whether to include extra fonts
8327 dnl ===================================================================
8328 AC_MSG_CHECKING([whether to include extra fonts])
8329 if test "z$enable_extra_font" = "z" -o "z$enable_extra_font" = "zno" ; then
8330     AC_MSG_RESULT([no])
8331     WITH_EXTRA_FONT=NO
8332     OOOP_FONTS_PACK=""
8333 else
8334     AC_MSG_RESULT([yes])
8335     WITH_EXTRA_FONT=YES
8336     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
8337     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
8338     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
8340 AC_SUBST(WITH_EXTRA_FONT)
8341 AC_SUBST(OOOP_FONTS_PACK)
8343 dnl ===================================================================
8344 dnl Test whether to build global menu support
8345 dnl ===================================================================
8346 AC_MSG_CHECKING([whether to build global menu support])
8347 if test "z$enable_lomenubar" = "z" -o "z$enable_lomenubar" = "zno" ; then
8348     AC_MSG_RESULT([no])
8349     ENABLE_LOMENUBAR="FALSE"
8350 else
8351     AC_MSG_RESULT([yes])
8352     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]))
8353     ENABLE_LOMENUBAR="TRUE"
8355 AC_SUBST(ENABLE_LOMENUBAR)
8357 dnl ===================================================================
8358 dnl Test whether to enable online update service
8359 dnl ===================================================================
8360 AC_MSG_CHECKING([whether to enable online update])
8361 ENABLE_ONLINE_UPDATE=
8362 if test "z$enable_online_update" = "z" ; then
8363     if test "$_os" = "WINNT" -o "$_os" = "Darwin" ; then
8364         AC_MSG_RESULT([yes])
8365         ENABLE_ONLINE_UPDATE="TRUE"
8366     else
8367         AC_MSG_RESULT([no])
8368     fi
8369 else
8370     if test "z$enable_online_update" = "zyes" ; then
8371         AC_MSG_RESULT([yes])
8372         ENABLE_ONLINE_UPDATE="TRUE"
8373     else
8374         AC_MSG_RESULT([no])
8375     fi
8377 AC_SUBST(ENABLE_ONLINE_UPDATE)
8379 dnl ===================================================================
8380 dnl Test whether build target is Release Build
8381 dnl ===================================================================
8382 AC_MSG_CHECKING([whether build target is Release Build])
8383 if test "z$enable_release_build" = "z" -o "z$enable_release_build" = "zno" ; then
8384     AC_MSG_RESULT([no])
8385     ENABLE_RELEASE_BUILD="FALSE"
8386 else
8387     AC_MSG_RESULT([yes])
8388     ENABLE_RELEASE_BUILD="TRUE"
8390 AC_SUBST(ENABLE_RELEASE_BUILD)
8392 dnl ===================================================================
8393 dnl Test whether to enable ActiveX embedding
8394 dnl ===================================================================
8395 if test "$_os" = "WINNT"; then
8396     AC_MSG_CHECKING([whether to enable ActiveX embedding of LibreOffice components])
8397     if test "$enable_activex_component" = "yes" -o "$enable_activex_component" = "TRUE" -o "$enable_activex_component" = ""; then
8398         ENABLE_ACTIVEX_COMPONENT="TRUE"
8399         AC_MSG_RESULT([yes])
8400         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
8401     else
8402         ENABLE_ACTIVEX_COMPONENT=""
8403         AC_MSG_RESULT([no])
8404     fi
8405     AC_SUBST(ENABLE_ACTIVEX_COMPONENT)
8406     AC_SUBST(SCPDEFS)
8409 AC_MSG_CHECKING([whether and how to use Xinerama])
8410 if test "$_os" = "Darwin"; then
8411     USE_XINERAMA=YES
8412     XINERAMA_LINK=dynamic
8413     AC_MSG_RESULT([yes])
8414 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
8415     if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then
8416         # we have both versions, let the user decide but use the dynamic one
8417         # per default
8418         USE_XINERAMA=YES
8419         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
8420             XINERAMA_LINK=dynamic
8421         else
8422             XINERAMA_LINK=static
8423         fi
8424     elif test -e "$XLIB/libXinerama.so" -a ! -e "$XLIB/libXinerama.a"; then
8425         # we have only the dynamic version
8426         USE_XINERAMA=YES
8427         XINERAMA_LINK=dynamic
8428     elif test -e "$XLIB/libXinerama.a"; then
8429         # static version
8430         if echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
8431             USE_XINERAMA=YES
8432             XINERAMA_LINK=static
8433         else
8434             USE_XINERAMA=NO
8435             XINERAMA_LINK=none
8436         fi
8437     else
8438         # no Xinerama
8439         USE_XINERAMA=NO
8440         XINERAMA_LINK=none
8441     fi
8442     if test "$USE_XINERAMA" = "YES"; then
8443         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
8444         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
8445             [AC_MSG_ERROR(Xinerama header not found.)], [])
8446         XINERAMA_EXTRA_LIBS="-L$XLIB -lXext"
8447         if test "$_os" = "FreeBSD"; then
8448             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
8449         fi
8450         if test "$_os" = "Linux"; then
8451             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
8452         fi
8453         AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
8454             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
8455     else
8456         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
8457     fi
8458 else
8459     USE_XINERAMA=NO
8460     XINERAMA_LINK=none
8461     AC_MSG_RESULT([no])
8463 AC_SUBST(USE_XINERAMA)
8464 AC_SUBST(XINERAMA_LINK)
8466 dnl ===================================================================
8467 dnl Checks for librsvg
8468 dnl ===================================================================
8470 dnl ENABLE_LIBRSVG is set to "" (for NO), SYSTEM or INTERNAL. The
8471 dnl SYSTEM_LIBRSVG, SYSTEM_GDKPIXBUF etc are redundant.
8473 ENABLE_LIBRSVG=""
8474 LIBRSVG_CFLAGS=""
8475 LIBRSVG_LIBS=""
8477 AC_MSG_CHECKING([what librsvg to use])
8479 case "$enable_librsvg" in
8480 no|disable)
8481     AC_MSG_RESULT([none])
8482     enable_librsvg=no
8483     ;;
8485 ""|yes|auto)
8486     if test $build_os = cygwin -o \
8487            $_os = Darwin; then
8488         dnl When building on/for these OSes always use the internal one,
8489         dnl if at all. Add more OSes above as needed.
8490         AC_MSG_RESULT([internal])
8491         enable_librsvg=internal
8492     elif test  $_os = iOS -o $_os = Android; then
8493         AC_MSG_RESULT([none])
8494         enable_librsvg=no
8495     else
8496         if test "$with_system_libs" = yes; then
8497             AC_MSG_RESULT([system])
8498             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8499             enable_librsvg=system
8500         elif test "$with_system_libs" = no; then
8501             AC_MSG_RESULT([internal])
8502             enable_librsvg=internal
8503         else
8504             AC_MSG_RESULT([checking further])
8505             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14,, [:])
8506             if test -z "$LIBRSVG_PKG_ERRORS"; then
8507                 enable_librsvg=system
8508             else
8509                 enable_librsvg=internal
8510             fi
8511         fi
8512     fi
8513     ;;
8515 internal)
8516     AC_MSG_RESULT([internal])
8517     ;;
8519 system)
8520     if test $_os = WINNT -a "$WITH_MINGW" != yes; then
8521         AC_MSG_ERROR([Must use internal librsvg when building with MSVC])
8522     fi
8523     AC_MSG_RESULT([system])
8524     PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8525     ;;
8528     AC_MSG_ERROR([Incorrect --enable-librsvg option])
8529     ;;
8530 esac
8532 dnl By now enable_librsvg should be "system", "internal" or "no"
8533 case $enable_librsvg in
8534 system)
8535     ENABLE_LIBRSVG=SYSTEM
8536     SYSTEM_LIBRSVG=YES
8537     ;;
8539 internal)
8540     ENABLE_LIBRSVG=INTERNAL
8541     SYSTEM_LIBRSVG=NO
8542     BUILD_TYPE="$BUILD_TYPE LIBRSVG"
8543     ;;
8546     ENABLE_LIBRSVG=NO
8547     SYSTEM_LIBRSVG=NO
8548     ;;
8551     AC_MSG_ERROR([Internal configure script error, invalid enable_librsvg value "$enable_librsvg"])
8552     ;;
8553 esac
8555 AC_SUBST(ENABLE_LIBRSVG)
8556 AC_SUBST(LIBRSVG_CFLAGS)
8557 AC_SUBST(LIBRSVG_LIBS)
8558 AC_SUBST(SYSTEM_LIBRSVG)
8560 dnl ===================================================================
8561 dnl Test whether to build cairo or rely on the system version
8562 dnl ===================================================================
8564 SYSTEM_CAIRO=""
8566 AC_MSG_CHECKING([whether to use the system cairo])
8568 if test "$with_system_cairo" = "yes"; then
8569     SYSTEM_CAIRO=YES
8570     AC_MSG_RESULT([yes])
8572     PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
8574     if test "$with_system_xrender_headers" = "yes"; then
8575          AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
8576          AC_RUN_IFELSE([AC_LANG_SOURCE([[
8577 #include <X11/extensions/Xrender.h>
8579 int main(int argc, char **argv) {
8580 #ifdef PictStandardA8
8581       return 0;
8582 #else
8583       return 1;
8584 #endif
8586         ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])
8587         ],[])
8588     fi
8589     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libfontconfig-1.dll libfreetype-6.dll libpixman-1-0.dll libpng15-15.dll libcairo-2.dll"
8590 else
8591     AC_MSG_RESULT([no])
8593     if test $_os = Android; then
8594         dnl For Android cairo isn't
8595         dnl buildable yet.
8596         :
8597     elif test $_os = WINNT; then
8598         dnl We only need cairo for Windows if we
8599         dnl build librsvg or directx disabled
8600         if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
8601             BUILD_TYPE="$BUILD_TYPE CAIRO"
8602         fi
8603     else
8604         BUILD_TYPE="$BUILD_TYPE CAIRO"
8605     fi
8608 AC_SUBST(SYSTEM_CAIRO)
8609 AC_SUBST(CAIRO_CFLAGS)
8610 AC_SUBST(CAIRO_LIBS)
8613 dnl ===================================================================
8614 dnl Test whether to build gdk-pixbuf or rely on the system version
8615 dnl ===================================================================
8617 AC_MSG_CHECKING([whether to use the system gdk-pixbuf])
8619 dnl As long as the only thing we need gdk-pixbuf for is below
8620 dnl librsvg, use the same --enable-librsvg (possibly implied
8621 dnl by --with-system-libs) to override this.
8623 if test "$SYSTEM_LIBRSVG" = YES; then
8624     SYSTEM_GDKPIXBUF=YES
8625     AC_MSG_RESULT([yes])
8626 else
8627     case "$_os" in
8628     WINNT|Darwin|iOS|Android)
8629         SYSTEM_GDKPIXBUF=NO
8630         AC_MSG_RESULT([no])
8631         ;;
8632     *)
8633         SYSTEM_GDKPIXBUF=YES
8634         AC_MSG_RESULT([yes])
8635         ;;
8636     esac
8638 AC_SUBST(SYSTEM_GDKPIXBUF)
8640 dnl ===================================================================
8641 dnl Test whether to build GLib or rely on the system version
8642 dnl ===================================================================
8644 AC_MSG_CHECKING([whether to use the system GLib])
8646 dnl As long as the only thing we need GLib for is below
8647 dnl librsvg, use the same --enable-librsvg (possibly implied
8648 dnl by --with-system-libs) to override this.
8650 if test "$SYSTEM_LIBRSVG" = YES; then
8651     SYSTEM_GLIB=YES
8652     AC_MSG_RESULT([yes])
8653 else
8654     case "$_os" in
8655     WINNT|Darwin|iOS|Android)
8656         SYSTEM_GLIB=NO
8657         AC_MSG_RESULT([no])
8658         ;;
8659     *)
8660         SYSTEM_GLIB=YES
8661         AC_MSG_RESULT([yes])
8662         ;;
8663     esac
8665 AC_SUBST(SYSTEM_GLIB)
8667 dnl ===================================================================
8668 dnl Test whether to build gettext runtime (libintl) or rely on the
8669 dnl system version
8670 dnl ===================================================================
8672 AC_MSG_CHECKING([whether to use the system gettext runtime])
8674 if test "$with_system_gettext" = yes; then
8675     SYSTEM_GETTEXT=YES
8676     AC_MSG_RESULT([yes])
8677 else
8678     case "$_os" in
8679     WINNT|Darwin|iOS|Android)
8680         SYSTEM_GETTEXT=NO
8681         AC_MSG_RESULT([no])
8682         ;;
8683     *)
8684         SYSTEM_GETTEXT=YES
8685         AC_MSG_RESULT([yes])
8686         ;;
8687     esac
8689 AC_SUBST(SYSTEM_GETTEXT)
8691 dnl ===================================================================
8692 dnl Test whether to build libcroco or rely on the system version
8693 dnl ===================================================================
8695 AC_MSG_CHECKING([whether to use the system libcroco])
8697 dnl As long as the only thing we need libcroco for is below
8698 dnl librsvg, use the same --enable-librsvg (possibly implied
8699 dnl by --with-system-libs) to override this.
8701 if test "$SYSTEM_LIBRSVG" = YES; then
8702     SYSTEM_LIBCROCO=YES
8703     AC_MSG_RESULT([yes])
8704 else
8705     case "$_os" in
8706     WINNT|Darwin|iOS|Android)
8707         SYSTEM_LIBCROCO=NO
8708         AC_MSG_RESULT([no])
8709         ;;
8710     *)
8711         SYSTEM_LIBCROCO=YES
8712         AC_MSG_RESULT([yes])
8713         ;;
8714     esac
8716 AC_SUBST(SYSTEM_LIBCROCO)
8718 dnl ===================================================================
8719 dnl Test whether to build Pango or rely on the system version
8720 dnl ===================================================================
8722 AC_MSG_CHECKING([whether to use the system pango])
8724 dnl As long as the only thing we need Pango for is below
8725 dnl librsvg, use the same --enable-librsvg (possibly implied
8726 dnl by --with-system-libs) to override this.
8728 if test "$SYSTEM_LIBRSVG" = YES; then
8729     SYSTEM_PANGO=YES
8730     AC_MSG_RESULT([yes])
8731 else
8732     case "$_os" in
8733     WINNT|Darwin|iOS|Android)
8734         SYSTEM_PANGO=NO
8735         AC_MSG_RESULT([no])
8736         ;;
8737     *)
8738         SYSTEM_PANGO=YES
8739         AC_MSG_RESULT([yes])
8740         ;;
8741     esac
8743 AC_SUBST(SYSTEM_PANGO)
8745 dnl ===================================================================
8746 dnl Test whether to build libgsf or rely on the system version
8747 dnl ===================================================================
8749 AC_MSG_CHECKING([whether to use the system libgsf])
8751 dnl As long as the only thing we need libgsf for is below librsvg (is
8752 dnl it?), use the same --enable-librsvg (possibly implied by
8753 dnl --with-system-libs) to override this.
8755 if test "$SYSTEM_LIBRSVG" = YES; then
8756     SYSTEM_LIBGSF=YES
8757     AC_MSG_RESULT([yes])
8758 else
8759     case "$_os" in
8760     WINNT|Darwin|iOS|Android)
8761         SYSTEM_LIBGSF=NO
8762         AC_MSG_RESULT([no])
8763         ;;
8764     *)
8765         SYSTEM_LIBGSF=YES
8766         AC_MSG_RESULT([yes])
8767         ;;
8768     esac
8770 AC_SUBST(SYSTEM_LIBGSF)
8772 dnl ===================================================================
8773 dnl Test whether to build libpng or rely on the system version
8774 dnl ===================================================================
8776 AC_MSG_CHECKING([whether to use the system libpng])
8778 dnl How should and does this interact with the checks for libpng
8779 dnl related to use of libpng in the quickstarter above? This needs to
8780 dnl be unified.
8782 if test "$with_system_libpng" = yes; then
8783     SYSTEM_LIBPNG=YES
8784     AC_MSG_RESULT([yes])
8785 else
8786     case "$_os" in
8787     WINNT|Darwin|iOS|Android)
8788         SYSTEM_LIBPNG=NO
8789         AC_MSG_RESULT([no])
8790         ;;
8791     *)
8792         SYSTEM_LIBPNG=YES
8793         AC_MSG_RESULT([no])
8794         ;;
8795     esac
8797 AC_SUBST(SYSTEM_LIBPNG)
8799 dnl ===================================================================
8800 dnl Test whether to build libjpeg or rely on the system version
8801 dnl ===================================================================
8802 dnl FIXME: this is currently because we have jpeg-6b for our filters
8803 dnl        and jpeg-8 as dependency for librsvg
8804 dnl        this should be unified into using only one version for both
8806 AC_MSG_CHECKING([whether to use the system libjpeg])
8808 if test "$SYSTEM_JPEG" == "YES"; then
8809     SYSTEM_LIBJPEG=YES
8810     AC_MSG_RESULT([yes])
8811 else
8812     case "$_os" in
8813     WINNT|Darwin|iOS|Android)
8814         SYSTEM_LIBJPEG=NO
8815         AC_MSG_RESULT([no])
8816         ;;
8817     *)
8818         SYSTEM_LIBJPEG=YES
8819         AC_MSG_RESULT([yes])
8820         ;;
8821     esac
8823 AC_SUBST(SYSTEM_LIBJPEG)
8825 dnl ===================================================================
8826 dnl Check for runtime JVM search path
8827 dnl ===================================================================
8828 if test "$SOLAR_JAVA" != ""; then
8829     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
8830     if test -n "$with_jvm_path" && test "$with_jvm_path" != "no"; then
8831         AC_MSG_RESULT([yes])
8832         if ! test -d "$with_jvm_path"; then
8833             AC_MSG_ERROR(["$with_jvm_path" not a directory])
8834         fi
8835         if ! test -d "$with_jvm_path"jvm; then
8836             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
8837         fi
8838         JVM_ONE_PATH_CHECK="$with_jvm_path"
8839         AC_SUBST(JVM_ONE_PATH_CHECK)
8840     else
8841         AC_MSG_RESULT([no])
8842     fi
8845 dnl ===================================================================
8846 dnl Test for the presence of Ant and that it works
8847 dnl ===================================================================
8849 if test "$SOLAR_JAVA" != ""; then
8850     ANT_HOME=; export ANT_HOME
8851     WITH_ANT_HOME=; export WITH_ANT_HOME
8852     if test -z "$with_ant_home"; then
8853         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
8854     else
8855         if test "$_os" = "WINNT"; then
8856             with_ant_home=`cygpath -u "$with_ant_home"`
8857         fi
8858         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
8859         WITH_ANT_HOME=$with_ant_home
8860         ANT_HOME=$with_ant_home
8861     fi
8863     if test -z "$ANT"; then
8864         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
8865     else
8866         # resolve relative or absolute symlink
8867         while test -h "$ANT"; do
8868             a_cwd=`pwd`
8869             a_basename=`basename "$ANT"`
8870             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
8871             cd "`dirname "$ANT"`"
8872             cd "`dirname "$a_script"`"
8873             ANT="`pwd`"/"`basename "$a_script"`"
8874             cd "$a_cwd"
8875         done
8877         AC_MSG_CHECKING([if $ANT works])
8878         cat > conftest.java << EOF
8879         public class conftest {
8880             int testmethod(int a, int b) {
8881                     return a + b;
8882             }
8883         }
8886         cat > conftest.xml << EOF
8887         <project name="conftest" default="conftest">
8888         <target name="conftest">
8889             <javac srcdir="." includes="conftest.java">
8890             </javac>
8891         </target>
8892         </project>
8895         oldJAVA_HOME=$JAVA_HOME
8896         if test "$JAVACISGCJ" = "yes"; then
8897             JAVA_HOME=; export JAVA_HOME
8898             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
8899         else
8900             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
8901         fi
8902         AC_TRY_EVAL(ant_cmd)
8903         if test $? = 0 && test -f ./conftest.class ; then
8904             AC_MSG_RESULT([Ant works])
8905             if test -z "$WITH_ANT_HOME"; then
8906                 ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
8907                 if test -z "$ANT_HOME"; then
8908                     ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
8909                 fi
8910             else
8911                 ANT_HOME="$WITH_ANT_HOME"
8912             fi
8913         else
8914             echo "configure: Ant test failed" >&5
8915             cat conftest.java >&5
8916             cat conftest.xml >&5
8917             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
8918             ANT_HOME=""
8919             echo "Ant does not work - Some Java projects will not build!" >>warn
8920         fi
8921         JAVA_HOME=$oldJAVA_HOME
8922         rm -f conftest* core core.* *.core
8923     fi
8924     if test -z "$ANT_HOME"; then
8925         ANT_HOME="NO_ANT_HOME"
8926     fi
8927     AC_SUBST(ANT_HOME)
8929     dnl Checking for ant.jar
8930     if test "$ANT_HOME" != "NO_ANT_HOME"; then
8931         AC_MSG_CHECKING([Ant lib directory])
8932         if test -f $ANT_HOME/lib/ant.jar; then
8933             ANT_LIB="$ANT_HOME/lib"
8934         else
8935             if test -f $ANT_HOME/ant.jar; then
8936                 ANT_LIB="$ANT_HOME"
8937             else
8938                 if test -f /usr/share/java/ant.jar; then
8939                     ANT_LIB=/usr/share/java
8940                 else
8941                     if test -f /usr/share/ant-core/lib/ant.jar; then
8942                         ANT_LIB=/usr/share/ant-core/lib
8943                     else
8944                         if test -f $ANT_HOME/lib/ant/ant.jar; then
8945                             ANT_LIB="$ANT_HOME/lib/ant"
8946                         else
8947                             if test -f /usr/share/lib/ant/ant.jar; then
8948                                 ANT_LIB=/usr/share/lib/ant
8949                             else
8950                                 AC_MSG_ERROR([Ant libraries not found!])
8951                             fi
8952                         fi
8953                     fi
8954                 fi
8955             fi
8956         fi
8957         AC_MSG_RESULT([Ant lib directory found.])
8958     fi
8959     AC_SUBST(ANT_LIB)
8961     ant_minver=1.6.0
8962     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
8964     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
8965     ant_version=`$ANT -version | $AWK '{ print $4; }'`
8966     ant_version_major=`echo $ant_version | cut -d. -f1`
8967     ant_version_minor=`echo $ant_version | cut -d. -f2`
8968     echo "configure: ant_version $ant_version " >&5
8969     echo "configure: ant_version_major $ant_version_major " >&5
8970     echo "configure: ant_version_minor $ant_version_minor " >&5
8971     if test "$ant_version_major" -ge "2"; then
8972         AC_MSG_RESULT([yes, $ant_version])
8973     elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
8974         AC_MSG_RESULT([yes, $ant_version])
8975     else
8976         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
8977     fi
8979     if test "$ENABLE_MEDIAWIKI" = "YES"; then
8980         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
8981         rm -rf confdir
8982         mkdir confdir
8983         cat > conftest.java << EOF
8984             public class conftest {
8985                 int testmethod(int a, int b) {
8986                     return a + b;
8987                 }
8988             }
8991         cat > conftest.xml << EOF
8992             <project name="conftest" default="conftest">
8993             <target name="conftest" depends="copytest">
8994                 <javac srcdir="." includes="conftest.java">
8995                 </javac>
8996             </target>
8997             <target name="copytest">
8998                  <copy todir="confdir">
8999                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
9000                  <filterset/>
9001                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
9002                  </copy>
9003             </target>
9004             </project>
9007         if test "$JAVACISGCJ" = "yes"; then
9008             JAVA_HOME=; export JAVA_HOME
9009             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
9010         else
9011             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
9012         fi
9013         AC_TRY_EVAL(ant_cmd)
9014         if test $? = 0 && test -f ./conftest.class ; then
9015             AC_MSG_RESULT([yes])
9016             rm -rf confdir
9017         else
9018             echo "configure: Ant test failed" >&5
9019             cat conftest.java >&5
9020             cat conftest.xml >&5
9021             rm -rf confdir
9022             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
9023         fi
9024     fi
9025     rm -f conftest* core core.* *.core
9028 OOO_JUNIT_JAR=
9029 if test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
9030     AC_MSG_CHECKING([for JUnit 4])
9031     if test "$with_junit" = "yes"; then
9032         if test -e /usr/share/java/junit4.jar; then
9033             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
9034         else
9035            if test -e /usr/share/lib/java/junit.jar; then
9036               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
9037            else
9038               OOO_JUNIT_JAR=/usr/share/java/junit.jar
9039            fi
9040         fi
9041     else
9042         OOO_JUNIT_JAR=$with_junit
9043     fi
9044     if test "$_os" = "WINNT"; then
9045         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
9046     fi
9047     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
9048         grep org/junit/Before.class > /dev/null 2>&5
9049     if test $? -eq 0; then
9050         # check if either class-path entry is available for hamcrest or
9051         # it's bundled
9052         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |grep -q hamcrest || \
9053             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |grep -q 'Class-Path: hamcrest'; then
9054             AC_MSG_RESULT([$OOO_JUNIT_JAR])
9055         else
9056             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
9057 provide a full junit jar or use --without-junit])
9058         fi
9059     else
9060         AC_MSG_RESULT([no])
9061         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
9062 location (/usr/share/java), specify its pathname via
9063 --with-junit=..., or disable it via --without-junit])
9064     fi
9066 AC_SUBST(OOO_JUNIT_JAR)
9068 dnl ===================================================================
9069 dnl Product version
9070 dnl ===================================================================
9071 AC_MSG_CHECKING([for product version])
9072 PRODUCTVERSION=AC_PACKAGE_VERSION
9073 AC_MSG_RESULT([$PRODUCTVERSION])
9074 AC_SUBST(PRODUCTVERSION)
9076 dnl ===================================================================
9077 dnl Dealing with l10n options
9078 dnl ===================================================================
9079 AC_MSG_CHECKING([which languages to be built])
9080 # get list of all languages
9081 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
9082 # the sed command does the following:
9083 #   + if a line ends with a backslash, append the next line to it
9084 #   + adds " on the beginning of the value (after =)
9085 #   + adds " at the end of the value
9086 #   + removes en-US; we want to put it on the beginning
9087 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
9088 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
9089 ALL_LANGS="en-US $completelangiso"
9090 # check the configured localizations
9091 WITH_LANG="$with_lang"
9092 if test -z "$WITH_LANG"; then
9093     AC_MSG_RESULT([en-US])
9094 else
9095     AC_MSG_RESULT([$WITH_LANG])
9096     GIT_REPO_NAMES="$GIT_REPO_NAMES translations"
9098 # check that the list is valid
9099 for lang in $WITH_LANG ; do
9100     test "$lang" = "ALL" && continue;
9101     # need to check for the exact string, so add space before and after the list of all languages
9102     for vl in $ALL_LANGS ; do
9103         if test "$vl" = "$lang" ; then
9104            break;
9105         fi
9106     done
9107     if test "$vl" != "$lang" ; then
9108         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
9109     fi
9110 done
9111 # list with substituted ALL
9112 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
9113 # this variable is used only by bin/distro-install-* helper scripts
9114 # they need a real list of languages
9115 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
9116 AC_SUBST(ALL_LANGS)
9117 AC_SUBST(WITH_LANG)
9118 AC_SUBST(WITH_LANG_LIST)
9119 AC_SUBST(GIT_REPO_NAMES)
9121 dnl git-new-workdir
9122 dnl ===================================================================
9123 if test -n "${GIT_LINK_SRC}"; then
9124     for repo in ${GIT_REPO_NAMES}; do
9125         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
9126             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
9127         fi
9128     done
9130 AC_SUBST(GIT_LINK_SRC)
9132 AC_MSG_CHECKING([for another 'intro' bitmap])
9133 INTRO_BITMAP=
9134 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no" ; then
9135     INTRO_BITMAP=
9136     AC_MSG_RESULT([none])
9137 else
9138     case "$with_intro_bitmap" in
9139     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
9140     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
9141     esac
9142     AC_MSG_RESULT([$INTRO_BITMAP])
9144 AC_SUBST(INTRO_BITMAP)
9146 AC_MSG_CHECKING([for custom 'intro' progress bar color])
9147 PROGRESSBARCOLOR=
9148 if test -z "$with_intro_progressbar_color" ; then
9149    PROGRESSBARCOLOR="126,170,23"
9150    AC_MSG_RESULT([none])
9151 else
9152    PROGRESSBARCOLOR="$with_intro_progressbar_color"
9153    AC_MSG_RESULT([$PROGRESSBARCOLOR])
9155 AC_SUBST(PROGRESSBARCOLOR)
9157 AC_MSG_CHECKING([for custom 'intro' progress bar size])
9158 PROGRESSSIZE=
9159 if test -z "$with_intro_progressbar_size" ; then
9160    PROGRESSSIZE="319,10"
9161    AC_MSG_RESULT([none])
9162 else
9163    PROGRESSSIZE="$with_intro_progressbar_size"
9164    AC_MSG_RESULT([$PROGRESSSIZE])
9166 AC_SUBST(PROGRESSSIZE)
9168 AC_MSG_CHECKING([for custom 'intro' progress bar position])
9169 PROGRESSPOSITION=
9170 if test -z "$with_intro_progressbar_position" ; then
9171    PROGRESSPOSITION="164,225"
9172    AC_MSG_RESULT([none])
9173 else
9174    PROGRESSPOSITION="$with_intro_progressbar_position"
9175    AC_MSG_RESULT([$PROGRESSPOSITION])
9177 AC_SUBST(PROGRESSPOSITION)
9179 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
9180 PROGRESSFRAMECOLOR=
9181 if test -z "$with_intro_progressbar_frame_color" ; then
9182    PROGRESSFRAMECOLOR="207,208,211"
9183    AC_MSG_RESULT([none])
9184 else
9185    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
9186    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
9188 AC_SUBST(PROGRESSFRAMECOLOR)
9190 AC_MSG_CHECKING([for another 'about' bitmap])
9191 ABOUT_BITMAP=
9192 if test -z "$with_about_bitmap" -o "$with_about_bitmap" = "no" ; then
9193     ABOUT_BITMAP=
9194     AC_MSG_RESULT([none])
9195 else
9196    case "$with_about_bitmap" in
9197    *.png) ABOUT_BITMAP="$with_about_bitmap" ;;
9198    *)     AC_MSG_WARN([About bitmap should be a .png file!]) ;;
9199    esac
9200    AC_MSG_RESULT([$ABOUT_BITMAP])
9202 AC_SUBST(ABOUT_BITMAP)
9204 AC_MSG_CHECKING([for another 'start center left' bitmap])
9205 STARTCENTER_LEFT_BITMAP=
9206 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no" ; then
9207    STARTCENTER_LEFT_BITMAP=
9208    AC_MSG_RESULT([none])
9209 else
9210    case "$with_startcenter_left_bitmap" in
9211       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
9212       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9213    esac
9214    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
9216 AC_SUBST(STARTCENTER_LEFT_BITMAP)
9218 AC_MSG_CHECKING([for another 'start center right' bitmap])
9219 STARTCENTER_RIGHT_BITMAP=
9220 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no" ; then
9221    STARTCENTER_RIGHT_BITMAP=
9222    AC_MSG_RESULT([none])
9223 else
9224    case "$with_startcenter_right_bitmap" in
9225       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
9226       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
9227    esac
9228    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
9230 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
9232 AC_MSG_CHECKING([for another 'start center rtl left' bitmap])
9233 STARTCENTER_RTL_LEFT_BITMAP=
9234 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no" ; then
9235    STARTCENTER_RTL_LEFT_BITMAP=
9236    AC_MSG_RESULT([none])
9237 else
9238    case "$with_startcenter_rtl_left_bitmap" in
9239       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
9240       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
9241    esac
9242    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
9244 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
9246 AC_MSG_CHECKING([for another 'start center rtl right' bitmap])
9247 STARTCENTER_RTL_RIGHT_BITMAP=
9248 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no" ; then
9249    STARTCENTER_RTL_RIGHT_BITMAP=
9250    AC_MSG_RESULT([none])
9251 else
9252    case "$with_startcenter_rtl_right_bitmap" in
9253       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
9254       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
9255    esac
9256    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
9258 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
9260 AC_MSG_CHECKING([for another 'start center space' bitmap])
9261 STARTCENTER_SPACE_BITMAP=
9262 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no" ; then
9263    STARTCENTER_SPACE_BITMAP=
9264    AC_MSG_RESULT([none])
9265 else
9266    case "$with_startcenter_space_bitmap" in
9267       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
9268       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9269    esac
9270    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
9272 AC_SUBST(STARTCENTER_SPACE_BITMAP)
9274 OOO_VENDOR=
9275 AC_MSG_CHECKING([for vendor])
9276 if test -z "$with_vendor" -o "$with_vendor" = "no" ; then
9277     AC_MSG_RESULT([not set])
9278 else
9279     OOO_VENDOR="$with_vendor"
9280     AC_MSG_RESULT([$OOO_VENDOR])
9282 AC_SUBST(OOO_VENDOR)
9284 UNIXWRAPPERNAME=
9285 AC_MSG_CHECKING([for UNIX wrapper name])
9286 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes" ; then
9287     AC_MSG_RESULT([not set])
9288 else
9289     UNIXWRAPPERNAME="$with_unix_wrapper"
9290     AC_MSG_RESULT([$UNIXWRAPPERNAME])
9292 AC_SUBST(UNIXWRAPPERNAME)
9294 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
9295 if test "$with_compat_oowrappers" = "yes" ; then
9296     WITH_COMPAT_OOWRAPPERS=YES
9297     AC_MSG_RESULT(yes)
9298 else
9299     WITH_COMPAT_OOWRAPPERS=
9300     AC_MSG_RESULT(no)
9302 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
9304 AC_MSG_CHECKING([for product name])
9305 PRODUCTNAME=AC_PACKAGE_NAME
9306 AC_MSG_RESULT([$PRODUCTNAME])
9307 AC_SUBST(PRODUCTNAME)
9309 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
9310 AC_MSG_CHECKING([for install dirname])
9311 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes" ; then
9312    INSTALLDIRNAME="$with_install_dirname"
9314 AC_MSG_RESULT([$INSTALLDIRNAME])
9315 AC_SUBST(INSTALLDIRNAME)
9317 AC_MSG_CHECKING([for prefix])
9318 test "x$prefix" = xNONE && prefix=$ac_default_prefix
9319 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
9320 PREFIXDIR="$prefix"
9321 AC_MSG_RESULT([$PREFIXDIR])
9322 AC_SUBST(PREFIXDIR)
9324 AC_MSG_CHECKING([for libdir])
9325 LIBDIR=[$(eval echo $(eval echo $libdir))]
9326 AC_MSG_RESULT([$LIBDIR])
9327 AC_SUBST(LIBDIR)
9329 AC_MSG_CHECKING([for data dir])
9330 DATADIR=[$(eval echo $(eval echo $datadir))]
9331 AC_MSG_RESULT([$DATADIR])
9332 AC_SUBST(DATADIR)
9334 AC_MSG_CHECKING([for man dir])
9335 MANDIR=[$(eval echo $(eval echo $mandir))]
9336 AC_MSG_RESULT([$MANDIR])
9337 AC_SUBST(MANDIR)
9339 AC_MSG_CHECKING([for doc dir])
9340 DOCDIR=[$(eval echo $(eval echo $docdir))]
9341 AC_MSG_RESULT([$DOCDIR])
9342 AC_SUBST(DOCDIR)
9344 AC_MSG_CHECKING([for install dir])
9345 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
9346 AC_MSG_RESULT([$INSTALLDIR])
9347 AC_SUBST(INSTALLDIR)
9349 AC_MSG_CHECKING([whether to statically link to Gtk])
9350 if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
9351     ENABLE_STATIC_GTK="TRUE"
9352     AC_MSG_RESULT([yes])
9353 else
9354     ENABLE_STATIC_GTK="FALSE"
9355     AC_MSG_RESULT([no])
9357 AC_SUBST(ENABLE_STATIC_GTK)
9359 AC_MSG_CHECKING([whether to use layout dialogs])
9360 if test -n "$enable_layout" && test "$enable_layout" != "no"; then
9361     ENABLE_LAYOUT="TRUE"
9362     AC_MSG_RESULT([yes])
9363 else
9364     ENABLE_LAYOUT="FALSE"
9365     AC_MSG_RESULT([no])
9367 AC_SUBST(ENABLE_LAYOUT)
9369 # ===================================================================
9370 # De- or increase default verbosity of build process
9371 # ===================================================================
9372 AC_MSG_CHECKING([build verbosity])
9373 if test -n "$enable_verbose"; then
9374     if test "$enable_verbose" = "yes"; then
9375         VERBOSE="TRUE"
9376         AC_MSG_RESULT([high])
9377     fi
9378     if test "$enable_verbose" = "no"; then
9379         VERBOSE="FALSE"
9380         AC_MSG_RESULT([low])
9381     fi
9382 else
9383     AC_MSG_RESULT([not set])
9385 AC_SUBST(VERBOSE)
9387 dnl ===================================================================
9388 dnl Use zenity during build
9389 dnl ===================================================================
9390 AC_MSG_CHECKING([whether to use zenity during build])
9391 if test "$enable_zenity" = "yes"; then
9392     AC_MSG_RESULT([yes])
9393     AC_PATH_PROGS( ZNTY, zenity )
9394     if test -z "$ZNTY"; then
9395         ENABLE_ZENITY=FALSE
9396     else
9397         ENABLE_ZENITY=TRUE
9398     fi
9399 else
9400     ENABLE_ZENITY=FALSE
9401     AC_MSG_RESULT([no])
9403 AC_SUBST(ENABLE_ZENITY)
9406 dnl ===================================================================
9407 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
9408 dnl --enable-dependency-tracking configure option
9409 dnl ===================================================================
9410 AC_MSG_CHECKING([whether to enable dependency tracking])
9411 if test "$enable_dependency_tracking" = "no"; then
9412     nodep=TRUE
9413     AC_MSG_RESULT([no])
9414 else
9415     AC_MSG_RESULT([yes])
9417 AC_SUBST(nodep)
9419 dnl ===================================================================
9420 dnl Number of CPUs to use during the build
9421 dnl ===================================================================
9422 AC_MSG_CHECKING([for number of processors to use])
9423 if test -n "$with_num_cpus"; then
9424     BUILD_NCPUS=$with_num_cpus
9425 else
9426     case `uname -s` in
9428     Darwin|FreeBSD|NetBSD|OpenBSD)
9429         BUILD_NCPUS=`sysctl -n hw.ncpu`
9430         ;;
9432     Linux)
9433         BUILD_NCPUS=`getconf _NPROCESSORS_ONLN`
9434         ;;
9435     # what else than above does profit here *and* has /proc?
9436     *)
9437         BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
9438         ;;
9439     esac
9441     # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
9442     # unexpected format, 'wc -l' will have returned 0.
9443     if test "$BUILD_NCPUS" -eq 0; then
9444         BUILD_NCPUS=1
9445     fi
9447 AC_MSG_RESULT([$BUILD_NCPUS])
9448 AC_SUBST(BUILD_NCPUS)
9450 # ===================================================================
9451 # Creating bigger shared library to link against
9452 # ===================================================================
9453 AC_MSG_CHECKING([whether to create a big library for better performance])
9454 MERGELIBS=
9455 if test "$enable_mergelibs" = "yes"; then
9456     MERGELIBS="TRUE"
9457     AC_MSG_RESULT([yes])
9458 else
9459     AC_MSG_RESULT([no])
9461 AC_SUBST(MERGELIBS)
9463 dnl ===================================================================
9464 dnl Number of parallel jobs to be executed by dmake
9465 dnl ===================================================================
9466 AC_MSG_CHECKING([for maximum of jobs per processor])
9467 BUILD_MAX_JOBS="1"
9468 if test "z$with_max_jobs" != "z"; then
9469     BUILD_MAX_JOBS="$with_max_jobs"
9470 else
9471     if test "$enable_icecream" = "yes" ; then
9472         BUILD_MAX_JOBS="10"
9473     fi
9475 AC_MSG_RESULT([$BUILD_MAX_JOBS])
9476 AC_SUBST(BUILD_MAX_JOBS)
9478 # =====================================================================
9479 # determine the parallelism for gnu make
9480 # =====================================================================
9481 AC_MSG_CHECKING([for maximum parallelism for gmake])
9482 if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS ; then
9483     GMAKE_PARALLELISM="$BUILD_MAX_JOBS"
9484 else
9485     GMAKE_PARALLELISM="$BUILD_NCPUS"
9487 GMAKE_MODULE_PARALLELISM="$BUILD_MAX_JOBS"
9488 if test "$no_parallelism_make" = "YES" ; then
9489     if test -z "$with_num_cpus"; then
9490         GMAKE_PARALLELISM="1";
9491         if test $GMAKE_MODULE_PARALLELISM -gt 1 ; then
9492             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
9493             if test -z "$with_num_cpus"; then
9494                 echo "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this." >> warn
9495             fi
9496             GMAKE_MODULE_PARALLELISM="1"
9497         fi
9498     else
9499         GMAKE_PARALLELISM="$BUILD_NCPUS";
9500         echo "make 3.81 is prone to crashes with parallelism > 1. Since --with-num-cpus was explicitely given, it is honored, but do not complain when make segfault on you." >> warn
9501     fi
9504 # GMAKE_PARALLELISM is used in tail_build
9505 # GMAKE_MODULE_PARALLELISM is used when building individual gbuildified module
9506 AC_MSG_RESULT([per module:$GMAKE_MODULE_PARALLELISM, for tail_build:$GMAKE_PARALLELISM])
9507 AC_SUBST(GMAKE_PARALLELISM)
9508 AC_SUBST(GMAKE_MODULE_PARALLELISM)
9510 dnl ===================================================================
9511 dnl Setting up the environment.
9512 dnl ===================================================================
9513 echo "setting up the build environment variables..."
9515 if test -z "$COMPATH"; then
9516     AC_MSG_ERROR([No compiler found.])
9518 AC_SUBST(COMPATH)
9520 AC_MSG_CHECKING([solver path])
9521 if test -z "$with_local_solver"; then
9522     LOCAL_SOLVER="DEFAULT"
9523     AC_MSG_RESULT([default])
9524 else
9525     LOCAL_SOLVER=$with_local_solver
9526     AC_MSG_RESULT([$with_local_solver])
9528 AC_SUBST(LOCAL_SOLVER)
9530 AC_SUBST(BUILD_TYPE)
9532 if test "$WITH_MINGW" != "yes" ; then
9533     MINGW_EXTERNAL_DLLS=
9534 else
9535     mingw_dlldir=`$CC -print-sysroot`/mingw/bin
9536     for DLL in $MINGW_EXTERNAL_DLLS ; do
9537         AC_MSG_CHECKING([for $DLL])
9538         if ! test -f "$mingw_dlldir/$DLL" ; then
9539             AC_MSG_ERROR([Could not find $DLL, install the appropriate mingw32-<package>, not only mingw32-<package>-devel.])
9540         fi
9541         AC_MSG_RESULT([$mingw_dlldir/$DLL])
9542     done
9544 AC_SUBST(MINGW_EXTERNAL_DLLS)
9546 # make sure config.guess is +x; we execute config.guess, so it has to be so;
9547 chmod +x ./config.guess
9549 dnl Setting up the post_download check script
9550 dnl Using autoconf here, so that the migration from the previous state
9551 dnl (checks for the additional Windows downloads were directly in
9552 dnl configure.in) is as easy as possible
9553 echo "setting up the post_download check script"
9554 autoconf post_download.in > post_download
9555 chmod +x post_download
9557 # Generate a configuration timestamp we can use for deps
9558 if test -f set_soenv; then
9559     mv -f set_soenv set_soenv.last
9560 else
9561     echo > set_soenv.last
9564 AC_CONFIG_FILES([ooo.lst set_soenv Makefile bin/repo-list desktop/scripts/soffice.sh])
9565 AC_OUTPUT
9567 # make sure this is executable
9568 chmod +x desktop/scripts/soffice.sh
9570 # touch the config timestamp file set_soenv.stamp
9571 if test ! -f set_soenv.stamp; then
9572     echo > set_soenv.stamp
9573 elif diff set_soenv set_soenv.last >/dev/null 2>&1; then
9574     echo "Configuration unchanged - avoiding scp2 stamp update"
9575 else
9576     echo > set_soenv.stamp
9579 dnl Run the set_soenv script to setup the Env.Host.sh script that sets
9580 dnl environment variables for the build.
9581 chmod +x set_soenv
9583 ./set_soenv
9585 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: