fix typo
[LibreOffice.git] / configure.in
blob9cd71ede0544d05292be05c069751340794041e1
1 dnl -*- Mode: Autoconf; tab-width: 8; indent-tabs-mode: nil -*-
2 dnl configure.in serves as input for the GNU autoconf package
3 dnl in order to create a configure script.
5 AC_INIT([LibreOffice],[3.5],[],[],[http://documentfoundation.org/])
6 AC_PREREQ([2.59])
8 save_CC=$CC
9 save_CXX=$CXX
11 BUILD_TYPE="LibO"
12 SCPDEFS=""
13 GIT_REPO_NAMES=""
14 MINGW_EXTERNAL_DLLS=""
16 if test -n "$SOLARENV" ; then
17     AC_MSG_ERROR([You have sourced Env.Host.sh in this shell.  This may lead to trouble, please run in a fresh (login) shell.])
20 echo "********************************************************************"
21 echo "*"
22 echo "*   Running ${PACKAGE_NAME} build configuration."
23 echo "*"
24 echo "********************************************************************"
25 echo ""
27 dnl ===================================================================
28 dnl checks build and host OSes
29 dnl do this before argument processing to allow for platform dependent defaults
30 dnl ===================================================================
31 AC_CANONICAL_HOST
33 if test "$cross_compiling" = "yes"; then
34     CROSS_COMPILING=YES
35 else
36     CROSS_COMPILING=
37     BUILD_TYPE="$BUILD_TYPE NATIVE"
39 AC_SUBST(CROSS_COMPILING)
41 if test "$build_os" = "cygwin"; then
42     EXEEXT_FOR_BUILD=.exe
43     SRC_ROOT=`pwd`
44     SRC_ROOT=`cygpath -d "$SRC_ROOT"`
45     SRC_ROOT=`cygpath -u "$SRC_ROOT"`
46 else
47     EXEEXT_FOR_BUILD=
48     SRC_ROOT=`pwd`
50 AC_SUBST(SRC_ROOT)
51 AC_SUBST(EXEEXT_FOR_BUILD)
53 cat /dev/null > warn
55 if test "z$EUID" = "z0" -a "z`uname -o 2>/dev/null`" = "zCygwin"; then
56     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
59 # need sed in os checks...
60 AC_PATH_PROGS(SED, sed)
61 if test -z "$SED"; then
62     AC_MSG_ERROR([install sed to run this script])
65 dnl ===================================================================
66 dnl The following is a list of supported systems.
67 dnl Sequential to keep the logic very simple
68 dnl These values may be checked and reset later.
69 dnl ===================================================================
70 #defaults unless the os test overrides this:
71 test_randr=yes
72 test_xrender=yes
73 test_cups=yes
74 test_fontconfig=yes
76 case "$host_os" in
78 solaris*)
79     test_gtk=yes
80     build_gstreamer=yes
81     test_kde=yes
82     test_freetype=yes
83     test_gstreamer=yes
84     _os=SunOS
86     dnl ===========================================================
87     dnl Check whether we're using Solaris 10 - SPARC or Intel.
88     dnl ===========================================================
89     AC_MSG_CHECKING([the Solaris operating system release])
90     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
91     if test "$_os_release" -lt "10"; then
92         AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
93     else
94         AC_MSG_RESULT([ok ($_os_release)])
95     fi
97     dnl Check whether we're using a SPARC or i386 processor
98     AC_MSG_CHECKING([the processor type])
99     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
100         AC_MSG_RESULT([ok ($host_cpu)])
101     else
102         AC_MSG_ERROR([only SPARC and i386 processors are supported])
103     fi
104     ;;
106 linux-gnu*|k*bsd*-gnu*)
107     test_gtk=yes
108     build_gstreamer=yes
109     test_kde=yes
110     test_kde4=yes
111     test_freetype=yes
112     test_unix_quickstarter=yes
113     _os=Linux
114     ;;
116 gnu)
117     test_randr=no
118     test_xrender=no
119     _os=GNU
120      ;;
122 cygwin*|interix*|mingw32*)
124     # When building on Windows normally with MSVC under Cygwin,
125     # configure thinks that the host platform (the platform the
126     # built code will run on) is Cygwin, even if it obviously is
127     # Windows, which in Autoconf terminology is called
128     # "mingw32". (Which is misleading as MinGW is the name of the
129     # tool-chain, not an operating system.)
131     # Somewhat confusing, yes. But this configure script doesn't
132     # look at $host etc that much, it mostly uses its own $_os
133     # variable, set here in this case statement.
135     # When cross-compiling to Windows from Unix, the host platform
136     # is "mingw32" (because in that case it is the MinGW
137     # tool-chain that is used).
139     test_cups=no
140     test_randr=no
141     test_xrender=no
142     test_freetype=no
143     test_fontconfig=no
144     _os=WINNT
146     # If the host OS matches "mingw32*", that means we are using the
147     # MinGW cross-compiler, because we don't see the point in building
148     # LibreOffice using MinGW on Windows. If you want to build on
149     # Windows, use MSVC. If you want to use MinGW, surely you want to
150     # cross-compile (from Linux or some other Unix).
152     case "$host_os" in
153     mingw32*)
154         WITH_MINGW=yes
155         if test -z "$CC" ; then
156             CC="$host_cpu-$host_vendor-$host_os-gcc"
157         fi
158         if test -z "$CXX" ; then
159             CXX="$host_cpu-$host_vendor-$host_os-g++"
160         fi
161         ;;
162     esac
163     ;;
165 darwin*) # Mac OS X or iOS
166     test_gtk=yes
167     test_randr=no
168     test_xrender=no
169     test_freetype=no
170     test_fontconfig=no
171     if test "$host_cpu" = "arm"; then
172         _os=iOS
173         test_gtk=no
174         test_cups=no
175     else
176         _os=Darwin
177     fi
178     enable_systray=no
181 freebsd*)
182     test_gtk=yes
183     build_gstreamer=yes
184     test_kde=yes
185     test_kde4=yes
186     test_freetype=yes
187     AC_MSG_CHECKING([the FreeBSD operating system release])
188     if test -n "$with_os_version"; then
189         OSVERSION="$with_os_version"
190     else
191         OSVERSION=`/sbin/sysctl -n kern.osreldate`
192     fi
193     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
194     AC_MSG_CHECKING([which thread library to use])
195     if test "$OSVERSION" -lt "500016"; then
196         PTHREAD_CFLAGS="-D_THREAD_SAFE"
197         PTHREAD_LIBS="-pthread"
198     elif test "$OSVERSION" -lt "502102"; then
199         PTHREAD_CFLAGS="-D_THREAD_SAFE"
200         PTHREAD_LIBS="-lc_r"
201     else
202         PTHREAD_CFLAGS=""
203         PTHREAD_LIBS="-pthread"
204     fi
205     AC_MSG_RESULT([$PTHREAD_LIBS])
206     _os=FreeBSD
207     ;;
209 *netbsd*)
210     test_gtk=yes
211     build_gstreamer=yes
212     test_kde=no
213     test_kde4=yes
214     test_freetype=yes
215     PTHREAD_LIBS="-pthread -lpthread"
216     _os=NetBSD
217     ;;
219 aix*)
220     test_randr=no
221     test_freetype=yes
222     PTHREAD_LIBS=-pthread
223     _os=AIX
224     ;;
226 openbsd*)
227     test_gtk=yes
228     test_kde=yes
229     test_freetype=yes
230     PTHREAD_CFLAGS="-D_THREAD_SAFE"
231     PTHREAD_LIBS="-pthread"
232     _os=OpenBSD
233     ;;
235 dragonfly*)
236     test_gtk=yes
237     build_gstreamer=yes
238     test_kde=yes
239     test_kde4=yes
240     test_freetype=yes
241     PTHREAD_LIBS="-pthread"
242     _os=DragonFly
243     ;;
245 linux-androideabi*)
246     build_gstreamer=no
247     test_cups=no
248     test_fontconfig=no
249     test_freetype=no
250     test_gtk=no
251     test_kde=no
252     test_kde4=no
253     test_randr=no
254     test_xrender=no
255     test_unix_quickstarter=no
256     _os=Android
258     # Make sure env vars pointing to where to find the cross-build
259     # toolchain are set. There aren't really any sensible
260     # guesstimates.
261     for var in CC CXX AR NM OBJDUMP RANLIB STRIP; do
262         if test -z "`eval echo '$'$var`"; then
263             AC_MSG_ERROR([You need to set the $var environment variable in a cross-compilation for Android. See README.cross for an example.])
264         fi
265     done
266     ;;
269     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
270     ;;
271 esac
273 if test "$_os" = "AIX"; then
274     AC_PATH_PROG(GAWK, gawk)
275     if test -z "$GAWK"; then
276         AC_MSG_ERROR([gawk not found in \$PATH])
277     fi
280 AC_SUBST(WITH_MINGW)
281 AC_SUBST(OSVERSION)
282 AC_SUBST(PTHREAD_CFLAGS)
283 AC_SUBST(PTHREAD_LIBS)
286 ###############################################################################
287 # Extensions switches --enable/--disable
288 ###############################################################################
289 # By default these should be enabled unless having extra dependencies.
290 # If there is extra dependency over configure options then the enable should
291 # be automagic based on wether the requiring feature is enabled or not.
292 # All this options change anything only with --enable-extension-integration.
293 AC_ARG_ENABLE(extension-integration,
294     AS_HELP_STRING([--disable-extension-integration],
295         [Disable integration of the builded extensions to the installer of the
296          product. Use this switch to disable the integration.])
299 AC_ARG_ENABLE(ext-barcode,
300     AS_HELP_STRING([--enable-ext-barcode],
301         [Enable the Barcode extension.])
304 AC_ARG_ENABLE(ext-diagram,
305     AS_HELP_STRING([--enable-ext-diagram],
306         [Enable the SmART Gallery (Diagram) extension.])
309 AC_ARG_ENABLE(ext-google-docs,
310     AS_HELP_STRING([--enable-ext-google-docs],
311         [Enable the Google Documents extension.])
314 AC_ARG_ENABLE(ext-hunart,
315     AS_HELP_STRING([--enable-ext-hunart],
316         [Enable the Hungarian Cross-reference Toolbar extension.])
319 AC_ARG_ENABLE(ext-languagetool,
320     AS_HELP_STRING([--enable-ext-languagetool],
321         [Enable the LanguageTool extension.])
324 AC_ARG_ENABLE(ext-lightproof,
325     AS_HELP_STRING([--enable-ext-lightproof],
326         [Enable the Lightproof extension. The enable switch can contain only
327          the desired languages: --enable-lightproof="en hu ru"]),
328     [enable_ext_lightproof="$enableval"],
329     [enable_ext_lightproof=no]
332 AC_ARG_ENABLE(ext-mysql-connector,
333     AS_HELP_STRING([--enable-ext-mysql-connector],
334         [Enable the build of the MySQL Connector extension.])
337 AC_ARG_ENABLE(ext-nlpsolver,
338     AS_HELP_STRING([--enable-ext-nlpsolver],
339         [Enable the NLPSolver extension.])
342 AC_ARG_ENABLE(ext-ct2n,
343     AS_HELP_STRING([--enable-ext-ct2n],
344         [Enable the ConvertTextToNumber extension.])
347 AC_ARG_ENABLE(ext-numbertext,
348     AS_HELP_STRING([--enable-ext-numbertext],
349         [Enable the Numbertext extension.])
352 AC_ARG_ENABLE(ext-oooblogger,
353     AS_HELP_STRING([--enable-ext-oooblogger],
354         [Enable the OOo Blogger extension.])
357 AC_ARG_ENABLE(ext-pdfimport,
358     AS_HELP_STRING([--disable-ext-pdfimport],
359         [Disable the PDF Import extension.])
362 AC_ARG_ENABLE(ext-postgresql-sdbc,
363     AS_HELP_STRING([--enable-ext-postgresql-sdbc],
364         [Enable the build of the PostgreSQL-SDBC extension.])
367 AC_ARG_ENABLE(ext-presenter-console,
368     AS_HELP_STRING([--disable-ext-presenter-console],
369         [Disable the Presenter Console extension.])
372 AC_ARG_ENABLE(ext-presenter-minimizer,
373     AS_HELP_STRING([--disable-ext-presenter-minimizer],
374         [Disable the Presentation Minimizer extension.])
377 AC_ARG_ENABLE(ext-report-builder,
378     AS_HELP_STRING([--disable-ext-report-builder],
379         [Disable the Report Builder extension.])
382 AC_ARG_ENABLE(ext-scripting-beanshell,
383     AS_HELP_STRING([--enable-ext-scripting-beanshell],
384         [Enable support for scripts in BeanShell.])
387 AC_ARG_ENABLE(ext-scripting-javascript,
388     AS_HELP_STRING([--enable-ext-scripting-javascript],
389         [Enable support for scripts in JavaScript.])
392 AC_ARG_ENABLE(ext-typo,
393     AS_HELP_STRING([--enable-ext-typo],
394         [Enable the Typography Toolbar extension.])
397 AC_ARG_ENABLE(ext-validator,
398     AS_HELP_STRING([--enable-ext-validator],
399         [Enable the Validator extension.])
402 AC_ARG_ENABLE(ext-watch-window,
403     AS_HELP_STRING([--enable-ext-watch-window],
404         [Enable the Watch Window extension to Calc.])
407 AC_ARG_ENABLE(ext-wiki-publisher,
408     AS_HELP_STRING([--enable-ext-wiki-publisher],
409         [Enable the Wiki Publisher extension.])
411 ###############################################################################
413 dnl ---------- *** ----------
415 AC_ARG_ENABLE(mergelibs,
416     AS_HELP_STRING([--enable-mergelibs],
417         [Enables linking of big merged library used for better performance.])
420 AC_ARG_ENABLE(graphite,
421     AS_HELP_STRING([--enable-graphite],
422         [Enables the compilation of Graphite smart font rendering.])
425 AC_ARG_ENABLE(ldap,
426     AS_HELP_STRING([--disable-ldap],
427         [Disables the use of LDAP backend via Netscape/Mozilla or OpenLDAP LDAP SDK])
430 AC_ARG_ENABLE(fetch-external,
431     AS_HELP_STRING([--disable-fetch-external],
432         [Disables fetching external tarballs from web sources.])
435 AC_ARG_ENABLE(lockdown,
436     AS_HELP_STRING([--disable-lockdown],
437         [Disables the gconf integration work in LibreOffice.]),
440 AC_ARG_ENABLE(vba,
441     AS_HELP_STRING([--disable-vba],
442         [Disables the vba compatibility feature.])
445 AC_ARG_ENABLE(pch,
446     AS_HELP_STRING([--enable-pch],
447         [DEPRECATED : is ignored])
450 AC_ARG_ENABLE(mozilla,
451     AS_HELP_STRING([--disable-mozilla],
452         [LibreOffice usually includes a strangely hacked up Mozilla binary for your
453          platform, to build without this version, use this option.])
456 AC_ARG_ENABLE(epm,
457     AS_HELP_STRING([--enable-epm],
458         [LibreOffice includes self-packaging code, that requires epm, however epm is
459          useless for large scale package building.])
462 AC_ARG_ENABLE(activex_component,
463     AS_HELP_STRING([--disable-activex-component],
464         [Remove support for ActiveX embedding of LibreOffice.])
467 AC_ARG_ENABLE(odk,
468     AS_HELP_STRING([--disable-odk],
469         [LibreOffice includes an ODK, office development kit which some packagers may
470          wish to build without.])
473 AC_ARG_ENABLE(mathmldtd,
474     AS_HELP_STRING([--disable-mathmldtd],
475         [Disable mathmldtd (useful for distributions that want to avoid
476          packaging it).])
479 AC_ARG_ENABLE(evolution2,
480     AS_HELP_STRING([--enable-evolution2],
481         [Allows the built-in evolution 2 addressbook connectivity build to be
482          enabled.])
485 AC_ARG_ENABLE(directx,
486     AS_HELP_STRING([--disable-directx],
487         [Remove DirectX implementation for the new XCanvas interface.
488          The DirectX support requires more stuff installed on Windows to
489          compile. (DirectX SDK, GDI+ libs)])
492 AC_ARG_ENABLE(activex,
493     AS_HELP_STRING([--disable-activex],
494         [Disable the use of ActiveX for a Windows build.
495         This switch is mandatory when using VC++ 2008 Express.])
498 AC_ARG_ENABLE(atl,
499     AS_HELP_STRING([--disable-atl],
500         [Disable the use of ATL for a Windows build.])
501     [
502                           This switch is mandatory when using VC++ 2008 Express.
503     ],
506 AC_ARG_ENABLE(symbols,
507     AS_HELP_STRING([--enable-symbols],
508         [Include debugging symbols in output. WARNING - a complete build needs
509          8 Gb of space and takes much longer (enables -g compiler flag).])
510     [
511                           Enabling symbols disables the stripping of the solver
512                           (--disable-strip-solver).
513     ],
516 AC_ARG_ENABLE(strip-solver,
517     AS_HELP_STRING([--disable-strip-solver],
518         [Disable the stripping of the solver. By default the solver is stripped
519          unless a build with debugging symbols (--enable-symbols) is requested.])
520     [
521                           This switch allows to override this setting.
522     ],
525 AC_ARG_ENABLE(werror,
526     AS_HELP_STRING([--enable-werror],
527         [Turn warnings to errors. (Has no effect in modules where the treating
528          of warnings as errors is disabled explicitly.)]),
531 AC_ARG_ENABLE(debug,
532     AS_HELP_STRING([--enable-debug],
533         [Include debugging symbols from --enable-symbols plus extra debugging
534          code. Extra large build! (enables -g compiler flag and dmake debug=true)
535          If you need even more verbose output, build a module with
536          "build -- debug=true dbglevel=2".]))
538 AC_ARG_ENABLE(dbgutil,
539     AS_HELP_STRING([--enable-dbgutil],
540         [Include additional debugging utilities, such as assertions, object
541          counting, etc. Larger build. Independent from --enable-debug]))
543 AC_ARG_ENABLE(linkoo,
544     AS_HELP_STRING([--disable-linkoo],
545         [Disable linkoo for the smoketest installation.]))
547 AC_ARG_ENABLE(lto,
548     AS_HELP_STRING([--enable-lto],
549         [Enable link-time optimization. Suitable for product builds.
550          Building takes longer but libraries are optimized for speed.
551          (possible only with gcc-4.5 or later,
552           better to use gcc-4.6 and 'gold' as linker)]))
554 AC_ARG_ENABLE(crashdump,
555     AS_HELP_STRING([--enable-crashdump],
556         [Enable the crashdump feature.]))
558 AC_ARG_ENABLE(python,
559     AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
560         [Enables or disables Python support at run-time and build-time.
561          Also specifies what Python to use. 'auto' is the
562          default. Note that Python can be disabled with
563          --disable-python or --enable-python=no only if no
564          translations are required.]))
566 AC_ARG_ENABLE(gtk,
567     AS_HELP_STRING([--disable-gtk],
568         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
569 ,enable_gtk=yes)
571 AC_ARG_ENABLE(gtk3,
572     AS_HELP_STRING([--disable-gtk3],
573         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
574 ,enable_gtk3=no)
576 AC_ARG_ENABLE(systray,
577     AS_HELP_STRING([--disable-systray],
578         [Determines whether to build the systray quickstarter.]),
579 ,enable_systray=yes)
581 AC_ARG_ENABLE(split-app-modules,
582     AS_HELP_STRING([--enable-split-app-modules],
583         [Split file lists for app modules, e.g. base, calc.
584          Has effect only with make distro-pack-install]),
587 AC_ARG_ENABLE(split-opt-features,
588     AS_HELP_STRING([--enable-split-opt-features],
589         [Split file lists for some optional features, .e.g. pyuno, testtool.
590          Has effect only with make distro-pack-install]),
593 AC_ARG_ENABLE(cairo-canvas,
594 [  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
595                           platforms where Cairo is available.
596 ],,enable_cairo_canvas=yes)
598 AC_ARG_ENABLE(librsvg,
599     AS_HELP_STRING([--enable-librsvg=<no/auto/system/internal>],
600         [Enables or disables use of librsvg to render SVG at run-time.
601          Also specificed what librsvg to use. 'auto' is the default.]))
603 AC_ARG_ENABLE(opengl,
604     AS_HELP_STRING([--disable-opengl],
605         [Determines whether to build the OpenGL 3D slide transitions component.]),
606 ,enable_opengl=yes)
608 AC_ARG_ENABLE(dbus,
609     AS_HELP_STRING([--enable-dbus],
610         [Determines whether to enable presentation mode screensaver control
611          under GNOME via DBUS.]),
612 ,enable_dbus=no)
614 AC_ARG_ENABLE(gconf,
615     AS_HELP_STRING([--disable-gconf],
616         [Determines whether to use the GConf support.]),
617 ,enable_gconf=yes)
619 AC_ARG_ENABLE(gnome-vfs,
620     AS_HELP_STRING([--disable-gnome-vfs],
621         [Determines whether to use the Gnome Virtual Filing System on platforms
622          where that VFS is available.]),
623 ,enable_gnome_vfs=yes)
625 AC_ARG_ENABLE(gio,
626     AS_HELP_STRING([--enable-gio],
627         [Determines whether to use the GIO support.]),
628 ,enable_gio=no)
630 AC_ARG_ENABLE(static-gtk,
631     AS_HELP_STRING([--enable-static-gtk],
632         [Modules that are linked against GTK+ libraries use the static libraries
633          instead of the dynamic ones. (Enables -Bstatic linker flag for GTK+ libraries.)]),
636 AC_ARG_ENABLE(build-mozilla,
637     AS_HELP_STRING([--disable-build-mozilla],
638         [Use this option if you do not want to build the Mozilla components from
639          the Mozilla source code but take precompiled zips.]),
642 AC_ARG_ENABLE(xmlsec,
643     AS_HELP_STRING([--disable-xmlsec],
644         [Whether to enable XMLsec for open document signing.]),
647 AC_ARG_ENABLE(kde,
648     AS_HELP_STRING([--enable-kde],
649         [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
650          KDE3 are available.]),
653 AC_ARG_ENABLE(kdeab,
654     AS_HELP_STRING([--disable-kdeab],
655         [Disable the KDE3 address book support.]),
657     if test "$enable_kde" = "yes"; then
658         enable_kdeab=yes;
659     fi
662 AC_ARG_ENABLE(kde4,
663     AS_HELP_STRING([--enable-kde4],
664         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
665          KDE4 are available. May be used with --enable-kde if you want to support
666          both KDE3 and KDE4.]),
669 AC_ARG_ENABLE(unix-qstart-libpng,
670     AS_HELP_STRING([--disable-unix-qstart-libpng],
671         [On UNIX systems, we have a faster splash app, that can use libpng to
672          render its splash, if we can safely link to the system libpng then
673          enabling this is a good idea (ie. for Linux Distro packaging).]),
674 ,enable_unix_qstart_libpng=yes)
676 AC_ARG_ENABLE(binfilter,
677     AS_HELP_STRING([--enable-binfilter],
678         [Enable legacy binary file formats filters build.]),
679 ,enable_binfilter=no
682 AC_ARG_ENABLE(ugly,
683     AS_HELP_STRING([--enable-ugly],
684         [Enables ugly pieces of functionality.]),
685 ,enable_ugly=no
688 AC_ARG_ENABLE(rpath,
689     AS_HELP_STRING([--disable-rpath],
690         [Disable the use of relative paths in shared libraries.]),
693 AC_ARG_ENABLE(randr,
694     AS_HELP_STRING([--disable-randr],
695         [Disable RandR support in the vcl project.]),
696 ,enable_randr=yes)
698 AC_ARG_ENABLE(randr-link,
699     AS_HELP_STRING([--disable-randr-link],
700         [Disable linking with libXrandr, instead dynamically open it at runtime.]),
701 ,enable_randr_link=yes)
703 AC_ARG_ENABLE(gstreamer,
704     AS_HELP_STRING([--disable-gstreamer],
705         [Disable building the gstreamer avmedia backend.]),
706 ,enable_gstreamer=yes)
708 AC_ARG_ENABLE(neon,
709     AS_HELP_STRING([--disable-neon],
710         [Disable neon and the compilation of webdav binding.]),
713 AC_ARG_ENABLE(build-unowinreg,
714     AS_HELP_STRING([--enable-build-unowinreg],
715         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
716          compiler is needed on Linux.])
717     [
718                           Usage:     --enable-build-unowinreg
719     ],
722 AC_ARG_ENABLE(verbose,
723     AS_HELP_STRING([--enable-verbose],
724         [Increase build verbosity.])[
725   --disable-verbose       Decrease build verbosity.],
728 AC_ARG_ENABLE(dependency-tracking,
729     AS_HELP_STRING([--enable-dependency-tracking],
730         [Do not reject slow dependency extractors.])[
731   --disable-dependency-tracking
732                           Disables generation of dependency information.
733                           Speed up one-time builds.],
736 AC_ARG_ENABLE(icecream,
737     AS_HELP_STRING([--enable-icecream],
738         [Use the 'icecream' distributed compiling tool to speedup the compilation.
739          It defaults to /opt/icecream for the location of the icecream gcc/g++
740          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
743 AC_ARG_ENABLE(zenity,
744     AS_HELP_STRING([--disable-zenity],
745         [Do not display a build icon in the notification area (on unix) during build.]),
746 ,enable_zenity=yes)
748 AC_ARG_ENABLE(nsplugin,
749     AS_HELP_STRING([--disable-nsplugin],
750         [Do not build nsplugin extension for browser embedding.])
753 AC_ARG_ENABLE(ccache,
754     AS_HELP_STRING([--disable-ccache],
755         [Do not try to use ccache automatically.
756          By default, we will try to detect if ccache is available; in that case if
757          CC/CXX are not yet set, and --enable-icecream is not given, we
758          attempt to use ccache. --disable-ccache disables ccache completely.
762 AC_ARG_ENABLE(cl-x64,
763     AS_HELP_STRING([--enable-cl-x64],
764         [Build a 64-bit LibreOffice using the Microsoft C/C++ x64 compiler.]),
767 AC_ARG_ENABLE(extra-gallery,
768     AS_HELP_STRING([--enable-extra-gallery],
769         [Add extra gallery content.]),
772 AC_ARG_ENABLE(extra-template,
773     AS_HELP_STRING([--enable-extra-template],
774         [Add extra template content.]),
777 AC_ARG_ENABLE(extra-sample,
778     AS_HELP_STRING([--enable-extra-sample],
779         [Add extra sample content.]),
782 AC_ARG_ENABLE(extra-font,
783     AS_HELP_STRING([--enable-extra-font],
784         [Add extra font content.]),
787 AC_ARG_ENABLE(oxygenoffice,
788     AS_HELP_STRING([--enable-oxygenoffice],
789         [Download OxygenOffice branding and set custom settings.]),
792 AC_ARG_ENABLE(lomenubar,
793     AS_HELP_STRING([--enable-lomenubar],
794         [Enable global menu support.]),
797 AC_ARG_ENABLE(online-update,
798     AS_HELP_STRING([--enable-online-update],
799         [Enable the online update service that will check for new versions of
800          LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
803 AC_ARG_ENABLE(release-build,
804     AS_HELP_STRING([--enable-release-build],
805         [Enable release build.
806          See http://wiki.documentfoundation.org/DevBuild]),
809 AC_ARG_ENABLE(silent-msi,
810     AS_HELP_STRING([--enable-silent-msi],
811         [Enable MSI with LIMITUI=1 (silent install).]),
814 dnl ===================================================================
815 dnl Optional Packages (--with/without-)
816 dnl ===================================================================
817 AC_ARG_WITH(gnu-patch,
818     AS_HELP_STRING([--with-gnu-patch],
819         [Specify location of GNU patch on Solaris or FreeBSD.]),
822 AC_ARG_WITH(gnu-cp,
823     AS_HELP_STRING([--with-gnu-cp],
824         [Specify location of GNU cp on Solaris or FreeBSD.]),
827 AC_ARG_WITH(external-tar,
828     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
829         [Specify path to tarfiles manually.]),
830     TARFILE_LOCATION=$withval ,
833 AC_ARG_WITH(linked-git,
834     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
835         [Specify another checkout's clonedir to re-use. This makes use of
836                  git-new-workdir, and saves a lot of diskspace when having multiple
837                  trees side-by-side.]),
838     GIT_LINK_SRC=$withval ,
841 AC_ARG_WITH(openldap,
842     AS_HELP_STRING([--with-openldap],
843         [Enables the use of the OpenLDAP LDAP SDK instead of the Netscape/Mozilla one.]),
846 AC_ARG_WITH(vba-package-format,
847     AS_HELP_STRING([--with-vba-package-format],
848         [Specify package format for vba compatibility api. Specifying  "builtin"
849          means the api component and associated type library are  part of the
850          installation set. Specifying "extn" creates an uno extension that is
851          part of the installation set (located in the program directory) that
852          MUST be optionly registered using either the unopkg executeable or the
853          extension manager gui.])
854     [
855                           Note: "builtin" is the default, "extn" can cause
856                           problems.
858                           Usage:     --with-vba-package-format="builtin" or
859                                      --with-vba-package-format="extn"
860     ],
863 AC_ARG_WITH(theme,
864     AS_HELP_STRING([--with-theme="theme1 theme2..."],
865         [Choose which themes to include. By default those themes with an '*' are included.
866          Possible choices: *default, *crystal, *hicontrast, *oxygen, *tango, classic, industrial.]),
869 AC_ARG_WITH(helppack-integration,
871   --without-helppack-integration      It will not integrate the helppacks to the installer
872                           of the product.
873                           Please use this switch to use the online help or separate help packages.],
876 AC_ARG_WITH(fonts,
877     AS_HELP_STRING([--without-fonts],
878         [LibreOffice includes some third-party fonts to provide a reliable basis for
879          help content, templates, samples, etc. When these fonts are already
880          known to be available on the system then you should use this option.]),
883 AC_ARG_WITH(ppds,
884     AS_HELP_STRING([--without-ppds],
885         [Removes Postscript Printer definition files from LibreOffice
886          installation set, for people building for specific distributions where
887          PPDs are known to be already available (every recent distro with CUPS backend).]),
890 AC_ARG_WITH(afms,
891     AS_HELP_STRING([--without-afms],
892         [Removes bitmap font files from LibreOffice installation set, for people
893          building for specific distributions where AFM files or TrueType Fonts
894          are known to be available.]),
897 AC_ARG_WITH(agfa-monotype-fonts,
898      AS_HELP_STRING([--with-agfa-monotype-fonts],
899           [This switch should only be enabled for those who have the right
900            to use or distribute the proprietary Agfa Monotype
901            fonts.])
904 AC_ARG_WITH(epm,
905     AS_HELP_STRING([--with-epm],
906         [Decides which epm to use. Default is to use the one from the system if
907          one is built. When either this is not there or you say =internal epm
908          will be built.]),
911 AC_ARG_WITH(package-format,
912     AS_HELP_STRING([--with-package-format],
913         [Specify package format(s) for LibreOffice installsets. Default is the
914          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
915          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
916           installed, msi. Example: --with-package-format="deb dmg"]),
919 AC_ARG_WITH(system-libs,
920     AS_HELP_STRING([--with-system-libs],
921         [Use libraries already on system -- enables all --with-system-* flags except
922          mozilla.]),
925 AC_ARG_WITH(system-headers,
926     AS_HELP_STRING([--with-system-headers],
927         [Use headers already on system -- enables all --with-system-* flags for
928          external packages whose headers are the only entities used i.e.
929          boost/vigra/odbc/sane-header(s).]),
932 AC_ARG_WITH(system-jars,
933     AS_HELP_STRING([--without-system-jars],
934         [When building with --with-system-libs, also the needed jars are expected
935          on the system. Use this to disable that (except for the db case where
936          --with-system-db *has to* imply using the db.jar from there, too).]),
939 AC_ARG_WITH(system-stdlibs,
940     AS_HELP_STRING([--with-system-stdlibs],
941         [Use libstdc++/libgcc_s already on system.]),,
942     [with_system_stdlibs="$with_system_libs"])
944 AC_ARG_WITH(system-cairo,
945     AS_HELP_STRING([--with-system-cairo],
946         [Use Cairo libraries already on system.]),,
947     [with_system_cairo="$with_system_libs"])
949 AC_ARG_WITH(system-graphite,
950     AS_HELP_STRING([--with-system-graphite],
951         [Use graphite library already installed on system.]),,
952     [with_system_graphite="$with_system_libs"])
954 AC_ARG_WITH(system-nss,
955     AS_HELP_STRING([--with-system-nss],
956         [Use NSS/nspr libraries already on system.]),,
957     [with_system_nss="$with_system_libs"])
959 AC_ARG_WITH(system-sampleicc,
960     AS_HELP_STRING([--with-system-sampleicc],
961         [Use SampleICC libraries already on system (used only during build).]),,
962     [with_system_sampleicc="$with_system_libs"])
964 AC_ARG_WITH(mozilla-version,
965     AS_HELP_STRING([--with-mozilla-version],
966         [Choose which version of Mozilla to use while building Mozilla.
967          (default=1.7.5) Note that not all versions are supported.]),
970 AC_ARG_WITH(mozilla-toolkit,
971     AS_HELP_STRING([--with-mozilla-toolkit],
972         [Choose which GUI toolkit to use while building Mozilla components. (default=gtk2)]),
975 AC_ARG_WITH(myspell-dicts,
976     AS_HELP_STRING([--without-myspell-dicts],
977         [Removes myspell dictionaries from LibreOffice installation set, for
978          people building for specific distributions where the myspell dictionaries
979          are installed from other sources.]),
982 AC_ARG_WITH(system-dicts,
983     AS_HELP_STRING([--with-system-dicts],
984         [Use dictionaries from system paths- Specify them via
985          --with-{dict,hyph,thes}-path=/path if you want to override the default ones.]),
988 AC_ARG_WITH(external-dict-dir,
989     AS_HELP_STRING([--with-external-dict-dir],
990         [Specify external dictionary dir.]),
993 AC_ARG_WITH(external-hyph-dir,
994     AS_HELP_STRING([--with-external-hyph-dir],
995         [Specify external hyphenation pattern dir.]),
998 AC_ARG_WITH(external-thes-dir,
999     AS_HELP_STRING([--with-external-thes-dir],
1000         [Specify external thesaurus dir.]),
1003 AC_ARG_WITH(system-zlib,
1004     AS_HELP_STRING([--with-system-zlib],
1005         [Use zlib already on system.]),,
1006  [if test "$_os" != "WINNT"; then
1007     with_system_zlib=yes
1008   else
1009     with_system_zlib="$with_system_libs"
1010   fi])
1012 AC_ARG_WITH(system-openssl,
1013     AS_HELP_STRING([--with-system-openssl],
1014         [Use OpenSSL already on system.]),,
1015     [with_system_openssl="$with_system_libs"])
1017 AC_ARG_WITH(system-jpeg,
1018     AS_HELP_STRING([--with-system-jpeg],
1019         [Use jpeg already on system.]),,
1020  [if test "$_os" = "Linux"; then
1021     with_system_jpeg=yes
1022   else
1023     with_system_jpeg="$with_system_libs"
1024   fi])
1026 AC_ARG_WITH(system-expat,
1027     AS_HELP_STRING([--with-system-expat],
1028         [Use expat already on system.]),,
1029     [with_system_expat="$with_system_libs"])
1031 AC_ARG_WITH(system-libcmis,
1032     AS_HELP_STRING([--with-system-libcmis],
1033         [Use libcmis already on system.]),,
1034     [with_system_libcmis="$with_system_libs"])
1036 AC_ARG_WITH(system-libvisio,
1037     AS_HELP_STRING([--with-system-libvisio],
1038         [Use libvisio already on system.]),,
1039     [with_system_libvisio="$with_system_libs"])
1041 AC_ARG_WITH(system-libwpd,
1042     AS_HELP_STRING([--with-system-libwpd],
1043         [Use libwpd already on system.]),,
1044     [with_system_libwpd="$with_system_libs"])
1046 AC_ARG_WITH(system-libwps,
1047     AS_HELP_STRING([--with-system-libwps],
1048         [Use libwps already on system.]),,
1049     [with_system_libwps="$with_system_libs"])
1051 AC_ARG_WITH(system-libwpg,
1052     AS_HELP_STRING([--with-system-libwpg],
1053         [Use libwpg already on system.]),,
1054     [with_system_libwpg="$with_system_libs"])
1056 AC_ARG_WITH(system-libxml,
1057     AS_HELP_STRING([--with-system-libxml],
1058         [Use libxml/libxslt already on system.]),,
1059  [if test "$_os" = "Darwin"; then
1060     with_system_libxml=yes
1061   else
1062     with_system_libxml="$with_system_libs"
1063   fi])
1065 AC_ARG_WITH(system-icu,
1066     AS_HELP_STRING([--with-system-icu],
1067         [Use icu already on system.]),,
1068     [with_system_icu="$with_system_libs"])
1070 AC_ARG_WITH(system-poppler,
1071     AS_HELP_STRING([--with-system-poppler],
1072         [Use system poppler. (only needed for pdfimport extension)]),,
1073     [with_system_poppler="$with_system_libs"])
1075 AC_ARG_WITH(system-db,
1076     AS_HELP_STRING([--with-system-db],
1077         [Use Berkeley db already on system.]),,
1078     [with_system_db="$with_system_libs"])
1080 AC_ARG_WITH(system-lucene,
1081     AS_HELP_STRING([--with-system-lucene],
1082         [Use Lucene already on system.]),,
1083     [with_system_lucene="$with_system_jars"])
1085 AC_ARG_WITH(system-apache-commons,
1086     AS_HELP_STRING([--with-system-apache-commons],
1087         [Use Apache commons libraries already on system.]),,
1088     [with_system_apache_commons="$with_system_jars"])
1090 AC_ARG_WITH(lucene-core-jar,
1091     AS_HELP_STRING([--with-lucene-core-jar=JARFILE],
1092         [Specify path to jarfile manually.]),
1093     LUCENE_CORE_JAR=$withval)
1095 AC_ARG_WITH(lucene-analyzers-jar,
1096     AS_HELP_STRING([--with-lucene-analyzers-jar=JARFILE],
1097         [Specify path to jarfile manually.]),
1098     LUCENE_ANALYZERS_JAR=$withval ,)
1100 AC_ARG_WITH(system-mysql,
1101     AS_HELP_STRING([--with-system-mysql],
1102         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
1103          extension. If the the mysql_config executable is not in PATH, use MYSQLCONFIG to
1104          point to it.]),,
1105     [with_system_mysql="$with_system_libs"])
1107 AC_ARG_WITH(libmysql-path,
1108     AS_HELP_STRING([--with-libmysql-path],
1109         [Use Connector/C (libmysql) installation for building the MySQL
1110          Connector/LibreOffice extension.])
1111     [
1112                           Usage:     --with-libmysql-path=<absolute path to
1113                                                   your Connector/C installation>
1114     ],
1117 AC_ARG_WITH(system-mysql-cppconn,
1118     AS_HELP_STRING([--with-system-mysql-cppconn],
1119         [Use MySQL C++ Connector libraries already on system.]),,
1120     [with_system_mysql_cppconn="$with_system_libs"])
1122 AC_ARG_WITH(system-postgresql,
1123     AS_HELP_STRING([--with-system-postgresql],
1124         [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1125          extension. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1126     [with_system_postgresql="$with_system_libs"])
1128 AC_ARG_WITH(libpq-path,
1129     AS_HELP_STRING([--with-libpq-path],
1130         [Use this PostgreSQL C interface (libpq) installation for building
1131          the PostgreSQL-SDBC extension.])
1132     [
1133                           Usage:     --with-libpq-path=<absolute path to
1134                                                   your libq installation>
1135     ],
1138 AC_ARG_WITH(system-hsqldb,
1139     AS_HELP_STRING([--with-system-hsqldb],
1140         [Use hsqldb already on system.]),,
1141     [with_system_hsqldb="$with_system_jars"])
1143 AC_ARG_WITH(hsqldb-jar,
1144     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1145         [Specify path to jarfile manually.]),
1146     HSQLDB_JAR=$withval)
1148 AC_ARG_WITH(system-beanshell,
1149     AS_HELP_STRING([--with-system-beanshell],
1150         [Use beanshell already on system.]),,
1151     [with_system_beanshell="$with_system_jars"])
1153 AC_ARG_WITH(beanshell-jar,
1154     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1155         [Specify path to jarfile manually.]),
1156     BSH_JAR=$withval)
1158 AC_ARG_WITH(commons-codec-jar,
1159     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1160         [Specify path to jarfile manually.]),
1161     COMMONS_CODEC_JAR=$withval)
1163 AC_ARG_WITH(commons-lang-jar,
1164     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1165         [Specify path to jarfile manually.]),
1166     COMMONS_LANG_JAR=$withval)
1168 AC_ARG_WITH(commons-httpclient-jar,
1169     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1170         [Specify path to jarfile manually.]),
1171     COMMONS_HTTPCLIENT_JAR=$withval)
1173 AC_ARG_WITH(commons-logging-jar,
1174     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1175         [Specify path to jarfile manually.]),
1176     COMMONS_LOGGING_JAR=$withval)
1178 AC_ARG_WITH(system-servlet-api,
1179     AS_HELP_STRING([--with-system-servlet-api],
1180         [Use servlet-api already on system.]),,
1181     [with_system_servlet_api="$with_system_jars"])
1183 AC_ARG_WITH(servlet-api-jar,
1184     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
1185         [Specify path to jarfile manually.]),
1186     SERVLETAPI_JAR=$withval)
1188 AC_ARG_WITH(system-jfreereport,
1189     AS_HELP_STRING([--with-system-jfreereport],
1190         [Use JFreeReport already on system.]),,
1191     [with_system_jfreereport="$with_system_jars"])
1193 AC_ARG_WITH(sac-jar,
1194     AS_HELP_STRING([--with-sac-jar=JARFILE],
1195         [Specify path to jarfile manually.]),
1196     SAC_JAR=$withval)
1198 AC_ARG_WITH(libxml-jar,
1199     AS_HELP_STRING([--with-libxml-jar=JARFILE],
1200         [Specify path to jarfile manually.]),
1201     LIBXML_JAR=$withval)
1203 AC_ARG_WITH(flute-jar,
1204     AS_HELP_STRING([--with-flute-jar=JARFILE],
1205         [Specify path to jarfile manually.]),
1206     FLUTE_JAR=$withval)
1208 AC_ARG_WITH(jfreereport-jar,
1209     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1210         [Specify path to jarfile manually.]),
1211     JFREEREPORT_JAR=$withval)
1213 AC_ARG_WITH(liblayout-jar,
1214     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1215         [Specify path to jarfile manually.]),
1216     LIBLAYOUT_JAR=$withval)
1218 AC_ARG_WITH(libloader-jar,
1219     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1220         [Specify path to jarfile manually.]),
1221     LIBLOADER_JAR=$withval)
1223 AC_ARG_WITH(libloader-jar,
1224     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1225         [Specify path to jarfile manually.]),
1226     LIBLOADER_JAR=$withval)
1228 AC_ARG_WITH(libformula-jar,
1229     AS_HELP_STRING([--with-libformula-jar=JARFILE],
1230         [Specify path to jarfile manually.]),
1231     LIBFORMULA_JAR=$withval)
1233 AC_ARG_WITH(librepository-jar,
1234     AS_HELP_STRING([--with-librepository-jar=JARFILE],
1235         [Specify path to jarfile manually.]),
1236     LIBREPOSITORY_JAR=$withval)
1238 AC_ARG_WITH(libfonts-jar,
1239     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1240         [Specify path to jarfile manually.]),
1241     LIBFONTS_JAR=$withval)
1243 AC_ARG_WITH(libserializer-jar,
1244     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1245         [Specify path to jarfile manually.]),
1246     LIBSERIALIZER_JAR=$withval)
1248 AC_ARG_WITH(libbase-jar,
1249     AS_HELP_STRING([--with-libbase-jar=JARFILE],
1250         [Specify path to jarfile manually.]),
1251     LIBBASE_JAR=$withval)
1253 AC_ARG_WITH(system-saxon,
1254     AS_HELP_STRING([--with-system-saxon],
1255         [Use saxon already on system.]),,
1256     [with_system_saxon="$with_system_jars"])
1258 AC_ARG_WITH(saxon-jar,
1259     AS_HELP_STRING([--with-saxon-jar=JARFILE],
1260         [Specify path to jarfile manually.]),
1261     SAXON_JAR=$withval)
1263 AC_ARG_WITH(system-odbc,
1264     AS_HELP_STRING([--with-system-odbc],
1265         [Use the odbc headers already on system.]),,
1266     [with_system_odbc="$with_system_headers"])
1268 AC_ARG_WITH(system-sane,
1269     AS_HELP_STRING([--with-system-sane],
1270         [Use sane.h already on system.]),,
1271     [with_system_sane="$with_system_headers"])
1273 AC_ARG_WITH(system-xextensions-headers,
1274     AS_HELP_STRING([--with-system-xextensions-headers],
1275         [To build without system X11 extensions headers, use
1276          --without-system-xextensions-headers. This is possibly
1277          useful on legacy unix systems which ship with the libs
1278          but without the headers.]))
1280 AC_ARG_WITH(system-mesa-headers,
1281     AS_HELP_STRING([--with-system-mesa-headers],
1282         [Use Mesa headers already on system.]),,
1283     [with_system_mesa_headers="$with_system_headers"])
1285 AC_ARG_WITH(system-curl,
1286     AS_HELP_STRING([--with-system-curl],
1287         [Use curl already on system.]),,
1288  [if test "$_os" = "Darwin"; then
1289     with_system_curl=yes
1290   else
1291     with_system_curl="$with_system_libs"
1292   fi])
1294 AC_ARG_WITH(system-boost,
1295     AS_HELP_STRING([--with-system-boost],
1296         [Use boost already on system.]),,
1297     [with_system_boost="$with_system_headers"])
1299 AC_ARG_WITH(system-mdds,
1300     AS_HELP_STRING([--with-system-mdds],
1301         [Use mdds already on system.]),,
1302     [with_system_mdds="$with_system_headers"])
1304 AC_ARG_WITH(system-vigra,
1305     AS_HELP_STRING([--with-system-vigra],
1306         [Use vigra already on system.]),,
1307     [with_system_vigra="$with_system_headers"])
1309 AC_ARG_WITH(system-neon,
1310     AS_HELP_STRING([--with-system-neon],
1311         [Use neon already on system.]),,
1312     [with_system_neon="$with_system_libs"])
1314 AC_ARG_WITH(system-hunspell,
1315     AS_HELP_STRING([--with-system-hunspell],
1316         [Use libhunspell already on system.]),,
1317     [with_system_hunspell="$with_system_libs"])
1319 AC_ARG_WITH(system-mythes,
1320     AS_HELP_STRING([--with-system-mythes],
1321         [Use mythes already on system.]),,
1322     [with_system_mythes="$with_system_libs"])
1324 AC_ARG_WITH(system-altlinuxhyph,
1325     AS_HELP_STRING([--with-system-altlinuxhyph],
1326         [Use ALTLinuxhyph already on system.]),,
1327     [with_system_altlinuxhyph="$with_system_libs"])
1329 AC_ARG_WITH(system-lpsolve,
1330     AS_HELP_STRING([--with-system-lpsolve],
1331         [Use lpsolve already on system.]),,
1332     [with_system_lpsolve="$with_system_libs"])
1334 AC_ARG_WITH(system-libexttextcat,
1335     AS_HELP_STRING([--with-system-libexttextcat],
1336         [Use libexttextcat already on system.]),,
1337     [with_system_libexttextcat="$with_system_libs"])
1339 AC_ARG_WITH(system-cppunit,
1340     AS_HELP_STRING([--with-system-cppunit],
1341         [Use cppunit already on system.]),,
1342     [with_system_cppunit="$with_system_libs"])
1344 AC_ARG_WITH(system-redland,
1345     AS_HELP_STRING([--with-system-redland],
1346         [Use redland library already on system.]),,
1347     [with_system_redland="$with_system_libs"])
1349 AC_ARG_WITH(system-mozilla,
1350     AS_HELP_STRING([--with-system-mozilla],
1351         [Use Mozilla already on system. Note that some components cannot be built
1352          against a contemporary Mozilla. The flavour used can be specified by
1353          --with-system-mozilla=<flavour>. Supported are: libxul (default),
1354          xulrunner, firefox, seamonkey, mozilla, iceape.]),
1355     WITH_SYSTEM_MOZILLA=$withval ,
1356 WITH_SYSTEM_MOZILLA=no)
1358 AC_ARG_WITH(system-mozilla-headers,
1359     AS_HELP_STRING([--with-system-mozilla-headers],
1360         [Use mozilla headers provided by system instead of bundled ones. Used in
1361          nsplugin]),,
1362     [with_system_mozilla_headers="$with_system_headers"]
1365 AC_ARG_WITH(system-gettext,
1366     AS_HELP_STRING([--with-system-gettext],
1367         [Use gettext runtime library already on system.]),,
1368     [with_system_gettext="$with_system_libs"])
1370 AC_ARG_WITH(system-libpng,
1371     AS_HELP_STRING([--with-system-libpng],
1372         [Use libpng already on system.]),,
1373     [with_system_libpng="$with_system_libs"])
1375 AC_ARG_WITH(linker-hash-style,
1376     AS_HELP_STRING([--with-linker-hash-style],
1377         [Use linker with --hash-style=<style> when linking shared objects.
1378          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1379          if supported on the build system, and "sysv" otherwise.]))
1381 AC_ARG_WITH(stlport,
1382     AS_HELP_STRING([--with-stlport],
1383         [Build the STLPort library for compatibility with old extensions for
1384          architectures where STLPort used to be used.]),
1385     with_stlport=$withval ,
1386 with_stlport=auto)
1388 AC_ARG_WITH(jdk-home,
1389     AS_HELP_STRING([--with-jdk-home],
1390         [If you have installed JDK 1.3 or later on your system please supply the
1391          path here. Note that this is not the location of the java command but the
1392          location of the entire distribution.])
1393     [
1394                           Usage:     --with-jdk-home=<absolute path to JDK home>
1395     ],
1398 AC_ARG_WITH(gxx_include_path,
1399     AS_HELP_STRING([--with-gxx-include-path],
1400         [If you want to override the autodetected g++ include path.])
1401     [
1402                           Usage:     --with-gxx-include-path=<absolute path to
1403                                                                 g++ include dir>
1404     ],
1407 AC_ARG_WITH(help,
1408     AS_HELP_STRING([--with-help],
1409         [Enable the build of help.
1411          To build without help, use --without-help.]))
1413 AC_ARG_WITH(java,
1414     AS_HELP_STRING([--with-java],
1415         [Specify the name of the Java interpreter command. Typically "java"
1416          which is the default.
1418          To build without support for Java components, applets, accessibility
1419          or the XML filters written in Java, use --without-java or --with-java=no.])
1420     [
1421                           Usage:     --with-java==<java command>
1422                                      --without-java
1423     ],
1424     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1425     [ with_java=java ]
1428 AC_ARG_WITH(java_target_version,
1429     AS_HELP_STRING([--with-java-target-version],
1430         [Generate class files that will work on JVMs with the specified version.
1431          For example, use --with-java-target-version=1.4 to make sure that the
1432          application will work with JVM 1.4 even when compiled with JDK 1.5.])
1433     [
1434                           This option is ignored when you compile with gcj/gij.
1436                           Usage:     --with-java-target-version=<jvm version>
1437     ],
1440 AC_ARG_WITH(jvm-path,
1441     AS_HELP_STRING([--with-jvm-path],
1442         [Use a specific JVM search path at runtime.])
1443     [
1444                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1446                           e. g.: --with-jvm-path=/usr/lib/
1447                                  to find JRE/JDK in /usr/lib/jvm/
1448     ],
1451 AC_ARG_WITH(ant-home,
1452     AS_HELP_STRING([--with-ant-home],
1453         [If you have installed Jakarta Ant on your system, please supply the path here.
1454          Note that this is not the location of the Ant binary but the location
1455          of the entire distribution.])
1456     [
1457                           Usage:     --with-ant-home=<absolute path to Ant home>
1458     ],
1461 AC_ARG_WITH(junit,
1462     AS_HELP_STRING([--with-junit],
1463         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1464          --without-junit disables those tests. Not relevant in the --without-java case.])
1465     [
1466                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1467     ],
1468 ,with_junit=yes)
1470 AC_ARG_WITH(perl-home,
1471     AS_HELP_STRING([--with-perl-home],
1472         [If you have installed Perl 5 Distribution, on your system, please
1473          supply the path here. Note that this is not the location of the Perl
1474          binary but the location of the entire distribution.])
1475     [
1476                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1477     ],
1480 AC_ARG_WITH(cl-home,
1481     AS_HELP_STRING([--with-cl-home],
1482         [For Windows NT users, please supply the path for the Microsoft C/C++
1483          compiler. Note that this is not the location of the compiler binary but
1484          the location of the entire distribution.])
1485     [
1486                           Usage:     --with-cl-home=<absolute path to Microsoft
1487                                                             C/C++ compiler home>
1488     ],
1491 AC_ARG_WITH(mspdb-path,
1492     AS_HELP_STRING([--with-mspdb-path],
1493         [For Microsoft C/C++ compiler users, please supply the path pointing to
1494          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1495          Visual Studio 2010).])
1496     [
1497                           Usage:     --with-mspdb-path=<path to
1498                                                        mspdb80.dll/mspdb100.dll>
1499     ],
1502 AC_ARG_WITH(midl-path,
1503     AS_HELP_STRING([--with-midl-path],
1504         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1505     [
1506                           Usage:     --with-midl-path=<abs. path to midl.exe>
1507     ],
1510 AC_ARG_WITH(csc-path,
1511     AS_HELP_STRING([--with-csc-path],
1512         [For Windows builds, please supply the path pointing to the csc.exe.
1513          Usually found automatically when building on Windows.])
1514     [
1515                           Usage:     --with-csc-path=<abs. path to csc.exe>
1516     ],
1519 AC_ARG_WITH(dotnet-framework-home,
1520     AS_HELP_STRING([--with-dotnet-framework-home],
1521         [For Microsoft compiler users, please supply the path pointing to
1522          lib/mscoree.lib, usually something like:
1523          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1524     [
1525                           Note that in most cases it will be automatically
1526                           found, though.
1528                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1529                                                           Framework>
1530     ],
1533 AC_ARG_WITH(windows-sdk-home,
1534     AS_HELP_STRING([--with-windows-sdk-home],
1535         [For Windows builds, please supply the path to the Windows SDK.
1536          Usually found automatically when building on Windows.])
1537     [
1538                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1539     ],
1542 AC_ARG_WITH(directx-home,
1543     AS_HELP_STRING([--with-directx-home],
1544         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1545     [
1546                           Usage:     --with-directx-home=<absolute path to
1547                                                           Microsoft DirectX SDK>
1548     ],
1551 AC_ARG_WITH(mozilla-build,
1552     AS_HELP_STRING([--with-mozilla-build],
1553         [For Windows users, please supply the path to the Mozilla build tools.])
1554     [
1555                           Usage:     --with-mozilla-build=<absolute path to
1556                                                           Mozilla build tools>
1558                           At the moment of this writing, an installer for the
1559                           mozilla build tools can be obtained from http://ftp.
1560                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1561     ],
1562     MOZILLABUILD=$withval ,
1565 AC_ARG_WITH(local-solver,
1566     AS_HELP_STRING([--with-local-solver],
1567         [If you have solver in a location other than ./solver, please supply the path here.])
1568     [
1569                           Usage:     --with-local-solver=<abs. path to solver>
1570     ],
1573 AC_ARG_WITH(lang,
1574     AS_HELP_STRING([--with-lang],
1575         [Use this option to build LibreOffice with additional language support.
1576          English (US) is always included by default.
1577          Separate multiple languages with space.
1578          For all languages, use --with-lang=ALL.])
1579     [
1580                           Usage:     --with-lang="es sw tu cs sk"
1581     ],
1584 dnl ===================================================================
1585 dnl Branding
1586 dnl ===================================================================
1588 AC_ARG_WITH(branding,
1589 [  --with-branding        Use given path to retrieve all branding images.
1590                           Expects /path/intro.png ...
1591                           /path/backing_rtl_right.png to be there. Individual
1592                           images can be overridden via --with-intro-bitmap ...
1593                           --with-startcenter-rtl-left-bitmap switches.
1595                           Usage:     --with-branding=/path/to/images
1596 ],,)
1598 AC_ARG_WITH(intro-bitmap,
1599 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1600                           the default one.
1602                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1603 ],,)
1605 AC_ARG_WITH(intro-progressbar-color,
1606 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1607                                      Comma separated RGB values in decimal format.
1609                           Usage: --with-intro-progressbar-color=126,170,23
1610 ],,)
1612 AC_ARG_WITH(intro-progressbar-size,
1613 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1614                                      Comma separated values in decimal format.
1616                           Usage: --with-intro-progressbar-size=319,10
1617 ],,)
1619 AC_ARG_WITH(intro-progressbar-position,
1620 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1621                                      Comma separated values in decimal format.
1623                           Usage: --with-intro-progressbar-position=164,225
1624 ],,)
1626 AC_ARG_WITH(intro-progressbar-frame-color,
1627 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1628                                            Comma separated RGB values in decimal format.
1630                           Usage: --with-intro-progressbar-frame-color=207,208,211
1631 ],,)
1633 AC_ARG_WITH(about-bitmap,
1634 [  --with-about-bitmap    Similarly to --with-intro-bitmap, this allows
1635                           specification of bitmap for the About box.
1637                           Usage:     --with-about-bitmap=/path/my_ooo_about.png
1638 ],,)
1640 AC_ARG_WITH(startcenter-left-bitmap,
1641 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1642                                      specification of bitmap for the Start center.
1644                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1645 ],,)
1647 AC_ARG_WITH(startcenter-right-bitmap,
1648 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1649                                       specification of bitmap for the Start center.
1651                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1652 ],,)
1654 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1655 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1656                                          specification of bitmap for the Start center.
1658                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1659 ],,)
1661 AC_ARG_WITH(startcenter-rtl-right-bitmap,
1662 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
1663                                           specification of bitmap for the Start center.
1665                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
1666 ],,)
1668 AC_ARG_WITH(startcenter-space-bitmap,
1669 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
1670                                       specification of bitmap for the Start center.
1672                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
1673 ],,)
1675 AC_ARG_WITH(vendor,
1676     AS_HELP_STRING([--with-vendor],
1677         [Set vendor of the build.])
1678     [
1679                           Usage:     --with-vendor="John the Builder"
1680     ],
1683 AC_ARG_WITH(unix-wrapper,
1684     AS_HELP_STRING([--with-unix-wrapper],
1685         [Redefines the name of the UNIX wrapper that will be used in the desktop
1686          files and in the desktop-integration RPMs.])
1687     [
1688                           Usage:     --with-unix-wrapper=ooffice
1689     ],
1692 AC_ARG_WITH(compat-oowrappers,
1693     AS_HELP_STRING([--with-compat-oowrappers],
1694         [Install oo* wrappers in parallel with
1695          lo* ones to keep backward compatibility.
1696          Has effect only with make distro-pack-install]),
1699 AC_ARG_WITH(asm-home,
1700     AS_HELP_STRING([--with-asm-home],
1701         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
1702     [
1703                           Usage:     --with-asm-home=<path to assembler directory>
1704     ],
1707 AC_ARG_WITH(os-version,
1708     AS_HELP_STRING([--with-os-version],
1709         [For FreeBSD users, use this option option to override the detected OSVERSION.])
1710     [
1711                           Usage:     --with-os-version=<OSVERSION>
1712     ],
1715 AC_ARG_WITH(mingw-cross-compiler,
1716     AS_HELP_STRING([--with-mingw-cross-compiler],
1717         [Specify the MinGW cross-compiler to use.])
1718     [
1719                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
1721                           When building on the ODK on Unix and building unowinreg.dll,
1722                           specify the MinGW C++ cross-compiler.
1723     ],
1726 AC_ARG_WITH(build-version,
1727     AS_HELP_STRING([--with-build-version],
1728         [Allows the builder to add a custom version tag that will appear in the
1729          Help/About box for QA purposes.])
1730     [
1731                           Usage:     --with-build-version="Built by Jim"
1732     ],
1733     with_build_version=$withval ,
1736 AC_ARG_WITH(alloc,
1737     AS_HELP_STRING([--with-alloc],
1738         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
1739          Note that on FreeBSD/NetBSD system==jemalloc]),
1742 AC_ARG_WITH(sun-templates,
1743     AS_HELP_STRING([--with-sun-templates],
1744         [Integrate Sun template packages.]),
1747 AC_ARG_WITH(num-cpus,
1748     AS_HELP_STRING([--with-num-cpus],
1749         [Number of build processes/cpus to use (number of projects that will build at the same time).
1750          Multi-process/multi-cpu builds can save a lot of time on multi-cpu machines.
1751          Defaults to the number of CPUs on the machine.]),
1754 AC_ARG_WITH(max-jobs,
1755     AS_HELP_STRING([--with-max-jobs],
1756         [Maximum number of jobs that will be issued at the same time per dmake or gbuild subproject.
1757          The real number of the jobs is affected by the --with-num-cpus too, it can get up to CPUS*max_jobs.
1758          Defaults to 1, unless you configure --enable-icecream - then to 10.]),
1761 dnl ===================================================================
1762 dnl MacOSX build and runtime environment options
1763 dnl ===================================================================
1765 AC_ARG_WITH(macosx-sdk,
1766     AS_HELP_STRING([--with-macosx-sdk],
1767         [Use a specific SDK for building.])
1768     [
1769                           Usage:     --with-macosx-sdk=<version>
1771                           e. g.: --with-macosx-sdk=10.4
1773                           there are 3 options to controle the MacOSX build:
1774                           --with-macosx-sdk (refered as 'sdl' below)
1775                           --with-macosx-version-min-required (refered as 'min' below)
1776                           --with-macosx-version-max-allowed (refered as 'max' below)
1778                           the connection between these value and the default they take is as follow:
1779                           ( ? means not specified on the command line, constraint: x <= y <= z)
1781                           ==========================================
1782                            command line      || config result
1783                           ==========================================
1784                           min  | max  | sdk  || min  | max  | sdk  |
1785                           ?    | ?    | ?    || 10.4 | 10.4 | 10.4 |
1786                           ?    | ?    | 10.x || 10.4 | 10.4 | 10.x |
1787                           ?    | 10.x | ?    || 10.4 | 10.x | 10.x |
1788                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
1789                           10.x | ?    | ?    || 10.x | 10.x | 10.x |
1790                           10.x | ?    | 10.y || 10.x | 10.x | 10.y |
1791                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
1792                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
1795                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
1796                           for a detailled technical explanation of these variables
1798                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
1800     ],
1803 AC_ARG_WITH(macosx-version-min-required,
1804     AS_HELP_STRING([--with-macosx-version-min-required],
1805         [set the minimum OS version needed to run the built LibreOffice])
1806     [
1807                           Usage:     --with-macosx-version-min-required=<version>
1809                           e. g.: --with-macos-version-min-required=10.4
1810                           see --with-macosx-sdk for more info
1811     ],
1814 AC_ARG_WITH(macosx-version-max-allowed,
1815     AS_HELP_STRING([--with-macosx-version-max-allowed],
1816         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
1817     [
1818                           Usage:     --with-macosx-version-max-allowed=<version>
1820                           e. g.: --with-macos-version-max-allowed=10.6
1821                           see --with-macosx-sdk for more info
1822     ],
1826 dnl ===================================================================
1827 dnl check for required programs (grep, awk, sed, bash)
1828 dnl ===================================================================
1829 AC_PROG_EGREP
1830 AC_PROG_AWK
1831 AC_PATH_PROG( AWK, $AWK)
1832 if test -z "$AWK"; then
1833     AC_MSG_ERROR([install awk to run this script])
1836 AC_PATH_PROG(BASH, bash)
1837 if test -z "$BASH"; then
1838     AC_MSG_ERROR([bash not found in \$PATH])
1840 AC_SUBST(BASH)
1842 AC_MSG_CHECKING([for GNU or BSD tar])
1843 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
1844     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
1845     if test $? -eq 0;  then
1846         GNUTAR=$a
1847         break
1848     fi
1849 done
1850 AC_MSG_RESULT($GNUTAR)
1851 if test -z "$GNUTAR"; then
1852     AC_MSG_ERROR([not found. install GNU or BSD tar.])
1854 AC_SUBST(GNUTAR)
1856 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
1857 dnl desktop OSes from "mobile" ones.
1859 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
1860 dnl In other words, that when building for an OS that is not a
1861 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
1863 dnl Note the direction of the implication; there is no assumption that
1864 dnl cross-compiling would imply a non-desktop OS.
1866 if test $_os != iOS -a $_os != Android; then
1867     BUILD_TYPE="$BUILD_TYPE DESKTOP"
1870 dnl ===================================================================
1871 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
1872 dnl although MSVC is used to build other build-time tools and 
1873 dnl LibreOffice itself.
1874 dnl ===================================================================
1875 if test "$build_os" = "cygwin" ; then
1876     AC_MSG_CHECKING([for Cygwin gcc/g++])
1877     if which gcc > /dev/null && which g++ > /dev/null ; then
1878         AC_MSG_RESULT([found])
1879     else
1880         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
1881     fi
1886 dnl ===================================================================
1887 dnl  Checks if ccache is available
1888 dnl ===================================================================
1889 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \) ; then
1890     if test -z "$CC" ; then
1891         if test -z "$CXX" ; then
1892             AC_PATH_PROG([CCACHE],[ccache],[not found])
1893             if test "$CCACHE" = "not found" ; then
1894                 CCACHE=""
1895             else
1896                 CCACHE="ccache"
1897                 # need to check for ccache version: otherwise prevents
1898                 # caching of the results (like "-x objective-c++" for Mac)
1899                 if test $_os = Darwin -o $_os = iOS; then
1900                     # check ccache version
1901                     AC_MSG_CHECKING([whether version of ccache is suitable])
1902                     CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
1903                     CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1904                     if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
1905                         AC_MSG_RESULT([yes])
1906                     else
1907                         AC_MSG_RESULT([no])
1908                         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.])
1909                         CCACHE=""
1910                     fi
1911                 fi
1912             fi
1913         else
1914             AC_MSG_NOTICE([Automatic ccache detection ingored: CXX is pre-defined])
1915             CCACHE=""
1916         fi
1917     else
1918         AC_MSG_NOTICE([Automatic ccache detection ingored: CC is pre-defined])
1919         CCACHE=""
1920     fi
1921 else
1922     CCACHE=""
1925 if test "$CCACHE" != "" ; then
1926     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
1927     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
1928     if test "$ccache_size" = "" ; then
1929         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
1930         if test "$ccache_size" = "" ; then
1931             ccache_size=0
1932         fi
1933         # we could not determine the size or it was less than 1GB -> disable auto-ccache
1934         if test $ccache_size -lt 1024 ; then
1935             CCACHE=""
1936             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
1937             echo "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled" >> warn
1938         else
1939             # warn that ccache may be too small for debug build
1940             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1941             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1942         fi
1943     else
1944         if test $ccache_size -lt 5  ; then
1945             #warn that ccache may be too small for debug build
1946             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1947             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1948         fi
1949     fi
1952 dnl ===================================================================
1953 dnl  Checks for C compiler,
1954 dnl  The check for the C++ compiler is later on.
1955 dnl ===================================================================
1956 GCC_HOME_SET="true"
1957 AC_MSG_CHECKING([gcc home])
1958 if test -z "$with_gcc_home"; then
1959     if test "$enable_icecream" = "yes" ; then
1960         GCC_HOME="/opt/icecream"
1961     else
1962         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
1963         GCC_HOME_SET="false"
1964     fi
1965 else
1966     GCC_HOME="$with_gcc_home"
1968 AC_MSG_RESULT($GCC_HOME)
1969 AC_SUBST(GCC_HOME)
1971 if test "$GCC_HOME_SET" = "true" ; then
1972     if test -z "$CC"; then
1973         CC="$GCC_HOME/bin/gcc"
1974     fi
1975     if test -z "$CXX"; then
1976         CXX="$GCC_HOME/bin/g++"
1977     fi
1980 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1981 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
1982     AC_PROG_CC
1985 COMPATH=`dirname "$CC"`
1986 if test "$COMPATH" = "." ; then
1987     AC_PATH_PROGS(COMPATH, $CC)
1988     dnl double square bracket to get single because of M4 quote...
1989     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
1991 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
1996 dnl ===================================================================
1997 dnl  Test MacOSX sdk and version requirement
1998 dnl ===================================================================
1999 if test "$_os" = "Darwin" ; then
2001     if test "$with_macosx_version_min_required" = "" ; then
2002         with_macosx_version_min_required="10.4"
2003     fi
2005     if test "$with_macosx_version_max_allowed" = "" ; then
2006         with_macosx_version_max_allowed="$with_macosx_version_min_required"
2007     fi
2009     if test "$with_macosx_sdk" = "" ; then
2010         with_macosx_sdk="$with_macosx_version_max_allowed"
2011     fi
2013     case "$with_macosx_sdk" in
2015     10.4)
2016         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.4u.sdk"
2017         if test ! -d "$MACOSX_SDK_PATH"; then
2018           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.4u.sdk"
2019         fi
2020         macosx_sdk_value="1040"
2021         ;;
2022     10.5)
2023         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.5.sdk"
2024         if test ! -d "$MACOSX_SDK_PATH"; then
2025           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.5.sdk"
2026         fi
2027         macosx_sdk_value="1050"
2028         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
2029         echo "Building with a SDK > 10.4 is experimental" >> warn
2030         ;;
2031     10.6)
2032         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"
2033         macosx_sdk_value="1060"
2034         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
2035         echo "Building with a SDK > 10.4 is experimental" >> warn
2036         ;;
2037     10.7)
2038         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.7.sdk"
2039         macosx_sdk_value="1070"
2040         AC_MSG_WARN([Building with SDK 10.7 is known to fail in vcl])
2041         echo "Building with SDK 10.7 is known to fail in vcl" >> warn
2042         ;;
2043     *)
2044         AC_MSG_ERROR([$with_macosx_sdk is not a supported SDK value, supported value are 10.4, 10.5, 10.6 and 10.7])
2045         ;;
2046     esac
2047     AC_MSG_CHECKING([the presence of the SDK $with_macosx_sdk])
2048     if test -d "$MACOSX_SDK_PATH" ; then
2049         AC_MSG_RESULT([$MACOSX_SDK_PATH ok])
2050     else
2051         AC_MSG_ERROR([$MACOSX_SDK_PATH not found])
2052     fi
2053     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2055     case "$with_macosx_version_min_required" in
2057     10.4)
2058         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
2059         ;;
2060     10.5)
2061         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2062         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2063         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2064         if test -z "$save_CC" ; then
2065             CC="gcc-4.2 -m32"
2066             CXX="g++-4.2 -m32"
2067         fi
2068         ;;
2069     10.6)
2070         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2071         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2072         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2073         if test -z "$save_CC" ; then
2074             CC="gcc-4.2 -m32"
2075             CXX="g++-4.2 -m32"
2076         fi
2077         ;;
2078     10.7)
2079         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2080         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
2081         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
2082         if test -z "$save_CC" ; then
2083             CC="gcc-4.2 -m32"
2084             CXX="g++-4.2 -m32"
2085         fi
2086         ;;
2087     *)
2088         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])
2089         ;;
2090     esac
2092     case "$with_macosx_version_max_allowed" in
2094     10.4)
2095         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
2096         ;;
2097     10.5)
2098         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2099         ;;
2100     10.6)
2101         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2102         ;;
2103     10.7)
2104         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2105         ;;
2106     *)
2107         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])
2108         ;;
2109     esac
2111     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2112     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED ; then
2113         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2114     else
2115         AC_MSG_RESULT([ok])
2116     fi
2118     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent macos-with-sdk])
2119     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $macosx_sdk_value ; then
2120         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2121     else
2122         AC_MSG_RESULT([ok])
2123     fi
2124     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2125     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2127 AC_SUBST(MACOSX_SDK_PATH)
2128 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2129 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2130 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2132 dnl ===================================================================
2133 dnl  Test the gcc version,  3 is OK
2134 dnl ===================================================================
2135 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
2136     AC_MSG_CHECKING([the GNU C compiler version])
2137     _gcc_version=`$CC -dumpversion`
2138     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2139     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2141     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100" ; then
2142         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0" ; then
2143             export CC="$GCC_HOME/bin/gcc-4.0"
2144             #  export CC to have it available in set_soenv -> config.guess
2145             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2146             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100" ; then
2147                 GCCVER=$GCCVER2
2148             fi
2149         fi
2150         if test "$GCCVER" -ge "040100" ; then
2151             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])
2152         else
2153             AC_MSG_RESULT([implicitly using CC=$CC])
2154         fi
2155     else
2156         AC_MSG_RESULT([checked (gcc $_gcc_version)])
2157     fi
2162 # prefix C with ccache if needed
2164 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" ; then
2165     if test "$CCACHE" != "" ; then
2166         AC_MSG_CHECKING([whether $CC is already ccached])
2169         AC_LANG_PUSH([C])
2170         save_CFLAGS=$CFLAGS
2171         CFLAGS="$CFLAGS --ccache-skip -O2"
2172         dnl an empty program will do, we're checking the compiler flags
2173         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2174                           [use_ccache=yes], [use_ccache=no])
2175         if test $use_ccache = yes ; then
2176             AC_MSG_RESULT([yes])
2177         else
2178             CC="$CCACHE $CC"
2179             AC_MSG_RESULT([no])
2180         fi
2181         CFLAGS=$save_CFLAGS
2182         AC_LANG_POP([C])
2183     fi
2187 HAVE_LD_BSYMBOLIC_FUNCTIONS=
2188 if test "$GCC" = "yes"; then
2189     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
2190     bsymbolic_functions_ldflags_save=$LDFLAGS
2191     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
2192     AC_LINK_IFELSE([AC_LANG_PROGRAM([
2193 #include <stdio.h>
2194         ],[
2195 printf ("hello world\n");
2196         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
2197     if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
2198         AC_MSG_RESULT( found )
2199     else
2200         AC_MSG_RESULT( not found )
2201     fi
2202     LDFLAGS=$bsymbolic_functions_ldflags_save
2204 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
2206 dnl ===================================================================
2207 dnl Set up a different compiler to produce tools to run on the build
2208 dnl machine when doing cross-compilation
2209 dnl ===================================================================
2211 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
2212 if test "$cross_compiling" = "yes"; then
2213     AC_MSG_CHECKING([for BUILD platform configuration])
2214     echo
2215     rm -rf CONF-FOR-BUILD Env.Build.sh
2216     mkdir CONF-FOR-BUILD
2217     tar cf - \
2218         Makefile.in \
2219         bin/repo-list.in \
2220         build_env.in \
2221         config.guess \
2222         configure \
2223         ooo.lst.in \
2224         oowintool \
2225         post_download.in \
2226         set_soenv.in \
2227         solenv/inc/langlist.mk \
2228         solenv/inc/postset.mk \
2229         desktop/scripts/soffice.sh.in \
2230     | (cd CONF-FOR-BUILD && tar xf -)
2231     (
2232     unset COM GUI GUIBASE OS CPU CPUNAME
2233     unset CC CXX SYSBASE CFLAGS
2234     unset PYTHON_CFLAGS PYTHON_LIBS
2235     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
2236     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
2237     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
2238     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
2239     cd CONF-FOR-BUILD
2240     sub_conf_opts=""
2241     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
2242     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
2243     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
2244     ./configure \
2245         --disable-mozilla \
2246         --disable-build-mozilla \
2247         --disable-zenity \
2248         --with-num-cpus="$with_num_cpus" \
2249         --with-max-jobs="$with_max_jobs" \
2250         $sub_conf_opts \
2251         2>&1 | sed -e 's/^/    /'
2252     test -f ./Env.Host.sh 2>/dev/null || exit
2253     cp Env.Host.sh ../Env.Build.sh
2254     . ./Env.Host.sh
2255     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
2256              SYSTEM_LIBXSLT; do
2257         VV='$'$V
2258         VV=`eval "echo $VV"`
2259         if test -n "$VV"; then
2260             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
2261             echo "$line" >>build-config
2262         fi
2263     done
2265     for V in OUTDIR PATH SOLARINC SOLARLIB WORKDIR; do
2266         VV='$'$V
2267         VV=`eval "echo $VV"`
2268         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
2269         if test -n "$VV"; then
2270             line="${V}_FOR_BUILD='$VV'"
2271             echo "$line" >>build-config
2272         fi
2273     done
2274     )
2275     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
2276     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])
2277     perl -pi -e 's,/CONF-FOR-BUILD,,g' Env.Build.sh
2278     eval `cat CONF-FOR-BUILD/build-config`
2279     AC_MSG_RESULT([checking for BUILD platform configuration... done])
2280     rm -rf CONF-FOR-BUILD
2281 else
2282     CC_FOR_BUILD="$CC"
2283     CXX_FOR_BUILD="$CXX"
2285 AC_SUBST(COM_FOR_BUILD)
2286 AC_SUBST(GUI_FOR_BUILD)
2287 AC_SUBST(GUIBASE_FOR_BUILD)
2288 AC_SUBST(OS_FOR_BUILD)
2289 AC_SUBST(CPU_FOR_BUILD)
2290 AC_SUBST(CPUNAME_FOR_BUILD)
2291 AC_SUBST(CC_FOR_BUILD)
2292 AC_SUBST(CXX_FOR_BUILD)
2293 AC_SUBST(GXX_INCLUDE_PATH_FOR_BUILD)
2294 AC_SUBST(INPATH_FOR_BUILD)
2295 AC_SUBST(OUTPATH_FOR_BUILD)
2296 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
2297 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
2299 AC_SUBST(OUTDIR_FOR_BUILD)
2300 AC_SUBST(PATH_FOR_BUILD)
2301 AC_SUBST(SOLARINC_FOR_BUILD)
2302 AC_SUBST(SOLARLIB_FOR_BUILD)
2303 AC_SUBST(WORKDIR_FOR_BUILD)
2305 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
2306 SOURCEVERSION="OOO$UPD"
2307 AC_SUBST(UPD)
2308 AC_SUBST(SOURCEVERSION)
2310 dnl ===================================================================
2311 dnl Set the ENABLE_CRASHDUMP variable.
2312 dnl ===================================================================
2313 AC_MSG_CHECKING([whether to enable crashdump feature])
2314 if test "$enable_crashdump" = "yes"; then
2315     ENABLE_CRASHDUMP="TRUE"
2316     BUILD_TYPE="$BUILD_TYPE CRASHREP"
2317     AC_MSG_RESULT([yes])
2318 else
2319     ENABLE_CRASHDUMP=""
2320     AC_MSG_RESULT([no])
2322 AC_SUBST(ENABLE_CRASHDUMP)
2325 dnl ===================================================================
2326 dnl Windows specific tests and stuff
2327 dnl ===================================================================
2328 if test "$_os" = "WINNT"; then
2330     dnl Include twain scanners
2331     BUILD_TYPE="$BUILD_TYPE TWAIN"
2333     dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice.
2334     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2335     if test "z$enable_cl_x64" = "z" -o "$enable_cl_x64" = "no"; then
2336         CL_X64=""
2337         AC_MSG_RESULT([no])
2338     else
2339         CL_X64="TRUE"
2340         AC_MSG_RESULT([yes])
2341     fi
2342     AC_SUBST(CL_X64)
2344     AC_MSG_CHECKING([whether to use DirectX])
2345     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2346         ENABLE_DIRECTX="TRUE"
2347         AC_MSG_RESULT([yes])
2348     else
2349         ENABLE_DIRECTX=""
2350         AC_MSG_RESULT([no])
2351     fi
2352     AC_SUBST(ENABLE_DIRECTX)
2354     AC_MSG_CHECKING([whether to use ActiveX])
2355     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2356         DISABLE_ACTIVEX=""
2357         AC_MSG_RESULT([yes])
2358     else
2359         DISABLE_ACTIVEX="TRUE"
2360         AC_MSG_RESULT([no])
2361     fi
2362     AC_SUBST(DISABLE_ACTIVEX)
2364     AC_MSG_CHECKING([whether to use ATL])
2365     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE"; then
2366         DISABLE_ATL=""
2367         AC_MSG_RESULT([yes])
2368     elif test "$enable_atl" = ""; then
2369         if test "$WITH_MINGW" = "yes"; then
2370             DISABLE_ATL="TRUE"
2371             AC_MSG_RESULT([no])
2372         else
2373             DISABLE_ATL=""
2374             AC_MSG_RESULT([yes])
2375         fi
2376     else
2377         DISABLE_ATL="TRUE"
2378         AC_MSG_RESULT([no])
2379     fi
2380     AC_SUBST(DISABLE_ATL)
2383 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
2384 dnl ===================================================================
2385 AC_MSG_CHECKING([whether to turn warnings to errors])
2386 if test -n "$enable_werror" && test "$enable_werror" != "no"; then
2387     ENABLE_WERROR="TRUE"
2388     AC_MSG_RESULT([yes])
2389 else
2390     ENABLE_WERROR="FALSE"
2391     AC_MSG_RESULT([no])
2393 AC_SUBST(ENABLE_WERROR)
2395 dnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
2396 dnl ===================================================================
2397 AC_MSG_CHECKING([whether to do a debug build])
2398 if test -n "$enable_debug" && test "$enable_debug" != "no"; then
2399     ENABLE_DEBUG="TRUE"
2400     enable_symbols="yes"
2401     AC_MSG_RESULT([yes])
2402 else
2403     ENABLE_DEBUG="FALSE"
2404     AC_MSG_RESULT([no])
2406 AC_SUBST(ENABLE_DEBUG)
2408 dnl Set the ENABLE_DBGUTIL variable
2409 dnl ===================================================================
2410 AC_MSG_CHECKING([whether to build with additional debug utilities])
2411 if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
2412     PROEXT=""
2413     PRODUCT=""
2415     # Compiling with MSVC using --enable-dbgutil (i.e. using the
2416     # debugging runtime, and defining _DEBUG when compiling) just
2417     # causes too many compilation errors. After having spent some
2418     # months slowly fixing them one by one, having reached sw, I give
2419     # up. Feel free to try again.
2420     if test "$_os" = WINNT -a "$WITH_MINGW" != yes; then
2421         AC_MSG_ERROR([Sorry, --enable-dbgutil won't work with MSVC])
2422     fi
2424     AC_MSG_RESULT([yes])
2425     # cppunit and graphite expose STL in public headers
2426     if test "$with_system_cppunit" = "yes"; then
2427         AC_MSG_ERROR([--with-system-cppunit conflicts with DBG_UTIL build])
2428     else
2429         with_system_cppunit=no
2430     fi
2431     if test "$with_system_graphite" = "yes"; then
2432         AC_MSG_ERROR([--with-system-graphite conflicts with DBG_UTIL build])
2433     else
2434         with_system_graphite=no
2435     fi
2436     if test "$with_system_mysql_cppconn" = "yes"; then
2437         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with DBG_UTIL build])
2438     else
2439         with_system_mysql_cppconn=no
2440     fi
2441     if test $_os = WINNT -a \
2442             \( "$enable_mozilla" != no -o \
2443                "$enable_build_mozilla" != no \); then
2444         # We can't build against the Mozilla stuff if using _DEBUG, will get linking errors
2445         # See connectivity/drivers/mozab
2446         AC_MSG_WARN([Also disabling Mozilla stuff then])
2447         enable_mozilla=no
2448         enable_build_mozilla=no
2449     fi
2450 else
2451     PRODUCT="full"
2452     PROEXT=".pro"
2453     AC_MSG_RESULT([no, full product build])
2455 AC_SUBST(PRODUCT)
2456 AC_SUBST(PROEXT)
2458 dnl Determine whether to use linkoo for the smoketest installation
2459 dnl ===================================================================
2460 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
2461 if test "$enable_linkoo" = "no"; then
2462     DISABLE_LINKOO="TRUE"
2463     AC_MSG_RESULT([no])
2464 else
2465     DISABLE_LINKOO=
2466     AC_MSG_RESULT([yes])
2468 AC_SUBST(DISABLE_LINKOO)
2470 # Set the ENABLE_LTO variable
2471 # ===================================================================
2472 AC_MSG_CHECKING([whether to use link-time optimization])
2473 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
2474     ENABLE_LTO="TRUE"
2475     AC_MSG_RESULT([yes])
2476 else
2477     ENABLE_LTO=""
2478     AC_MSG_RESULT([no])
2480 AC_SUBST(ENABLE_LTO)
2482 dnl whether to include symbols into final build.
2483 dnl ===================================================================
2484 AC_MSG_CHECKING([whether to include symbols])
2485 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
2486     ENABLE_SYMBOLS="TRUE"
2487     AC_MSG_RESULT([yes])
2488 else
2489     ENABLE_SYMBOLS=
2490     AC_MSG_RESULT([no])
2492 AC_SUBST(ENABLE_SYMBOLS)
2494 dnl Determine if the solver is to be stripped or not.
2495 dnl ===================================================================
2496 AC_MSG_CHECKING([whether to strip the solver or not.])
2497 if test "z$enable_strip_solver" = "zno"; then
2498     DISABLE_STRIP="TRUE"
2499     AC_MSG_RESULT([no])
2500 else
2501     if test -n "$ENABLE_SYMBOLS"; then
2502         DISABLE_STRIP="TRUE"
2503         AC_MSG_RESULT([no])
2504     else
2505         DISABLE_STRIP=
2506         AC_MSG_RESULT([yes])
2507     fi
2509 AC_SUBST(DISABLE_STRIP)
2511 dnl check for cups support
2512 dnl ===================================================================
2513 if test "$test_cups" = "yes"; then
2514     AC_MSG_CHECKING([whether cups support is present])
2515     AC_CHECK_LIB(cups, cupsPrintFiles)
2516     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
2517     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
2518         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
2519     fi
2523 # check for fontconfig support
2524 AC_MSG_CHECKING([whether we need fontconfig])
2525 if test "z$test_fontconfig" = "zyes"; then
2526     ENABLE_FONTCONFIG="TRUE"
2527     AC_MSG_RESULT([yes])
2528     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
2529 else
2530     ENABLE_FONTCONFIG=""
2531     AC_MSG_RESULT([no])
2533 AC_SUBST(ENABLE_FONTCONFIG)
2534 AC_SUBST(FONTCONFIG_CFLAGS)
2535 AC_SUBST(FONTCONFIG_LIBS)
2537 dnl whether to find & fetch external tarballs?
2538 dnl ===================================================================
2539 if test -z "$TARFILE_LOCATION"; then
2540     TARFILE_LOCATION="DEFAULT"
2542 AC_SUBST(TARFILE_LOCATION)
2544 AC_MSG_CHECKING([whether we want to fetch tarballs])
2545 if test "z$enable_fetch_external" != "zno" ; then
2546     AC_MSG_RESULT([yes])
2547     DO_FETCH_TARBALLS="YES"
2548 else
2549     AC_MSG_RESULT([no])
2550     DO_FETCH_TARBALLS="NO"
2552 AC_SUBST(DO_FETCH_TARBALLS)
2555 dnl Disable legacy binary file formats filters
2556 dnl ===================================================================
2557 AC_MSG_CHECKING([whether to enable filters for legacy binary file formats (StarOffice 5.2)])
2558 if test "$enable_binfilter" = "no"; then
2559     WITH_BINFILTER="NO"
2560     AC_MSG_RESULT([no])
2561 else
2562     WITH_BINFILTER="YES"
2563     BUILD_TYPE="$BUILD_TYPE BINFILTER"
2564     GIT_REPO_NAMES="$GIT_REPO_NAMES binfilter"
2565     AC_MSG_RESULT([yes])
2567 AC_SUBST(WITH_BINFILTER)
2569 AC_MSG_CHECKING([whether to build help])
2570 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
2571     AC_MSG_RESULT([yes])
2572     BUILD_TYPE="$BUILD_TYPE HELP"
2573     SCPDEFS="$SCPDEFS -DWITH_HELP"
2574     GIT_REPO_NAMES="$GIT_REPO_NAMES help"
2575 else
2576     AC_MSG_RESULT([no])
2579 dnl Enable ugly pieces of code we're better off without
2580 dnl ===================================================================
2581 if test "$enable_ugly" = "yes"; then
2582     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2583     SCPDEFS="$SCPDEFS -DWITH_UGLY"
2584     ENABLE_UGLY=YES
2585 else
2586     ENABLE_UGLY=NO
2588 AC_SUBST(ENABLE_UGLY)
2590 dnl ===================================================================
2591 dnl Disable rpath in shared libraries?
2592 dnl ===================================================================
2593 AC_MSG_CHECKING([whether to use RPATH in shared libraries])
2594 if test "$enable_rpath" = "no"; then
2595     ENABLE_RPATH="no"
2596 else
2597     ENABLE_RPATH="yes"
2599 AC_MSG_RESULT([$ENABLE_RPATH])
2600 AC_SUBST(ENABLE_RPATH)
2602 dnl Test whether to include MySpell dictionaries
2603 dnl ===================================================================
2604 AC_MSG_CHECKING([whether to include MySpell dictionaries])
2605 if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then
2606     AC_MSG_RESULT([yes])
2607     WITH_MYSPELL_DICTS=YES
2608     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2609     GIT_REPO_NAMES="$GIT_REPO_NAMES dictionaries"
2610 else
2611     AC_MSG_RESULT([no])
2612     WITH_MYSPELL_DICTS=NO
2614 AC_SUBST(WITH_MYSPELL_DICTS)
2616 AC_MSG_CHECKING([whether to use dicts from external paths])
2617 if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
2618     AC_MSG_RESULT([yes])
2619     SYSTEM_DICTS=YES
2620     AC_MSG_CHECKING([for spelling dictionary directory])
2621     if test -n "$with_external_dict_dir"; then
2622         DICT_SYSTEM_DIR=file://$with_external_dict_dir
2623     else
2624         DICT_SYSTEM_DIR=file:///usr/share/hunspell
2625     fi
2626     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
2627     AC_MSG_CHECKING([for hyphenation patterns directory])
2628     if test -n "$with_external_hyph_dir"; then
2629         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
2630     else
2631         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
2632     fi
2633     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
2634     AC_MSG_CHECKING([for thesaurus directory])
2635     if test -n "$with_external_thes_dir"; then
2636         THES_SYSTEM_DIR=file://$with_external_thes_dir
2637     else
2638         THES_SYSTEM_DIR=file:///usr/share/mythes
2639     fi
2640     AC_MSG_RESULT([$THES_SYSTEM_DIR])
2641 else
2642     AC_MSG_RESULT([no])
2643     SYSTEM_DICTS=NO
2645 AC_SUBST(SYSTEM_DICTS)
2646 AC_SUBST(DICT_SYSTEM_DIR)
2647 AC_SUBST(HYPH_SYSTEM_DIR)
2648 AC_SUBST(THES_SYSTEM_DIR)
2650 dnl ===================================================================
2651 dnl ENABLE_PCH i now a no-op
2652 dnl ===================================================================
2653 AC_MSG_CHECKING([whether to enable pch feature])
2654 AC_MSG_RESULT([no, obsolete])
2656 dnl ===================================================================
2657 dnl Search all the common names for GNU make
2658 dnl ===================================================================
2659 AC_MSG_CHECKING([for GNU make])
2661 # try to use our own make if it is available and GNUMAKE was not already defined
2662 if test -z "$GNUMAKE"; then
2663     if test -x "/opt/lo/bin/make"; then
2664         GNUMAKE="/opt/lo/bin/make"
2665     fi
2668 for a in "$MAKE" $GNUMAKE make gmake gnumake; do
2669     $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
2670     if test $? -eq 0;  then
2671         GNUMAKE=$a
2672         break
2673     fi
2674 done
2675 AC_MSG_RESULT($GNUMAKE)
2676 if test -z "$GNUMAKE"; then
2677     AC_MSG_ERROR([not found. install GNU make.])
2680 AC_MSG_CHECKING([the GNU make version])
2681 _make_version=`$GNUMAKE --version | grep GNU | grep -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
2682 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2683 if test "$_make_longver" -ge "038200" ; then
2684     AC_MSG_RESULT([$GNUMAKE $_make_version])
2686 elif test "$_make_longver" -ge "038100" ; then
2687     AC_MSG_RESULT([$GNUMAKE $_make_version])
2688     AC_MSG_CHECKING([for GNU make bug 20033])
2689     TESTGMAKEBUG20033=`mktemp -d`
2690     cat > $TESTGMAKEBUG20033/Makefile << EOF
2691 A := \$(wildcard *.a)
2693 .PHONY: all
2694 all: \$(A:.a=.b)
2695         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
2697 .PHONY: setup
2698 setup:
2699         @touch 1.a 2.a 3.a 4.a 5.a 6.a
2701 define d1
2702 @echo lala \$(1)
2703 @sleep 1
2704 endef
2706 define d2
2707 @echo tyty \$(1)
2708 @sleep 1
2709 endef
2711 %.b : %.a
2712         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | sha1sum))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
2713         \$(call d1,\$(CHECKSUM)),\
2714         \$(call d2,\$(CHECKSUM)))
2716     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
2717         no_parallelism_make="YES"
2718         AC_MSG_RESULT([yes, disable parallelism])
2719     else
2720         AC_MSG_RESULT([no, keep parallelism enabled])
2721     fi
2722     rm -rf $TESTGMAKEBUG20033
2723 else
2724     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
2726 AC_SUBST(GNUMAKE)
2728 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`;
2729 STALE_MAKE=
2730 make_warning=
2731 if test "z$_make_ver_check" = "z"; then
2732    STALE_MAKE=TRUE
2734 AC_SUBST(STALE_MAKE)
2736 dnl ===================================================================
2737 dnl  Test the Solaris compiler version
2738 dnl ===================================================================
2739 if test "$_os" = "SunOS"; then
2740     if test "$CC" = "cc"; then
2741         AC_PATH_PROGS(_cc, cc)
2742         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2743         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2744         dnl cc -V outputs to standard error!!!!
2745         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2746         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2747         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2748         if test "$_sunstudio_major" != "5"; then
2749             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2750         else
2751             _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" }'`
2752             if test "$_sunstudio_minor" = "false"; then
2753                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2754             else
2755                 dnl compiler will do
2756                 AC_MSG_RESULT([checked])
2757             fi
2758         fi
2759     fi
2762 HAVE_LD_HASH_STYLE=FALSE
2763 WITH_LINKER_HASH_STYLE=
2764 AC_MSG_CHECKING( for --hash-style gcc linker support )
2765 if test "$GCC" = "yes" ; then
2766     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes" ; then
2767         hash_styles="gnu sysv"
2768     elif test "$with_linker_hash_style" = "no" ; then
2769         hash_styles=
2770     else
2771         hash_styles="$with_linker_hash_style"
2772     fi
2774     for hash_style in $hash_styles ; do
2775         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
2776         hash_style_ldflags_save=$LDFLAGS
2777         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
2779         AC_LINK_IFELSE([AC_LANG_PROGRAM(
2780             [
2781 #include <stdio.h>
2782             ],[
2783 printf ("");
2784             ])],
2785             [ if ./conftest$EXEEXT; then
2786                   HAVE_LD_HASH_STYLE=TRUE
2787                   WITH_LINKER_HASH_STYLE=$hash_style
2788               fi],
2789             [HAVE_LD_HASH_STYLE=FALSE])
2790         LDFLAGS=$hash_style_ldflags_save
2791     done
2793     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
2794         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
2795     else
2796         AC_MSG_RESULT( no )
2797     fi
2798     LDFLAGS=$hash_style_ldflags_save
2799 else
2800     AC_MSG_RESULT( no )
2802 AC_SUBST(HAVE_LD_HASH_STYLE)
2803 AC_SUBST(WITH_LINKER_HASH_STYLE)
2805 dnl ===================================================================
2806 dnl Check whether there's a Perl version available.
2807 dnl ===================================================================
2808 if test -z "$with_perl_home"; then
2809     AC_PATH_PROG(PERL, perl)
2810 else
2811     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
2812     _perl_path="$with_perl_home/bin/perl"
2813     if test -x "$_perl_path"; then
2814         PERL=$_perl_path
2815     else
2816         AC_MSG_ERROR([$_perl_path not found])
2817     fi
2820 dnl ===================================================================
2821 dnl Testing for Perl version 5 or greater.
2822 dnl $] is the Perl version variable, it is returned as an integer
2823 dnl ===================================================================
2824 if test "$PERL"; then
2825     AC_MSG_CHECKING([the Perl version])
2826     ${PERL} -e "exit($]);"
2827     _perl_version=$?
2828     if test "$_perl_version" -lt 5; then
2829         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
2830     fi
2831     AC_MSG_RESULT([checked (perl $_perl_version)])
2832 else
2833     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
2835 AC_SUBST(PERL)
2837 dnl ===================================================================
2838 dnl Testing for required Perl modules
2839 dnl ===================================================================
2841 AC_MSG_CHECKING([for required Perl modules])
2842 if `$PERL -e 'use Archive::Zip; use Cwd;'`; then
2843     AC_MSG_RESULT([all modules found])
2844 else
2845     AC_MSG_ERROR([Failed to find some modules])
2848 dnl ===================================================================
2849 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2850 dnl ===================================================================
2851 SHOWINCLUDES_PREFIX=
2852 if test "$_os" = "WINNT"; then
2853     if test "$WITH_MINGW" != "yes"; then
2854         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
2855         if test -z "$with_cl_home"; then
2856             vctest=`./oowintool --msvc-productdir`;
2857             if test "$CL_X64" = ""; then
2858                 if test -x "$vctest/bin/cl.exe"; then
2859                     with_cl_home=$vctest;
2860                 fi
2861             else
2862                 if test -x "$vctest/bin/amd64/cl.exe"; then
2863                     with_cl_home=$vctest;
2864                 fi
2865             fi
2866         else
2867             with_cl_home=`cygpath -u "$with_cl_home"`
2868         fi
2869         with_cl_home=`cygpath -d "$with_cl_home"`
2870         with_cl_home=`cygpath -u "$with_cl_home"`
2871         AC_MSG_RESULT([$with_cl_home])
2873         dnl ===========================================================
2874         dnl  Check for mspdb80.dll/mspdb100.dll
2875         dnl ===========================================================
2876         dnl MSVS 2008/10 Compiler
2877         if test -n "$with_mspdb_path";then
2878             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2879         fi
2880         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll"; then
2881             MSPDB_PATH="$with_mspdb_path"
2882         fi
2883         dnl MSVS 2008 case
2884         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2885             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2886         fi
2887         dnl Windows SDK 6.0 case
2888         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2889             MSPDB_PATH="$with_cl_home/bin"
2890         fi
2891         dnl MSVS 2010 case
2892         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
2893             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2894         fi
2896         if test -z "$MSPDB_PATH";then
2897             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2898             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2899             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
2900             MSPDB_PATH=`dirname "$MSPDB_PATH"`
2901         fi
2903         if test -z "$MSPDB_PATH"; then
2904             AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path])
2905         fi
2906         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2907         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2908         dnl The path needs to be added before cl is called
2909         PATH="$MSPDB_PATH:$PATH"
2911         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2912         if test -z "$CC"; then
2913             if test "$CL_X64" = ""; then
2914                 if test -x "$with_cl_home/bin/cl.exe"; then
2915                     CC="$with_cl_home/bin/cl.exe"
2916                 fi
2917             else
2918                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
2919                     CC="$with_cl_home/bin/amd64/cl.exe"
2920                 fi
2921             fi
2922             if test -z "$CC"; then
2923                 AC_PATH_PROG(CC, cl.exe)
2924             fi
2925             # This gives us a posix path with 8.3 filename restrictions
2926             CC=`cygpath -d "$CC"`
2927             CC=`cygpath -u "$CC"`
2928         fi
2930         if test -n "$CC"; then
2931             # Remove /cl.exe from CC case insensitive
2932             AC_MSG_RESULT([found ($CC)])
2933             if test "$CL_X64" = ""; then
2934                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
2935             else
2936                 if test -n "$with_cl_home"; then
2937                     COMPATH=`echo $with_cl_home`
2938                 fi
2939             fi
2940             export INCLUDE=`cygpath -d "$COMPATH/Include"`
2941             dnl  Check which Microsoft C/C++ compiler is found
2942             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2943             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
2944             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
2945                             x = match( \\\$0, /..\\...\\...../ )
2946                             CCversion = substr( \\\$0, RSTART, RLENGTH)
2947                             tokencount = split (CCversion,vertoken,\".\")
2948                             for ( i = 1 ; i <= tokencount ; i++ ) {
2949                                 printf (\"%04d\",vertoken[[i]] )
2950                             }
2951                             }"`
2952             if test "$CCNUMVER" -ge "001600000000"; then
2953                 COMEX=13
2954                 MSVSVER=2010
2955             elif test "$CCNUMVER" -ge "001500000000"; then
2956                 COMEX=12
2957                 MSVSVER=2008
2958             else
2959                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
2960             fi
2961             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
2962         else
2963             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
2964         fi
2966         dnl We need to guess the prefix of the -showIncludes output, it can be
2967         dnl localized
2968         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
2969         echo "#include <stdlib.h>" > conftest.c
2970         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
2971             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
2972         rm -f conftest.c conftest.obj
2973         if test -z "$SHOWINCLUDES_PREFIX" ; then
2974             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
2975         else
2976             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
2977         fi
2979         # Check for 64-bit (cross-)compiler to use to build the 64-bit
2980         # version of the Explorer extension (and maybe other small
2981         # bits, too) needed when installing a 32-bit LibreOffice on a
2982         # 64-bit OS. The 64-bit Explorer extension is a feature that
2983         # has been present since long in OOo. Don't confuse it with
2984         # building LibreOffice itself as 64-bit code, which is
2985         # unfished work and highly experimental.
2987         BUILD_X64=
2988         CC_X64_BINARY=
2989         LINK_X64_BINARY=
2990         LIBMGR_X64_BINARY=
2992         AC_MSG_CHECKING([for a x64 compiler and libraries for 64bit ActiveX component])
2993         if test "$CL_X64" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
2994             # Prefer native x64 compiler to cross-compiler, in case we are running
2995             # the build on a 64-bit OS.
2996             if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2997                 BUILD_X64=TRUE
2998                 CC_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2999                 CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
3000                 LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
3001                 LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
3002             elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3003                 BUILD_X64=TRUE
3004                 CC_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
3005                 CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
3006                 LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
3007                 LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
3008             fi
3009         fi
3010         if test "$BUILD_X64" = TRUE; then
3011             AC_MSG_RESULT([found])
3012         else
3013             AC_MSG_RESULT([not found])
3014             AC_MSG_WARN([Installation set will not contain the 64-bit Explorer extension])
3015         fi
3016         AC_SUBST(BUILD_X64)
3018         # These are passed to the environment through set_soenv.in as usual, and then
3019         # used in set_wntx64.mk
3020         AC_SUBST(CC_X64_BINARY)
3021         AC_SUBST(CXX_X64_BINARY)
3022         AC_SUBST(LINK_X64_BINARY)
3023         AC_SUBST(LIBMGR_X64_BINARY)
3025     else
3026         AC_MSG_CHECKING([the compiler is MinGW])
3027         MACHINE_PREFIX=`$CC -dumpmachine`
3028         if echo $MACHINE_PREFIX | grep -q mingw32; then
3029             AC_MSG_RESULT([yes])
3030         else
3031             AC_MSG_ERROR([Compiler is not MinGW.])
3032         fi
3033     fi
3035 AC_SUBST(COMEX)
3036 AC_SUBST(MSPDB_PATH)
3037 AC_SUBST(SHOWINCLUDES_PREFIX)
3039 dnl ===================================================================
3040 dnl Check for pkg-config
3041 dnl ===================================================================
3042 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3043     PKG_PROG_PKG_CONFIG
3046 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3048     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
3049     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
3050     # explicitly. Or put /path/to/compiler in PATH yourself.
3052     AC_CHECK_TOOL(AR,ar)
3053     AC_CHECK_TOOL(NM,nm)
3054     AC_CHECK_TOOL(OBJDUMP,objdump)
3055     AC_CHECK_TOOL(RANLIB,ranlib)
3056     AC_CHECK_TOOL(STRIP,strip)
3057     if test "$_os" = "WINNT"; then
3058         AC_CHECK_TOOL(DLLTOOL,dlltool)
3059         AC_CHECK_TOOL(WINDRES,windres)
3060     fi
3062 AC_SUBST(AR)
3063 AC_SUBST(DLLTOOL)
3064 AC_SUBST(NM)
3065 AC_SUBST(OBJDUMP)
3066 AC_SUBST(PKG_CONFIG)
3067 AC_SUBST(RANLIB)
3068 AC_SUBST(STRIP)
3069 AC_SUBST(WINDRES)
3071 dnl ===================================================================
3072 dnl pkg-config checks on Mac OS X
3073 dnl ===================================================================
3075 if test $_os = Darwin; then
3076     AC_MSG_CHECKING([for bogus pkg-config])
3077     if test -n "$PKG_CONFIG"; then
3078         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | grep -q Mono.framework; then
3079             AC_MSG_RESULT([yes, from Mono])
3080         else
3081             AC_MSG_RESULT([yes, from unknown origin])
3082         fi
3083         AC_MSG_WARN([This might have unexpected consequences, please consider hiding $PKG_CONFIG])
3084         echo "Having a $PKG_CONFIG might have unexpected consequences, please consider hiding it" >>warn
3085     else
3086         AC_MSG_RESULT([no])
3087     fi
3090 dnl ===================================================================
3091 dnl  .NET needs special treatment
3092 dnl (does the above comment really mean .NET, or is it misusing
3093 dnl that to mean Visual Studio .NET 2003 ? And does this also
3094 dnl in fact apply equally to what we actually support, i.e.
3095 dnl Visual Studio 2008 and 2010?)
3096 dnl ===================================================================
3097 if test "$build_os" = "cygwin"; then
3098     dnl Check midl.exe
3099     AC_PATH_PROG(MIDL_PATH, midl.exe)
3100     if test -n "$MIDL_PATH";then
3101         MIDL_PATH=`dirname "$MIDL_PATH"`
3102     fi
3103     if test -n "$with_midl_path";then
3104         with_midl_path=`cygpath -u "$with_midl_path"`
3105     fi
3106     if test -x "$with_midl_path/midl.exe"; then
3107         MIDL_PATH="$with_midl_path"
3108     fi
3109     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
3110         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
3111     fi
3112     if test -z "$MIDL_PATH" ; then
3113         vstest=`./oowintool --msvs-productdir`;
3114         if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
3115             MIDL_PATH="$vstest/Common7/Tools/Bin"
3116         fi
3117     fi
3118     if test -z "$MIDL_PATH" ; then
3119         winsdktest=`./oowintool --windows-sdk-home`
3120         if test -x "$winsdktest/Bin/midl.exe" ; then
3121             MIDL_PATH="$winsdktest/Bin"
3122         fi
3123     fi
3124     if test ! -x "$MIDL_PATH/midl.exe"; then
3125         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
3126     fi
3127     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3128     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
3129     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
3131     dnl Check csc.exe
3132     AC_PATH_PROG(CSC_PATH, csc.exe)
3133     if test -n "$CSC_PATH";then
3134         CSC_PATH=`dirname "$CSC_PATH"`
3135     fi
3136     if test -n "$with_csc_path";then
3137         with_csc_path=`cygpath -u "$with_csc_path"`
3138     fi
3139     if test -x "$with_csc_path/csc.exe"; then
3140         CSC_PATH="$with_csc_path"
3141     else
3142        csctest=`./oowintool --csc-compilerdir`;
3143        if test -x "$csctest/csc.exe"; then
3144            CSC_PATH="$csctest"
3145        fi
3146     fi
3147     if test ! -x "$CSC_PATH/csc.exe"; then
3148         AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
3149     fi
3150     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3151     CSC_PATH=`cygpath -d "$CSC_PATH"`
3152     CSC_PATH=`cygpath -u "$CSC_PATH"`
3154     dnl Check mscoree.lib / .NET Framework dir
3155     AC_MSG_CHECKING(.NET Framework)
3156     if test -n "$with_dotnet_framework_home"; then
3157         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
3158     fi
3159     if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
3160         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
3161     fi
3162     if test -z "$DOTNET_FRAMEWORK_HOME" ; then
3163         frametest=`./oowintool --dotnetsdk-dir`
3164         if test -f "$frametest/lib/mscoree.lib"; then
3165             DOTNET_FRAMEWORK_HOME="$frametest"
3166         else
3167             frametest=`./oowintool --windows-sdk-home`
3168             if test -f "$frametest/lib/mscoree.lib"; then
3169                 DOTNET_FRAMEWORK_HOME="$frametest"
3170             fi
3171         fi
3172     fi
3173     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
3174         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
3175     fi
3176     AC_MSG_RESULT(found)
3177     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3178     DOTNET_FRAMEWORK_HOME=`cygpath -d "$DOTNET_FRAMEWORK_HOME"`
3179     DOTNET_FRAMEWORK_HOME=`cygpath -u "$DOTNET_FRAMEWORK_HOME"`
3180     AC_SUBST(MIDL_PATH)
3181     AC_SUBST(CSC_PATH)
3182     AC_SUBST(DOTNET_FRAMEWORK_HOME)
3185 dnl ===================================================================
3186 dnl Check if stdc headers are available excluding MSVC.
3187 dnl ===================================================================
3188 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3189     AC_HEADER_STDC
3192 dnl ===================================================================
3193 dnl Testing for C++ compiler and version...
3194 dnl ===================================================================
3196 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3197     AC_PROG_CXX
3198 else
3199     if test -n "$CC" -a -z "$CXX"; then
3200         CXX="$CC"
3201     fi
3204 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
3205 if test "$GXX" = "yes"; then
3206     AC_MSG_CHECKING([the GNU C++ compiler version])
3208     _gpp_version=`$CXX -dumpversion`
3209     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
3211     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401" ; then
3212         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0" ; then
3213             export CXX="$GCC_HOME/bin/g++-4.0"
3214             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
3215             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401" ; then
3216                 _gpp_majmin=$_gpp_majmin_2
3217             fi
3218         fi
3219         if test "$_gpp_majmin" -ge "401" ; then
3220             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])
3221         else
3222             AC_MSG_RESULT([implicitly using CXX=$CXX])
3223         fi
3224     else
3225         AC_MSG_RESULT([checked (g++ $_gpp_version)])
3226     fi
3228     if test "$_gpp_majmin" = "304"; then
3229         AC_MSG_CHECKING([whether $CXX has the enum bug])
3230         AC_RUN_IFELSE([AC_LANG_SOURCE([[
3231             extern "C" void abort (void);
3232             extern "C" void exit (int status);
3234             enum E { E0, E1, E2, E3, E4, E5 };
3236             void test (enum E e)
3237             {
3238                 if (e == E2 || e == E3 || e == E1)
3239                     exit (1);
3240             }
3242             int main (void)
3243             {
3244                 test (E4);
3245                 test (E5);
3246                 test (E0);
3247                 return 0;
3248             }
3249             ]])],[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])],[])
3250     fi
3254 # prefx CXX with ccache if needed
3256 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3257     if test "$CCACHE" != "" ; then
3258         AC_MSG_CHECKING([whether $CXX is already ccached])
3259         AC_LANG_PUSH([C++])
3260         save_CXXFLAGS=$CXXFLAGS
3261         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
3262         dnl an empty program will do, we're checking the compiler flags
3263         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3264                           [use_ccache=yes], [use_ccache=no])
3265         if test $use_ccache = yes ; then
3266             AC_MSG_RESULT([yes])
3267         else
3268             CXX="$CCACHE $CXX"
3269             AC_MSG_RESULT([no])
3270         fi
3271         CXXFLAGS=$save_CXXFLAGS
3272         AC_LANG_POP([C++])
3273     fi
3276 dnl ===================================================================
3277 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
3278 dnl ===================================================================
3280 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3281     AC_PROG_CXXCPP
3283     dnl Check whether there's a C pre-processor.
3284     dnl ===================================================================
3285     dnl When using SunStudio compiler, there is a bug with the cc
3286     dnl preprocessor, so use CC preprocessor as the cc preprocessor
3287     dnl See Issuezilla #445.
3288     dnl ===================================================================
3289     if test "$_os" = "SunOS"; then
3290         CPP=$CXXCPP
3291     else
3292         AC_PROG_CPP
3293     fi
3297 dnl ===================================================================
3298 dnl Find integral type sizes and alignments
3299 dnl ===================================================================
3301 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3303     AC_CHECK_SIZEOF(long)
3304     AC_CHECK_SIZEOF(short)
3305     AC_CHECK_SIZEOF(int)
3306     AC_CHECK_SIZEOF(long long)
3307     AC_CHECK_SIZEOF(double)
3308     AC_CHECK_SIZEOF(void*)
3310     SIZEOF_SHORT=$ac_cv_sizeof_short
3311     SIZEOF_INT=$ac_cv_sizeof_int
3312     SIZEOF_LONG=$ac_cv_sizeof_long
3313     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
3314     SIZEOF_DOUBLE=$ac_cv_sizeof_double
3315     SIZEOF_POINTER=$ac_cv_sizeof_voidp
3317     dnl Allow build without AC_CHECK_ALIGNOF, grrr
3318     m4_pattern_allow([AC_CHECK_ALIGNOF])
3319     m4_ifdef([AC_CHECK_ALIGNOF],
3320       ,
3321       [
3322          dnl We know that the ALIGNOF_ variables are used only when cross-compiling
3323          dnl in sal/typesconfig/makefile.mk...
3324          if test "$cross_compiling" = "yes"; then
3325             AC_MSG_ERROR([When cross-compiling you must use a recent Autoconf with [AC_][CHECK_ALIGNOF]])
3326          fi
3327          m4_define([AC_CHECK_ALIGNOF],
3328             [
3329                AC_MSG_WARN([Cannot determine alignment of $1])
3330                AS_TR_SH([ac_cv_alignof_$3])=unknown
3331             ])
3332       ])
3334     AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
3335     AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
3336     AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
3337     AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
3339     ALIGNOF_SHORT=$ac_cv_alignof_short
3340     ALIGNOF_INT=$ac_cv_alignof_int
3341     ALIGNOF_LONG=$ac_cv_alignof_long
3342     ALIGNOF_DOUBLE=$ac_cv_alignof_double
3344     AC_C_BIGENDIAN
3345     WORDS_BIGENDIAN=$ac_cv_c_bigendian
3347     dnl Check for large file support
3348     AC_SYS_LARGEFILE
3349     if test -n "$ac_cv_sys_file_offset_bits"; then
3350         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
3351     fi
3352     if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
3353         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
3354     fi
3355 else
3356     # Hardcode for MSVC
3357     SIZEOF_SHORT=2
3358     SIZEOF_INT=4
3359     SIZEOF_LONG=4
3360     SIZEOF_LONGLONG=8
3361     if test "$CL_X64" = ""; then
3362         SIZEOF_POINTER=4
3363     else
3364         SIZEOF_POINTER=8
3365     fi
3366     ALIGNOF_SHORT=2
3367     ALIGNOF_INT=4
3368     ALIGNOF_LONG=4
3369     ALIGNOF_DOUBLE=8
3370     WORDS_BIGENDIAN=no
3371     LFS_CFLAGS=''
3373 AC_SUBST(WORDS_BIGENDIAN)
3374 AC_SUBST(LFS_CFLAGS)
3376 AC_SUBST(SIZEOF_SHORT)
3377 AC_SUBST(SIZEOF_INT)
3378 AC_SUBST(SIZEOF_LONG)
3379 AC_SUBST(SIZEOF_LONGLONG)
3380 AC_SUBST(SIZEOF_DOUBLE)
3381 AC_SUBST(SIZEOF_POINTER)
3382 AC_SUBST(ALIGNOF_SHORT)
3383 AC_SUBST(ALIGNOF_INT)
3384 AC_SUBST(ALIGNOF_LONG)
3385 AC_SUBST(ALIGNOF_DOUBLE)
3387 dnl ===================================================================
3388 dnl Check if valgrind.h is available
3389 dnl ===================================================================
3390 if test "$cross_compiling" != "yes" -a "$enable_dbgutil" != "no" -a \
3391         -z "$VALGRIND_CFLAGS"; then
3392     dnl Test $prefix (currently only testing for /usr and /usr/local)
3393     dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
3394     prev_cppflags=$CPPFLAGS
3395     CPPFLAGS="-I/usr/include/valgrind"
3396     AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
3397     if test -z "$VALGRIND_CFLAGS"; then
3398         CPPFLAGS="-I/usr/local/include/valgrind"
3399         AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
3400     fi
3401     if test -n "$VALGRIND_CFLAGS"; then
3402         CPPFLAGS=$VALGRIND_CFLAGS
3403         AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
3404     fi
3405     CPPFLAGS=$prev_cppflags
3407 AC_SUBST([VALGRIND_CFLAGS])
3409 dnl ===================================================================
3410 dnl Set the gcc/gxx include directories
3411 dnl ===================================================================
3412 # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
3413 # often contains an i386 which is expanded as a macro.
3414 if test "$GXX" = "yes"; then
3415     AC_MSG_CHECKING([for g++ include path])
3416     if test -z "$with_gxx_include_path"; then
3417         with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
3418         if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
3419             with_gxx_include_path="/usr/include"
3420         fi
3421         if echo $with_gxx_include_path | grep -q linux; then
3422             # workaround for Mandriva - issue 100049
3423             with_gxx_include_path=`cd $with_gxx_include_path && pwd`
3424         fi
3425     fi
3426     dnl This is the original code...
3427     dnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
3428     if test -z "$with_gxx_include_path"; then
3429         with_gxx_include_path="NO_GXX_INCLUDE"
3430         AC_MSG_RESULT([none])
3431     else
3432         AC_MSG_RESULT([$with_gxx_include_path])
3433     fi
3434 else
3435     with_gxx_include_path="NO_GXX_INCLUDE"
3437 GXX_INCLUDE_PATH="$with_gxx_include_path"
3438 AC_SUBST(GXX_INCLUDE_PATH)
3440 dnl ===================================================================
3441 dnl Set the MinGW include directories
3442 dnl ===================================================================
3443 if test "$WITH_MINGW" = "yes"; then
3444     AC_MSG_CHECKING([for MinGW include path])
3445     cat >conftest.$ac_ext <<_ACEOF
3446 #include <stddef.h>
3447 #include <bits/c++config.h>
3448 _ACEOF
3449     _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`
3450     rm conftest.$ac_ext
3451     if test -z "$_mingw_lib_include_path"; then
3452         _mingw_lib_include_path="NO_LIB_INCLUDE"
3453         AC_MSG_RESULT([no MinGW include path])
3454     else
3455         AC_MSG_RESULT([$_mingw_lib_include_path])
3456     fi
3457     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
3458     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
3460     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
3461     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
3463     AC_LANG_PUSH([C++])
3465     AC_MSG_CHECKING([for dynamic libgcc])
3466     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3467 #include <iostream>
3468 using namespace std;
3469 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[   
3470             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
3471             if test -n "$MINGW_GCCDLL"; then
3472                 MINGW_SHARED_GCCLIB=YES
3473                 AC_MSG_RESULT([ $MINGW_GCCDLL])
3474             else
3475                 MINGW_SHARED_GCCLIB=NO
3476                 AC_MSG_RESULT([no])
3477             fi
3478        ],[ AC_MSG_RESULT([no])
3479        
3480     ])
3482     AC_MSG_CHECKING([for dynamic libstdc++])
3483     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3484 #include <iostream>
3485 using namespace std;
3486 ]], [[ cout << "Hello there." << endl; ]])],[   
3487             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
3488             if test -n "$MINGW_GXXDLL"; then
3489                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
3490                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
3491                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
3492                 MINGW_SHARED_GXXLIB=YES
3493                 AC_MSG_RESULT([$MINGW_GXXDLL])
3494             else
3495                 MINGW_SHARED_GXXLIB=NO
3496                 AC_MSG_RESULT([no])
3497             fi
3498        ],[ AC_MSG_RESULT([no])
3499        
3500     ])
3502     AC_LANG_POP([C++])
3504     AC_SUBST(MINGW_CLIB_DIR)
3505     AC_SUBST(MINGW_SHARED_GCCLIB)
3506     AC_SUBST(MINGW_SHARED_GXXLIB)
3507     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
3508     AC_SUBST(MINGW_GCCDLL)
3509     AC_SUBST(MINGW_GXXDLL)
3512 dnl ===================================================================
3513 dnl Extra checking for the SunOS compiler
3514 dnl ===================================================================
3515 if test "$_os" = "SunOS"; then
3516     dnl SunStudio C++ compiler packaged with SunStudio C compiler
3517     if test "$CC" = "cc"; then
3518     AC_MSG_CHECKING([SunStudio C++ Compiler])
3519         if test "$CXX" != "CC"; then
3520             AC_MSG_WARN([SunStudio C++ was not found])
3521             echo "SunStudio C++ was not found" >> warn
3522         else
3523             AC_MSG_RESULT([checked])
3524         fi
3525     fi
3528 dnl *************************************************************
3529 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
3530 dnl *************************************************************
3531 if test "$WITH_MINGW" = "yes"; then
3532     AC_MSG_CHECKING([exception type])
3533     AC_LANG_PUSH([C++])
3534     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
3536         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
3538         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
3539     ])
3540     AC_MSG_RESULT($exceptions_type)
3541     AC_LANG_POP([C++])
3544 EXCEPTIONS="$exceptions_type"
3545 AC_SUBST(EXCEPTIONS)
3547 dnl ===================================================================
3548 dnl Checks for what the default STL should be
3549 dnl ===================================================================
3550 AC_MSG_CHECKING([Whether building STLPort library makes sense])
3551 BUILD_STLPORT="no"
3552 if test "$_os" = "Linux"; then
3553     case "$host_cpu" in
3554     i?86)
3555         case "$host_os" in
3556         k*bsd*-gnu*)
3557             BUILD_STLPORT="no"
3558             ;;
3559         *)
3560             BUILD_STLPORT="yes"
3561             ;;
3562         esac
3563         ;;
3564     *)
3565         BUILD_STLPORT="no"
3566         ;;
3567     esac
3568 elif test "$_os" = "SunOS"; then
3569     BUILD_STLPORT="yes"
3570 elif test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
3571     BUILD_STLPORT="yes"
3572 elif test "$_os" = "FreeBSD"; then
3573     BUILD_STLPORT="yes"
3575 if test "$BUILD_STLPORT" = "yes" ; then
3576     AC_MSG_RESULT([yes])
3577 else
3578     AC_MSG_RESULT([no])
3581 AC_MSG_CHECKING([Whether STLPort library will be actually built])
3582 if test "$with_stlport" = "auto" -o "$BUILD_STLPORT" = "no"; then
3583     with_stlport=$BUILD_STLPORT
3585 if test "$with_stlport" = "yes" ; then
3586     AC_MSG_RESULT([yes])
3587     WITH_STLPORT=YES
3588     SCPDEFS="$SCPDEFS -DWITH_STLPORT"
3589     BUILD_TYPE="$BUILD_TYPE STLPORT"
3590 else
3591     WITH_STLPORT=NO
3592     AC_MSG_RESULT([no])
3595 AC_SUBST(WITH_STLPORT)
3597 dnl ===================================================================
3598 dnl thread-safe statics
3599 dnl ===================================================================
3600 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
3601 unset HAVE_THREADSAFE_STATICS
3602 if test "$GCC" = "yes"; then
3603     save_CXXFLAGS=$CXXFLAGS
3604     CXXFLAGS="$CXXFLAGS -fthreadsafe-statics"
3605     AC_LANG_PUSH([C++])
3606     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],[HAVE_THREADSAFE_STATICS=TRUE],[])
3607     AC_LANG_POP([C++])
3608     CXXFLAGS=$save_CXXFLAGS
3609     if test "$HAVE_THREADSAFE_STATICS" = "TRUE"; then
3610         dnl Some C++ runtimes use a single lock for all static variables, which
3611         dnl can cause deadlock in multi-threaded applications.  This is not
3612         dnl easily tested here; for POSIX-based systems, if executing the
3613         dnl following C++ program does not terminate then the tool chain
3614         dnl apparently has this problem:
3615         dnl
3616         dnl   #include <pthread.h>
3617         dnl   int h() { return 0; }
3618         dnl   void * g(void * unused) {
3619         dnl     static int n = h();
3620         dnl     return &n;
3621         dnl   }
3622         dnl   int f() {
3623         dnl     pthread_t t;
3624         dnl     pthread_create(&t, 0, g, 0);
3625         dnl     pthread_join(t, 0);
3626         dnl     return 0;
3627         dnl   }
3628         dnl   int main() {
3629         dnl     static int n = f();
3630         dnl     return n;
3631         dnl   }
3632         dnl
3633         dnl Mac OS X up to at least 10.7.1 is known to have this problem:
3634         if test "$_os" = "Darwin"; then
3635             unset HAVE_THREADSAFE_STATICS
3636             AC_MSG_RESULT([broken (i.e., no)])
3637         else
3638             AC_MSG_RESULT([yes])
3639         fi
3640     else
3641         AC_MSG_RESULT([no])
3642     fi
3643 else
3644     AC_MSG_RESULT([unknown (assuming no)])
3646 AC_SUBST(HAVE_THREADSAFE_STATICS)
3648 dnl ===================================================================
3649 dnl visibility and c++0x features
3650 dnl ===================================================================
3651 if test "$GCC" = "yes"; then
3652     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
3653     save_CFLAGS=$CFLAGS
3654     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
3655     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
3656     CFLAGS=$save_CFLAGS
3657     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3658         AC_MSG_RESULT([yes])
3659     else
3660         AC_MSG_RESULT([no])
3661     fi
3663     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
3664     save_CFLAGS=$CFLAGS
3665     CFLAGS="$CFLAGS -Werror -Wno-long-double"
3666     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
3667     CFLAGS=$save_CFLAGS
3668     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
3669         AC_MSG_RESULT([yes])
3670     else
3671         AC_MSG_RESULT([no])
3672     fi
3674     AC_MSG_CHECKING([whether $CC supports -mno-avx])
3675     save_CFLAGS=$CFLAGS
3676     CFLAGS="$CFLAGS -Werror -mno-avx"
3677     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
3678     CFLAGS=$save_CFLAGS
3679     if test "$HAVE_GCC_AVX" = "TRUE"; then
3680         AC_MSG_RESULT([yes])
3681     else
3682         AC_MSG_RESULT([no])
3683     fi
3685     AC_MSG_CHECKING([whether $CC supports -std=c++0x without Language Defect 757])
3686     save_CXXFLAGS=$CXXFLAGS
3687     CXXFLAGS="$CXXFLAGS -std=c++0x"
3688     AC_LANG_PUSH([C++])
3690     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3691 #include <stddef.h>
3693 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
3695 namespace
3697         struct b
3698         {
3699                 int i;
3700                 int j;
3701         };
3703 ]], [[
3704 struct a
3706         int i;
3707         int j;
3709 a thinga[]={{0,0}, {1,1}};
3710 b thingb[]={{0,0}, {1,1}};
3711 size_t i = sizeof(sal_n_array_size(thinga));
3712 size_t j = sizeof(sal_n_array_size(thingb));
3713 return !(i != 0 && j != 0);
3714 ]])],[HAVE_CXX0X=TRUE],[])
3716     AC_LANG_POP([C++])
3717     CXXFLAGS=$save_CXXFLAGS
3718     if test "$HAVE_CXX0X" = "TRUE"; then
3719         AC_MSG_RESULT([yes])
3720     else
3721         AC_MSG_RESULT([no])
3722     fi
3725 AC_SUBST(HAVE_CXX0X)
3726 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
3727 AC_SUBST(HAVE_GCC_AVX)
3729 dnl ===================================================================
3730 dnl system stl sanity tests
3731 dnl ===================================================================
3732 HAVE_GCC_VISIBILITY_BROKEN=
3733 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) ; then
3735     AC_LANG_PUSH([C++])
3737     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3738         AC_MSG_CHECKING([if STL headers are visibility safe])
3739         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
3740         AC_MSG_RESULT([$stlvisok])
3741         if test "$stlvisok" = "no"; then
3742             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
3743             echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
3744             unset HAVE_GCC_VISIBILITY_FEATURE
3745         fi
3746     fi
3748     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3749         sharedlink_ldflags_save=$LDFLAGS
3750         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
3752         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
3753         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3754 #include <sstream>
3755 using namespace std;
3756             ]], [[
3757 istringstream strm( "test" ); return 0;
3758             ]])],[$EGREP -q  unresolvable conftest.err;
3759             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
3760         ])
3761         AC_MSG_RESULT([$gccvisok])
3762         if test "$gccvisok" = "no"; then
3763             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
3764             echo "Your gcc is not -fvisibility-inlines-hidden safe, disabling that." >> warn
3765             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
3766         fi
3768         LDFLAGS=$sharedlink_ldflags_save
3769     fi
3771     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3772         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
3773         cat >visibility.cxx <<_ACEOF
3774 #pragma GCC visibility push(hidden)
3775 struct __attribute__ ((visibility ("default"))) TestStruct {
3776   static void Init();
3778 __attribute__ ((visibility ("default"))) void TestFunc() {
3779   TestStruct::Init();
3781 _ACEOF
3782         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
3783             gccvisbroken=yes
3784         else
3785             case "$host_cpu" in
3786             i?86|x86_64)
3787                 if test "$_os" = "Darwin"; then
3788                     gccvisbroken=no
3789                 else
3790                     if $EGREP -q '@PLT' visibility.s; then
3791                         gccvisbroken=no
3792                     else
3793                         gccvisbroken=yes
3794                     fi
3795                 fi
3796                 ;;
3797             *)
3798                 gccvisbroken=no
3799                 ;;
3800             esac
3801         fi
3802         rm -f visibility.s visibility.cxx
3804         AC_MSG_RESULT([$gccvisbroken])
3805         if test "$gccvisbroken" = "yes"; then
3806             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
3807             echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
3808             unset HAVE_GCC_VISIBILITY_FEATURE
3809         fi
3810     fi
3812     AC_LANG_POP([C++])
3815 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
3816 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
3818 dnl ===================================================================
3819 dnl allocator
3820 dnl ===================================================================
3821 AC_MSG_CHECKING([which memory allocator to use])
3822 if test "$with_alloc" = "system"; then
3823     AC_MSG_RESULT([system])
3824     ALLOC="SYS_ALLOC";
3825     AC_CHECK_FUNCS([malloc realloc calloc free])
3827 if test "$with_alloc" = "tcmalloc"; then
3828     AC_MSG_RESULT(tcmalloc)
3829     if ! echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
3830         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
3831     fi
3832     AC_CHECK_LIB(tcmalloc, malloc, [],
3833         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
3834     ALLOC="TCMALLOC";
3836 if test "$with_alloc" = "jemalloc"; then
3837     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
3838         AC_MSG_RESULT(jemalloc)
3839         save_CFLAGS=$CFLAGS
3840         CFLAGS="$CFLAGS -pthread"
3841         AC_CHECK_LIB(jemalloc, malloc, [],
3842             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
3843         ALLOC="JEMALLOC";
3844         CFLAGS=$save_CFLAGS
3845     else
3846         AC_MSG_RESULT([system])
3847         ALLOC="SYS_ALLOC";
3848         AC_CHECK_FUNCS([malloc realloc calloc free])
3849     fi
3851 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
3852     AC_MSG_RESULT([internal])
3854 AC_SUBST(ALLOC)
3856 dnl ===================================================================
3857 dnl Custom build version
3858 dnl ===================================================================
3860 AC_MSG_CHECKING([whether to add custom build version])
3861 if test "z$with_build_version" != "z"; then
3862     BUILD_VER_STRING=$with_build_version
3863     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
3864 else
3865     BUILD_VER_STRING=
3866     AC_MSG_RESULT([no])
3868 AC_SUBST(BUILD_VER_STRING)
3870 dnl ===================================================================
3871 dnl Java support enable
3872 dnl ===================================================================
3873 AC_MSG_CHECKING([whether to build with Java support])
3874 if test "$with_java" != "no"; then
3875     AC_MSG_RESULT([yes])
3876     SOLAR_JAVA="TRUE"
3877 else
3878     AC_MSG_RESULT([no])
3879     SOLAR_JAVA=""
3882 AC_SUBST(SOLAR_JAVA)
3884 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
3885 dnl want there to be *run-time* (and build-time) support for Java extensions in the
3886 dnl built LibreOffice.
3888 dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
3889 dnl (no runtime support). It doesn't seem to ever be set to this
3890 dnl value, though, and everywhere SOLAR_JAVA is only checked for being
3891 dnl empty or non-empty.
3893 dnl SOLAR_JAVA="" indicate no java support at all
3895 if test "$_os" = "Linux" && test "$host_cpu" = "powerpc"; then
3896     # IBMs JDK needs this...
3897     JITC_PROCESSOR_TYPE=6
3898     export JITC_PROCESSOR_TYPE
3900 AC_SUBST([JITC_PROCESSOR_TYPE])
3902 if test $_os = "WINNT"; then
3903     WITH_VC_REDIST="TRUE"
3905 AC_SUBST(WITH_VC_REDIST)
3907 dnl ===================================================================
3908 dnl Checks for Java
3909 dnl ===================================================================
3910 if test "$SOLAR_JAVA" != ""; then
3912     # Windows-specific tests
3913     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3914         if test "$CL_X64" != ""; then
3915             bitness="64-bit"
3916             otherbitness="32-bit"
3917         else
3918             bitness="32-bit"
3919             otherbitness="64-bit"
3920         fi
3922         if test -z "$with_jdk_home"; then
3924             # Unfortunately apparently no way to find, if needed, the 64-bit
3925             # JDK in the Registry from the 32-bit Perl oowintool
3927             _jdk_home=`./oowintool --jdk-home`
3928             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
3929                 with_jdk_home="$_jdk_home"
3930                 howfound="found by oowintool"
3931             else
3932                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
3933             fi
3934         else
3935             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
3936             howfound="you passed"
3937         fi
3938     fi
3940     JAVA_HOME=; export JAVA_HOME
3941     if test -z "$with_jdk_home"; then
3942         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
3943     else
3944         _java_path="$with_jdk_home/bin/$with_java"
3945         dnl Check if there is a Java interpreter at all.
3946         if test -x "$_java_path"; then
3947             JAVAINTERPRETER=$_java_path
3948         else
3949             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
3950         fi
3951     fi
3953     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3954         # Check that the JDK found is correct architecture
3955         # Why is this necessary, we don't link with any library from the JDK I think,
3957         shortjdkhome=`cygpath -d "$with_jdk_home"`
3958         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
3959             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
3960             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
3961         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
3962             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
3963             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
3964         fi
3966         if test x`echo "$JAVAINTERPRETER" | grep -i '\.exe$'` = x; then
3967             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
3968         fi
3969         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
3970         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
3971     elif test "$_os" = "Darwin"; then
3972         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
3973         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
3974         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
3975         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
3976         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
3977             AC_MSG_RESULT([yes])
3978             JAVAIFLAGS=-d32
3979         else
3980             AC_MSG_RESULT([no])
3981         fi
3982     fi
3985 dnl ===================================================================
3986 dnl Checks for JDK.
3987 dnl ===================================================================
3989 # Note that JAVA_HOME as for now always means the *build* platform's
3990 # JAVA_HOME. Whether all the complexity here actually is needed any
3991 # more or not, no idea.
3993 if test "$SOLAR_JAVA" != ""; then
3994     _gij_longver=0
3995     AC_MSG_CHECKING([the installed JDK])
3996     if test -n "$JAVAINTERPRETER"; then
3997         dnl java -version sends output to stderr!
3998         if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
3999             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
4000         elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then
4001             JDK=gcj
4002             AC_MSG_RESULT([checked (gcj)])
4003             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
4004             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4006         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "BEA"` -gt 0; then
4007             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
4008         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "IBM"` -gt 0; then
4009             JDK=ibm
4011             dnl IBM JDK specific tests
4012             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
4013             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
4015             if test "$_jdk_ver" -lt 10500; then
4016                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
4017             fi
4019             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
4021             if test "$with_jdk_home" = ""; then
4022                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
4023 you must use the "--with-jdk-home" configure option explicitly])
4024             fi
4026            JAVA_HOME=$with_jdk_home
4028         else
4029             JDK=sun
4031             dnl Sun JDK specific tests
4032             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
4033             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
4035             if test "$_jdk_ver" -lt 10500; then
4036                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
4037             fi
4038             AC_MSG_RESULT([checked (JDK $_jdk)])
4039             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
4040             if test "$_os" = "WINNT"; then
4041                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
4042             fi
4043         fi
4044     else
4045         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
4046     fi
4047 else
4048     dnl Java disabled
4049     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
4052 _java_target_ver="1.5"
4053 dnl ===================================================================
4054 dnl Check for target Java bytecode version
4055 dnl ===================================================================
4056 if test "$SOLAR_JAVA" != ""; then
4057     AC_MSG_CHECKING([for target Java bytecode version])
4058     if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
4059     AC_MSG_RESULT([default by $JDK])
4060     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
4061         AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
4062     fi
4063     else
4064     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
4065         _java_target_ver="$with_java_target_version"
4066         AC_MSG_RESULT([$_java_target_ver])
4067     elif test $_jdk_ver -gt 10000 ; then
4068         _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
4069         AC_MSG_RESULT([$_java_target_ver])
4070     else
4071         AC_MSG_ERROR([Unable to guess Java bytecode version from Java version!])
4072     fi
4073     fi
4075     if ! test -z "$_java_target_ver" -o \
4076         "$_java_target_ver" = "1.1" -o \
4077             "$_java_target_ver" = "1.2" -o \
4078         "$_java_target_ver" = "1.3" -o \
4079         "$_java_target_ver" = "1.4" -o \
4080         "$_java_target_ver" = "1.5" -o \
4081         "$_java_target_ver" = "1.6" -o \
4082         "$_java_target_ver" = "5" ; then
4083         AC_MSG_ERROR([$_java_target_ver is not a supported Java bytecode version!])
4084     fi
4086     JAVA_SOURCE_VER="$_java_target_ver"
4087     JAVA_TARGET_VER="$_java_target_ver"
4090 dnl ===================================================================
4091 dnl Checks for javac
4092 dnl ===================================================================
4093 if test "$SOLAR_JAVA" != ""; then
4094     if test "$JDK" = "gcj"; then
4095         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
4096     else
4097         javacompiler="javac"
4098     fi
4099     if test -z "$with_jdk_home"; then
4100         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
4101     else
4102         _javac_path="$with_jdk_home/bin/$javacompiler"
4103         dnl Check if there is a Java compiler at all.
4104         if test -x "$_javac_path"; then
4105             JAVACOMPILER=$_javac_path
4106         fi
4107     fi
4108     if test -z "$JAVACOMPILER"; then
4109         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
4110     fi
4111     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4112         if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then
4113             JAVACOMPILER="${JAVACOMPILER}.exe"
4114         fi
4115         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
4116         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
4117     fi
4119     if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then
4120         AC_MSG_CHECKING([re-checking JDK])
4121         JDK=gcj
4122         AC_MSG_RESULT([checked (ecj)])
4123         #TODO: what's to do here? some switch to do 1.5 compiling?
4124         JAVAFLAGS="-source 1.5 -target 1.5"
4125         _gij_longver="40200"
4126     fi
4129 JAVACISGCJ=""
4130 dnl ===================================================================
4131 dnl Checks that javac is gcj
4132 dnl ===================================================================
4133 if test "$SOLAR_JAVA" != ""; then
4134     if test `$JAVACOMPILER --version 2>&1 | grep -c "GCC"` -gt 0; then
4135         JAVACISGCJ="yes"
4136     fi
4138 AC_SUBST(JAVACISGCJ)
4140 JAVACISKAFFE=""
4141 dnl ===================================================================
4142 dnl Checks that javac is kaffe
4143 dnl ===================================================================
4144 if test "$SOLAR_JAVA" != ""; then
4145     if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
4146         JAVACISKAFFE="yes"
4147     fi
4149 AC_SUBST(JAVACISKAFFE)
4151 dnl ===================================================================
4152 dnl Checks for javadoc
4153 dnl ===================================================================
4154 if test "$SOLAR_JAVA" != ""; then
4155     if test -z "$with_jdk_home"; then
4156         AC_PATH_PROG(JAVADOC, javadoc)
4157     else
4158         _javadoc_path="$with_jdk_home/bin/javadoc"
4159         dnl Check if there is a javadoc at all.
4160         if test -x "$_javadoc_path"; then
4161             JAVADOC=$_javadoc_path
4162         else
4163             AC_PATH_PROG(JAVADOC, javadoc)
4164         fi
4165     fi
4166     if test -z "$JAVADOC"; then
4167         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
4168     fi
4169     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4170         if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then
4171             JAVADOC="${JAVADOC}.exe"
4172         fi
4173         JAVADOC=`cygpath -d "$JAVADOC"`
4174         JAVADOC=`cygpath -u "$JAVADOC"`
4175     fi
4178 if test "$SOLAR_JAVA" != ""; then
4179     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
4180     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
4181         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
4182            # try to recover first by looking whether we have a alternatives
4183            # system as in Debian or newer SuSEs where following /usr/bin/javac
4184            # over /etc/alternatives/javac leads to the right bindir where we
4185            # just need to strip a bit away to get a valid JAVA_HOME
4186            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
4187         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
4188             # maybe only one level of symlink (e.g. on Mac)
4189             JAVA_HOME=$(readlink $JAVACOMPILER)
4190             if test "$(dirname $JAVA_HOME)" = "."; then
4191                 # we've got no path to trim back
4192                 JAVA_HOME=""
4193             fi
4194         else
4195             # else warn
4196             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
4197             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
4198             echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
4199             echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
4200         fi
4201         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
4202         if test "$JAVA_HOME" != "/usr"; then
4203             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
4204                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
4205                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
4206                 dnl Tiger already returns a JDK path..
4207                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
4208             else
4209                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
4210             fi
4211         fi
4212     fi
4213     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
4215     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
4216     if test -z "$JAVA_HOME"; then
4217         if test "x$with_jdk_home" = "x"; then
4218             cat > findhome.java <<_ACEOF
4219 [import java.io.File;
4221 class findhome
4223     public static void main(String args[])
4224     {
4225         String jrelocation = System.getProperty("java.home");
4226         File jre = new File(jrelocation);
4227         System.out.println(jre.getParent());
4228     }
4230 _ACEOF
4231             AC_MSG_CHECKING([if javac works])
4232             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
4233             AC_TRY_EVAL(javac_cmd)
4234             if test $? = 0 && test -f ./findhome.class ; then
4235                 AC_MSG_RESULT([javac works])
4236             else
4237                 echo "configure: javac test failed" >&5
4238                 cat findhome.java >&5
4239                 AC_MSG_ERROR([javac does not work - java projects will not build!])
4240             fi
4241             AC_MSG_CHECKING([if gij knows its java.home])
4242             JAVA_HOME=`$JAVAINTERPRETER findhome`
4243             if test $? = 0 && test "$JAVA_HOME" != "" ; then
4244                 AC_MSG_RESULT([$JAVA_HOME])
4245             else
4246                 echo "configure: java test failed" >&5
4247                 cat findhome.java >&5
4248                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
4249             fi
4250             # clean-up after ourselves
4251             rm -f ./findhome.java ./findhome.class
4252         else
4253             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
4254         fi
4255     fi
4257     dnl second sanity check JAVA_HOME if possible
4258     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
4259         # now check if $JAVA_HOME is really valid
4260         if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
4261             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
4262                 JAVA_HOME_OK="NO"
4263             fi
4264         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
4265             JAVA_HOME_OK="NO"
4266         fi
4267         if test "$JAVA_HOME_OK" = "NO"; then
4268             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
4269             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
4270             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
4271             echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
4272             echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
4273             echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
4274         fi
4275     fi
4278 AWTLIB=
4280 if test "$SOLAR_JAVA" != ""; then
4281     AC_MSG_CHECKING([for jawt lib name])
4282     if test "$JDK" = "gcj"; then
4283         save_CFLAGS=$CFLAGS
4284         save_LDFLAGS=$LDFLAGS
4285         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4286         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
4287         exec 6>/dev/null # no output
4288         AC_CHECK_HEADER(jni.h, [],
4289                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
4290         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
4291         exec 6>&1 # output on again
4292         CFLAGS=$save_CFLAGS
4293         LDFLAGS=$save_LDFLAGS
4294     fi
4295     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
4296     # A workaround is to link also against libpmawt.so
4297     if test "$JDK" = "ibm" ; then
4298         save_CFLAGS=$CFLAGS
4299         save_LDFLAGS=$LDFLAGS
4300         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
4301         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4302         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
4303         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
4304         export LD_LIBRARY_PATH
4305         exec 6>/dev/null # no output
4306         AC_CHECK_HEADER(jni.h, [],
4307                     [AC_MSG_ERROR([jni.h could not be found.])], [])
4308         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
4309         if test -z "$AWTLIB"; then
4310             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
4311             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
4312         fi
4313         exec 6>&1 # output on again
4314         CFLAGS=$save_CFLAGS
4315         LDFLAGS=$save_LDFLAGS
4316         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
4317     fi
4318     if test -z "$AWTLIB"; then
4319         AWTLIB=-ljawt
4320     fi
4321     AC_MSG_RESULT([$AWTLIB])
4322     AC_SUBST(AWTLIB)
4325 AC_SUBST(JAVA_HOME)
4326 AC_SUBST(JDK)
4327 AC_SUBST(JAVAFLAGS)
4328 AC_SUBST(JAVA_SOURCE_VER)
4329 AC_SUBST(JAVA_TARGET_VER)
4330 AC_SUBST(JAVAINTERPRETER)
4331 AC_SUBST(JAVAIFLAGS)
4332 AC_SUBST(JAVACOMPILER)
4333 AC_SUBST(JAVADOC)
4335 dnl ===================================================================
4336 dnl Checks for specific files.
4337 dnl ===================================================================
4339 dnl ===================================================================
4340 dnl Checks for programs.
4341 dnl ===================================================================
4343 dnl ===================================================================
4344 dnl Check whether we already have dmake
4345 dnl ===================================================================
4346 AC_PATH_PROG(DMAKE, dmake, no)
4347 if test "$DMAKE" = "no"; then
4348     BUILD_DMAKE=YES
4349     echo "dmake will be built on ./bootstrap"
4350 else
4351     AC_MSG_CHECKING([whether the found dmake is the right dmake])
4352     # we need to find out whether that dmake we found is "our" dmake
4353     # or the dmake from Sun's SunStudio Compiler which is something
4354     # different
4355     # This test _should_ work because the one accepts -V (ours) and one
4356     # (the other) not...
4357     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
4358     if test $? -eq 0; then
4359         BUILD_DMAKE=NO
4360         AC_MSG_RESULT([yes])
4361         AC_MSG_CHECKING([the dmake version])
4362         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
4363         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
4364             AC_MSG_RESULT([OK, >= 4.11])
4365         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
4366             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
4367             AC_MSG_RESULT([OK, >= 4.11])
4368         else
4369             AC_MSG_RESULT([too old. >= 4.11 is needed])
4370             echo "A newer dmake will be built on ./bootstrap"
4371             BUILD_DMAKE=YES
4372         fi
4373     else
4374         AC_MSG_RESULT([no])
4375         echo "dmake will be built on ./bootstrap"
4376         BUILD_DMAKE=YES
4377     fi
4379 AC_SUBST(BUILD_DMAKE)
4381 AC_MSG_CHECKING([whether to enable EPM for packing])
4382 BUILD_EPM=NO
4383 if test "$enable_epm" = "yes"; then
4384     AC_MSG_RESULT([yes])
4385     dnl ===================================================================
4386     dnl Check for epm - not needed for Windows
4387     dnl ===================================================================
4388     if test "$_os" != "WINNT"; then
4389         if test -n "$with_epm"; then
4390             EPM=$with_epm
4391         else
4392             AC_PATH_PROG(EPM, epm, no)
4393         fi
4394         if test "$EPM" = "no" || test "$EPM" = "internal"; then
4395             echo "EPM will be built."
4396             BUILD_EPM=YES
4397             BUILD_TYPE="$BUILD_TYPE EPM"
4398         else
4399             # Gentoo has some epm which is something different...
4400             AC_MSG_CHECKING([whether the found epm is the right epm])
4401             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
4402                 AC_MSG_RESULT([yes])
4403             else
4404                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
4405             fi
4406             AC_MSG_CHECKING([epm version])
4407             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
4408             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
4409                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
4410                 AC_MSG_RESULT([OK, >= 3.7])
4411                 BUILD_EPM=NO
4412                 if test "$_os" = "Darwin"; then
4413                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
4414                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
4415                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4416                         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)])
4417                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4418                         AC_MSG_RESULT([$_pm, ok])
4419                     else # we never should get here, but go safe
4420                         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)])
4421                     fi
4422                 fi
4423             else
4424                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
4425                 echo "EPM will be built."
4426                 BUILD_EPM=YES
4427                 BUILD_TYPE="$BUILD_TYPE EPM"
4428             fi
4429         fi
4430     fi
4432     # test which package format to use
4433     AC_MSG_CHECKING([which package format to use])
4435     # defaults
4436     case "$_os" in
4437     Darwin)
4438         PKGFORMAT=dmg
4439         ;;
4440     SunOS)
4441         PKGFORMAT=pkg
4442         ;;
4443     Linux)
4444         # if building on Debian, default should be deb...
4445         if test -e /etc/debian_version; then
4446             PKGFORMAT=deb
4447         else
4448             PKGFORMAT=rpm
4449         fi
4450         ;;
4451     AIX)
4452         PKGFORMAT=rpm
4453         ;;
4454     OpenBSD|DragonFly)
4455         PKGFORMAT=portable
4456         ;;
4457     *BSD)
4458         PKGFORMAT=bsd
4459         ;;
4460     WINNT)
4461         PKGFORMAT=msi
4462         ;;
4463     # we never should get here since we check the arciecture/os at the beginning,
4464     # but go sure...
4465     *)
4466         AC_MSG_ERROR([unknown system])
4467     esac
4468     if test -n "$with_package_format"; then
4469         for i in $with_package_format; do
4470             case "$i" in
4471             aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
4472                 ;;
4473             *)
4474                 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4475 aix - AIX software distribution
4476 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4477 deb - Debian software distribution
4478 inst or tardist - IRIX software distribution
4479 osx - MacOS X software distribution
4480 pkg - Solaris software distribution
4481 rpm - RedHat software distribution
4482 setld - Tru64 (setld) software distribution
4483 native - "Native" software distribution for the platform
4484 portable - Portable software distribution
4485 LibreOffice additionally supports:
4486 archive - .tar.gz or .zip
4487 dmg - Mac OS X .dmg
4488 installed - installation tree
4489 msi - Windows .msi
4490             ])
4491                 ;;
4492             esac
4493         done
4494         PKGFORMAT="$with_package_format"
4495     fi
4496     AC_MSG_RESULT([$PKGFORMAT])
4497     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
4498         AC_MSG_CHECKING([for rpm])
4499         for a in "$RPM" rpmbuild rpm; do
4500             $a --usage >/dev/null 2> /dev/null
4501             if test $? -eq 0; then
4502                 RPM=$a
4503                 break
4504             else
4505                 $a --version >/dev/null 2> /dev/null
4506                 if test $? -eq 0; then
4507                     RPM=$a
4508                     break
4509                 fi
4510             fi
4511         done
4512         if test -z "$RPM" ; then
4513             AC_MSG_ERROR([not found])
4514         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
4515             RPM_PATH=`which $RPM`
4516             AC_MSG_RESULT([$RPM_PATH])
4517         else
4518             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
4519         fi
4520     fi
4521     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
4522         AC_PATH_PROG(DPKG, dpkg, no)
4523         if test "$DPKG" = "no"; then
4524             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
4525         fi
4526     fi
4527     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
4528         if test "$_os" = "Darwin"; then
4529             AC_MSG_CHECKING([for PackageMaker availability])
4530             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
4531                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
4532             else
4533                 AC_MSG_RESULT([ok])
4534             fi
4535         else
4536             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
4537         fi
4538     fi
4539     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
4540        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4541         if test "$EPM" != "no" && test "$EPM" != "internal"; then
4542             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
4543                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
4544                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
4545                     AC_MSG_RESULT([yes])
4546                 else
4547                     AC_MSG_RESULT([no])
4548                     if echo "$PKGFORMAT" | grep -q rpm; then
4549                         _pt="rpm"
4550                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
4551                         echo "the rpms will need to be installed with --nodeps" >> warn
4552                     else
4553                         _pt="pkg"
4554                     fi
4555                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
4556                     echo "the ${_pt}s will not be relocateable" >> warn
4557                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
4558                                  relocation will work, you need to patch your epm with the
4559                                  patch in epm/epm-3.7.patch or build with
4560                                  --with-epm=internal which will build a suitable epm])
4561                 fi
4562             fi
4563         fi
4564     fi
4565     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4566         AC_PATH_PROG(PKGMK, pkgmk, no)
4567         if test "$PKGMK" = "no"; then
4568             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
4569         fi
4570     fi
4571     AC_SUBST(RPM)
4572     AC_SUBST(DPKG)
4573     AC_SUBST(PKGMK)
4574 else
4575     AC_MSG_RESULT([no])
4576     EPM=NO
4577     PKGFORMAT=native
4579 AC_SUBST(EPM)
4580 AC_SUBST(BUILD_EPM)
4581 AC_SUBST(PKGFORMAT)
4583 dnl ===================================================================
4584 dnl Check for gperf
4585 dnl ===================================================================
4586 AC_PATH_PROG(GPERF, gperf)
4587 if test -z "$GPERF"; then
4588     AC_MSG_ERROR([gperf not found but needed. Install it.])
4590 AC_MSG_CHECKING([gperf version])
4591 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
4592     AC_MSG_RESULT([OK])
4593 else
4594     AC_MSG_ERROR([too old, you need at least 3.0.0])
4596 AC_SUBST(GPERF)
4598 dnl ===================================================================
4599 dnl Check for building ODK
4600 dnl ===================================================================
4601 AC_MSG_CHECKING([whether to build the ODK])
4602 if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
4603     AC_MSG_RESULT([yes])
4605     if test "$with_java" != "no"; then
4606         AC_MSG_CHECKING([whether to build unowinreg.dll])
4607         if test "$_os" = "WINNT" -a "z$enable_build_unowinreg" = "z" ; then
4608             # build on Win by default
4609             enable_build_unowinreg=yes
4610         fi
4611         if test "z$enable_build_unowinreg" = "z" -o "$enable_build_unowinreg" = "no"; then
4612             AC_MSG_RESULT([no])
4613             BUILD_UNOWINREG=NO
4614         else
4615             AC_MSG_RESULT([yes])
4616             BUILD_UNOWINREG=YES
4617         fi
4618         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
4619             if test -z "$with_mingw_cross_compiler"; then
4620                 dnl Guess...
4621                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
4622             elif test -x "$with_mingw_cross_compiler"; then
4623                  MINGWCXX="$with_mingw_cross_compiler"
4624             else
4625                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
4626             fi
4628             if test "$MINGWCXX" = "false"; then
4629                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
4630             fi
4632             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
4633             if test -x "$mingwstrip_test"; then
4634                 MINGWSTRIP="$mingwstrip_test"
4635             else
4636                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
4637             fi
4639             if test "$MINGWSTRIP" = "false"; then
4640                 AC_MSG_ERROR(MinGW32 binutils not found.)
4641             fi
4642         fi
4643     fi
4644     BUILD_TYPE="$BUILD_TYPE ODK"
4645 else
4646     AC_MSG_RESULT([no])
4647     BUILD_UNOWINREG=NO
4649 AC_SUBST(BUILD_UNOWINREG)
4650 AC_SUBST(MINGWCXX)
4651 AC_SUBST(MINGWSTRIP)
4653 dnl ===================================================================
4654 dnl Check for system stdlibs
4655 dnl ===================================================================
4656 AC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
4657 if test "$with_system_stdlibs" = "yes"; then
4658     AC_MSG_RESULT([no])
4659     SYSTEM_STDLIBS=YES
4660 else
4661     AC_MSG_RESULT([yes])
4662     SYSTEM_STDLIBS=NO
4664 AC_SUBST(SYSTEM_STDLIBS)
4666 dnl ===================================================================
4667 dnl Check for system zlib
4668 dnl ===================================================================
4669 AC_MSG_CHECKING([which zlib to use])
4670 if test "$with_system_zlib" = "yes"; then
4671     AC_MSG_RESULT([external])
4672     SYSTEM_ZLIB=YES
4673     AC_CHECK_HEADER(zlib.h, [],
4674         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
4675     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
4676         [AC_MSG_ERROR(zlib not found or functional)], [])
4677 else
4678     AC_MSG_RESULT([internal])
4679     SYSTEM_ZLIB=NO
4680     BUILD_TYPE="$BUILD_TYPE ZLIB"
4682 AC_SUBST(SYSTEM_ZLIB)
4684 dnl ===================================================================
4685 dnl Check for system jpeg
4686 dnl ===================================================================
4687 AC_MSG_CHECKING([which jpeg to use])
4688 if test "$with_system_jpeg" = "yes"; then
4689     AC_MSG_RESULT([external])
4690     SYSTEM_JPEG=YES
4691     AC_CHECK_HEADER(jpeglib.h, [],
4692         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
4693     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
4694     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
4695 else
4696     AC_MSG_RESULT([internal])
4697     SYSTEM_JPEG=NO
4698     BUILD_TYPE="$BUILD_TYPE JPEG"
4700 AC_SUBST(SYSTEM_JPEG)
4702 dnl ===================================================================
4703 dnl Check for system expat
4704 dnl ===================================================================
4705 AC_MSG_CHECKING([which expat to use])
4706 if test "$with_system_expat" = "yes"; then
4707     AC_MSG_RESULT([external])
4708     SYSTEM_EXPAT=YES
4709     AC_CHECK_HEADER(expat.h, [],
4710         [AC_MSG_ERROR(expat.h not found. install expat)], [])
4711     AC_CHECK_LIB(expat, XML_ParserCreate, [],
4712     [AC_MSG_RESULT(expat library not found or functional.)], [])
4713     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libexpat-1.dll"
4714 else
4715     AC_MSG_RESULT([internal])
4716     SYSTEM_EXPAT=NO
4717     BUILD_TYPE="$BUILD_TYPE EXPAT"
4719 AC_SUBST(SYSTEM_EXPAT)
4721 dnl ===================================================================
4722 dnl Check for system libvisio
4723 dnl ===================================================================
4724 AC_MSG_CHECKING([which libvisio to use])
4725 if test "$with_system_libvisio" = "yes"; then
4726     AC_MSG_RESULT([external])
4727     SYSTEM_LIBVISIO=YES
4728     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
4729 else
4730     AC_MSG_RESULT([internal])
4731     SYSTEM_LIBVISIO=NO
4732     BUILD_TYPE="$BUILD_TYPE LIBVISIO"
4734 AC_SUBST(SYSTEM_LIBVISIO)
4735 AC_SUBST(VISIO_CFLAGS)
4736 AC_SUBST(VISIO_LIBS)
4738 dnl ===================================================================
4739 dnl Check for system libcmis
4740 dnl ===================================================================
4741 AC_MSG_CHECKING([which libcmis to use])
4742 if test "$with_system_libcmis" = "yes"; then
4743     AC_MSG_RESULT([external])
4744     SYSTEM_LIBCMIS=YES
4745     PKG_CHECK_MODULES( LIBCMIS, libcmis-0.2 )
4746 else
4747     AC_MSG_RESULT([internal])
4748     SYSTEM_LIBCMIS=NO
4749     BUILD_TYPE="$BUILD_TYPE LIBCMIS"
4751 AC_SUBST(SYSTEM_LIBCMIS)
4752 AC_SUBST(LIBCMIS_CFLAGS)
4753 AC_SUBST(LIBCMIS_LIBS)
4756 dnl ===================================================================
4757 dnl Check for system libwpd
4758 dnl ===================================================================
4759 AC_MSG_CHECKING([which libwpd to use])
4760 if test "$with_system_libwpd" = "yes"; then
4761     AC_MSG_RESULT([external])
4762     SYSTEM_LIBWPD=YES
4763     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
4764 else
4765     AC_MSG_RESULT([internal])
4766     SYSTEM_LIBWPD=NO
4767     BUILD_TYPE="$BUILD_TYPE LIBWPD"
4769 AC_SUBST(SYSTEM_LIBWPD)
4770 AC_SUBST(WPD_CFLAGS)
4771 AC_SUBST(WPD_LIBS)
4773 dnl ===================================================================
4774 dnl Check for system cppunit
4775 dnl ===================================================================
4776 AC_MSG_CHECKING([which cppunit to use])
4777 if test "$with_system_cppunit" = "yes"; then
4778     AC_MSG_RESULT([external])
4779     SYSTEM_CPPUNIT=YES
4780     # might work for earlier, too but go sure:
4781     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
4782 else
4783     AC_MSG_RESULT([internal])
4784     SYSTEM_CPPUNIT=NO
4785     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
4787 AC_SUBST(SYSTEM_CPPUNIT)
4788 AC_SUBST(CPPUNIT_CFLAGS)
4789 AC_SUBST(CPPUNIT_LIBS)
4791 dnl ===================================================================
4792 dnl Check whether freetype is available
4793 dnl ===================================================================
4794 if test  "$test_freetype" = "yes"; then
4795     AC_MSG_CHECKING([whether freetype is available])
4796     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
4798 AC_SUBST(FREETYPE_CFLAGS)
4799 AC_SUBST(FREETYPE_LIBS)
4801 dnl ===================================================================
4802 dnl Check for system libwps
4803 dnl ===================================================================
4804 AC_MSG_CHECKING([which libwps to use])
4805 if test "$with_system_libwps" = "yes"; then
4806     AC_MSG_RESULT([external])
4807     SYSTEM_LIBWPS=YES
4808     PKG_CHECK_MODULES( WPS, libwps-0.2 )
4809 else
4810     AC_MSG_RESULT([internal])
4811     SYSTEM_LIBWPS=NO
4812     BUILD_TYPE="$BUILD_TYPE LIBWPS"
4814 AC_SUBST(SYSTEM_LIBWPS)
4815 AC_SUBST(WPS_CFLAGS)
4816 AC_SUBST(WPS_LIBS)
4818 dnl ===================================================================
4819 dnl Check for system libwpg
4820 dnl ===================================================================
4821 AC_MSG_CHECKING([which libwpg to use])
4822 if test "$with_system_libwpg" = "yes"; then
4823     AC_MSG_RESULT([external])
4824     SYSTEM_LIBWPG=YES
4825     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
4826 else
4827     AC_MSG_RESULT([internal])
4828     SYSTEM_LIBWPG=NO
4829     BUILD_TYPE="$BUILD_TYPE LIBWPG"
4831 AC_SUBST(SYSTEM_LIBWPG)
4832 AC_SUBST(WPG_CFLAGS)
4833 AC_SUBST(WPG_LIBS)
4835 dnl ===================================================================
4836 dnl Check whether freetype2 supports emboldening
4837 dnl ===================================================================
4838 if test  "$test_freetype" = "yes"; then
4839     save_CPPFLAGS="$CPPFLAGS"
4840     save_LDFLAGS="$LDFLAGS"
4841     save_LIBS="$LIBS"
4842     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
4843     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
4844     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
4845                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
4846     LDFLAGS="$save_LDFLAGS"
4847     CPPFLAGS="$save_CPPFLAGS"
4848     LIBS="$save_LIBS"
4850 AC_SUBST(USE_FT_EMBOLDEN)
4852 # ===================================================================
4853 # Check for system libxslt
4854 # to prevent incompatibilities between internal libxml2 and external libxslt,
4855 # or vice versa, use with_system_libxml here
4856 # ===================================================================
4857 AC_MSG_CHECKING([which libxslt to use])
4858 if test "$with_system_libxml" = "yes"; then
4859     AC_MSG_RESULT([external])
4860     SYSTEM_LIBXSLT=YES
4861     if test "$_os" = "Darwin"; then
4862         dnl make sure to use SDK path
4863         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4864         dnl omit -L/usr/lib
4865         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
4866     else
4867         PKG_CHECK_MODULES(LIBXSLT, libxslt)
4868     fi
4870     dnl Check for xsltproc
4871     AC_PATH_PROG(XSLTPROC, xsltproc, no)
4872     if test "$XSLTPROC" = "no"; then
4873         AC_MSG_ERROR([xsltproc is required])
4874     fi
4876     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libxslt-1.dll"
4877 else
4878     AC_MSG_RESULT([internal])
4879     SYSTEM_LIBXSLT=NO
4880     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
4882     if test "$cross_compiling" = "yes"; then
4883         AC_PATH_PROG(XSLTPROC, xsltproc, no)
4884         if test "$XSLTPROC" = "no"; then
4885             AC_MSG_ERROR([xsltproc is required])
4886         fi
4887     fi
4889 AC_SUBST(SYSTEM_LIBXSLT)
4890 AC_SUBST(LIBXSLT_CFLAGS)
4891 AC_SUBST(LIBXSLT_LIBS)
4892 AC_SUBST(XSLTPROC)
4894 # ===================================================================
4895 # Check for system libxml
4896 # ===================================================================
4897 AC_MSG_CHECKING([which libxml to use])
4898 if test "$with_system_libxml" = "yes"; then
4899     AC_MSG_RESULT([external])
4900     SYSTEM_LIBXML=YES
4901     if test "$_os" = "Darwin"; then
4902         dnl make sure to use SDK path
4903         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4904         dnl omit -L/usr/lib
4905         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
4906     elif test $_os = iOS; then
4907         dnl make sure to use SDK path
4908         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
4909         LIBXML_CFLAGS="-I$usr/include/libxml2"
4910         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
4911     else
4912         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
4913     fi
4914     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS zlib1.dll libxml2-2.dll"
4915 else
4916     AC_MSG_RESULT([internal])
4917     SYSTEM_LIBXML=NO
4918     BUILD_TYPE="$BUILD_TYPE LIBXML2"
4920 AC_SUBST(SYSTEM_LIBXML)
4921 AC_SUBST(LIBXML_CFLAGS)
4922 AC_SUBST(LIBXML_LIBS)
4924 dnl ===================================================================
4925 dnl Checks for Python
4926 dnl ===================================================================
4928 AC_MSG_CHECKING([which Python to use])
4930 case "$enable_python" in
4931 no|disable)
4932     enable_python=no
4933     AC_MSG_RESULT([none])
4934     DISABLE_PYTHON=TRUE
4935     ;;
4936 ""|yes|auto)
4937     if test $build_os = cygwin; then
4938         dnl When building on Windows we don't attempt to use any installed
4939         dnl "system"  Python.
4940         dnl
4941         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
4942         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
4943         dnl MinGW cross-compilation setups.)
4944         AC_MSG_RESULT([internal])
4945         enable_python=internal
4946     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4947         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4948         enable_python=internal
4949     else
4950         AC_MSG_RESULT([checking below])
4951         enable_python=auto
4952     fi
4953     ;;
4954 internal)
4955     AC_MSG_RESULT([internal])
4956     ;;
4957 system)
4958     if test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4959         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4960     fi
4961     AC_MSG_RESULT([system])
4962     ;;
4964     AC_MSG_ERROR([Incorrect --enable-python option])
4965     ;;
4966 esac
4968 AC_SUBST(DISABLE_PYTHON)
4970 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
4971     AC_MSG_ERROR([Must use internal Python when building with MSVC])
4974 if test $enable_python != no; then
4975     BUILD_TYPE="$BUILD_TYPE PYUNO"
4978 if test "$cross_compiling" = yes; then
4979     if test $enable_python = auto; then
4980         enable_python=system
4981     fi
4982 else
4983     if test $enable_python = system; then
4984         # This causes an error if no python command is found
4985         # Note that this takes the system python called just "python",
4986         # which isn't actually what we want on MacOSX when building
4987         # against the 10.6 SDK. But that shouldn't matter, we
4988         # select the correct python command manually below anyway.
4989         AM_PATH_PYTHON([2.6])
4990     elif test $enable_python = auto; then
4991         dnl This allows lack of system Python
4992         AM_PATH_PYTHON([2.6],, [:])
4994         if test "$PYTHON" = :; then
4995             enable_python=internal
4996         else
4997             enable_python=system
4998         fi
4999     fi
5002 if test $enable_python = system; then
5003     if test $_os = Darwin; then
5004         # We already have logic above to make sure the system Python
5005         # is used only when building against SDK 10.6 or newer.
5007         # Make sure we use the 2.6 Python when building against the
5008         # 10.6 SDK.
5009         case $with_macosx_sdk in
5010         10.6)
5011             python_version=2.6;;
5012         10.7)
5013             python_version=2.7;;
5014         *)
5015             # ???
5016             python_version=2.7;;
5017         esac
5018         PYTHON=python$python_version
5020         PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
5021         PYTHON_LIBS="-framework Python"
5022     fi
5023     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
5024         # Fallback: Accept these in the environment, or as set above
5025         # for MacOSX.
5026         :
5027     elif test "$cross_compiling" != yes; then
5028         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
5029         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
5030         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
5031         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
5032         if $PKG_CONFIG --exists python-$python_version; then
5033             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
5034             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version`"
5035         else
5036             PYTHON_CFLAGS="-I$python_include"
5037             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
5038         fi
5039     elif test "$cross_compiling" = yes; then
5040         dnl How to find out the cross-compilation Python installation path?
5041         dnl Let's hardocode what we know for different distributions for now...
5043         for python_sysroot in /usr/i686-w64-mingw32/sys-root/mingw ; do
5044             for python_version in 2.6 ; do
5045                 if test -f ${python_sysroot}/include/python${python_version}/Python.h; then
5046                     PYTHON_CFLAGS="-I ${python_sysroot}/include/python$python_version"
5047                     PYTHON_LIBS="-L ${python_sysroot}lib -lpython$python_version $python_libs"
5048                     break
5049                 fi
5050             done
5051             test -n "$PYTHON_CFLAGS" && break
5052         done
5053     fi
5056 dnl By now enable_python should be "system", "internal" or "no"
5057 case $enable_python in
5058 system)
5059     SYSTEM_PYTHON=YES
5061     dnl Check if the headers really work
5062     save_CPPFLAGS="$CPPFLAGS"
5063     CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
5064     AC_CHECK_HEADER(Python.h, [],
5065        [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
5066        [])
5067     CPPFLAGS="$save_CPPFLAGS"
5069     dnl FIXME Check if the Python library can be linked with, too?
5070     ;;
5072 internal)
5073     SYSTEM_PYTHON=NO
5074     BUILD_TYPE="$BUILD_TYPE PYTHON"
5075     # Embedded Python dies without Home set
5076     if test "z$HOME" = "z"; then
5077         export HOME="";
5078     fi
5079     # bz2 tarball and bzip2 is not standard
5080     if test -z "$BZIP2"; then
5081         AC_PATH_PROG( BZIP2, bzip2)
5082         if test -z "$BZIP2"; then
5083             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
5084         fi
5085     fi
5086     ;;
5088     SYSTEM_PYTHON=NO
5089     ;;
5091     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
5092     ;;
5093 esac
5095 AC_SUBST(SYSTEM_PYTHON)
5096 AC_SUBST(PYTHON_CFLAGS)
5097 AC_SUBST(PYTHON_LIBS)
5099 dnl ===================================================================
5100 dnl Check for system Berkeley db
5101 dnl ===================================================================
5102 AC_MSG_CHECKING([which db to use])
5103 if test "$with_system_db" = "yes"; then
5104     SYSTEM_DB=YES
5105     AC_MSG_RESULT([external])
5107     db_header=
5108     for dbver in 5.1 5.0 5 4.8 4.7 4; do
5109         for dash in - ''; do
5110             AC_CHECK_HEADER([db$dash$dbver/db.h],
5111                 [ db_header="db$dash$dbver/db.h"; break 2 ])
5112         done
5113     done
5115     if test -z "$db_header"; then
5116         AC_CHECK_HEADER([db/db.h], [db_header='db/db.h'; dbver=''])
5117     fi
5119     if test -z "$db_header"; then
5120        AC_CHECK_HEADER(db.h, [ db_header='db.h'; dbver='' ])
5121     fi
5123     if test -z "$db_header"; then
5124         AC_MSG_ERROR([db.h not found. Use the correct -I flag, or install the Berkeley db development package.])
5125     fi
5127     AC_MSG_CHECKING([whether db is at least 4.1])
5128     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])])
5130     SYSTEM_DB_CFLAGS="-DSYSTEM_DB_HEADER='<$db_header>'"
5132     DB_LIB=
5133     dnl At least on OpenBSD dbver is not appended to the library
5134     if test "$_os" = "OpenBSD"; then
5135         dbver=''
5136     fi
5137     for dash in - ''; do
5138         AC_CHECK_LIB(db$dash$dbver, dbopen,
5139             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5140         AC_CHECK_LIB(db$dash$dbver, __db185_open,
5141             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5142     done
5144     if test -z "$DB_LIB" ; then
5145         AC_MSG_ERROR([db library not found. Use the correct -L flag,
5146 or install the Berkeley db development package.])
5147     fi
5149     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
5150     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libdb-4.8.dll"
5151 else
5152     AC_MSG_RESULT([internal])
5153     SYSTEM_DB=NO
5154     BUILD_TYPE="$BUILD_TYPE BERKELEYDB"
5156 AC_SUBST(SYSTEM_DB)
5157 AC_SUBST(SYSTEM_DB_CFLAGS)
5158 AC_SUBST(DB_LIB)
5159 AC_SUBST(DB_CPPLIB)
5161 dnl ===================================================================
5162 dnl Check for system lucene
5163 dnl ===================================================================
5164 if test "$with_java" != "no"; then
5165 AC_MSG_CHECKING([which lucene to use])
5166 if test "$with_system_lucene" = "yes"; then
5167     AC_MSG_RESULT([external])
5168     SYSTEM_LUCENE=YES
5169     if test -z $LUCENE_CORE_JAR; then
5170          AC_CHECK_FILE(/usr/share/java/lucene-core-2.3.jar,
5171             [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar ],
5172             [
5173               AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
5174                 [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
5175                 [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
5176                    [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
5177                    [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
5178                   )
5179                 ]
5180               )
5181             ]
5182          )
5183     else
5184         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5185                [AC_MSG_ERROR(lucene-core.jar not found.)], [])
5186     fi
5188     if test -z $LUCENE_ANALYZERS_JAR; then
5189         AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
5190             [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
5191             [
5192               AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
5193                 [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
5194                 [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
5195               )
5196             ]
5197         )
5198     else
5199         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5200                [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
5201     fi
5202     AC_MSG_CHECKING([whether lucene is version 2.x])
5203     export LUCENE_CORE_JAR
5204     if $PERL -e 'use Archive::Zip;
5205             my $file = "$ENV{'LUCENE_CORE_JAR'}";
5206             my $zip = Archive::Zip->new( $file );
5207             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5208             if ( $mf =~ m/Specification-Version: 2.*/ ) {
5209                 exit 0;
5210             } else {
5211                 exit 1;
5212             }'; then
5213         AC_MSG_RESULT([yes])
5214     else
5215         AC_MSG_ERROR([no, you need lucene 2])
5216     fi
5218 else
5219     AC_MSG_RESULT([internal])
5220     SYSTEM_LUCENE=NO
5221     BUILD_TYPE="$BUILD_TYPE LUCENE"
5224 AC_SUBST(SYSTEM_LUCENE)
5225 AC_SUBST(LUCENE_CORE_JAR)
5226 AC_SUBST(LUCENE_ANALYZERS_JAR)
5228 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
5229 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
5230     AC_MSG_RESULT([yes])
5231     ENABLE_MYSQLC=YES
5232     BUILD_TYPE="$BUILD_TYPE MYSQLC"
5233 else
5234     AC_MSG_RESULT([no])
5235     ENABLE_MYSQLC=NO
5237 AC_SUBST(ENABLE_MYSQLC)
5239 if test "$ENABLE_MYSQLC" = "YES"; then
5241     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
5243     dnl ===================================================================
5244     dnl Check for system MySQL
5245     dnl ===================================================================
5246     AC_MSG_CHECKING([for MySQL prerequisites])
5247     if test "$with_system_mysql" = "yes"; then
5248         AC_MSG_RESULT([external MySQL])
5249         SYSTEM_MYSQL=YES
5250         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
5251         AC_MSG_CHECKING([MySQL version])
5252         MYSQL_VERSION=`$MYSQLCONFIG --version`
5253         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
5254         if test "$MYSQL_MAJOR" -ge "5"; then
5255             AC_MSG_RESULT([OK])
5256         else
5257             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
5258         fi
5259         AC_MSG_CHECKING([for MySQL Client library])
5260         MYSQL_INC=`$MYSQLCONFIG --include`
5261         MYSQL_LIB=`$MYSQLCONFIG --libs`
5262         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
5263         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
5264     else
5265         SYSTEM_MYSQL=NO
5266         if test -n "$with_libmysql_path"; then
5267             AC_MSG_RESULT([external Connector/C (libmysql)])
5268             LIBMYSQL=libmysql.so
5269             if test "$_os" = "Darwin"; then
5270                 LIBMYSQL=libmysql.dylib
5271             elif test "$_os" = "WINNT"; then
5272                 LIBMYSQL=libmysql.dll
5273             fi
5274             AC_MSG_CHECKING([for $LIBMYSQL])
5275             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
5276                 AC_MSG_RESULT([found.])
5277                 LIBMYSQL_PATH=$with_libmysql_path
5278             else
5279                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
5280             fi
5281         else
5282             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
5283         fi
5284     fi
5285     AC_SUBST(SYSTEM_MYSQL)
5286     AC_SUBST(MYSQL_INC)
5287     AC_SUBST(MYSQL_LIB)
5288     AC_SUBST(MYSQL_DEFINES)
5289     AC_SUBST(LIBMYSQL_PATH)
5291     AC_LANG_PUSH([C++])
5292     dnl ===================================================================
5293     dnl Check for system MySQL C++ Connector
5294     dnl ===================================================================
5295     # FIXME!
5296     # who thought this too-generic cppconn dir was a good idea?
5297     AC_MSG_CHECKING([MySQL Connector/C++])
5298     if test "$with_system_mysql_cppconn" = "yes"; then
5299         AC_MSG_RESULT([external])
5300         SYSTEM_MYSQL_CPPCONN=YES
5301         AC_LANG_PUSH([C++])
5302         AC_CHECK_HEADER(mysql_driver.h, [],
5303                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
5304         AC_CHECK_LIB(mysqlcppconn, main, [],
5305                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
5306         AC_MSG_CHECKING([version])
5307         AC_RUN_IFELSE([AC_LANG_SOURCE([[
5308 #include <mysql_driver.h>
5310 int main(int argc, char **argv) {
5311     sql::Driver *driver;
5312     driver = get_driver_instance();
5313     if (driver->getMajorVersion() > 1 || \
5314        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
5315        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
5316         return 0;
5317       else
5318         return 1;
5320       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
5322         AC_LANG_POP([C++])
5324     else
5325         AC_MSG_RESULT([internal])
5326         AC_MSG_CHECKING([for mysqlcppconn module])
5327         if test -d mysqlcppconn; then
5328             AC_MSG_RESULT([OK])
5329         else
5330             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
5331         fi
5332         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
5333         SYSTEM_MYSQL_CPPCONN=NO
5334     fi
5335     AC_LANG_POP([C++])
5336     AC_SUBST(SYSTEM_MYSQL_CPPCONN)
5339 dnl ===================================================================
5340 dnl Check for system hsqldb
5341 dnl ===================================================================
5342 if test "$with_java" != "no"; then
5343 AC_MSG_CHECKING([which hsqldb to use])
5344 if test "$with_system_hsqldb" = "yes"; then
5345     AC_MSG_RESULT([external])
5346     SYSTEM_HSQLDB=YES
5347     if test -z $HSQLDB_JAR; then
5348         HSQLDB_JAR=/usr/share/java/hsqldb.jar
5349     fi
5350     AC_CHECK_FILE($HSQLDB_JAR, [],
5351                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
5352     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
5353     export HSQLDB_JAR
5354     if $PERL -e 'use Archive::Zip;
5355             my $file = "$ENV{'HSQLDB_JAR'}";
5356             my $zip = Archive::Zip->new( $file );
5357             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5358             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
5359                push @l, split(/\n/, $mf);
5360                foreach my $line (@l) {
5361                   if ($line =~ m/Specification-Version:/) {
5362                       ($t, $version) = split (/:/,$line);
5363                       $version =~ s/^\s//;
5364                       ($a, $b, $c, $d) = split (/\./,$version);
5365                       if ($c == "0" && $d > "8")  {
5366                           exit 0;
5367                       } else {
5368                           exit 1;
5369                       }
5370                   }
5371                }
5372             } else {
5373                 exit 1;
5374             }'; then
5375         AC_MSG_RESULT([yes])
5376     else
5377         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
5378     fi
5379 else
5380     AC_MSG_RESULT([internal])
5381     SYSTEM_HSQLDB=NO
5382     BUILD_TYPE="$BUILD_TYPE HSQLDB"
5384 AC_SUBST(SYSTEM_HSQLDB)
5385 AC_SUBST(HSQLDB_JAR)
5388 dnl ===================================================================
5389 dnl Check for PostgreSQL stuff
5390 dnl ===================================================================
5392 if test "x$enable_ext_postgresql_sdbc" = "xyes" -a "x$enable_extension_integration" != "xno"; then
5393     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_POSTGRESQL"
5395     AC_MSG_CHECKING([PostgreSQL C interface])
5396     if test "$with_system_postgresql" = "yes"; then
5397         AC_MSG_RESULT([external PostgreSQL])
5398         SYSTEM_POSTGRESQL=YES
5399         if test "$_os" = Darwin; then
5400            supp_path=''
5401            for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
5402             pg_supp_path="$PATH_SEPARATOR$d$pg_supp_path"
5403            done
5404         fi
5405         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
5406         if test -z "$PGCONFIG"; then
5407            AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
5408         fi
5409         POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
5410         POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
5411     else
5412         if test -n "$with_libpq_path"; then
5413             SYSTEM_POSTGRESQL=YES
5414             AC_MSG_RESULT([external libpq])
5415             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
5416             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
5417         else
5418             SYSTEM_POSTGRESQL=NO
5419             AC_MSG_RESULT([internal])
5420             POSTGRESQL_LIB=""
5421             POSTGRESQL_INC="%OVERRIDE_ME%"
5422             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
5423         fi
5424     fi
5425     if test "${SYSTEM_POSTGRESQL}" = "YES"; then
5426         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
5427         save_CFLAGS=$CFLAGS
5428         save_CPPFLAGS=$CPPFLAGS
5429         save_LIBS=$LIBS
5430         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
5431         LIBS="${LIBS} ${POSTGRESQL_LIB}"
5432         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
5433         AC_CHECK_LIB(pq, PQconnectdbParams, [],
5434             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
5435         CFLAGS=$save_CFLAGS
5436         CPPFLAGS=$save_CPPFLAGS
5437         LIBS=$save_LIBS
5438     fi
5439     BUILD_POSTGRESQL_SDBC=YES
5441 AC_SUBST(BUILD_POSTGRESQL_SDBC)
5442 AC_SUBST(SYSTEM_POSTGRESQL)
5443 AC_SUBST(POSTGRESQL_INC)
5444 AC_SUBST(POSTGRESQL_LIB)
5446 dnl ===================================================================
5447 dnl Check for system beanshell
5448 dnl ===================================================================
5449 if test "$with_java" != "no"; then
5450 AC_MSG_CHECKING([which beanshell to use])
5451 if test "$with_system_beanshell" = "yes"; then
5452     AC_MSG_RESULT([external])
5453     SYSTEM_BSH=YES
5454     if test -z $BSH_JAR; then
5455         BSH_JAR=/usr/share/java/bsh.jar
5456     fi
5457     AC_CHECK_FILE($BSH_JAR, [],
5458                [AC_MSG_ERROR(bsh.jar not found.)], [])
5459 else
5460     AC_MSG_RESULT([internal])
5461     SYSTEM_BSH=NO
5462     BUILD_TYPE="$BUILD_TYPE BSH"
5465 AC_SUBST(SYSTEM_BSH)
5466 AC_SUBST(BSH_JAR)
5469 dnl ===================================================================
5470 dnl Check for system saxon
5471 dnl ===================================================================
5472 if test "$with_java" != "no"; then
5473 AC_MSG_CHECKING([which saxon to use])
5474 if test "$with_system_saxon" = "yes"; then
5475     AC_MSG_RESULT([external])
5476     SYSTEM_SAXON=YES
5477     if test -z $SAXON_JAR; then
5478         AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5479             [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5480             [
5481               AC_CHECK_FILE(/usr/share/java/saxon.jar,
5482                 [ SAXON_JAR=/usr/share/java/saxon.jar ],
5483                 [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5484                     [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5485                     [ AC_MSG_ERROR(saxon.jar replacement not found)]
5486                   )
5487                 ]
5488               )
5489             ]
5490           )
5491     else
5492         AC_CHECK_FILE($SAXON_JAR, [],
5493                [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
5494     fi
5495     if test -n "$SERIALIZER_JAR"; then
5496         AC_CHECK_FILE($SERIALIZER_JAR, [],
5497                [AC_MSG_ERROR(serializer.jar not found.)], [])
5498         AC_SUBST(SERIALIZER_JAR)
5499     fi
5501     dnl Saxon comes in two practically available versions, the out-of-date saxonb which
5502     dnl supports the Java extensions that LibreOffice uses, and the up-to-date saxon he
5503     dnl "home edition" version, which is crippled to not support those Java extensions.
5504     dnl And as an aside the he one also needs to be tweaked to include
5505     dnl a META-INF/services to broadcast that it supports the jaxp transform factory
5507     AC_MSG_CHECKING([if saxon works])
5508     cat > saxontest.java <<_ACEOF
5509 [import javax.xml.transform.TransformerFactory;
5510 import javax.xml.transform.Transformer;
5511 import javax.xml.transform.stream.StreamSource;
5512 import java.io.*;
5514 import net.sf.saxon.FeatureKeys;
5516 class saxontest {
5517     public static void main(String[] args) {
5518       System.setProperty("javax.xml.transform.TransformerFactory",
5519         "net.sf.saxon.TransformerFactoryImpl");
5520       try {
5521         TransformerFactory tfactory = TransformerFactory.newInstance();
5522     // some external saxons (Debian, Ubuntu, ...) have this disabled
5523     // per default
5524     tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
5525         System.out.println("TransformerFactory is" +
5526           tfactory.getClass().getName());
5527         Transformer transformer = tfactory.newTransformer(
5528           new StreamSource(new File(args[0])));
5529       } catch(Exception e){
5530         e.printStackTrace(System.err);
5531         System.exit(-1);
5532       }
5533       System.exit(0);
5534     }
5537 _ACEOF
5539     cat > saxontest.xsl<<_ACEOF
5540 [<?xml version="1.0" encoding="UTF-8"?>
5541 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5542  <xsl:template match="/">
5543   <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
5544  </xsl:template>
5545 </xsl:stylesheet>
5547 _ACEOF
5549     javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
5550     AC_TRY_EVAL(javac_cmd)
5551     if test $? = 0 && test -f ./saxontest.class ; then
5552         java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
5553         AC_TRY_EVAL(java_cmd)
5554         if test $? = 0; then
5555             AC_MSG_RESULT([yes])
5556         else
5557             cat saxontest.java >&5
5558             AC_MSG_RESULT([no])
5559             AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
5560         fi
5561     else
5562         AC_MSG_RESULT([no])
5563         cat saxontest.java >&5
5564         AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
5565     fi
5566 else
5567     AC_MSG_RESULT([internal])
5568     SYSTEM_SAXON=NO
5569     NEED_SAXON=TRUE
5572 AC_SUBST(SYSTEM_SAXON)
5573 AC_SUBST(SAXON_JAR)
5575 if test -n "$NEED_SAXON"; then
5576     BUILD_TYPE="$BUILD_TYPE SAXON"
5579 # ===================================================================
5580 # Check whether to build stax
5581 # ===================================================================
5582 AC_MSG_CHECKING([whether building the stax is required])
5583 BUILD_STAX=NO
5584 if test -z "$SOLAR_JAVA"; then
5585     AC_MSG_RESULT([no (java disabled)])
5586 elif test "$SYSTEM_SAXON" = "YES"; then
5587     AC_MSG_RESULT([no (already provided by system saxon)])
5588 elif test -f "./stax/download/jsr173_1.0_api.jar"; then
5589     AC_MSG_RESULT([no (will use the prebuilt stax/download/jsr173_1.0_api.jar)])
5590 else
5591     BUILD_STAX=YES
5592     AC_MSG_RESULT([yes (no system saxon and no prebuilt copy)])
5594 AC_SUBST(BUILD_STAX)
5596 dnl ===================================================================
5597 dnl Check for system curl
5598 dnl ===================================================================
5599 AC_MSG_CHECKING([which libcurl to use])
5600 if test "$with_system_curl" = "yes"; then
5601     AC_MSG_RESULT([external])
5602     SYSTEM_CURL=YES
5604     curl_version=""
5605     if test "$cross_compiling" = "yes"; then
5606         dnl At least the OBS mingw32-libcurl-devel package
5607         dnl comes with a proper .pc file
5608         PKG_CHECK_MODULES(CURL, libcurl,, [:])
5609         if test -n "$CURL_PKG_ERRORS"; then
5610             AC_MSG_RESULT([no])
5611         else
5612             curl_version=`$PKG_CONFIG --modversion libcurl`
5613         fi
5614     fi
5615     if test -z "$curl_version"; then
5616         AC_PATH_PROG(CURLCONFIG, curl-config)
5617         if test -z "$CURLCONFIG"; then
5618             AC_MSG_ERROR([install the libcurl development package])
5619         fi
5620         CURL_LIBS=`$CURLCONFIG --libs`
5621         CURL_CFLAGS=`$CURLCONFIG --cflags`
5622         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
5623     fi
5625     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
5627     case $curl_version in
5628     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
5629     dnl so they need to be doubled to end up in the configure script
5630     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
5631         AC_MSG_RESULT([yes, you have $curl_version])
5632         ;;
5633     *)
5634         AC_MSG_ERROR([no, you have $curl_version])
5635         ;;
5636     esac
5638     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"
5639 else
5640     AC_MSG_RESULT([internal])
5641     SYSTEM_CURL=NO
5642     BUILD_TYPE="$BUILD_TYPE CURL"
5644 AC_SUBST(SYSTEM_CURL)
5645 AC_SUBST(CURL_CFLAGS)
5646 AC_SUBST(CURL_LIBS)
5648 dnl ===================================================================
5649 dnl Check for system boost
5650 dnl ===================================================================
5651 AC_MSG_CHECKING([which boost to use])
5652 if test "$with_system_boost" = "yes"; then
5653     AC_MSG_RESULT([external])
5654     SYSTEM_BOOST=YES
5655     AC_LANG_PUSH([C++])
5656     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
5657        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
5658     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
5659        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
5660     AC_CHECK_HEADER(boost/function.hpp, [],
5661        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
5662     AC_CHECK_HEADER([boost/unordered_map.hpp], [HAVE_BOOST_UNORDERED_MAP=TRUE],
5663                    [AC_MSG_WARN([boost/unordered_map.hpp not found])], [])
5665     save_CXXFLAGS=$CXXFLAGS
5666     CXXFLAGS="$CXXFLAGS -fno-exceptions"
5667     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
5668     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
5669 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
5671     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
5672         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
5673     else
5674         AC_MSG_RESULT([yes])
5675     fi
5676     CXXFLAGS=$save_CXXFLAGS
5677     AC_LANG_POP([C++])
5678 else
5679     AC_MSG_RESULT([internal])
5680     BUILD_TYPE="$BUILD_TYPE BOOST"
5681     SYSTEM_BOOST=NO
5682     HAVE_BOOST_UNORDERED_MAP=TRUE
5684 AC_SUBST([HAVE_BOOST_UNORDERED_MAP])
5685 AC_SUBST(SYSTEM_BOOST)
5687 dnl ===================================================================
5688 dnl Check for system mdds
5689 dnl ===================================================================
5690 AC_MSG_CHECKING([which mdds to use])
5691 if test "$with_system_mdds" = "yes"; then
5692     AC_MSG_RESULT([external])
5693     SYSTEM_MDDS=YES
5695     dnl ===================================================================
5696     dnl Determine which hash container mdds shall use
5697     dnl ===================================================================
5698     AC_MSG_CHECKING([which hash container mdds shall use])
5699     if test "x$HAVE_CXX0X" = "xTRUE"; then
5700         MDDS_CPPFLAGS="-std=c++0x"
5701         AC_MSG_RESULT([std::unordered_map])
5702     else
5703         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5704         AC_MSG_RESULT([boost::unordered_map])
5705     fi
5707     AC_LANG_PUSH([C++])
5708     save_CPPFLAGS="$CPPFLAGS"
5709     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
5710     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
5711         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
5712     AC_CHECK_HEADER(mdds/mixed_type_matrix.hpp, [],
5713         [AC_MSG_ERROR(mdds/mixed_type_matrix.hpp not found. install mdds >= 0.4.0)], [])
5714     CPPFLAGS="$save_CPPFLAGS"
5715     save_CXXFLAGS="$CXXFLAGS"
5716     CXXFLAGS="$CXXFLAGS $MDDS_CPPFLAGS"
5717     AC_MSG_CHECKING([for correct signature of ::mdds::flat_segment_tree])
5718     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mdds/flat_segment_tree.hpp>
5720     int main(int argc, char **argv) {
5721         ::mdds::flat_segment_tree<long, short> db(0, 100, 0);
5722         short val;
5723         if (!db.search(5, val).second)
5724             return 1;
5725         return 0;
5726     }
5727 ]])],[ac_cv_cxx_mdds_flat_segment_tree_correct=yes],[ac_cv_cxx_mdds_flat_segment_tree_correct=no],[])
5729     if test "$ac_cv_cxx_mdds_flat_segment_tree_correct" = "yes"; then
5730         AC_MSG_RESULT([yes])
5731     else
5732         AC_MSG_ERROR([no, install mdds >= 0.5.0])
5733     fi
5734     CXXFLAGS=$save_CXXFLAGS
5735     AC_LANG_POP([C++])
5736 else
5737     AC_MSG_RESULT([internal])
5738     BUILD_TYPE="$BUILD_TYPE MDDS"
5739     SYSTEM_MDDS=NO
5741     dnl ===================================================================
5742     dnl Determine which hash container mdds shall use
5743     dnl ===================================================================
5744     AC_MSG_CHECKING([which hash container mdds shall use])
5745     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5746     AC_MSG_RESULT([boost::unordered_map])
5748 AC_SUBST(SYSTEM_MDDS)
5749 AC_SUBST([MDDS_CPPFLAGS])
5751 dnl ===================================================================
5752 dnl Check for system vigra
5753 dnl ===================================================================
5754 AC_MSG_CHECKING([which vigra to use])
5755 if test "$with_system_vigra" = "yes"; then
5756     AC_MSG_RESULT([external])
5757     SYSTEM_VIGRA=YES
5758     AC_LANG_PUSH([C++])
5759     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
5760        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
5761     AC_LANG_POP([C++])
5762 else
5763     AC_MSG_RESULT([internal])
5764     BUILD_TYPE="$BUILD_TYPE VIGRA"
5765     SYSTEM_VIGRA=NO
5767 AC_SUBST(SYSTEM_VIGRA)
5769 dnl ===================================================================
5770 dnl Check for system odbc
5771 dnl ===================================================================
5772 AC_MSG_CHECKING([which odbc headers to use])
5773 if test "$with_system_odbc" = "yes"; then
5774     AC_MSG_RESULT([external])
5775     SYSTEM_ODBC_HEADERS=YES
5777     AC_CHECK_HEADER(sqlext.h, [],
5778       [AC_MSG_ERROR(odbc not found. install odbc)], [])
5779 else
5780     AC_MSG_RESULT([internal])
5781     SYSTEM_ODBC_HEADERS=NO
5782     BUILD_TYPE="$BUILD_TYPE UNIXODBC"
5784 AC_SUBST(SYSTEM_ODBC_HEADERS)
5786 AC_MSG_CHECKING([whether to enable build of Mozilla])
5787 if test "$enable_mozilla" = "no"; then
5788     AC_MSG_RESULT([no])
5789     WITH_MOZILLA=NO
5790 else
5791     AC_MSG_RESULT([yes])
5792     WITH_MOZILLA=YES
5794 AC_SUBST(WITH_MOZILLA)
5796 AC_MSG_CHECKING([whether to build Mozilla addressbook connectivity])
5797 if test "$enable_mozilla" = "no"; then
5798     AC_MSG_RESULT([no])
5799 elif test "$with_system_mozilla" = "yes"; then
5800     AC_MSG_RESULT([no, not possible with system-mozilla])
5801 else
5802     AC_MSG_RESULT([yes])
5805 AC_MSG_CHECKING([whether to build XML Security support])
5806 if test "$enable_xmlsec" = "no"; then
5807     AC_MSG_RESULT([no])
5808     ENABLE_XMLSEC=
5809 else
5810     ENABLE_XMLSEC="YES"
5811     BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
5812     AC_MSG_RESULT([yes])
5814 AC_SUBST(ENABLE_XMLSEC)
5816 AC_MSG_CHECKING([whether to build LDAP configuration backend])
5817 if test "$enable_ldap" != "no"; then
5818     WITH_OPENLDAP=NO
5819     WITH_LDAP=NO
5820     if test "$with_openldap" = "yes"; then
5821         WITH_LDAP=YES
5822         AC_MSG_RESULT([OpenLDAP])
5823         WITH_OPENLDAP=YES
5824         AC_CHECK_HEADERS(ldap.h, [],
5825             [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
5826         AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
5827             [AC_MSG_ERROR(openldap lib not found or functional)], [])
5828         AC_CHECK_LIB(ldap, ldap_set_option, [],
5829             [AC_MSG_ERROR(openldap lib not found or functional)], [])
5830     elif test "$enable_mozilla" != "no"; then
5831         AC_MSG_RESULT([Mozilla])
5832         WITH_LDAP=YES
5833         WITH_OPENLDAP=NO
5834     else
5835         AC_MSG_RESULT([no. Either Mozilla or OpenLDAP required])
5836     fi
5837 else
5838     AC_MSG_RESULT([no])
5839     WITH_LDAP=NO
5841 AC_SUBST(WITH_LDAP)
5842 AC_SUBST(WITH_OPENLDAP)
5844 dnl ===================================================================
5845 dnl Check for system mozilla
5846 dnl ===================================================================
5847 AC_MSG_CHECKING([which Mozilla to use])
5848 if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then
5849     AC_MSG_RESULT([external])
5850     SYSTEM_MOZILLA=YES
5851     AC_MSG_CHECKING([which Mozilla flavour to use])
5852     if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then
5853         MOZ_FLAVOUR=libxul
5854     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then
5855         MOZ_FLAVOUR=xulrunner
5856     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "seamonkey"; then
5857         MOZ_FLAVOUR=seamonkey
5858     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "iceape"; then
5859         MOZ_FLAVOUR=iceape
5860     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "firefox"; then
5861         MOZ_FLAVOUR=firefox
5862     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "mozilla"; then
5863         MOZ_FLAVOUR=mozilla
5864     else
5865         MOZ_FLAVOUR=libxul
5866     fi
5867     tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst(<STDIN>);'`
5868     AC_MSG_RESULT($tmp)
5870     if test "$MOZ_FLAVOUR" != "libxul"; then
5871         PKG_CHECK_MODULES( MOZILLAXPCOM, $MOZ_FLAVOUR-xpcom, HASXPCOM="TRUE", HASXPCOM="" )
5872         MOZ_INC=`$PKG_CONFIG --variable=includedir $MOZ_FLAVOUR-xpcom`
5873         MOZ_LIB=`$PKG_CONFIG --variable=libdir $MOZ_FLAVOUR-xpcom`
5874     fi
5876     if test -z "$HASXPCOM"; then
5877         PKG_CHECK_MODULES( MOZILLAXPCOM, libxul )
5878         MOZ_INC=`$PKG_CONFIG --variable=includedir libxul`
5879         MOZ_LIB=`$PKG_CONFIG --variable=libdir libxul`
5880         if ! test -e "$MOZ_LIB/libxul.so"; then
5881             MOZ_LIB=`$PKG_CONFIG --variable=sdkdir libxul`
5882             if test -e "$MOZ_LIB/sdk/lib/libxul.so"; then
5883                 MOZ_LIB="$MOZ_LIB/sdk/lib"
5884             fi
5885         fi
5886     fi
5888     MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS
5889     if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then
5890         AC_MSG_CHECKING([whether $tmp was compiled with --enable-ldap])
5891         if test -d "$MOZ_INC/ldap"; then
5892             AC_MSG_RESULT([yes])
5893             MOZ_LDAP_CFLAGS="-I$MOZ_INC"
5894         else
5895             AC_MSG_ERROR([no.
5896 Could not find LDAP header include files in $MOZ_INC/ldap.
5897 Please recompile $tmp with --enable-ldap or use --with-openldap.])
5898         fi
5899     fi
5901     #e.g. http://fedoraproject.org/wiki/Releases/FeatureXULRunnerAPIChanges
5902     #the plugin pkg-config etc. reverts to "mozilla-plugin" with libxul
5903     if test "$MOZ_FLAVOUR" = "libxul"; then
5904         MOZ_FLAVOUR="mozilla"
5905     fi
5907 elif test "$enable_mozilla" = "no"; then
5908     AC_MSG_RESULT([none])
5909     WITH_MOZILLA=NO
5910 else
5911     AC_MSG_RESULT([internal])
5912     SYSTEM_MOZILLA=NO
5913     BUILD_TYPE="$BUILD_TYPE MOZ"
5914 if test -z "$with_mozilla_version"; then
5915     MOZILLA_VERSION=
5916 else
5917     AC_MSG_CHECKING([which Mozilla version to build])
5918     MOZILLA_VERSION=$with_mozilla_version
5919     enable_build_mozilla=1
5920     AC_MSG_RESULT([$MOZILLA_VERSION])
5923 AC_SUBST(MOZILLA_VERSION)
5925 AC_MSG_CHECKING([for toolkit Mozilla should use])
5926 if test -z "$with_mozilla_toolkit"; then
5927     if test "$_os" != "WINNT" ; then
5928         if test "$_os" = "Darwin" ; then
5929             MOZILLA_TOOLKIT=mac
5930             AC_MSG_RESULT([mac])
5931         else
5932             MOZILLA_TOOLKIT=gtk2
5933             AC_MSG_RESULT([gtk2])
5934         fi
5935     fi
5936 else
5937     MOZILLA_TOOLKIT=$with_mozilla_toolkit
5938     enable_build_mozilla=1
5939     AC_MSG_RESULT([$MOZILLA_TOOLKIT])
5942 AC_SUBST(MOZILLA_TOOLKIT)
5944 # default to enabling build mozilla
5945 if test "$enable_build_mozilla" != "no"; then
5946     enable_build_mozilla=yes
5947 else
5948     enable_build_mozilla=
5951 AC_MSG_CHECKING([whether to build Mozilla/SeaMonkey])
5952 if test -n "$enable_build_mozilla"; then
5953     BUILD_MOZAB="TRUE"
5954     AC_MSG_RESULT([yes])
5955 else
5956     BUILD_MOZAB=""
5957     AC_MSG_RESULT([no])
5960 if test "$BUILD_MOZAB" = "TRUE"; then
5961     if test "$_os" = "WINNT"; then
5962         if test "$WITH_MINGW" != "yes"; then
5963             # compiling with MSVC. Only supported platform here is MSVS2005 at the moment.
5964             if test "$MSVSVER" != "2005"; then
5965                 AC_MSG_ERROR([Building SeaMonkey is supported with Microsoft Visual Studio 2005 only.])
5966             fi
5967         else
5968             AC_MSG_WARN([Building SeaMonkey with MinGW is not tested, and likely to break.])
5969             echo "Building SeaMonkey with MinGW is not tested, and likely to break." >> warn
5970         fi
5971     fi
5973     if test -z "$MOZILLA_VERSION"; then
5974         MOZILLA_VERSION=1.1.14
5975     fi
5976     MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"
5977     MOZILLA_FETCH_FILE=`grep $MOZILLA_SOURCE_VERSION ooo.lst.in`
5978     AC_MSG_CHECKING([for Mozilla sources])
5979     if test -z "$MOZILLA_FETCH_FILE"; then
5980         AC_MSG_RESULT([not found])
5981         HAVE_MOZILLA_TARBALL=n
5982     else
5983         AC_MSG_CHECKING([for $MOZILLA_FETCH_FILE])
5984         if test ! -e "$TARFILE_LOCATION/$MOZILLA_FETCH_FILE"; then
5985             if test -z "$DO_FETCH"; then
5986                 AC_MSG_RESULT([will be fetched])
5987                 HAVE_MOZILLA_TARBALL=y
5988             else
5989                 AC_MSG_RESULT([not found])
5990                 HAVE_MOZILLA_TARBALL=n
5991             fi
5992         else
5993             AC_MSG_RESULT([found])
5994             HAVE_MOZILLA_TARBALL=y
5995         fi
5996     fi
5997     if test "$HAVE_MOZILLA_TARBALL" != "y"; then
5998         AC_MSG_ERROR([Mozilla/SeaMonkey source archive not found.
5999 Use "./download" to download.])
6000     fi
6001     if test "$_os" = "WINNT"; then
6002         AC_MSG_CHECKING([for moztools binaries])
6003         if test ! -e "$TARFILE_LOCATION/vc8-moztools.zip" ; then
6004             AC_MSG_ERROR([The following file is missing in $TARFILE_LOCATION: vc8-moztools.zip
6005 (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)])
6006         else
6007             AC_MSG_RESULT([ok])
6008         fi
6009     elif test "$_os" = "Darwin"; then
6010         PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.6.3,  MOZIDL="TRUE", MOZIDL="")
6011         if test -z "$MOZIDL"; then
6012             AC_MSG_ERROR([libIDL 0.6.3 or newer is needed to build Mozilla with Mac toolkit.])
6013         fi
6014     else
6015         # Generic Unix/Linux section
6016         if test "$MOZILLA_TOOLKIT" = "gtk2"; then
6017             PKG_CHECK_MODULES(MOZLIBREQ, gtk+-2.0, MOZGTK="TRUE", MOZGTK="")
6018             if test -z "$MOZGTK"; then
6019                 AC_MSG_ERROR([GTK2 is needed to build Mozilla.])
6020             fi
6021             PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.8.0, MOZIDL="TRUE", MOZIDL="")
6022             if test -z "$MOZIDL"; then
6023                 AC_MSG_ERROR([libIDL >= 0.8.0 is needed when using GTK2 to build Mozilla.])
6024             fi
6025         else
6026             PKG_CHECK_MODULES(MOZLIBREQ, gtk+ >= 1.2.3, MOZGTK="TRUE", MOZGTK="")
6027             if test -z "$MOZGTK"; then
6028                 AC_MSG_ERROR([GTK+ 1.2 is needed when not using GTK2 to build Mozilla.])
6029             fi
6030             PKG_CHECK_MODULES(MOZLIBREQ, libidl >= 0.6.3 libidl <= 0.6.8, MOZIDL="TRUE", MOZIDL="")
6031             if test -z "$MOZIDL"; then
6032                 AC_MSG_ERROR([libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build Mozilla.])
6033             fi
6034         fi
6035     fi
6038 AC_SUBST(BUILD_MOZAB)
6041 AC_SUBST(MOZILLABUILD)
6042 AC_SUBST(SYSTEM_MOZILLA)
6043 AC_SUBST(MOZ_FLAVOUR)
6044 AC_SUBST(MOZ_INC)
6045 AC_SUBST(MOZ_LIB)
6046 AC_SUBST(MOZ_LIB_XPCOM)
6047 AC_SUBST(MOZ_LDAP_CFLAGS)
6049 dnl ===================================================================
6050 dnl Check for system NSS only with xmlsec or mozilla build enabled
6051 dnl ===================================================================
6052 if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" != "xno"; then
6053 AC_MSG_CHECKING([which NSS to use])
6054 if test "$with_system_nss" = "yes"; then
6055     AC_MSG_RESULT([external])
6056     SYSTEM_NSS="YES"
6057     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
6058 else
6059     SYSTEM_NSS="NO"
6060     BUILD_TYPE="$BUILD_TYPE NSS"
6061     AC_MSG_RESULT([internal])
6062     if test "$build_os" = "cygwin"; then
6063         AC_MSG_CHECKING([for Mozilla build tooling. Required for nss and/or mozilla])
6064         if test -z "$MOZILLABUILD" ; then
6065             AC_MSG_ERROR([Mozilla build tooling not found.
6066 Use the --with-mozilla-build option after installing the tools obtained
6067 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
6068         else
6069             if test \( "$WITH_MINGW" = "yes" \) ; then
6070                 if test ! -d "$MOZILLABUILD" ; then
6071                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
6072                 else
6073                     AC_MSG_RESULT([ok])
6074                 fi
6075             else
6076                 if test ! -d "$MOZILLABUILD/moztools" \
6077                         -o ! -d "$MOZILLABUILD/msys" ; then
6078                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
6079                 else
6080                     AC_MSG_RESULT([ok])
6081                 fi
6082             fi
6083         fi
6084     fi
6085 fi # system nss
6086 fi # enable xmlsec || enable mozilla
6087 AC_SUBST(SYSTEM_NSS)
6088 AC_SUBST(NSS_CFLAGS)
6089 AC_SUBST(NSS_LIBS)
6091 dnl ===================================================================
6092 dnl Check for system mozilla headers
6093 dnl ===================================================================
6094 AC_MSG_CHECKING([which mozilla headers to use])
6095 if test "$with_system_mozilla_headers" = "yes"; then
6096     AC_MSG_RESULT([external])
6097     SYSTEM_MOZILLA_HEADERS=YES
6098     # First try npapi-sdk:
6099     PKG_CHECK_MODULES(MOZILLA_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
6100     # Then go with libxul:
6101     if test "x$LOCATED" != "xyes"; then
6102         PKG_CHECK_MODULES(MOZILLA_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
6103     fi
6104     # if still not found bail out
6105     if test "x$LOCATED" != "xyes"; then
6106         AC_MSG_ERROR([npapi.h header file not found])
6107     fi
6108 else
6109     AC_MSG_RESULT([internal])
6110     SYSTEM_MOZILLA_HEADERS=NO
6112 AC_SUBST(MOZILLA_HEADERS_CFLAGS)
6113 AC_SUBST(SYSTEM_MOZILLA_HEADERS)
6115 dnl ===================================================================
6116 dnl Check for system sane
6117 dnl ===================================================================
6118 AC_MSG_CHECKING([which sane header to use])
6119 if test "$with_system_sane" = "yes"; then
6120     AC_MSG_RESULT([external])
6121     SYSTEM_SANE_HEADER=YES
6122     AC_CHECK_HEADER(sane/sane.h, [],
6123       [AC_MSG_ERROR(sane not found. install sane)], [])
6124 else
6125     AC_MSG_RESULT([internal])
6126     SYSTEM_SANE_HEADER=NO
6127     BUILD_TYPE="$BUILD_TYPE SANE"
6129 AC_SUBST(SYSTEM_SANE_HEADER)
6131 dnl ===================================================================
6132 dnl Check for system icu
6133 dnl ===================================================================
6134 SYSTEM_GENBRK=
6135 SYSTEM_GENCCODE=
6136 SYSTEM_GENCMN=
6137 ICU_MAJOR=
6138 ICU_MINOR=
6139 ICU_MICRO=
6140 ICU_RECLASSIFIED_CLOSE_PARENTHESIS=
6141 AC_MSG_CHECKING([which icu to use])
6142 if test "$with_system_icu" = "yes"; then
6143     AC_MSG_RESULT([external])
6144     SYSTEM_ICU=YES
6145     AC_LANG_PUSH([C++])
6146     AC_MSG_CHECKING([for unicode/rbbi.h])
6147     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
6148     AC_LANG_POP([C++])
6150     ICUPATH="$PATH"
6151     if test "$WITH_MINGW" = "yes" ; then
6152         ICUPATH="/usr/i686-w64-mingw32/sys-root/mingw/bin:$ICUPATH"
6153     fi
6154     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
6156     AC_MSG_CHECKING([ICU version])
6157     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
6158     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
6159     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
6160     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
6162     if test "$ICU_MAJOR" -ge "4"; then
6163         AC_MSG_RESULT([OK, $ICU_VERSION])
6164     else
6165         AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
6166     fi
6168     if test "$cross_compiling" != "yes"; then
6169         # using the system icu tools can lead to version confusion, use the
6170         # ones from the build environment when cross-compiling
6171         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
6172         if test -z "$SYSTEM_GENBRK"; then
6173             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
6174         fi
6175         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6176         if test -z "$SYSTEM_GENCCODE"; then
6177             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
6178         fi
6179         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6180         if test -z "$SYSTEM_GENCMN"; then
6181             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
6182         fi
6183         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4"; then
6184             ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6185         fi
6186     fi
6188     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS icui18n$ICU_MAJOR$ICU_MINOR.dll icuuc$ICU_MAJOR$ICU_MINOR.dll icudata$ICU_MAJOR$ICU_MINOR.dll"
6189 else
6190     AC_MSG_RESULT([internal])
6191     SYSTEM_ICU="NO"
6192     ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6193     BUILD_TYPE="$BUILD_TYPE ICU"
6195 AC_SUBST(SYSTEM_ICU)
6196 AC_SUBST(SYSTEM_GENBRK)
6197 AC_SUBST(SYSTEM_GENCCODE)
6198 AC_SUBST(SYSTEM_GENCMN)
6199 AC_SUBST(ICU_MAJOR)
6200 AC_SUBST(ICU_MINOR)
6201 AC_SUBST(ICU_MICRO)
6202 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
6204 dnl ===================================================================
6205 dnl Graphite
6206 dnl ===================================================================
6208 AC_MSG_CHECKING([whether to enable graphite support])
6209 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" = "z" -o "$enable_graphite" != "no" ; then
6210     AC_MSG_RESULT([yes])
6211     ENABLE_GRAPHITE="TRUE"
6212     AC_MSG_CHECKING([which graphite to use])
6213     if test "$with_system_graphite" = "yes"; then
6214         AC_MSG_RESULT([external])
6215         SYSTEM_GRAPHITE=YES
6216         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
6217         MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libgraphite2.dll"
6218     else
6219         AC_MSG_RESULT([internal])
6220         SYSTEM_GRAPHITE=NO
6221         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
6222     fi
6223 else
6224     AC_MSG_RESULT([no])
6226 AC_SUBST(ENABLE_GRAPHITE)
6227 AC_SUBST(SYSTEM_GRAPHITE)
6228 AC_SUBST(GRAPHITE_LIBS)
6229 AC_SUBST(GRAPHITE_CFLAGS)
6231 dnl ===================================================================
6232 dnl SampleICC
6233 dnl ===================================================================
6234 AC_MSG_CHECKING([whether to use system SampleICC])
6235 if test "$with_system_sampleicc" = "yes"; then
6236     AC_MSG_RESULT([yes])
6237     SYSTEM_SAMPLEICC=YES
6238     PKG_CHECK_MODULES(SAMPLEICC, sampleicc)
6239 else
6240     AC_MSG_RESULT([no])
6241     SYSTEM_SAMPLEICC=NO
6243 AC_SUBST(SYSTEM_SAMPLEICC)
6244 AC_SUBST(SAMPLEICC_LIBS)
6245 AC_SUBST(SAMPLEICC_CFLAGS)
6247 dnl ===================================================================
6248 dnl Checks for libraries.
6249 dnl ===================================================================
6250 dnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
6251 dnl See if we have the AppKit framework for building with Quartz graphics.
6253 if test  "$_os" = "Darwin"; then
6254     if test "x$with_x" = "xyes"; then
6255         AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
6256     else
6257         AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
6258         if test -d "/System/Library/Frameworks/AppKit.framework/"; then
6259             AC_MSG_RESULT([yes])
6260             x_includes="no_x_includes"
6261             x_libraries="no_x_libraries"
6262             dnl disable some things used on other Unix versions but not on the aqua build
6263             enable_gtk=no
6264         else
6265             AC_MSG_ERROR([No AppKit.framewrok found])
6266         fi
6267     fi
6270 if test $_os = iOS -o $_os = Android; then
6271     enable_gtk=no
6274 dnl ===================================================================
6275 dnl Check for nsplugin
6276 dnl ===================================================================
6277 AC_MSG_CHECKING([wether to build nsplugin extension])
6278 ENABLE_NSPLUGIN=NO
6279 if test "$enable_nsplugin" != "no"; then
6280     if test "$enable_gtk" != "no"; then
6281         AC_MSG_RESULT([yes])
6282         ENABLE_NSPLUGIN=YES
6283     else
6284         AC_MSG_RESULT([no, disabled gtk2])
6285     fi
6286 else
6287     AC_MSG_RESULT([no])
6289 AC_SUBST(ENABLE_NSPLUGIN)
6291 dnl ***************************************
6292 dnl testing for X libraries and includes...
6293 dnl ***************************************
6294 if test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
6295     dnl Mac OS X using Aqua graphics. Don't check for X11.
6296     :
6297 elif test "$_os" != "WINNT" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6298     AC_PATH_X
6299     AC_PATH_XTRA
6300     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6302     if test "x$x_includes" = "x"; then
6303         x_includes="default_x_includes"
6304     fi
6305     if test "x$x_libraries" = "x"; then
6306         x_libraries="default_x_libraries"
6307     fi
6308     dnl The variables $x_libraries and $x_includes are set.
6309     if test -z "$x_libraries"; then
6310         AC_MSG_ERROR([No X libraries found]) # Exit
6311     fi
6312     if test -z "$x_includes"; then
6313         AC_MSG_ERROR([No X includes found]) # Exit
6314     fi
6315     CFLAGS="$CFLAGS $X_CFLAGS"
6316     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
6317     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
6318     dnl Check if the XauDisposeAuth symbol is provided by libXau.
6319     AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
6320 else
6321     x_includes="no_x_includes"
6322     x_libraries="no_x_libraries"
6324 if test -z "$x_includes"; then
6325     x_includes="no_x_includes"
6327 if test -z "$x_libraries"; then
6328     x_libraries="no_x_libraries"
6330 if test "$x_includes" = "default_x_includes"; then
6331     XINC="/usr/include"
6332 else
6333     XINC="$x_includes"
6335 AC_SUBST(XINC)
6336 if test "$x_libraries" = "default_x_libraries"; then
6337     XLIB=`$PKG_CONFIG --variable=libdir x11`
6338     if test "x$XLIB" = x; then
6339         XLIB="/usr/lib"
6340     fi
6341 else
6342     XLIB="$x_libraries"
6344 AC_SUBST(XLIB)
6345 AC_SUBST(XAU_LIBS)
6347 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6348     dnl ===================================================================
6349     dnl Check for Composite.h for Mozilla plugin
6350     dnl ===================================================================
6351     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
6352      [#include <X11/Intrinsic.h>])
6355 AC_MSG_CHECKING([whether to use internal X11 extensions headers])
6356 if test "$with_system_xextensions_headers" != "no"; then
6357     AC_MSG_RESULT([no])
6358 else
6359     AC_MSG_RESULT([yes])
6360     BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
6363 dnl ===================================================================
6364 dnl Check for system Xrender
6365 dnl ===================================================================
6366 AC_MSG_CHECKING([whether to use Xrender])
6367 if test "$test_xrender" = "yes"; then
6368     AC_MSG_RESULT([yes])
6369     AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
6370       [AC_MSG_ERROR(libXrender not found or functional)], [])
6371     AC_MSG_CHECKING([which Xrender headers to use])
6372     if test "$with_system_xextensions_headers" != "no"; then
6373         AC_MSG_RESULT([external])
6374         AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
6375           [AC_MSG_ERROR(Xrender not found. install X)], [])
6376     else
6377         AC_MSG_RESULT([internal])
6378     fi
6381 dnl ===================================================================
6382 dnl Check for XRandr
6383 dnl ===================================================================
6384 AC_MSG_CHECKING([whether to enable RandR support])
6385 if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
6386     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
6387         XRANDR_DLOPEN="TRUE"
6388         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
6389     else
6390         AC_MSG_RESULT([yes])
6391         XRANDR_DLOPEN="FALSE"
6392         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
6393         if test "$ENABLE_RANDR" != "TRUE"; then
6394             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
6395                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
6396             XRANDR_CFLAGS=" "
6397             AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
6398               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
6399             XRANDR_LIBS="-lXrandr "
6400             ENABLE_RANDR="TRUE"
6401         fi
6402     fi
6403 else
6404     ENABLE_RANDR=""
6405     AC_MSG_RESULT([no])
6407 AC_SUBST(XRANDR_DLOPEN)
6408 AC_SUBST(XRANDR_CFLAGS)
6409 AC_SUBST(XRANDR_LIBS)
6410 AC_SUBST(ENABLE_RANDR)
6412 dnl ===================================================================
6413 dnl Check for building neon
6414 dnl ===================================================================
6415 AC_MSG_CHECKING([whether to use neon])
6416 if test "$enable_neon" = "no"; then
6417     AC_MSG_RESULT([no])
6418     DISABLE_NEON=TRUE
6419     AC_SUBST(DISABLE_NEON)
6420 else
6421     AC_MSG_RESULT([yes])
6422 dnl ===================================================================
6423 dnl Check for system neon
6424 dnl ===================================================================
6425 AC_MSG_CHECKING([which neon to use])
6426 if test "$with_system_neon" = "yes"; then
6427     AC_MSG_RESULT([external])
6428     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
6429     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
6430     NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1"
6431     SYSTEM_NEON=YES
6432     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libtasn1-3.dll libgnutls-26.dll libneon-27.dll"
6433 else
6434     AC_MSG_RESULT([internal])
6435     SYSTEM_NEON=NO
6436     NEON_LIBS=-lneon
6437     NEON_CFLAGS=
6438     BUILD_TYPE="$BUILD_TYPE NEON"
6440 AC_SUBST(SYSTEM_NEON)
6441 AC_SUBST(NEON_VERSION)
6442 AC_SUBST(NEON_LIBS)
6443 AC_SUBST(NEON_CFLAGS)
6446 dnl ===================================================================
6447 dnl Check for system openssl
6448 dnl ===================================================================
6449 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6450         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
6451     with_system_openssl=yes
6453 AC_MSG_CHECKING([which libssl to use])
6454 if test "$with_system_openssl" = "yes"; then
6455     AC_MSG_RESULT([external])
6456     # Mac OS builds should get out without extra stuff is the Mac porters'
6457     # wish. And pkg-config is although Xcode ships a .pc for openssl
6458     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6459             "$_os" = "DragonFly"; then
6460         OPENSSL_CFLAGS=
6461         OPENSSL_LIBS="-lssl -lcrypto"
6462     else
6463         PKG_CHECK_MODULES( OPENSSL, openssl )
6464     fi
6465     SYSTEM_OPENSSL=YES
6466     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libssl-8.dll libcrypto-8.dll"
6467 else
6468     AC_MSG_RESULT([internal])
6469     SYSTEM_OPENSSL=NO
6470     BUILD_TYPE="$BUILD_TYPE OPENSSL"
6472 AC_SUBST(SYSTEM_OPENSSL)
6473 AC_SUBST(OPENSSL_CFLAGS)
6474 AC_SUBST(OPENSSL_LIBS)
6476 dnl ===================================================================
6477 dnl Check for system redland
6478 dnl ===================================================================
6479 AC_MSG_CHECKING([which redland library to use])
6480 if test "$with_system_redland" = "yes"; then
6481     AC_MSG_RESULT([external])
6482     SYSTEM_REDLAND=YES
6483     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
6484     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
6485     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libraptor-1.dll librasqal-2.dll libsqlite3-0.dll librdf-0.dll"
6486 else
6487     AC_MSG_RESULT([internal])
6488     BUILD_TYPE="$BUILD_TYPE REDLAND"
6489     SYSTEM_REDLAND=NO
6491 AC_SUBST(SYSTEM_REDLAND)
6492 AC_SUBST(REDLAND_CFLAGS)
6493 AC_SUBST(REDLAND_LIBS)
6495 dnl ===================================================================
6496 dnl Check for system hunspell
6497 dnl ===================================================================
6498 AC_MSG_CHECKING([which libhunspell to use])
6499 if test "$with_system_hunspell" = "yes"; then
6500     AC_MSG_RESULT([external])
6501     SYSTEM_HUNSPELL=YES
6502     AC_LANG_PUSH([C++])
6503     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
6504     if test "$HUNSPELL_PC" != "TRUE"; then
6505         AC_CHECK_HEADER(hunspell.hxx, [],
6506             [
6507             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
6508             [AC_MSG_ERROR(hunspell headers not found.)], [])
6509             ], [])
6510         AC_CHECK_LIB(hunspell, main, [],
6511            [ AC_MSG_ERROR(hunspell library not found.) ], [])
6512         HUNSPELL_LIBS=-lhunspell
6513     fi
6514     AC_LANG_POP([C++])
6515     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhunspell-1.3-0.dll"
6516 else
6517     AC_MSG_RESULT([internal])
6518     SYSTEM_HUNSPELL=NO
6519     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
6521 AC_SUBST(SYSTEM_HUNSPELL)
6522 AC_SUBST(HUNSPELL_CFLAGS)
6523 AC_SUBST(HUNSPELL_LIBS)
6525 dnl ===================================================================
6526 dnl Checking for altlinuxhyph
6527 dnl ===================================================================
6528 AC_MSG_CHECKING([which altlinuxhyph to use])
6529 if test "$with_system_altlinuxhyph" = "yes"; then
6530     AC_MSG_RESULT([external])
6531     SYSTEM_HYPH=YES
6532     AC_CHECK_HEADER(hyphen.h, [],
6533        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
6534     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
6535        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
6536        [#include <hyphen.h>])
6537     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
6538         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6539     if test -z "$HYPHEN_LIB"; then
6540         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
6541            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6542     fi
6543     if test -z "$HYPHEN_LIB"; then
6544         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
6545            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6546     fi
6547     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhyphen-0.dll"
6548 else
6549     AC_MSG_RESULT([internal])
6550     SYSTEM_HYPH=NO
6551     BUILD_TYPE="$BUILD_TYPE HYPHEN"
6553 AC_SUBST(SYSTEM_HYPH)
6554 AC_SUBST(HYPHEN_LIB)
6556 dnl ===================================================================
6557 dnl Checking for mythes
6558 dnl ===================================================================
6559 AC_MSG_CHECKING([which mythes to use])
6560 if test "$with_system_mythes" = "yes"; then
6561     AC_MSG_RESULT([external])
6562     SYSTEM_MYTHES=YES
6563     AC_LANG_PUSH([C++])
6564     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
6565     if test "$MYTHES_PKGCONFIG" = "no"; then
6566         AC_CHECK_HEADER(mythes.hxx, [],
6567             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
6568         AC_CHECK_LIB(mythes-1.2, main, [],
6569             [ MYTHES_FOUND=no], [])
6570     if test "$MYTHES_FOUND" = "no"; then
6571         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
6572                 [ MYTHES_FOUND=no], [])
6573     fi
6574     if test "$MYTHES_FOUND" = "no"; then
6575         AC_MSG_ERROR([mythes library not found!.])
6576     fi
6577     fi
6578     AC_LANG_POP([C++])
6579     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libmythes-1.2-0.dll"
6580 else
6581     AC_MSG_RESULT([internal])
6582     SYSTEM_MYTHES=NO
6583     BUILD_TYPE="$BUILD_TYPE MYTHES"
6585 AC_SUBST(SYSTEM_MYTHES)
6586 AC_SUBST(MYTHES_CFLAGS)
6587 AC_SUBST(MYTHES_LIBS)
6589 dnl ===================================================================
6590 dnl Checking for lpsolve
6591 dnl ===================================================================
6592 AC_MSG_CHECKING([which lpsolve to use])
6593 if test "$with_system_lpsolve" = "yes"; then
6594     AC_MSG_RESULT([external])
6595     SYSTEM_LPSOLVE=YES
6596     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
6597        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
6598     # some systems need this. Like Ubuntu....
6599     AC_CHECK_LIB(m, floor)
6600     AC_CHECK_LIB(dl, dlopen)
6601     AC_CHECK_LIB(lpsolve55, make_lp, ,
6602         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
6603     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS lpsolve55.dll"
6604 else
6605     AC_MSG_RESULT([internal])
6606     SYSTEM_LPSOLVE=NO
6607     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
6609 AC_SUBST(SYSTEM_LPSOLVE)
6611 dnl ===================================================================
6612 dnl Checking for libexttextcat
6613 dnl ===================================================================
6614 AC_MSG_CHECKING([which libexttextcat to use])
6615 if test "$with_system_libexttextcat" = "yes"; then
6616     AC_MSG_RESULT([external])
6617     SYSTEM_LIBEXTTEXTCAT=YES
6618     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
6619     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
6620 else
6621     AC_MSG_RESULT([internal])
6622     SYSTEM_LIBEXTTEXTCAT=NO
6623     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
6625 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
6626 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
6627 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
6628 AC_SUBST(LIBEXTTEXTCAT_LIBS)
6630 dnl ***************************************
6631 dnl testing libc version for Linux...
6632 dnl ***************************************
6633 if test "$_os" = "Linux"; then
6634     AC_MSG_CHECKING([whether libc is >= 2.1.1])
6635     exec 6>/dev/null # no output
6636     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
6637     exec 6>&1 # output on again
6638     if test "$HAVE_LIBC"; then
6639         AC_MSG_RESULT([yes])
6640     else
6641         AC_MSG_ERROR([no, upgrade libc])
6642     fi
6645 if test "$_os" != "WINNT"; then
6646     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
6647     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
6648     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
6649         SYSTEM_LIBC=YES
6650     fi
6651 else
6652     HAVE_GETOPT=NO
6653     HAVE_READDIR_R=NO
6654     SYSTEM_LIBC=YES
6656 AC_SUBST(HAVE_GETOPT)
6657 AC_SUBST(HAVE_READDIR_R)
6658 AC_SUBST(SYSTEM_LIBC)
6660 dnl =========================================
6661 dnl Check for the Windows  SDK.
6662 dnl =========================================
6663 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
6664 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
6665 if test "$_os" = "WINNT"; then
6666     AC_MSG_CHECKING([for Windows SDK])
6667     if test "$build_os" = "cygwin"; then
6668         if test -z "$with_windows_sdk_home"; then
6669             # This first line will detect a February 2003 Microsoft Platform SDK
6670             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
6671             # But there might be also an April 2005 PSDK, unfortunately MS changed
6672             # the registry entry. (we prefer the old version!?)
6673             if test -z "$WINDOWS_SDK_HOME"; then
6674                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
6675             fi
6676             # normalize if found
6677             if test -n "$WINDOWS_SDK_HOME"; then
6678                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
6679                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
6680             fi
6681         else
6682             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
6683         fi
6684     fi
6685     if test -n "$WINDOWS_SDK_HOME"; then
6686         # Remove a possible trailing backslash
6687         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6688         # Problem with current PSDK (iz 49865)
6689         # (What "current" does that mean?)
6690         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
6691             AC_MSG_ERROR([
6692 Some modules do not build correctly with MS Platform SDK - April 2005
6693 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
6694 Remove/rename/backup that file and restart configure. Details about this
6695 problem can be found in issue 49856.])
6696         fi
6698         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6699              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6700              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6701             HAVE_PSDK_H="yes"
6702         else
6703             HAVE_PSDK_H="no"
6704         fi
6705         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
6706             HAVE_PSDK_LIB="yes"
6707         else
6708             HAVE_PSDK_LIB="no"
6709         fi
6711         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
6712             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
6713 the  Windows SDK are installed.])
6714         fi
6716         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
6717              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
6718              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
6719              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe" ; then
6720             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
6721         fi
6722     fi
6724     if test -z "$WINDOWS_SDK_HOME"; then
6725         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6726     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
6727         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
6728     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
6729         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
6730     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
6731         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
6732     else
6733         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
6734     fi
6736 AC_SUBST(WINDOWS_SDK_HOME)
6738 dnl =========================================
6739 dnl Check for the Microsoft DirectX SDK.
6740 dnl =========================================
6741 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
6742     AC_MSG_CHECKING([for DirectX SDK])
6743     if test "$build_os" = "cygwin"; then
6744         if test -z "$with_directx_home"; then
6745             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
6746             if test -n "$DXSDK_DIR"; then
6747                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
6748                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
6749             fi
6750             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
6751             # the "DirectX SDK not found" error later
6752         else
6753             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
6754         fi
6755         # Remove a possible trailing backslash
6756         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
6757     elif test -n "$with_directx_home"; then
6758         DIRECTXSDK_HOME="$with_directx_home"
6759     fi
6761     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
6762         HAVE_DIRECTXSDK_H="yes"
6763     else
6764         HAVE_DIRECTXSDK_H="no"
6765     fi
6767     # MS changed the location of the libraries with Dec 2004 DirectX SDK
6768     if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
6769         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
6770     else
6771         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
6772     fi
6774     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
6775         HAVE_DIRECTXSDK_LIB="yes"
6776     else
6777         HAVE_DIRECTXSDK_LIB="no"
6778     fi
6780     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
6781         AC_MSG_RESULT([found])
6782     else
6783         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6784     fi
6786 AC_SUBST(DIRECTXSDK_HOME)
6787 AC_SUBST(DIRECTXSDK_LIB)
6789 dnl ***************************************
6790 dnl Checking for bison and flex
6791 dnl ***************************************
6792 AC_PATH_PROG(BISON, bison)
6793 if test -z "$BISON"; then
6794     AC_MSG_ERROR([no bison found in \$PATH, install it])
6795 else
6796     AC_MSG_CHECKING([the bison version])
6797     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
6798     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
6799     # Accept newer than 1.875 or older(equal) than 1.75
6800     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
6801         if test "$_bison_version" = "1.875" ; then
6802             AC_MSG_WARN([suspect ($BISON $_bison_version)])
6803             echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
6804         else
6805             AC_MSG_RESULT([checked ($BISON $_bison_version)])
6806         fi
6807     else
6808         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
6809     fi
6811 AC_PATH_PROG(FLEX, flex)
6812 if test -z "$FLEX"; then
6813     AC_MSG_ERROR([no flex found in \$PATH, install it])
6815 dnl ***************************************
6816 dnl Checking for patch
6817 dnl ***************************************
6818 AC_PATH_PROG(PATCH, patch)
6819 if test -z "$PATCH"; then
6820     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
6823 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
6824 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
6825     if test -z "$with_gnu_patch"; then
6826         GNUPATCH=$PATCH
6827     else
6828         if test -x "$with_gnu_patch"; then
6829             GNUPATCH=$with_gnu_patch
6830         else
6831             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
6832         fi
6833     fi
6835     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
6836     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
6837         AC_MSG_RESULT([yes])
6838     else
6839         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
6840     fi
6843 dnl We also need to check for --with-gnu-cp
6845 if test -z "$with_gnu_cp"; then
6846     # check the place where the good stuff is hidden on Solaris...
6847     if test -x /usr/gnu/bin/cp; then
6848         GNUCP=/usr/gnu/bin/cp
6849     else
6850         AC_PATH_PROGS(GNUCP, gnucp cp)
6851     fi
6852     if test -z $GNUCP; then
6853         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
6854     fi
6855 else
6856     if test -x "$with_gnu_cp"; then
6857         GNUCP=$with_gnu_cp
6858     else
6859         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
6860     fi
6863 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
6864 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
6865     AC_MSG_RESULT([yes])
6866 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
6867     AC_MSG_RESULT([yes])
6868 else
6869     case "$build_os" in
6870     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
6871         GNUCP=''
6872         AC_MSG_RESULT([no gnucp found - using the system's cp command])
6873         ;;
6874     *)
6875         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
6876         ;;
6877     esac
6880 AC_SUBST(GNUPATCH)
6881 AC_SUBST(GNUCP)
6883 dnl ***************************************
6884 dnl testing assembler path
6885 dnl ***************************************
6886 ML_EXE=""
6887 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
6888     if test "$CL_X64" = ""; then
6889         assembler=ml.exe
6890         assembler_bin=bin
6891     else
6892         assembler=ml64.exe
6893         assembler_bin=bin/amd64
6894     fi
6895     if test -n "$with_asm_home"; then
6896         with_asm_home=`cygpath -u "$with_asm_home"`
6897     fi
6898     if test -x "$with_asm_home/$assembler"; then
6899         AC_MSG_CHECKING([$assembler assembler path])
6900         AC_MSG_RESULT([$with_asm_home/$assembler])
6901         ML_EXE="$with_asm_home/$assembler"
6902     else
6903         AC_PATH_PROG(ML_EXE, $assembler)
6904         if test -z "$ML_EXE"; then
6905             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
6906             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
6907                 with_asm_home=$with_cl_home/$assembler_bin
6908                 AC_MSG_RESULT([found])
6909                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
6910             else
6911                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
6912             fi
6913         else
6914             with_asm_home="ASM_IN_PATH"
6915             ML_EXE="$assembler"
6916         fi
6917     fi
6918 else
6919     with_asm_home="NO_ASM_HOME"
6921 ASM_HOME="$with_asm_home"
6922 AC_SUBST(ASM_HOME)
6923 AC_SUBST(ML_EXE)
6925 dnl ===================================================================
6926 dnl We need zip and unzip
6927 dnl ===================================================================
6928 AC_PATH_PROG(ZIP, zip)
6929 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
6930 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
6931     AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
6934 AC_PATH_PROG(UNZIP, unzip)
6935 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
6937 dnl ===================================================================
6938 dnl Zip must be a specific type for different build types.
6939 dnl ===================================================================
6940 if test $build_os = cygwin; then
6941     if test -n "`$ZIP -h | grep -i WinNT`" ; then
6942         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
6943     fi
6946 dnl ===================================================================
6947 dnl Test which vclplugs have to be built.
6948 dnl ===================================================================
6949 R=""
6950 GTK3_CFLAGS=""
6951 GTK3_LIBS=""
6952 ENABLE_GTK3=""
6953 if test "x$enable_gtk3" = "xyes"; then
6954     if test "$with_system_cairo" != yes; then
6955         echo "System cairo required for gtk3 support, please use --with-system-cairo"
6956     fi
6957     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 gtk+-unix-print-3.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
6958     if test "x$ENABLE_GTK3" = "xTRUE"; then
6959         R="gtk3"
6960     else
6961         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
6962     fi
6964 AC_SUBST(GTK3_LIBS)
6965 AC_SUBST(GTK3_CFLAGS)
6966 AC_SUBST(ENABLE_GTK3)
6968 AC_MSG_CHECKING([which VCLplugs shall be built])
6969 ENABLE_GTK=""
6970 if test "x$enable_gtk" = "xyes"; then
6971     ENABLE_GTK="TRUE"
6972     R="gtk $R"
6974 AC_SUBST(ENABLE_GTK)
6976 ENABLE_KDE=""
6977 if test "x$enable_kde" = "xyes"; then
6978     ENABLE_KDE="TRUE"
6979     R="$R kde"
6981 AC_SUBST(ENABLE_KDE)
6983 ENABLE_KDE4=""
6984 if test "x$enable_kde4" = "xyes"; then
6985     ENABLE_KDE4="TRUE"
6986     R="$R kde4"
6988 AC_SUBST(ENABLE_KDE4)
6990 if test -z "$R"; then
6991     AC_MSG_RESULT([none])
6992 else
6993     AC_MSG_RESULT([$R])
6996 dnl ===================================================================
6997 dnl GCONF check
6998 dnl ===================================================================
7000 ENABLE_GCONF=""
7001 AC_MSG_CHECKING([whether to enable GConf support])
7002 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
7003     ENABLE_GCONF="TRUE"
7004     AC_MSG_RESULT([yes])
7005     PKG_CHECK_MODULES( GCONF, gconf-2.0 ORBit-2.0 )
7006 else
7007     AC_MSG_RESULT([no])
7009 AC_SUBST(ENABLE_GCONF)
7011 dnl ===================================================================
7012 dnl Gnome VFS check
7013 dnl ===================================================================
7015 ENABLE_GNOMEVFS=""
7016 AC_MSG_CHECKING([whether to enable GNOME VFS support])
7017 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
7018     ENABLE_GNOMEVFS="TRUE"
7019     AC_MSG_RESULT([yes])
7020     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
7021 else
7022     AC_MSG_RESULT([no])
7024 AC_SUBST(ENABLE_GNOMEVFS)
7026 dnl ===================================================================
7027 dnl Check whether the gtk 2.0 libraries are available.
7028 dnl ===================================================================
7030 GTK_CFLAGS=""
7031 GTK_LIBS=""
7032 ENABLE_SYSTRAY_GTK=""
7033 ENABLE_DBUS=""
7034 DBUS_CFLAGS=""
7035 DBUS_LIBS=""
7036 if test  "$test_gtk" = "yes"; then
7038     if test "$ENABLE_GTK" = "TRUE" ; then
7039         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]))
7040         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]))
7041         BUILD_TYPE="$BUILD_TYPE GTK"
7043         if test "x$enable_systray" = "xyes"; then
7044             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
7045                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
7046                             [ ENABLE_SYSTRAY_GTK="" ])
7047         fi
7049         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
7050         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
7051                           [ENABLE_GTK_PRINT="TRUE"],
7052                           [ENABLE_GTK_PRINT=""])
7054         AC_MSG_CHECKING([whether to enable DBUS support])
7055         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
7056             ENABLE_DBUS="TRUE"
7057             AC_MSG_RESULT([yes])
7058             PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
7059         else
7060             AC_MSG_RESULT([no])
7061         fi
7063         AC_MSG_CHECKING([whether to enable GIO support])
7064         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
7065             if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
7066                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
7067             fi
7068             ENABLE_GIO="TRUE"
7069             AC_MSG_RESULT([yes])
7070             PKG_CHECK_MODULES( GIO, gio-2.0 )
7071         else
7072             AC_MSG_RESULT([no])
7073         fi
7074     fi
7076 AC_SUBST(ENABLE_GIO)
7077 AC_SUBST(ENABLE_DBUS)
7078 AC_SUBST(ENABLE_SYSTRAY_GTK)
7079 AC_SUBST(GTK_CFLAGS)
7080 AC_SUBST(GTK_LIBS)
7081 AC_SUBST(GTHREAD_CFLAGS)
7082 AC_SUBST(GTHREAD_LIBS)
7083 AC_SUBST(DBUS_CFLAGS)
7084 AC_SUBST(DBUS_LIBS)
7085 AC_SUBST([ENABLE_GTK_PRINT])
7086 AC_SUBST([GTK_PRINT_CFLAGS])
7087 AC_SUBST([GTK_PRINT_LIBS])
7089 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
7090 AC_SUBST(LIBPNG_LIBS)
7091 AC_SUBST(LIBPNG_CFLAGS)
7093 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
7094 if test "x$enable_unix_qstart_libpng" != "xno"; then
7095     AC_MSG_RESULT([yes])
7096 else
7097     AC_MSG_RESULT([no])
7098     ENABLE_QUICKSTART_LIBPNG=""
7100 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
7102 SPLIT_APP_MODULES=""
7103 if test "$enable_split_app_modules" = "yes"; then
7104     SPLIT_APP_MODULES="YES"
7106 AC_SUBST(SPLIT_APP_MODULES)
7108 SPLIT_OPT_FEATURES=""
7109 if test "$enable_split_opt_features" = "yes"; then
7110     SPLIT_OPT_FEATURES="YES"
7112 AC_SUBST(SPLIT_OPT_FEATURES)
7114 ENABLE_CAIRO_CANVAS="FALSE"
7115 if test "$enable_cairo_canvas" = "yes" ; then
7116    ENABLE_CAIRO_CANVAS="TRUE"
7118 AC_SUBST(ENABLE_CAIRO_CANVAS)
7120 dnl ===================================================================
7121 dnl Check whether the GStreamer libraries are available.
7122 dnl ===================================================================
7124 ENABLE_GSTREAMER=""
7126 if test  "$build_gstreamer" = "yes"; then
7128     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
7129     if test "x$enable_gstreamer" != "xno" ; then
7130         ENABLE_GSTREAMER="TRUE"
7131         AC_MSG_RESULT([yes])
7132         PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 )
7133     else
7134         AC_MSG_RESULT([no])
7135     fi
7138 AC_SUBST(ENABLE_GSTREAMER)
7140 dnl ===================================================================
7141 dnl Check whether the OpenGL libraries are available
7142 dnl ===================================================================
7144 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
7145 ENABLE_OPENGL=
7147 if test "$_os" = "Darwin" ; then
7148     # We use frameworks on Mac OS X, no need for detail checks
7149     ENABLE_OPENGL=TRUE
7150     SYSTEM_MESA_HEADERS=YES
7151     AC_MSG_RESULT([yes])
7152 else
7153     if test "x$enable_opengl" != "xno" ; then
7154         if test "$_os" != "WINNT"; then
7155             save_LDFLAGS=$LDFLAGS
7156             LDFLAGS="$LDFLAGS -lm"
7157             AC_MSG_RESULT([yes])
7158             AC_CHECK_LIB(GL, main, [],
7159                       [AC_MSG_ERROR(libGL not installed or functional)], [])
7160             AC_CHECK_LIB(GLU, main, [],
7161                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
7162             ENABLE_OPENGL=TRUE
7163             LDFLAGS=$save_LDFLAGS
7165             dnl ===================================================================
7166             dnl Check for system Mesa
7167             dnl ===================================================================
7168             AC_MSG_CHECKING([which Mesa headers to use])
7169             if test "$with_system_mesa_headers" = "yes"; then
7170                 AC_MSG_RESULT([external])
7171                 SYSTEM_MESA_HEADERS=YES
7172                 AC_LANG_PUSH(C)
7173                 AC_CHECK_HEADER(GL/glxext.h, [],
7174                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
7175                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
7176                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
7177                 AC_LANG_POP(C)
7178             else
7179                 AC_MSG_RESULT([internal])
7180                 SYSTEM_MESA_HEADERS=NO
7181                 BUILD_TYPE="$BUILD_TYPE MESA"
7182             fi
7183         else
7184             AC_MSG_RESULT([not on Windows])
7185         fi
7186     else
7187        AC_MSG_RESULT([no])
7188     fi
7191 AC_SUBST(SYSTEM_MESA_HEADERS)
7192 AC_SUBST(ENABLE_OPENGL)
7194 # presenter minimizer extension?
7195 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
7196 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
7197    AC_MSG_RESULT([yes])
7198    ENABLE_MINIMIZER=YES
7199 else
7200    AC_MSG_RESULT([no])
7201    ENABLE_MINIMIZER=NO
7202    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
7204 AC_SUBST(ENABLE_MINIMIZER)
7206 # presenter console extension?
7207 AC_MSG_CHECKING([whether to build the Presenter Console extension])
7208 if test "x$enable_ext_presenter_console" != "xno" -a "x$enable_extension_integration" != "xno"; then
7209    AC_MSG_RESULT([yes])
7210    ENABLE_PRESENTER_SCREEN=YES
7211 else
7212    AC_MSG_RESULT([no])
7213    ENABLE_PRESENTER_SCREEN=NO
7214    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PRESENTER_SCREEN"
7216 AC_SUBST(ENABLE_PRESENTER_SCREEN)
7218 # pdf import extension?
7219 AC_MSG_CHECKING([whether to build the PDF Import extension])
7220 if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" != "xno"; then
7221   AC_MSG_RESULT([yes])
7222   ENABLE_PDFIMPORT=YES
7224   dnl ===================================================================
7225   dnl Check for system poppler
7226   dnl ===================================================================
7227   AC_MSG_CHECKING([which pdf backend to use])
7228   if test "$with_system_poppler" = "yes"; then
7229       AC_MSG_RESULT([external])
7230       SYSTEM_POPPLER=YES
7231       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
7232       AC_LANG_PUSH([C++])
7233       save_CXXFLAGS=$CXXFLAGS
7234       save_CPPFLAGS=$CPPFLAGS
7235       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
7236       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
7237       AC_CHECK_HEADER([cpp/poppler-version.h], [],
7238                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
7239       CXXFLAGS=$save_CXXFLAGS
7240       CPPFLAGS=$save_CPPFLAGS
7241       AC_LANG_POP([C++])
7242   else
7243       AC_MSG_RESULT([internal])
7244       SYSTEM_POPPLER=NO
7245       BUILD_TYPE="$BUILD_TYPE XPDF"
7246   fi
7247 else
7248   AC_MSG_RESULT([no])
7249   ENABLE_PDFIMPORT=NO
7250   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PDFIMPORT"
7252 AC_SUBST(ENABLE_PDFIMPORT)
7253 AC_SUBST(SYSTEM_POPPLER)
7254 AC_SUBST(POPPLER_CFLAGS)
7255 AC_SUBST(POPPLER_LIBS)
7258 if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then
7259    AC_MSG_CHECKING([for sdext module])
7260    BUILD_TYPE="$BUILD_TYPE SDEXT"
7263 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
7264 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7265   AC_MSG_RESULT([yes])
7266   AC_MSG_CHECKING([for swext module])
7267   ENABLE_MEDIAWIKI=YES
7268   BUILD_TYPE="$BUILD_TYPE SWEXT"
7269   if test  "x$with_java" = "xno"; then
7270     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
7271   fi
7272 else
7273   AC_MSG_RESULT([no])
7274   ENABLE_MEDIAWIKI=NO
7275   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
7277 AC_SUBST(ENABLE_MEDIAWIKI)
7279 if test "$ENABLE_MEDIAWIKI" = "YES"; then
7280     AC_MSG_CHECKING([which Servlet API Jar to use])
7281     if test "$with_system_servlet_api" = "yes"; then
7282         AC_MSG_RESULT([external])
7283         SYSTEM_SERVLETAPI=YES
7284         if test -z "$SERVLETAPI_JAR"; then
7285             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
7286         fi
7287         AC_CHECK_FILE($SERVLETAPI_JAR, [],
7288               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
7289     else
7290         AC_MSG_RESULT([internal])
7291         SYSTEM_SERVLETAPI=NO
7292         BUILD_TYPE="$BUILD_TYPE TOMCAT"
7293     fi
7295 AC_SUBST(SYSTEM_SERVLETAPI)
7296 AC_SUBST(SERVLETAPI_JAR)
7298 AC_MSG_CHECKING([whether to build the Report Builder extension])
7299 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7300     AC_MSG_RESULT([yes])
7301     ENABLE_REPORTBUILDER=YES
7302     AC_MSG_CHECKING([for reportbuilder module])
7303     AC_MSG_CHECKING([which jfreereport libs to use])
7304     if test "$with_system_jfreereport" = "yes"; then
7305         SYSTEM_JFREEREPORT=YES
7306         AC_MSG_RESULT([external])
7307         if test -z $SAC_JAR; then
7308             SAC_JAR=/usr/share/java/sac.jar
7309         fi
7310         AC_CHECK_FILE($SAC_JAR, [],
7311              [AC_MSG_ERROR(sac.jar not found.)], [])
7313         if test -z $LIBXML_JAR; then
7314             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
7315                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
7316                 [
7317                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
7318                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
7319                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
7320                     )
7321                 ]
7322             )
7323         else
7324             AC_CHECK_FILE($LIBXML_JAR, [],
7325                  [AC_MSG_ERROR(libxml.jar not found.)], [])
7326         fi
7328         if test -z $FLUTE_JAR; then
7329             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
7330                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
7331                 [
7332                     AC_CHECK_FILE(/usr/share/java/flute.jar,
7333                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
7334                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
7335                     )
7336                 ]
7337             )
7338         else
7339             AC_CHECK_FILE($FLUTE_JAR, [],
7340                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
7341         fi
7343         if test -z $JFREEREPORT_JAR; then
7344             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
7345                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
7346                 [
7347                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
7348                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
7349                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
7350                     )
7351                 ]
7352             )
7353         else
7354             AC_CHECK_FILE($JFREEREPORT_JAR, [],
7355                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
7356         fi
7358         if test -z $LIBLAYOUT_JAR; then
7359             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
7360                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
7361                 [
7362                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
7363                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
7364                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
7365                     )
7366                 ]
7367             )
7368         else
7369             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
7370                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
7371         fi
7373         if test -z $LIBLOADER_JAR; then
7374             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
7375                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
7376                 [
7377                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
7378                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
7379                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
7380                     )
7381                 ]
7382             )
7383         else
7384             AC_CHECK_FILE($LIBLOADER_JAR, [],
7385                 [AC_MSG_ERROR(libloader.jar not found.)], [])
7386         fi
7388         if test -z $LIBFORMULA_JAR; then
7389             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
7390                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
7391                  [
7392                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
7393                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
7394                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
7395                      )
7396                  ]
7397             )
7398         else
7399             AC_CHECK_FILE($LIBFORMULA_JAR, [],
7400                 [AC_MSG_ERROR(libformula.jar not found.)], [])
7401         fi
7403         if test -z $LIBREPOSITORY_JAR; then
7404             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
7405                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
7406                 [
7407                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
7408                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
7409                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
7410                     )
7411                 ]
7412             )
7413         else
7414             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
7415                 [AC_MSG_ERROR(librepository.jar not found.)], [])
7416         fi
7418         if test -z $LIBFONTS_JAR; then
7419             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
7420                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
7421                 [
7422                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
7423                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
7424                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
7425                     )
7426                 ]
7427             )
7428         else
7429             AC_CHECK_FILE($LIBFONTS_JAR, [],
7430                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
7431         fi
7433         if test -z $LIBSERIALIZER_JAR; then
7434             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
7435                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
7436                 [
7437                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
7438                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
7439                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
7440                     )
7441                 ]
7442             )
7443         else
7444             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
7445                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
7446         fi
7449         if test -z $LIBBASE_JAR; then
7450             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
7451                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
7452                 [
7453                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
7454                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
7455                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
7456                     )
7457                 ]
7458             )
7459         else
7460             AC_CHECK_FILE($LIBBASE_JAR, [],
7461                 [AC_MSG_ERROR(libbase.jar not found.)], [])
7462         fi
7464     else
7465         AC_MSG_RESULT([internal])
7466         AC_MSG_CHECKING([for jfreereport module])
7467         SYSTEM_JFREEREPORT=NO
7468         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
7469     fi
7470     BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
7471 else
7472     AC_MSG_RESULT([no])
7473     ENABLE_REPORTBUILDER=NO
7474     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
7475     SYSTEM_JFREEREPORT=NO
7477 AC_SUBST(ENABLE_REPORTBUILDER)
7478 AC_SUBST(SYSTEM_JFREEREPORT)
7479 AC_SUBST(SAC_JAR)
7480 AC_SUBST(LIBXML_JAR)
7481 AC_SUBST(FLUTE_JAR)
7482 AC_SUBST(JFREEREPORT_JAR)
7483 AC_SUBST(LIBBASE_JAR)
7484 AC_SUBST(LIBLAYOUT_JAR)
7485 AC_SUBST(LIBLOADER_JAR)
7486 AC_SUBST(LIBFORMULA_JAR)
7487 AC_SUBST(LIBREPOSITORY_JAR)
7488 AC_SUBST(LIBFONTS_JAR)
7489 AC_SUBST(LIBSERIALIZER_JAR)
7491 # this has to be here because both the Wiki Publisher and the SRB use
7492 # commons-logging
7493 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7494     AC_MSG_CHECKING([which Apache commons-* libs to use])
7495     if test "$with_system_apache_commons" = "yes"; then
7496         SYSTEM_APACHE_COMMONS=YES
7497         AC_MSG_RESULT([external])
7498         if test "$ENABLE_MEDIAWIKI" = "YES"; then
7499             if test -z $COMMONS_CODEC_JAR; then
7500                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
7501                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
7502                     [
7503                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
7504                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
7505                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
7506                         )
7507                     ]
7508                 )
7509             else
7510                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
7511                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
7512             fi
7514             if test -z $COMMONS_LANG_JAR; then
7515                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
7516                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
7517                     [
7518                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
7519                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
7520                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
7521                             )
7522                     ]
7523                 )
7524             else
7525                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
7526                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
7527             fi
7529             if test -z $COMMONS_HTTPCLIENT_JAR; then
7530                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
7531                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
7532                     [
7533                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
7534                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
7535                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
7536                         )
7537                     ]
7538                 )
7539             else
7540                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
7541                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
7542             fi
7543         fi
7544         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7545             if test -z $COMMONS_LOGGING_JAR; then
7546                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
7547                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
7548                    [
7549                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
7550                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
7551                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
7552                         )
7553                     ]
7554                 )
7555             else
7556                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
7557                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
7558             fi
7559         fi
7560     else
7561         AC_MSG_RESULT([internal])
7562         SYSTEM_APACHE_COMMONS=NO
7563         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
7564     fi
7566 AC_SUBST(SYSTEM_APACHE_COMMONS)
7567 AC_SUBST(COMMONS_CODEC_JAR)
7568 AC_SUBST(COMMONS_LANG_JAR)
7569 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
7570 AC_SUBST(COMMONS_LOGGING_JAR)
7572 # scripting provider for BeanShell extension?
7573 AC_MSG_CHECKING([whether to build extension for support of scripts in BeanShell])
7574 if test "x$enable_ext_scripting_beanshell" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
7575    AC_MSG_RESULT([yes])
7576    ENABLE_SCRIPTING_BEANSHELL=YES
7577 else
7578    AC_MSG_RESULT([no])
7579    ENABLE_SCRIPTING_BEANSHELL=NO
7580    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_BEANSHELL"
7582 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
7584 # scripting provider for JavaScript extension?
7585 AC_MSG_CHECKING([whether to build extension for support of scripts in JavaScript])
7586 if test "x$enable_ext_scripting_javascript" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
7587    AC_MSG_RESULT([yes])
7588    ENABLE_SCRIPTING_JAVASCRIPT=YES
7589 else
7590    AC_MSG_RESULT([no])
7591    ENABLE_SCRIPTING_JAVASCRIPT=NO
7592    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_JAVASCRIPT"
7594 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
7596 dnl Scripting provider for Python extension?
7597 dnl We always provide this unless we have disabled Python completely
7598 if test $enable_python = no; then
7599     ENABLE_SCRIPTING_PYTHON=NO
7600 else
7601     ENABLE_SCRIPTING_PYTHON=YES
7603 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
7605 supports_multilib=
7606 case "$host_cpu" in
7607 x86_64 | powerpc64 | s390x)
7608     if test "$SIZEOF_LONG" = "8"; then
7609         supports_multilib="yes"
7610     fi
7611     ;;
7613     ;;
7614 esac
7616 dnl ===================================================================
7617 dnl Check whether the Qt3 and KDE3 libraries are available.
7618 dnl ===================================================================
7620 KDE_CFLAGS=""
7621 KDE_LIBS=""
7622 if test "$_os" != "OpenBSD"; then
7623     MOC="moc"
7625 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
7626     dnl Search paths for Qt3 and KDE3
7627     if test -z "$supports_multilib" ; then
7628         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"
7629         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"
7630     else
7631         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"
7632         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"
7633     fi
7634     if test -n "$QTDIR" ; then
7635         qt_incdirs="$QTDIR/include $qt_incdirs"
7636         if test -z "$supports_multilib" ; then
7637             qt_libdirs="$QTDIR/lib $qt_libdirs"
7638         else
7639             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7640         fi
7641     fi
7642     if test -z "$supports_multilib" ; then
7643         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"
7644         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"
7645     else
7646         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"
7647         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"
7648     fi
7649     if test -n "$KDEDIR" ; then
7650         kde_incdirs="$KDEDIR/include $kde_incdirs"
7651         if test -z "$supports_multilib" ; then
7652             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7653         else
7654             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7655         fi
7656     fi
7658     dnl What to test
7659     qt_test_include="qstyle.h"
7660     kde_test_include="kapp.h"
7662     if test "$_os" != "OpenBSD"; then
7663         qt_test_library="libqt-mt.so"
7664         kde_test_library="libDCOP.so"
7665     else
7666         qt_test_library="libqt-mt.so*"
7667         kde_test_library="libDCOP.so*"
7668     fi
7670     dnl Check for Qt3 headers
7671     AC_MSG_CHECKING([for Qt3 headers])
7672     qt_incdir="no"
7673     for kde_check in $qt_incdirs ; do
7674         if test -r "$kde_check/$qt_test_include" ; then
7675             qt_incdir="$kde_check"
7676             break
7677         fi
7678     done
7679     AC_MSG_RESULT([$qt_incdir])
7680     if test "x$qt_incdir" = "xno" ; then
7681         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
7682 your Qt3 installation by exporting QTDIR before running "configure".])
7683     fi
7685     dnl Check for Qt3 libraries
7686     AC_MSG_CHECKING([for Qt3 libraries])
7687     qt_libdir="no"
7688     for qt_check in $qt_libdirs ; do
7689         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`" ; then
7690             qt_libdir="$qt_check"
7691             break
7692         fi
7693     done
7694     AC_MSG_RESULT([$qt_libdir])
7695     if test "x$qt_libdir" = "xno" ; then
7696         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
7697 your Qt3 installation by exporting QTDIR before running "configure".])
7698     fi
7700     dnl Check for Meta Object Compiler
7701     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
7702     if test "$MOC" = "no" ; then
7703         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
7704 the root of your Qt3 installation by exporting QTDIR before running "configure".])
7705     fi
7707     dnl Check for KDE3 headers
7708     AC_MSG_CHECKING([for KDE3 headers])
7709     kde_incdir="no"
7710     for kde_check in $kde_incdirs ; do
7711         if test -r "$kde_check/$kde_test_include" ; then
7712             kde_incdir="$kde_check"
7713             break
7714         fi
7715     done
7716     AC_MSG_RESULT([$kde_incdir])
7717     if test "x$kde_incdir" = "xno" ; then
7718         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
7719 your KDE3 installation by exporting KDEDIR before running "configure".])
7720     fi
7722     dnl Check for KDE3 libraries
7723     AC_MSG_CHECKING([for KDE3 libraries])
7724     kde_libdir="no"
7725     for kde_check in $kde_libdirs ; do
7726         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`" ; then
7727             kde_libdir="$kde_check"
7728             break
7729         fi
7730     done
7731     AC_MSG_RESULT([$kde_libdir])
7732     if test "x$kde_libdir" = "xno" ; then
7733         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
7734 your KDE3 installation by exporting KDEDIR before running "configure".])
7735     fi
7737     dnl Set the variables
7738     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7739     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
7741 AC_SUBST(KDE_CFLAGS)
7742 AC_SUBST(KDE_LIBS)
7743 AC_SUBST(MOC)
7745 dnl ===================================================================
7746 dnl KDE4 Integration
7747 dnl ===================================================================
7749 KDE4_CFLAGS=""
7750 KDE4_LIBS=""
7751 MOC4="moc"
7752 KDE_GLIB_CFLAGS=""
7753 KDE_GLIB_LIBS=""
7754 KDE_HAVE_GLIB=""
7755 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
7756     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
7757     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
7759     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
7760     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
7762     if test -n "$supports_multilib" ; then
7763         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
7764         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
7765     fi
7767     if test -n "$QTDIR" ; then
7768         qt_incdirs="$QTDIR/include $qt_incdirs"
7769         if test -z "$supports_multilib" ; then
7770             qt_libdirs="$QTDIR/lib $qt_libdirs"
7771         else
7772             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7773         fi
7774     fi
7775     if test -n "$QT4DIR" ; then
7776         qt_incdirs="$QT4DIR/include $qt_incdirs"
7777         if test -z "$supports_multilib" ; then
7778             qt_libdirs="$QT4DIR/lib $qt_libdirs"
7779         else
7780             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
7781         fi
7782     fi
7784     if test -n "$KDEDIR" ; then
7785         kde_incdirs="$KDEDIR/include $kde_incdirs"
7786         if test -z "$supports_multilib" ; then
7787             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7788         else
7789             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7790         fi
7791     fi
7792     if test -n "$KDE4DIR" ; then
7793         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
7794         if test -z "$supports_multilib" ; then
7795             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
7796         else
7797             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
7798         fi
7799     fi
7801     qt_test_include="Qt/qobject.h"
7802     qt_test_library="libQtCore.so"
7803     kde_test_include="kwindowsystem.h"
7804     kde_test_library="libsolid.so"
7806     AC_MSG_CHECKING([for Qt4 headers])
7807     qt_header_dir="no"
7808     for inc_dir in $qt_incdirs ; do
7809         if test -r "$inc_dir/$qt_test_include" ; then
7810             qt_header_dir="$inc_dir"
7811             break
7812         fi
7813     done
7815     AC_MSG_RESULT([$qt_header_dir])
7816     if test "x$qt_header_dir" = "xno" ; then
7817         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7818     fi
7820     AC_MSG_CHECKING([for Qt4 libraries])
7821     qt_lib_dir="no"
7822     for lib_dir in $qt_libdirs ; do
7823         if test -r "$lib_dir/$qt_test_library" ; then
7824             qt_lib_dir="$lib_dir"
7825             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
7826             break
7827         fi
7828     done
7830     AC_MSG_RESULT([$qt_lib_dir])
7832     if test "x$qt_lib_dir" = "xno" ; then
7833         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7834     fi
7836     dnl Check for Meta Object Compiler
7838     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7839     MOC4="$MOCQT4"
7840     if test "$MOC4" = "no" ; then
7841         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7842         if test "$MOC4" = "no" ; then
7843             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
7844 the root of your Qt installation by exporting QT4DIR before running "configure".])
7845         fi
7846     fi
7848     dnl Check for KDE4 headers
7849     AC_MSG_CHECKING([for KDE4 headers])
7850     kde_incdir="no"
7851     for kde_check in $kde_incdirs ; do
7852         if test -r "$kde_check/$kde_test_include" ; then
7853             kde_incdir="$kde_check"
7854             break
7855         fi
7856     done
7857     AC_MSG_RESULT([$kde_incdir])
7858     if test "x$kde_incdir" = "xno" ; then
7859         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7860     fi
7862     dnl Check for KDE4 libraries
7863     AC_MSG_CHECKING([for KDE4 libraries])
7864     kde_libdir="no"
7865     for kde_check in $kde_libdirs ; do
7866         if test -r "$kde_check/$kde_test_library" ; then
7867             kde_libdir="$kde_check"
7868             break
7869         fi
7870     done
7872     AC_MSG_RESULT([$kde_libdir])
7873     if test "x$kde_libdir" = "xno" ; then
7874         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7875     fi
7877     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7878     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
7880     AC_LANG_PUSH([C++])
7881     save_CXXFLAGS=$CXXFLAGS
7882     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
7883     AC_MSG_CHECKING([whether KDE is >= 4.2])
7884        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7885 #include <kdeversion.h>
7887 int main(int argc, char **argv) {
7888        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
7889        else return 1;
7891        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
7892     CXXFLAGS=$save_CXXFLAGS
7893     AC_LANG_POP([C++])
7895    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
7896     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
7897         [KDE_HAVE_GLIB=1],
7898         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
7900 AC_SUBST(KDE4_CFLAGS)
7901 AC_SUBST(KDE4_LIBS)
7902 AC_SUBST(MOC4)
7903 AC_SUBST(KDE_GLIB_CFLAGS)
7904 AC_SUBST(KDE_GLIB_LIBS)
7905 AC_SUBST(KDE_HAVE_GLIB)
7907 dnl ===================================================================
7908 dnl Test for the enabling the lockdown pieces
7909 dnl ===================================================================
7910 AC_MSG_CHECKING([whether to enable the lockdown pieces])
7911 ENABLE_LOCKDOWN=""
7912 if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
7913     ENABLE_LOCKDOWN=YES
7914     AC_MSG_RESULT([yes])
7915 else
7916     AC_MSG_RESULT([no])
7918 AC_SUBST(ENABLE_LOCKDOWN)
7920 dnl ===================================================================
7921 dnl Test whether to include Evolution 2 support
7922 dnl ===================================================================
7923 AC_MSG_CHECKING([whether to enable evolution 2 support])
7924 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
7925     AC_MSG_RESULT([yes])
7926     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
7927     ENABLE_EVOAB2="TRUE"
7928 else
7929     ENABLE_EVOAB2=""
7930     AC_MSG_RESULT([no])
7932 AC_SUBST(ENABLE_EVOAB2)
7933 AC_SUBST(GOBJECT_CFLAGS)
7934 AC_SUBST(GOBJECT_LIBS)
7936 dnl ===================================================================
7937 dnl Test whether to include KDE AB support
7938 dnl ===================================================================
7939 AC_MSG_CHECKING([whether to enable KDE address book support])
7940 if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then
7941     AC_MSG_RESULT([yes])
7942     AC_LANG_PUSH([C++])
7943     save_CXXFLAGS=$CXXFLAGS
7944     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
7945     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
7946        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7947 #include <kdeversion.h>
7949 int main(int argc, char **argv) {
7950        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
7951        else return 1;
7953        ]])],[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])],[])
7954     CXXFLAGS=$save_CXXFLAGS
7955     AC_LANG_POP([C++])
7956     ENABLE_KAB=TRUE
7957 else
7958     AC_MSG_RESULT([no])
7959     ENABLE_KAB=
7961 AC_SUBST(ENABLE_KAB)
7963 dnl ===================================================================
7964 dnl Test whether to include MathMLDTD
7965 dnl ===================================================================
7966 AC_MSG_CHECKING([whether to include MathMLDTD])
7967 if test -n "$enable_mathmldtd"; then
7968     if test "$enable_mathmldtd" = "no"; then
7969         AC_MSG_RESULT([no])
7970         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
7971     else
7972         AC_MSG_RESULT([yes])
7973         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
7974     fi
7975 else
7976     AC_MSG_RESULT([no])
7977     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
7980 dnl ===================================================================
7981 dnl Test which themes to include
7982 dnl ===================================================================
7983 AC_MSG_CHECKING([which themes to include])
7984 # if none given, use all available themes
7985 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
7986     with_theme="default crystal hicontrast oxygen tango"
7989 WITH_THEMES=""
7990 for theme in $with_theme; do
7991     case $theme in
7992         default|crystal|hicontrast|oxygen|tango) : ;;
7993         *) AC_MSG_ERROR([Unknown value for --with-themes: $theme]) ;;
7994     esac
7995     WITH_THEMES="$WITH_THEMES $theme"
7996     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
7997 done
7998 AC_MSG_RESULT([$WITH_THEMES])
7999 AC_SUBST([WITH_THEMES])
8001 dnl ===================================================================
8002 dnl Test whether to integrate helppacks into the product's installer
8003 dnl ===================================================================
8004 AC_MSG_CHECKING([for helppack integration])
8005 if test "z$with_helppack_integration" = "zno" ; then
8006     WITH_HELPPACK_INTEGRATION=NO
8007     AC_MSG_RESULT([no integration])
8008 else
8009     WITH_HELPPACK_INTEGRATION=YES
8010     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
8011     AC_MSG_RESULT([integration])
8013 AC_SUBST(WITH_HELPPACK_INTEGRATION)
8015 ###############################################################################
8016 # Extensions checking
8017 ###############################################################################
8018 dnl ===================================================================
8019 dnl Test whether to integrate extensions into the product's installer
8020 dnl ===================================================================
8021 AC_MSG_CHECKING([for extensions integration])
8022 if test "x$enable_extension_integration" != "xno"; then
8023     WITH_EXTENSION_INTEGRATION=YES
8024     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
8025     AC_MSG_RESULT([yes, use integration])
8026 else
8027     WITH_EXTENSION_INTEGRATION=NO
8028     AC_MSG_RESULT([no, do not integrate])
8030 AC_SUBST(WITH_EXTENSION_INTEGRATION)
8032 dnl ===================================================================
8033 dnl Test whether to include Lightproof extensions
8034 dnl ===================================================================
8035 AC_MSG_CHECKING([for Lightproof extensions integration (only supported languages displayed)])
8036 LIGHTPROOF_LANG=
8037 LIGHTPROOF_HU_PACK=
8038 LIGHTPROOF_RU_PACK=
8039 LIGHTPROOF_EN_US_PACK=
8040 if test "x$enable_ext_lightproof" = "xno" -o "x$enable_extension_integration" = "xno"; then
8041     AC_MSG_RESULT([no integration])
8042 else
8043     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LIGHTPROOF"
8044     if test "x$enable_ext_lightproof" = "xyes" -o "x$enable_ext_lightproof" = "x"; then
8045         wanted_lightproof="en-US hu ru"
8046     else
8047         for lang in $enable_ext_lightproof ; do
8048             case $lang in
8049                 en-US|hu|ru)
8050                     wanted_lightproof="$wanted_lightproof $lang"
8051                     ;;
8052                 *)
8053                     AC_MSG_ERROR([Unknown value for --enable-ext-lightproof: $lang])
8054                     ;;
8055                 esac
8056         done
8057     fi
8058     for lang in $wanted_lightproof ; do
8059         LIGHTPROOF_LANG="$LIGHTPROOF_LANG $lang"
8060         case $lang in
8061             en-US) LIGHTPROOF_EN_US_PACK="0ab55ac8e88f04258f1d3e79e984382f-lightproof-en_US-0.1.oxt" ;;
8062             hu) LIGHTPROOF_HU_PACK="76345f925e34fef2d29bade4f29108e9-lightproof-hu_1.3.oxt" ;;
8063             ru) LIGHTPROOF_RU_PACK="673860e8649cff2ebdc68bd46f2f7f1a-lightproof-ru_0.1.oxt" ;;
8064             *) AC_MSG_ERROR([Unknown value for --enable-ext-lightproof: $lang]) ;;
8065         esac
8066     done
8067     AC_MSG_RESULT([$LIGHTPROOF_LANG])
8069 AC_SUBST(LIGHTPROOF_LANG)
8070 AC_SUBST(LIGHTPROOF_HU_PACK)
8071 AC_SUBST(LIGHTPROOF_RU_PACK)
8072 AC_SUBST(LIGHTPROOF_EN_US_PACK)
8074 dnl ===================================================================
8075 dnl Test whether to include Watch Window extension
8076 dnl ===================================================================
8077 AC_MSG_CHECKING([for Watch Window extension integration])
8078 WATCH_WINDOW_EXTENSION_PACK=
8079 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8080     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
8081     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
8082     AC_MSG_RESULT([yes])
8083 else
8084     AC_MSG_RESULT([no])
8086 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
8088 dnl ===================================================================
8089 dnl Test whether to include SmART Gallery (Diagram) extension
8090 dnl ===================================================================
8091 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
8092 DIAGRAM_EXTENSION_PACK=
8093 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8094     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
8095     DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
8096     AC_MSG_RESULT([yes])
8097 else
8098     AC_MSG_RESULT([no])
8100 AC_SUBST(DIAGRAM_EXTENSION_PACK)
8102 dnl ===================================================================
8103 dnl Test whether to include Validator extension
8104 dnl ===================================================================
8105 AC_MSG_CHECKING([for Validator extension integration])
8106 VALIDATOR_EXTENSION_PACK=
8107 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8108     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
8109     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
8110     AC_MSG_RESULT([yes])
8111 else
8112     AC_MSG_RESULT([no])
8114 AC_SUBST(VALIDATOR_EXTENSION_PACK)
8116 dnl ===================================================================
8117 dnl Test whether to include Barcode extension
8118 dnl ===================================================================
8119 AC_MSG_CHECKING([for Barcode extension integration])
8120 BARCODE_EXTENSION_PACK=
8121 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8122     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
8123     BARCODE_EXTENSION_PACK="7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt"
8124     AC_MSG_RESULT([yes])
8125 else
8126     AC_MSG_RESULT([no])
8128 AC_SUBST([BARCODE_EXTENSION_PACK])
8130 dnl ===================================================================
8131 dnl Test whether to include ConvertTextToNumber extension
8132 dnl ===================================================================
8133 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
8134 CT2N_EXTENSION_PACK=
8135 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8136     BUILD_TYPE="$BUILD_TYPE CT2N"
8137     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
8138     CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber_1.3.2.oxt"
8139     AC_MSG_RESULT([yes])
8140 else
8141     AC_MSG_RESULT([no])
8143 AC_SUBST(CT2N_EXTENSION_PACK)
8145 dnl ===================================================================
8146 dnl Test whether to include Numbertext extension
8147 dnl ===================================================================
8148 AC_MSG_CHECKING([for Numbertext extension integration])
8149 NUMBERTEXT_EXTENSION_PACK=
8150 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8151     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
8152     NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt"
8153     AC_MSG_RESULT([yes])
8154 else
8155     AC_MSG_RESULT([no])
8157 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
8159 dnl ===================================================================
8160 dnl Test whether to include Hungarian Cross-reference Toolbar extension
8161 dnl ===================================================================
8162 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
8163 HUNART_EXTENSION_PACK=
8164 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8165     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
8166     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
8167     AC_MSG_RESULT([yes])
8168 else
8169     AC_MSG_RESULT([no])
8171 AC_SUBST(HUNART_EXTENSION_PACK)
8173 dnl ===================================================================
8174 dnl Test whether to include Typography Toolbar extension
8175 dnl ===================================================================
8176 AC_MSG_CHECKING([for Typography Toolbar extension integration])
8177 TYPO_EXTENSION_PACK=
8178 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8179     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
8180     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
8181     AC_MSG_RESULT([yes])
8182 else
8183     AC_MSG_RESULT([no])
8185 AC_SUBST(TYPO_EXTENSION_PACK)
8187 dnl ===================================================================
8188 dnl Test whether to include Google Docs extension
8189 dnl ===================================================================
8190 AC_MSG_CHECKING([for Google Docs extension integration])
8191 GOOGLE_DOCS_EXTENSION_PACK=
8192 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8193     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
8194     GOOGLE_DOCS_EXTENSION_PACK="cea0f63d5985ba4fcbd882031df44346-gdocs_3.0.0_modified.oxt"
8195     AC_MSG_RESULT([yes])
8196 else
8197     AC_MSG_RESULT([no])
8199 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
8201 dnl ===================================================================
8202 dnl Test whether to include NLPSolver extension
8203 dnl ===================================================================
8204 AC_MSG_CHECKING([for NLPSolver extension integration])
8205 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
8206     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
8207     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
8208     AC_MSG_RESULT([yes])
8209 else
8210     AC_MSG_RESULT([no])
8213 dnl ===================================================================
8214 dnl Test whether to include LanguageTool extension
8215 dnl ===================================================================
8216 AC_MSG_CHECKING([for LanguageTool extension integration])
8217 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8218     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
8219     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
8220     AC_MSG_RESULT([yes])
8221 else
8222     AC_MSG_RESULT([no])
8225 dnl ===================================================================
8226 dnl Test whether to include oooblogger extension
8227 dnl ===================================================================
8228 AC_MSG_CHECKING([for oooblogger extension integration])
8229 OOOBLOGGER_EXTENSION_PACK=
8230 if test "x$enable_ext_oooblogger" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8231     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_OOOBLOGGER"
8232     OOOBLOGGER_EXTENSION_PACK="b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt"
8233     AC_MSG_RESULT([yes])
8234 else
8235     AC_MSG_RESULT([no])
8237 AC_SUBST(OOOBLOGGER_EXTENSION_PACK)
8238 ###############################################################################
8240 dnl ===================================================================
8241 dnl Test whether to include Sun Professional Template Pack
8242 dnl ===================================================================
8243 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
8244 if test "z$with_sun_templates" = "z" -o "z$with_sun_templates" = "zno" ; then
8245     SUNTEMPLATES_LANG=""
8246     AC_MSG_RESULT([no integration])
8247 else
8248     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
8249     sun_supported_langs="en-US de it fr es hu"
8250     if test "z$with_sun_templates" = "zyes" ; then
8251         wanted_sun_templates="$sun_supported_langs"
8252     else
8253         # check whether the langs are supported by Sun
8254         wanted_sun_templates=
8255         for lang in $with_sun_templates ; do
8256             if test -n "`echo $sun_supported_langs | grep "$lang"`" ; then
8257                 wanted_sun_templates="$wanted_sun_templates $lang"
8258             fi
8259         done
8260     fi
8261     SUNTEMPLATES_LANG=
8262     SUNTEMPLATES_DE_PACK=
8263     SUNTEMPLATES_EN_US_PACK=
8264     SUNTEMPLATES_ES_PACK=
8265     SUNTEMPLATES_FR_PACK=
8266     SUNTEMPLATES_HU_PACK=
8267     SUNTEMPLATES_IT_PACK=
8268     # check whether the langs are requested at all
8269     for lang in $wanted_sun_templates ; do
8270     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`" ; then
8271         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
8272         case $lang in
8273         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
8274         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
8275         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
8276         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
8277         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
8278         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
8279         esac
8280     fi
8281     done
8282     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
8284 AC_SUBST(SUNTEMPLATES_LANG)
8285 AC_SUBST(SUNTEMPLATES_DE_PACK)
8286 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
8287 AC_SUBST(SUNTEMPLATES_ES_PACK)
8288 AC_SUBST(SUNTEMPLATES_FR_PACK)
8289 AC_SUBST(SUNTEMPLATES_HU_PACK)
8290 AC_SUBST(SUNTEMPLATES_IT_PACK)
8292 dnl ===================================================================
8293 dnl Test whether to include fonts
8294 dnl ===================================================================
8295 AC_MSG_CHECKING([whether to include third-party fonts])
8296 if test "$with_fonts" != "no" ; then
8297     AC_MSG_RESULT([yes])
8298     WITH_FONTS=YES
8299     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
8300 else
8301     AC_MSG_RESULT([no])
8302     WITH_FONTS=NO
8303     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
8305 AC_SUBST(WITH_FONTS)
8307 AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
8308 if test "$with_agfa_monotype_fonts" = "yes" ; then
8309     AC_MSG_RESULT([yes])
8310     WITH_AGFA_MONOTYPE_FONTS=YES
8311     SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
8312     BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
8313 else
8314     AC_MSG_RESULT([no])
8315     WITH_AGFA_MONOTYPE_FONTS=NO
8317 AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
8319 dnl ===================================================================
8320 dnl Test whether to include ppds
8321 dnl ===================================================================
8322 AC_MSG_CHECKING([whether to include PPDs])
8323 if test "$with_ppds" != "no"; then
8324     AC_MSG_RESULT([yes])
8325 else
8326     AC_MSG_RESULT([no])
8327     WITHOUT_PPDS=YES
8328     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
8330 AC_SUBST(WITHOUT_PPDS)
8332 dnl ===================================================================
8333 dnl Test whether to include afms
8334 dnl ===================================================================
8335 AC_MSG_CHECKING([whether to include AFMs])
8336 if test "$with_afms" != "no"; then
8337     AC_MSG_RESULT([yes])
8338     BUILD_TYPE="$BUILD_TYPE AFMS"
8339 else
8340     AC_MSG_RESULT([no])
8341     WITHOUT_AFMS=YES
8342     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
8344 AC_SUBST(WITHOUT_AFMS)
8346 dnl ===================================================================
8347 dnl Test whether to include extra galleries
8348 dnl ===================================================================
8349 AC_MSG_CHECKING([whether to include extra galleries])
8350 if test "z$enable_extra_gallery" = "z" -o "z$enable_extra_gallery" = "zno" ; then
8351     AC_MSG_RESULT([no])
8352     WITH_EXTRA_GALLERY=NO
8353     OOOP_GALLERY_PACK=""
8354 else
8355     AC_MSG_RESULT([yes])
8356     WITH_EXTRA_GALLERY=YES
8357     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
8358     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
8359     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
8361 AC_SUBST(WITH_EXTRA_GALLERY)
8362 AC_SUBST(OOOP_GALLERY_PACK)
8364 dnl ===================================================================
8365 dnl Test whether to include extra templates
8366 dnl ===================================================================
8367 AC_MSG_CHECKING([whether to include extra templates])
8368 if test "z$enable_extra_template" = "z" -o "z$enable_extra_template" = "zno" ; then
8369     AC_MSG_RESULT([no])
8370     WITH_EXTRA_TEMPLATE=NO
8371     OOOP_TEMPLATES_PACK=""
8372 else
8373     AC_MSG_RESULT([yes])
8374     WITH_EXTRA_TEMPLATE=YES
8375     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
8376     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
8377     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
8379 AC_SUBST(WITH_EXTRA_TEMPLATE)
8380 AC_SUBST(OOOP_TEMPLATES_PACK)
8382 dnl ===================================================================
8383 dnl Test whether to include extra samples
8384 dnl ===================================================================
8385 AC_MSG_CHECKING([whether to include extra samples])
8386 if test "z$enable_extra_sample" = "z" -o "z$enable_extra_sample" = "zno" ; then
8387     AC_MSG_RESULT([no])
8388     WITH_EXTRA_SAMPLE=NO
8389     OOOP_SAMPLES_PACK=""
8390 else
8391     AC_MSG_RESULT([yes])
8392     WITH_EXTRA_SAMPLE=YES
8393     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
8394     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
8395     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
8397 AC_SUBST(WITH_EXTRA_SAMPLE)
8398 AC_SUBST(OOOP_SAMPLES_PACK)
8400 dnl ===================================================================
8401 dnl Test whether to include extra fonts
8402 dnl ===================================================================
8403 AC_MSG_CHECKING([whether to include extra fonts])
8404 if test "z$enable_extra_font" = "z" -o "z$enable_extra_font" = "zno" ; then
8405     AC_MSG_RESULT([no])
8406     WITH_EXTRA_FONT=NO
8407     OOOP_FONTS_PACK=""
8408 else
8409     AC_MSG_RESULT([yes])
8410     WITH_EXTRA_FONT=YES
8411     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
8412     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
8413     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
8415 AC_SUBST(WITH_EXTRA_FONT)
8416 AC_SUBST(OOOP_FONTS_PACK)
8418 dnl ===================================================================
8419 dnl Test whether to download OxygenOffice branding and set custom settings
8420 dnl ===================================================================
8421 AC_MSG_CHECKING([whether to download OxygenOffice branding and set custom settings])
8422 if test "z$enable_oxygenoffice" = "z" -o "z$enable_oxygenoffice" = "zno" ; then
8423     AC_MSG_RESULT([no])
8424     ENABLE_OXYGENOFFICE=NO
8425 else
8426     AC_MSG_RESULT([yes])
8427     ENABLE_OXYGENOFFICE=YES
8428     OXYGENOFFICE_PACK="18bf204479ff641d99a88cd71f6f25f7-oxygenoffice-001.zip"
8429     BUILD_TYPE="$BUILD_TYPE OXYGENOFFICE"
8431 AC_SUBST(ENABLE_OXYGENOFFICE)
8432 AC_SUBST(OXYGENOFFICE_PACK)
8434 dnl ===================================================================
8435 dnl Test whether to build global menu support
8436 dnl ===================================================================
8437 AC_MSG_CHECKING([whether to build global menu support])
8438 if test "z$enable_lomenubar" = "z" -o "z$enable_lomenubar" = "zno" ; then
8439     AC_MSG_RESULT([no])
8440     ENABLE_LOMENUBAR="FALSE"
8441 else
8442     AC_MSG_RESULT([yes])
8443     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]))
8444     ENABLE_LOMENUBAR="TRUE"
8446 AC_SUBST(ENABLE_LOMENUBAR)
8448 dnl ===================================================================
8449 dnl Test whether to enable online update service
8450 dnl ===================================================================
8451 AC_MSG_CHECKING([whether to enable online update])
8452 ENABLE_ONLINE_UPDATE=
8453 if test "z$enable_online_update" = "z" ; then
8454     if test "$_os" = "WINNT" -o "$_os" = "Darwin" ; then
8455         AC_MSG_RESULT([yes])
8456         ENABLE_ONLINE_UPDATE="TRUE"
8457     else
8458         AC_MSG_RESULT([no])
8459     fi
8460 else
8461     if test "z$enable_online_update" = "zyes" ; then
8462         AC_MSG_RESULT([yes])
8463         ENABLE_ONLINE_UPDATE="TRUE"
8464     else
8465         AC_MSG_RESULT([no])
8466     fi
8468 AC_SUBST(ENABLE_ONLINE_UPDATE)
8470 dnl ===================================================================
8471 dnl Test whether build target is Release Build
8472 dnl ===================================================================
8473 AC_MSG_CHECKING([whether build target is Release Build])
8474 if test "z$enable_release_build" = "z" -o "z$enable_release_build" = "zno" ; then
8475     AC_MSG_RESULT([no])
8476     ENABLE_RELEASE_BUILD="FALSE"
8477 else
8478     AC_MSG_RESULT([yes])
8479     ENABLE_RELEASE_BUILD="TRUE"
8481 AC_SUBST(ENABLE_RELEASE_BUILD)
8483 dnl ===================================================================
8484 dnl Test whether to create MSI with LIMITUI=1 (silent install)
8485 dnl ===================================================================
8486 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
8487 if test "z$enable_silent_msi" = "z" -o "z$enable_silent_msi" = "zno" ; then
8488     AC_MSG_RESULT([no])
8489     ENABLE_SILENT_MSI="FALSE"
8490 else
8491     AC_MSG_RESULT([yes])
8492     ENABLE_SILENT_MSI="TRUE"
8493     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
8495 AC_SUBST(ENABLE_SILENT_MSI)
8497 dnl ===================================================================
8498 dnl Test whether to enable ActiveX embedding
8499 dnl ===================================================================
8500 if test "$_os" = "WINNT"; then
8501     AC_MSG_CHECKING([whether to enable ActiveX embedding of LibreOffice components])
8502     if test "$enable_activex_component" = "yes" -o "$enable_activex_component" = "TRUE" -o "$enable_activex_component" = ""; then
8503         ENABLE_ACTIVEX_COMPONENT="TRUE"
8504         AC_MSG_RESULT([yes])
8505         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
8506     else
8507         ENABLE_ACTIVEX_COMPONENT=""
8508         AC_MSG_RESULT([no])
8509     fi
8510     AC_SUBST(ENABLE_ACTIVEX_COMPONENT)
8511     AC_SUBST(SCPDEFS)
8514 AC_MSG_CHECKING([whether and how to use Xinerama])
8515 if test "$_os" = "Darwin"; then
8516     USE_XINERAMA=YES
8517     XINERAMA_LINK=dynamic
8518     AC_MSG_RESULT([yes])
8519 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
8520     if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then
8521         # we have both versions, let the user decide but use the dynamic one
8522         # per default
8523         USE_XINERAMA=YES
8524         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
8525             XINERAMA_LINK=dynamic
8526         else
8527             XINERAMA_LINK=static
8528         fi
8529     elif test -e "$XLIB/libXinerama.so" -a ! -e "$XLIB/libXinerama.a"; then
8530         # we have only the dynamic version
8531         USE_XINERAMA=YES
8532         XINERAMA_LINK=dynamic
8533     elif test -e "$XLIB/libXinerama.a"; then
8534         # static version
8535         if echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
8536             USE_XINERAMA=YES
8537             XINERAMA_LINK=static
8538         else
8539             USE_XINERAMA=NO
8540             XINERAMA_LINK=none
8541         fi
8542     else
8543         # no Xinerama
8544         USE_XINERAMA=NO
8545         XINERAMA_LINK=none
8546     fi
8547     if test "$USE_XINERAMA" = "YES"; then
8548         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
8549         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
8550             [AC_MSG_ERROR(Xinerama header not found.)], [])
8551         XINERAMA_EXTRA_LIBS="-L$XLIB -lXext"
8552         if test "$_os" = "FreeBSD"; then
8553             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
8554         fi
8555         if test "$_os" = "Linux"; then
8556             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
8557         fi
8558         AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
8559             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
8560     else
8561         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
8562     fi
8563 else
8564     USE_XINERAMA=NO
8565     XINERAMA_LINK=none
8566     AC_MSG_RESULT([no])
8568 AC_SUBST(USE_XINERAMA)
8569 AC_SUBST(XINERAMA_LINK)
8571 dnl ===================================================================
8572 dnl Checks for librsvg
8573 dnl ===================================================================
8575 dnl ENABLE_LIBRSVG is set to "" (for NO), SYSTEM or INTERNAL. The
8576 dnl SYSTEM_LIBRSVG, SYSTEM_GDKPIXBUF etc are redundant.
8578 ENABLE_LIBRSVG=""
8579 LIBRSVG_CFLAGS=""
8580 LIBRSVG_LIBS=""
8582 AC_MSG_CHECKING([what librsvg to use])
8584 case "$enable_librsvg" in
8585 no|disable)
8586     AC_MSG_RESULT([none])
8587     enable_librsvg=no
8588     ;;
8590 ""|yes|auto)
8591     if test $build_os = cygwin -o \
8592            $_os = Darwin; then
8593         dnl When building on/for these OSes always use the internal one,
8594         dnl if at all. Add more OSes above as needed.
8595         AC_MSG_RESULT([internal])
8596         enable_librsvg=internal
8597     elif test  $_os = iOS -o $_os = Android; then
8598         AC_MSG_RESULT([none])
8599         enable_librsvg=no
8600     else
8601         if test "$with_system_libs" = yes; then
8602             AC_MSG_RESULT([system])
8603             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8604             enable_librsvg=system
8605         elif test "$with_system_libs" = no; then
8606             AC_MSG_RESULT([internal])
8607             enable_librsvg=internal
8608         else
8609             AC_MSG_RESULT([checking further])
8610             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14,, [:])
8611             if test -z "$LIBRSVG_PKG_ERRORS"; then
8612                 enable_librsvg=system
8613             else
8614                 enable_librsvg=internal
8615             fi
8616         fi
8617     fi
8618     ;;
8620 internal)
8621     AC_MSG_RESULT([internal])
8622     ;;
8624 system)
8625     if test $_os = WINNT -a "$WITH_MINGW" != yes; then
8626         AC_MSG_ERROR([Must use internal librsvg when building with MSVC])
8627     fi
8628     AC_MSG_RESULT([system])
8629     PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8630     ;;
8633     AC_MSG_ERROR([Incorrect --enable-librsvg option])
8634     ;;
8635 esac
8637 dnl By now enable_librsvg should be "system", "internal" or "no"
8638 case $enable_librsvg in
8639 system)
8640     ENABLE_LIBRSVG=SYSTEM
8641     SYSTEM_LIBRSVG=YES
8642     ;;
8644 internal)
8645     ENABLE_LIBRSVG=INTERNAL
8646     SYSTEM_LIBRSVG=NO
8647     BUILD_TYPE="$BUILD_TYPE LIBRSVG"
8648     ;;
8651     ENABLE_LIBRSVG=NO
8652     SYSTEM_LIBRSVG=NO
8653     ;;
8656     AC_MSG_ERROR([Internal configure script error, invalid enable_librsvg value "$enable_librsvg"])
8657     ;;
8658 esac
8660 AC_SUBST(ENABLE_LIBRSVG)
8661 AC_SUBST(LIBRSVG_CFLAGS)
8662 AC_SUBST(LIBRSVG_LIBS)
8663 AC_SUBST(SYSTEM_LIBRSVG)
8665 dnl ===================================================================
8666 dnl Test whether to build cairo or rely on the system version
8667 dnl ===================================================================
8670 SYSTEM_CAIRO=""
8672 AC_MSG_CHECKING([whether to use the system cairo])
8674 if test "$with_system_cairo" = "yes"; then
8675     SYSTEM_CAIRO=YES
8676     AC_MSG_RESULT([yes])
8678     PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
8680     if test "$test_xrender" = "yes"; then
8681         if test "$with_system_xextensions_headers" != "no"; then
8682             AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
8683             AC_LANG_PUSH([C])
8684             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
8685 #ifdef PictStandardA8
8686 #else
8687       return fail;
8688 #endif
8689 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
8691             AC_LANG_POP([C])
8692         fi
8693     fi
8694     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libfontconfig-1.dll libfreetype-6.dll libpixman-1-0.dll libpng15-15.dll libcairo-2.dll"
8695 else
8696     AC_MSG_RESULT([no])
8698     if test $_os = Android; then
8699         dnl For Android cairo isn't
8700         dnl buildable yet.
8701         :
8702     elif test $_os = WINNT; then
8703         dnl We only need cairo for Windows if we
8704         dnl build librsvg or directx disabled
8705         if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
8706             BUILD_TYPE="$BUILD_TYPE CAIRO"
8707         fi
8708     else
8709         BUILD_TYPE="$BUILD_TYPE CAIRO"
8710     fi
8713 AC_SUBST(SYSTEM_CAIRO)
8714 AC_SUBST(CAIRO_CFLAGS)
8715 AC_SUBST(CAIRO_LIBS)
8718 dnl ===================================================================
8719 dnl Test whether to build gdk-pixbuf or rely on the system version
8720 dnl ===================================================================
8722 AC_MSG_CHECKING([whether to use the system gdk-pixbuf])
8724 dnl As long as the only thing we need gdk-pixbuf 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_GDKPIXBUF=YES
8730     AC_MSG_RESULT([yes])
8731 else
8732     case "$_os" in
8733     WINNT|Darwin|iOS|Android)
8734         SYSTEM_GDKPIXBUF=NO
8735         AC_MSG_RESULT([no])
8736         ;;
8737     *)
8738         SYSTEM_GDKPIXBUF=YES
8739         AC_MSG_RESULT([yes])
8740         ;;
8741     esac
8743 AC_SUBST(SYSTEM_GDKPIXBUF)
8745 dnl ===================================================================
8746 dnl Test whether to build GLib or rely on the system version
8747 dnl ===================================================================
8749 AC_MSG_CHECKING([whether to use the system GLib])
8751 dnl As long as the only thing we need GLib for is below
8752 dnl librsvg, use the same --enable-librsvg (possibly implied
8753 dnl by --with-system-libs) to override this.
8755 if test "$SYSTEM_LIBRSVG" = YES; then
8756     SYSTEM_GLIB=YES
8757     AC_MSG_RESULT([yes])
8758 else
8759     case "$_os" in
8760     WINNT|Darwin|iOS|Android)
8761         SYSTEM_GLIB=NO
8762         AC_MSG_RESULT([no])
8763         ;;
8764     *)
8765         SYSTEM_GLIB=YES
8766         AC_MSG_RESULT([yes])
8767         ;;
8768     esac
8770 AC_SUBST(SYSTEM_GLIB)
8772 dnl ===================================================================
8773 dnl Test whether to build gettext runtime (libintl) or rely on the
8774 dnl system version
8775 dnl ===================================================================
8777 AC_MSG_CHECKING([whether to use the system gettext runtime])
8779 if test "$with_system_gettext" = yes; then
8780     SYSTEM_GETTEXT=YES
8781     AC_MSG_RESULT([yes])
8782 else
8783     case "$_os" in
8784     WINNT|Darwin|iOS|Android)
8785         SYSTEM_GETTEXT=NO
8786         AC_MSG_RESULT([no])
8787         ;;
8788     *)
8789         SYSTEM_GETTEXT=YES
8790         AC_MSG_RESULT([yes])
8791         ;;
8792     esac
8794 AC_SUBST(SYSTEM_GETTEXT)
8796 dnl ===================================================================
8797 dnl Test whether to build libcroco or rely on the system version
8798 dnl ===================================================================
8800 AC_MSG_CHECKING([whether to use the system libcroco])
8802 dnl As long as the only thing we need libcroco for is below
8803 dnl librsvg, use the same --enable-librsvg (possibly implied
8804 dnl by --with-system-libs) to override this.
8806 if test "$SYSTEM_LIBRSVG" = YES; then
8807     SYSTEM_LIBCROCO=YES
8808     AC_MSG_RESULT([yes])
8809 else
8810     case "$_os" in
8811     WINNT|Darwin|iOS|Android)
8812         SYSTEM_LIBCROCO=NO
8813         AC_MSG_RESULT([no])
8814         ;;
8815     *)
8816         SYSTEM_LIBCROCO=YES
8817         AC_MSG_RESULT([yes])
8818         ;;
8819     esac
8821 AC_SUBST(SYSTEM_LIBCROCO)
8823 dnl ===================================================================
8824 dnl Test whether to build Pango or rely on the system version
8825 dnl ===================================================================
8827 AC_MSG_CHECKING([whether to use the system pango])
8829 dnl As long as the only thing we need Pango for is below
8830 dnl librsvg, use the same --enable-librsvg (possibly implied
8831 dnl by --with-system-libs) to override this.
8833 if test "$SYSTEM_LIBRSVG" = YES; then
8834     SYSTEM_PANGO=YES
8835     AC_MSG_RESULT([yes])
8836 else
8837     case "$_os" in
8838     WINNT|Darwin|iOS|Android)
8839         SYSTEM_PANGO=NO
8840         AC_MSG_RESULT([no])
8841         ;;
8842     *)
8843         SYSTEM_PANGO=YES
8844         AC_MSG_RESULT([yes])
8845         ;;
8846     esac
8848 AC_SUBST(SYSTEM_PANGO)
8850 dnl ===================================================================
8851 dnl Test whether to build libgsf or rely on the system version
8852 dnl ===================================================================
8854 AC_MSG_CHECKING([whether to use the system libgsf])
8856 dnl As long as the only thing we need libgsf for is below librsvg (is
8857 dnl it?), use the same --enable-librsvg (possibly implied by
8858 dnl --with-system-libs) to override this.
8860 if test "$SYSTEM_LIBRSVG" = YES; then
8861     SYSTEM_LIBGSF=YES
8862     AC_MSG_RESULT([yes])
8863 else
8864     case "$_os" in
8865     WINNT|Darwin|iOS|Android)
8866         SYSTEM_LIBGSF=NO
8867         AC_MSG_RESULT([no])
8868         ;;
8869     *)
8870         SYSTEM_LIBGSF=YES
8871         AC_MSG_RESULT([yes])
8872         ;;
8873     esac
8875 AC_SUBST(SYSTEM_LIBGSF)
8877 dnl ===================================================================
8878 dnl Test whether to build libpng or rely on the system version
8879 dnl ===================================================================
8881 AC_MSG_CHECKING([whether to use the system libpng])
8883 dnl How should and does this interact with the checks for libpng
8884 dnl related to use of libpng in the quickstarter above? This needs to
8885 dnl be unified.
8887 if test "$with_system_libpng" = yes; then
8888     SYSTEM_LIBPNG=YES
8889     AC_MSG_RESULT([yes])
8890 else
8891     case "$_os" in
8892     WINNT|Darwin|iOS|Android)
8893         SYSTEM_LIBPNG=NO
8894         AC_MSG_RESULT([no])
8895         ;;
8896     *)
8897         SYSTEM_LIBPNG=YES
8898         AC_MSG_RESULT([no])
8899         ;;
8900     esac
8902 AC_SUBST(SYSTEM_LIBPNG)
8904 dnl ===================================================================
8905 dnl Test whether to build libjpeg or rely on the system version
8906 dnl ===================================================================
8907 dnl FIXME: this is currently because we have jpeg-6b for our filters
8908 dnl        and jpeg-8 as dependency for librsvg
8909 dnl        this should be unified into using only one version for both
8911 AC_MSG_CHECKING([whether to use the system libjpeg])
8913 if test "$SYSTEM_JPEG" == "YES"; then
8914     SYSTEM_LIBJPEG=YES
8915     AC_MSG_RESULT([yes])
8916 else
8917     case "$_os" in
8918     WINNT|Darwin|iOS|Android)
8919         SYSTEM_LIBJPEG=NO
8920         AC_MSG_RESULT([no])
8921         ;;
8922     *)
8923         SYSTEM_LIBJPEG=YES
8924         AC_MSG_RESULT([yes])
8925         ;;
8926     esac
8928 AC_SUBST(SYSTEM_LIBJPEG)
8930 dnl ===================================================================
8931 dnl Check for runtime JVM search path
8932 dnl ===================================================================
8933 if test "$SOLAR_JAVA" != ""; then
8934     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
8935     if test -n "$with_jvm_path" && test "$with_jvm_path" != "no"; then
8936         AC_MSG_RESULT([yes])
8937         if ! test -d "$with_jvm_path"; then
8938             AC_MSG_ERROR(["$with_jvm_path" not a directory])
8939         fi
8940         if ! test -d "$with_jvm_path"jvm; then
8941             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
8942         fi
8943         JVM_ONE_PATH_CHECK="$with_jvm_path"
8944         AC_SUBST(JVM_ONE_PATH_CHECK)
8945     else
8946         AC_MSG_RESULT([no])
8947     fi
8950 dnl ===================================================================
8951 dnl Test for the presence of Ant and that it works
8952 dnl ===================================================================
8954 if test "$SOLAR_JAVA" != ""; then
8955     ANT_HOME=; export ANT_HOME
8956     WITH_ANT_HOME=; export WITH_ANT_HOME
8957     if test -z "$with_ant_home"; then
8958         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
8959     else
8960         if test "$_os" = "WINNT"; then
8961             with_ant_home=`cygpath -u "$with_ant_home"`
8962         fi
8963         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
8964         WITH_ANT_HOME=$with_ant_home
8965         ANT_HOME=$with_ant_home
8966     fi
8968     if test -z "$ANT"; then
8969         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
8970     else
8971         # resolve relative or absolute symlink
8972         while test -h "$ANT"; do
8973             a_cwd=`pwd`
8974             a_basename=`basename "$ANT"`
8975             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
8976             cd "`dirname "$ANT"`"
8977             cd "`dirname "$a_script"`"
8978             ANT="`pwd`"/"`basename "$a_script"`"
8979             cd "$a_cwd"
8980         done
8982         AC_MSG_CHECKING([if $ANT works])
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">
8994             <javac srcdir="." includes="conftest.java">
8995             </javac>
8996         </target>
8997         </project>
9000         oldJAVA_HOME=$JAVA_HOME
9001         if test "$JAVACISGCJ" = "yes"; then
9002             JAVA_HOME=; export JAVA_HOME
9003             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
9004         else
9005             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
9006         fi
9007         AC_TRY_EVAL(ant_cmd)
9008         if test $? = 0 && test -f ./conftest.class ; then
9009             AC_MSG_RESULT([Ant works])
9010             if test -z "$WITH_ANT_HOME"; then
9011                 ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
9012                 if test -z "$ANT_HOME"; then
9013                     ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
9014                 fi
9015             else
9016                 ANT_HOME="$WITH_ANT_HOME"
9017             fi
9018         else
9019             echo "configure: Ant test failed" >&5
9020             cat conftest.java >&5
9021             cat conftest.xml >&5
9022             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
9023             ANT_HOME=""
9024             echo "Ant does not work - Some Java projects will not build!" >>warn
9025         fi
9026         JAVA_HOME=$oldJAVA_HOME
9027         rm -f conftest* core core.* *.core
9028     fi
9029     if test -z "$ANT_HOME"; then
9030         ANT_HOME="NO_ANT_HOME"
9031     fi
9032     AC_SUBST(ANT_HOME)
9034     dnl Checking for ant.jar
9035     if test "$ANT_HOME" != "NO_ANT_HOME"; then
9036         AC_MSG_CHECKING([Ant lib directory])
9037         if test -f $ANT_HOME/lib/ant.jar; then
9038             ANT_LIB="$ANT_HOME/lib"
9039         else
9040             if test -f $ANT_HOME/ant.jar; then
9041                 ANT_LIB="$ANT_HOME"
9042             else
9043                 if test -f /usr/share/java/ant.jar; then
9044                     ANT_LIB=/usr/share/java
9045                 else
9046                     if test -f /usr/share/ant-core/lib/ant.jar; then
9047                         ANT_LIB=/usr/share/ant-core/lib
9048                     else
9049                         if test -f $ANT_HOME/lib/ant/ant.jar; then
9050                             ANT_LIB="$ANT_HOME/lib/ant"
9051                         else
9052                             if test -f /usr/share/lib/ant/ant.jar; then
9053                                 ANT_LIB=/usr/share/lib/ant
9054                             else
9055                                 AC_MSG_ERROR([Ant libraries not found!])
9056                             fi
9057                         fi
9058                     fi
9059                 fi
9060             fi
9061         fi
9062         AC_MSG_RESULT([Ant lib directory found.])
9063     fi
9064     AC_SUBST(ANT_LIB)
9066     ant_minver=1.6.0
9067     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
9069     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
9070     ant_version=`$ANT -version | $AWK '{ print $4; }'`
9071     ant_version_major=`echo $ant_version | cut -d. -f1`
9072     ant_version_minor=`echo $ant_version | cut -d. -f2`
9073     echo "configure: ant_version $ant_version " >&5
9074     echo "configure: ant_version_major $ant_version_major " >&5
9075     echo "configure: ant_version_minor $ant_version_minor " >&5
9076     if test "$ant_version_major" -ge "2"; then
9077         AC_MSG_RESULT([yes, $ant_version])
9078     elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
9079         AC_MSG_RESULT([yes, $ant_version])
9080     else
9081         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
9082     fi
9084     if test "$ENABLE_MEDIAWIKI" = "YES"; then
9085         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
9086         rm -rf confdir
9087         mkdir confdir
9088         cat > conftest.java << EOF
9089             public class conftest {
9090                 int testmethod(int a, int b) {
9091                     return a + b;
9092                 }
9093             }
9096         cat > conftest.xml << EOF
9097             <project name="conftest" default="conftest">
9098             <target name="conftest" depends="copytest">
9099                 <javac srcdir="." includes="conftest.java">
9100                 </javac>
9101             </target>
9102             <target name="copytest">
9103                  <copy todir="confdir">
9104                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
9105                  <filterset/>
9106                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
9107                  </copy>
9108             </target>
9109             </project>
9112         if test "$JAVACISGCJ" = "yes"; then
9113             JAVA_HOME=; export JAVA_HOME
9114             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
9115         else
9116             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
9117         fi
9118         AC_TRY_EVAL(ant_cmd)
9119         if test $? = 0 && test -f ./conftest.class ; then
9120             AC_MSG_RESULT([yes])
9121             rm -rf confdir
9122         else
9123             echo "configure: Ant test failed" >&5
9124             cat conftest.java >&5
9125             cat conftest.xml >&5
9126             rm -rf confdir
9127             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
9128         fi
9129     fi
9130     rm -f conftest* core core.* *.core
9133 OOO_JUNIT_JAR=
9134 if test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
9135     AC_MSG_CHECKING([for JUnit 4])
9136     if test "$with_junit" = "yes"; then
9137         if test -e /usr/share/java/junit4.jar; then
9138             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
9139         else
9140            if test -e /usr/share/lib/java/junit.jar; then
9141               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
9142            else
9143               OOO_JUNIT_JAR=/usr/share/java/junit.jar
9144            fi
9145         fi
9146     else
9147         OOO_JUNIT_JAR=$with_junit
9148     fi
9149     if test "$_os" = "WINNT"; then
9150         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
9151     fi
9152     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
9153         grep org/junit/Before.class > /dev/null 2>&5
9154     if test $? -eq 0; then
9155         # check if either class-path entry is available for hamcrest or
9156         # it's bundled
9157         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |grep -q hamcrest || \
9158             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |grep -q 'Class-Path: hamcrest'; then
9159             AC_MSG_RESULT([$OOO_JUNIT_JAR])
9160         else
9161             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
9162 provide a full junit jar or use --without-junit])
9163         fi
9164     else
9165         AC_MSG_RESULT([no])
9166         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
9167 location (/usr/share/java), specify its pathname via
9168 --with-junit=..., or disable it via --without-junit])
9169     fi
9171 AC_SUBST(OOO_JUNIT_JAR)
9173 dnl ===================================================================
9174 dnl Product version
9175 dnl ===================================================================
9176 AC_MSG_CHECKING([for product version])
9177 PRODUCTVERSION=AC_PACKAGE_VERSION
9178 AC_MSG_RESULT([$PRODUCTVERSION])
9179 AC_SUBST(PRODUCTVERSION)
9181 dnl ===================================================================
9182 dnl Dealing with l10n options
9183 dnl ===================================================================
9184 AC_MSG_CHECKING([which languages to be built])
9185 # get list of all languages
9186 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
9187 # the sed command does the following:
9188 #   + if a line ends with a backslash, append the next line to it
9189 #   + adds " on the beginning of the value (after =)
9190 #   + adds " at the end of the value
9191 #   + removes en-US; we want to put it on the beginning
9192 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
9193 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
9194 ALL_LANGS="en-US $completelangiso"
9195 # check the configured localizations
9196 WITH_LANG="$with_lang"
9197 if test -z "$WITH_LANG"; then
9198     AC_MSG_RESULT([en-US])
9199 else
9200     AC_MSG_RESULT([$WITH_LANG])
9201     GIT_REPO_NAMES="$GIT_REPO_NAMES translations"
9203 # check that the list is valid
9204 for lang in $WITH_LANG ; do
9205     test "$lang" = "ALL" && continue;
9206     # need to check for the exact string, so add space before and after the list of all languages
9207     for vl in $ALL_LANGS ; do
9208         if test "$vl" = "$lang" ; then
9209            break;
9210         fi
9211     done
9212     if test "$vl" != "$lang" ; then
9213         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
9214     fi
9215 done
9216 # list with substituted ALL
9217 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
9218 # this variable is used only by bin/distro-install-* helper scripts
9219 # they need a real list of languages
9220 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
9221 AC_SUBST(ALL_LANGS)
9222 AC_SUBST(WITH_LANG)
9223 AC_SUBST(WITH_LANG_LIST)
9224 AC_SUBST(GIT_REPO_NAMES)
9226 dnl git-new-workdir
9227 dnl ===================================================================
9228 if test -n "${GIT_LINK_SRC}"; then
9229     for repo in ${GIT_REPO_NAMES}; do
9230         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
9231             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
9232         fi
9233     done
9235 AC_SUBST(GIT_LINK_SRC)
9237 AC_MSG_CHECKING([for custom 'intro' progress bar color])
9238 PROGRESSBARCOLOR=
9239 if test -z "$with_intro_progressbar_color" ; then
9240    PROGRESSBARCOLOR="126,170,23"
9241    AC_MSG_RESULT([none])
9242 else
9243    PROGRESSBARCOLOR="$with_intro_progressbar_color"
9244    AC_MSG_RESULT([$PROGRESSBARCOLOR])
9246 AC_SUBST(PROGRESSBARCOLOR)
9248 AC_MSG_CHECKING([for custom 'intro' progress bar size])
9249 PROGRESSSIZE=
9250 if test -z "$with_intro_progressbar_size" ; then
9251    PROGRESSSIZE="319,10"
9252    AC_MSG_RESULT([none])
9253 else
9254    PROGRESSSIZE="$with_intro_progressbar_size"
9255    AC_MSG_RESULT([$PROGRESSSIZE])
9257 AC_SUBST(PROGRESSSIZE)
9259 AC_MSG_CHECKING([for custom 'intro' progress bar position])
9260 PROGRESSPOSITION=
9261 if test -z "$with_intro_progressbar_position" ; then
9262    PROGRESSPOSITION="164,225"
9263    AC_MSG_RESULT([none])
9264 else
9265    PROGRESSPOSITION="$with_intro_progressbar_position"
9266    AC_MSG_RESULT([$PROGRESSPOSITION])
9268 AC_SUBST(PROGRESSPOSITION)
9270 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
9271 PROGRESSFRAMECOLOR=
9272 if test -z "$with_intro_progressbar_frame_color" ; then
9273    PROGRESSFRAMECOLOR="207,208,211"
9274    AC_MSG_RESULT([none])
9275 else
9276    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
9277    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
9279 AC_SUBST(PROGRESSFRAMECOLOR)
9281 AC_MSG_CHECKING([for alternative branding images directory])
9282 INTRO_BITMAP=
9283 ABOUT_BITMAP=
9284 STARTCENTER_LEFT_BITMAP=
9285 STARTCENTER_RIGHT_BITMAP=
9286 STARTCENTER_RTL_LEFT_BITMAP=
9287 STARTCENTER_RTL_RIGHT_BITMAP=
9288 STARTCENTER_SPACE_BITMAP=
9289 if test -z "$with_branding" -o "$with_branding" = "no" ; then
9290     AC_MSG_RESULT([none])
9291 else
9292     INTRO_BITMAP="$with_branding/intro.png"
9293     ABOUT_BITMAP="$with_branding/about.png"
9294     STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
9295     STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
9296     STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
9297     STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
9298     STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
9299     for i in $INTRO_BITMAP \
9300              $ABOUT_BITMAP \
9301              $STARTCENTER_LEFT_BITMAP \
9302              $STARTCENTER_RIGHT_BITMAP \
9303              $STARTCENTER_RTL_LEFT_BITMAP \
9304              $STARTCENTER_RTL_RIGHT_BITMAP \
9305              $STARTCENTER_SPACE_BITMAP; do
9306         if test ! -f $i; then
9307             AC_MSG_WARN([Required file $i does not exist!])
9308         fi
9309     done
9310     AC_MSG_RESULT([$with_branding])
9313 AC_MSG_CHECKING([for yet another 'intro' bitmap])
9314 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no" ; then
9315     if test "$with_intro_bitmap" = "no" ; then
9316         INTRO_BITMAP=
9317     fi
9318     AC_MSG_RESULT([none])
9319 else
9320     case "$with_intro_bitmap" in
9321     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
9322     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
9323     esac
9324     AC_MSG_RESULT([$INTRO_BITMAP])
9326 AC_SUBST(INTRO_BITMAP)
9328 AC_MSG_CHECKING([for yet another 'about' bitmap])
9329 if test -z "$with_about_bitmap" -o "$with_about_bitmap" = "no" ; then
9330     if test "$with_about_bitmap" = "no" ; then
9331         ABOUT_BITMAP=
9332     fi
9333     AC_MSG_RESULT([none])
9334 else
9335    case "$with_about_bitmap" in
9336    *.png) ABOUT_BITMAP="$with_about_bitmap" ;;
9337    *)     AC_MSG_WARN([About bitmap should be a .png file!]) ;;
9338    esac
9339    AC_MSG_RESULT([$ABOUT_BITMAP])
9341 AC_SUBST(ABOUT_BITMAP)
9343 AC_MSG_CHECKING([for yet another 'start center left' bitmap])
9344 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no" ; then
9345    if test "$with_startcenter_left_bitmap" = "no" ; then
9346       STARTCENTER_LEFT_BITMAP=
9347    fi
9348    AC_MSG_RESULT([none])
9349 else
9350    case "$with_startcenter_left_bitmap" in
9351       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
9352       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9353    esac
9354    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
9356 AC_SUBST(STARTCENTER_LEFT_BITMAP)
9358 AC_MSG_CHECKING([for yet another 'start center right' bitmap])
9359 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no" ; then
9360    if test "$with_startcenter_right_bitmap" = "no" ; then
9361       STARTCENTER_RIGHT_BITMAP=
9362    fi
9363    AC_MSG_RESULT([none])
9364 else
9365    case "$with_startcenter_right_bitmap" in
9366       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
9367       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
9368    esac
9369    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
9371 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
9373 AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
9374 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no" ; then
9375    if test "$with_startcenter_rtl_left_bitmap" = "no" ; then
9376       STARTCENTER_RTL_LEFT_BITMAP=
9377    fi
9378    AC_MSG_RESULT([none])
9379 else
9380    case "$with_startcenter_rtl_left_bitmap" in
9381       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
9382       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
9383    esac
9384    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
9386 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
9388 AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
9389 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no" ; then
9390    if test "$with_startcenter_rtl_right_bitmap" = "no" ; then
9391       STARTCENTER_RTL_RIGHT_BITMAP=
9392    fi
9393    AC_MSG_RESULT([none])
9394 else
9395    case "$with_startcenter_rtl_right_bitmap" in
9396       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
9397       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
9398    esac
9399    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
9401 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
9403 AC_MSG_CHECKING([for yet another 'start center space' bitmap])
9404 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no" ; then
9405    if test "$with_startcenter_space_bitmap" = "no" ; then
9406       STARTCENTER_SPACE_BITMAP=
9407    fi
9408    AC_MSG_RESULT([none])
9409 else
9410    case "$with_startcenter_space_bitmap" in
9411       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
9412       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9413    esac
9414    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
9416 AC_SUBST(STARTCENTER_SPACE_BITMAP)
9418 OOO_VENDOR=
9419 AC_MSG_CHECKING([for vendor])
9420 if test -z "$with_vendor" -o "$with_vendor" = "no" ; then
9421     AC_MSG_RESULT([not set])
9422 else
9423     OOO_VENDOR="$with_vendor"
9424     AC_MSG_RESULT([$OOO_VENDOR])
9426 AC_SUBST(OOO_VENDOR)
9428 UNIXWRAPPERNAME=
9429 AC_MSG_CHECKING([for UNIX wrapper name])
9430 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes" ; then
9431     AC_MSG_RESULT([not set])
9432 else
9433     UNIXWRAPPERNAME="$with_unix_wrapper"
9434     AC_MSG_RESULT([$UNIXWRAPPERNAME])
9436 AC_SUBST(UNIXWRAPPERNAME)
9438 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
9439 if test "$with_compat_oowrappers" = "yes" ; then
9440     WITH_COMPAT_OOWRAPPERS=YES
9441     AC_MSG_RESULT(yes)
9442 else
9443     WITH_COMPAT_OOWRAPPERS=
9444     AC_MSG_RESULT(no)
9446 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
9448 AC_MSG_CHECKING([for product name])
9449 PRODUCTNAME=AC_PACKAGE_NAME
9450 AC_MSG_RESULT([$PRODUCTNAME])
9451 AC_SUBST(PRODUCTNAME)
9453 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
9454 AC_MSG_CHECKING([for install dirname])
9455 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes" ; then
9456    INSTALLDIRNAME="$with_install_dirname"
9458 AC_MSG_RESULT([$INSTALLDIRNAME])
9459 AC_SUBST(INSTALLDIRNAME)
9461 AC_MSG_CHECKING([for prefix])
9462 test "x$prefix" = xNONE && prefix=$ac_default_prefix
9463 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
9464 PREFIXDIR="$prefix"
9465 AC_MSG_RESULT([$PREFIXDIR])
9466 AC_SUBST(PREFIXDIR)
9468 AC_MSG_CHECKING([for libdir])
9469 LIBDIR=[$(eval echo $(eval echo $libdir))]
9470 AC_MSG_RESULT([$LIBDIR])
9471 AC_SUBST(LIBDIR)
9473 AC_MSG_CHECKING([for data dir])
9474 DATADIR=[$(eval echo $(eval echo $datadir))]
9475 AC_MSG_RESULT([$DATADIR])
9476 AC_SUBST(DATADIR)
9478 AC_MSG_CHECKING([for man dir])
9479 MANDIR=[$(eval echo $(eval echo $mandir))]
9480 AC_MSG_RESULT([$MANDIR])
9481 AC_SUBST(MANDIR)
9483 AC_MSG_CHECKING([for doc dir])
9484 DOCDIR=[$(eval echo $(eval echo $docdir))]
9485 AC_MSG_RESULT([$DOCDIR])
9486 AC_SUBST(DOCDIR)
9488 AC_MSG_CHECKING([for install dir])
9489 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
9490 AC_MSG_RESULT([$INSTALLDIR])
9491 AC_SUBST(INSTALLDIR)
9493 AC_MSG_CHECKING([whether to statically link to Gtk])
9494 if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
9495     ENABLE_STATIC_GTK="TRUE"
9496     AC_MSG_RESULT([yes])
9497 else
9498     ENABLE_STATIC_GTK="FALSE"
9499     AC_MSG_RESULT([no])
9501 AC_SUBST(ENABLE_STATIC_GTK)
9503 # ===================================================================
9504 # De- or increase default verbosity of build process
9505 # ===================================================================
9506 AC_MSG_CHECKING([build verbosity])
9507 if test -n "$enable_verbose"; then
9508     if test "$enable_verbose" = "yes"; then
9509         VERBOSE="TRUE"
9510         AC_MSG_RESULT([high])
9511     fi
9512     if test "$enable_verbose" = "no"; then
9513         VERBOSE="FALSE"
9514         AC_MSG_RESULT([low])
9515     fi
9516 else
9517     AC_MSG_RESULT([not set])
9519 AC_SUBST(VERBOSE)
9521 dnl ===================================================================
9522 dnl Use zenity during build
9523 dnl ===================================================================
9524 AC_MSG_CHECKING([whether to use zenity during build])
9525 if test "$enable_zenity" = "yes"; then
9526     AC_MSG_RESULT([yes])
9527     AC_PATH_PROGS( ZNTY, zenity )
9528     if test -z "$ZNTY"; then
9529         ENABLE_ZENITY=FALSE
9530     else
9531         ENABLE_ZENITY=TRUE
9532     fi
9533 else
9534     ENABLE_ZENITY=FALSE
9535     AC_MSG_RESULT([no])
9537 AC_SUBST(ENABLE_ZENITY)
9540 dnl ===================================================================
9541 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
9542 dnl --enable-dependency-tracking configure option
9543 dnl ===================================================================
9544 AC_MSG_CHECKING([whether to enable dependency tracking])
9545 if test "$enable_dependency_tracking" = "no"; then
9546     nodep=TRUE
9547     AC_MSG_RESULT([no])
9548 else
9549     AC_MSG_RESULT([yes])
9551 AC_SUBST(nodep)
9553 dnl ===================================================================
9554 dnl Number of CPUs to use during the build
9555 dnl ===================================================================
9556 AC_MSG_CHECKING([for number of processors to use])
9557 if test -n "$with_num_cpus"; then
9558     BUILD_NCPUS=$with_num_cpus
9559 else
9560     case `uname -s` in
9562     Darwin|FreeBSD|NetBSD|OpenBSD)
9563         BUILD_NCPUS=`sysctl -n hw.ncpu`
9564         ;;
9566     Linux)
9567         BUILD_NCPUS=`getconf _NPROCESSORS_ONLN`
9568         ;;
9569     # what else than above does profit here *and* has /proc?
9570     *)
9571         BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
9572         ;;
9573     esac
9575     # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
9576     # unexpected format, 'wc -l' will have returned 0.
9577     if test "$BUILD_NCPUS" -eq 0; then
9578         BUILD_NCPUS=1
9579     fi
9581 AC_MSG_RESULT([$BUILD_NCPUS])
9582 AC_SUBST(BUILD_NCPUS)
9584 # ===================================================================
9585 # Creating bigger shared library to link against
9586 # ===================================================================
9587 AC_MSG_CHECKING([whether to create a big library for better performance])
9588 MERGELIBS=
9589 if test "$enable_mergelibs" = "yes"; then
9590     MERGELIBS="TRUE"
9591     AC_MSG_RESULT([yes])
9592 else
9593     AC_MSG_RESULT([no])
9595 AC_SUBST(MERGELIBS)
9597 dnl ===================================================================
9598 dnl Number of parallel jobs to be executed by dmake
9599 dnl ===================================================================
9600 AC_MSG_CHECKING([for maximum of jobs per processor])
9601 BUILD_MAX_JOBS="1"
9602 if test "z$with_max_jobs" != "z"; then
9603     BUILD_MAX_JOBS="$with_max_jobs"
9604 else
9605     if test "$enable_icecream" = "yes" ; then
9606         BUILD_MAX_JOBS="10"
9607     fi
9609 AC_MSG_RESULT([$BUILD_MAX_JOBS])
9610 AC_SUBST(BUILD_MAX_JOBS)
9612 # =====================================================================
9613 # determine the parallelism for gnu make
9614 # =====================================================================
9615 AC_MSG_CHECKING([for maximum parallelism for gmake])
9616 if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS ; then
9617     GMAKE_PARALLELISM="$BUILD_MAX_JOBS"
9618 else
9619     GMAKE_PARALLELISM="$BUILD_NCPUS"
9621 GMAKE_MODULE_PARALLELISM="$BUILD_MAX_JOBS"
9622 if test "$no_parallelism_make" = "YES" ; then
9623     if test -z "$with_num_cpus"; then
9624         GMAKE_PARALLELISM="1";
9625         if test $GMAKE_MODULE_PARALLELISM -gt 1 ; then
9626             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
9627             if test -z "$with_num_cpus"; then
9628                 echo "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this." >> warn
9629             fi
9630             GMAKE_MODULE_PARALLELISM="1"
9631         fi
9632     else
9633         GMAKE_PARALLELISM="$BUILD_NCPUS";
9634         echo "make 3.81 is prone to crashes with parallelism > 1. Since --with-num-cpus was explicitly given, it is honored, but do not complain when make segfault on you." >> warn
9635     fi
9638 # GMAKE_PARALLELISM is used in tail_build
9639 # GMAKE_MODULE_PARALLELISM is used when building individual gbuildified module
9640 AC_MSG_RESULT([per module:$GMAKE_MODULE_PARALLELISM, for tail_build:$GMAKE_PARALLELISM])
9641 AC_SUBST(GMAKE_PARALLELISM)
9642 AC_SUBST(GMAKE_MODULE_PARALLELISM)
9644 dnl ===================================================================
9645 dnl Setting up the environment.
9646 dnl ===================================================================
9647 echo "setting up the build environment variables..."
9649 if test -z "$COMPATH"; then
9650     AC_MSG_ERROR([No compiler found.])
9652 AC_SUBST(COMPATH)
9654 AC_MSG_CHECKING([solver path])
9655 if test -z "$with_local_solver"; then
9656     LOCAL_SOLVER="DEFAULT"
9657     AC_MSG_RESULT([default])
9658 else
9659     LOCAL_SOLVER=$with_local_solver
9660     AC_MSG_RESULT([$with_local_solver])
9662 AC_SUBST(LOCAL_SOLVER)
9664 AC_SUBST(BUILD_TYPE)
9666 if test "$WITH_MINGW" != "yes" ; then
9667     MINGW_EXTERNAL_DLLS=
9668 else
9669     mingw_dlldir=`$CC -print-sysroot`/mingw/bin
9670     for DLL in $MINGW_EXTERNAL_DLLS ; do
9671         AC_MSG_CHECKING([for $DLL])
9672         if ! test -f "$mingw_dlldir/$DLL" ; then
9673             AC_MSG_ERROR([Could not find $DLL, install the appropriate mingw32-<package>, not only mingw32-<package>-devel.])
9674         fi
9675         AC_MSG_RESULT([$mingw_dlldir/$DLL])
9676     done
9678 AC_SUBST(MINGW_EXTERNAL_DLLS)
9680 # make sure config.guess is +x; we execute config.guess, so it has to be so;
9681 chmod +x ./config.guess
9683 dnl Setting up the post_download check script
9684 dnl Using autoconf here, so that the migration from the previous state
9685 dnl (checks for the additional Windows downloads were directly in
9686 dnl configure.in) is as easy as possible
9687 echo "setting up the post_download check script"
9688 autoconf post_download.in > post_download
9689 chmod +x post_download
9691 # Generate a configuration timestamp we can use for deps
9692 if test -f set_soenv; then
9693     mv -f set_soenv set_soenv.last
9694 else
9695     echo > set_soenv.last
9698 AC_CONFIG_FILES([ooo.lst set_soenv bin/repo-list desktop/scripts/soffice.sh build_env])
9699 AC_OUTPUT
9701 # make sure this is executable
9702 chmod +x desktop/scripts/soffice.sh
9704 # touch the config timestamp file set_soenv.stamp
9705 if test ! -f set_soenv.stamp; then
9706     echo > set_soenv.stamp
9707 elif diff set_soenv set_soenv.last >/dev/null 2>&1; then
9708     echo "Configuration unchanged - avoiding scp2 stamp update"
9709 else
9710     echo > set_soenv.stamp
9713 dnl Run the set_soenv script to setup the Env.Host.sh script that sets
9714 dnl environment variables for the build.
9715 chmod +x set_soenv
9717 ./set_soenv
9719 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: