fix smoketest linkage
[LibreOffice.git] / configure.in
blob6052587e70d833720d505dc3e5b74aee9870cb5e
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 ###############################################################################
9 # Extensions switches --enable/--disable
10 ###############################################################################
11 # By default these should be enabled unless having extra dependencies.
12 # If there is extra dependency over configure options then the enable should
13 # be automagic based on wether the requiring feature is enabled or not.
14 # All this options change anything only with --enable-extension-integration.
15 AC_ARG_ENABLE(extension-integration,
16     AS_HELP_STRING([--disable-extension-integration],
17         [Disable integration of the builded extensions to the installer of the
18          product. Use this switch to disable the integration.])
21 AC_ARG_ENABLE(ext-barcode,
22     AS_HELP_STRING([--enable-ext-barcode],
23         [Enable the Barcode extension.])
26 AC_ARG_ENABLE(ext-diagram,
27     AS_HELP_STRING([--enable-ext-diagram],
28         [Enable the SmART Gallery (Diagram) extension.])
31 AC_ARG_ENABLE(ext-google-docs,
32     AS_HELP_STRING([--enable-ext-google-docs],
33         [Enable the Google Documents extension.])
36 AC_ARG_ENABLE(ext-hunart,
37     AS_HELP_STRING([--enable-ext-hunart],
38         [Enable the Hungarian Cross-reference Toolbar extension.])
41 AC_ARG_ENABLE(ext-languagetool,
42     AS_HELP_STRING([--enable-ext-languagetool],
43         [Enable the LanguageTool extension.])
46 AC_ARG_ENABLE(ext-lightproof,
47     AS_HELP_STRING([--enable-ext-lightproof],
48         [Enable the Lightproof extension. The enable switch can contain only
49          the desired languages: --enable-lightproof="en hu ru"]),
50     [enable_ext_lightproof="$enableval"],
51     [enable_ext_lightproof=no]
54 AC_ARG_ENABLE(ext-mysql-connector,
55     AS_HELP_STRING([--enable-ext-mysql-connector],
56         [Enable the build of the MySQL Connector extension.])
59 AC_ARG_ENABLE(ext-nlpsolver,
60     AS_HELP_STRING([--enable-ext-nlpsolver],
61         [Enable the NLPSolver extension.])
64 AC_ARG_ENABLE(ext-ct2n,
65     AS_HELP_STRING([--enable-ext-ct2n],
66         [Enable the ConvertTextToNumber extension.])
69 AC_ARG_ENABLE(ext-numbertext,
70     AS_HELP_STRING([--enable-ext-numbertext],
71         [Enable the Numbertext extension.])
74 AC_ARG_ENABLE(ext-oooblogger,
75     AS_HELP_STRING([--enable-ext-oooblogger],
76         [Enable the OOo Blogger extension.])
79 AC_ARG_ENABLE(ext-pdfimport,
80     AS_HELP_STRING([--disable-ext-pdfimport],
81         [Disable the PDF Import extension.])
84 AC_ARG_ENABLE(ext-presenter-console,
85     AS_HELP_STRING([--disable-ext-presenter-console],
86         [Disable the Presenter Console extension.])
89 AC_ARG_ENABLE(ext-presenter-minimizer,
90     AS_HELP_STRING([--disable-ext-presenter-minimizer],
91         [Disable the Presentation Minimizer extension.])
94 AC_ARG_ENABLE(ext-report-builder,
95     AS_HELP_STRING([--disable-ext-report-builder],
96         [Disable the Report Builder extension.])
99 AC_ARG_ENABLE(ext-scripting-beanshell,
100     AS_HELP_STRING([--enable-ext-scripting-beanshell],
101         [Enable support for scripts in BeanShell.])
104 AC_ARG_ENABLE(ext-scripting-javascript,
105     AS_HELP_STRING([--enable-ext-scripting-javascript],
106         [Enable support for scripts in JavaScript.])
109 AC_ARG_ENABLE(ext-typo,
110     AS_HELP_STRING([--enable-ext-typo],
111         [Enable the Typography Toolbar extension.])
114 AC_ARG_ENABLE(ext-validator,
115     AS_HELP_STRING([--enable-ext-validator],
116         [Enable the Validator extension.])
119 AC_ARG_ENABLE(ext-watch-window,
120     AS_HELP_STRING([--enable-ext-watch-window],
121         [Enable the Watch Window extension to Calc.])
124 AC_ARG_ENABLE(ext-wiki-publisher,
125     AS_HELP_STRING([--enable-ext-wiki-publisher],
126         [Enable the Wiki Publisher extension.])
128 ###############################################################################
130 dnl ---------- *** ----------
132 AC_ARG_ENABLE(mergelibs,
133     AS_HELP_STRING([--enable-mergelibs],
134         [Enables linking of big merged library used for better performance.])
137 AC_ARG_ENABLE(graphite,
138     AS_HELP_STRING([--enable-graphite],
139         [Enables the compilation of Graphite smart font rendering.])
142 AC_ARG_ENABLE(ldap,
143     AS_HELP_STRING([--disable-ldap],
144         [Disables the use of LDAP backend via Netscape/Mozilla or OpenLDAP LDAP SDK])
147 AC_ARG_ENABLE(fetch-external,
148     AS_HELP_STRING([--disable-fetch-external],
149         [Disables fetching external tarballs from web sources.])
152 AC_ARG_ENABLE(lockdown,
153     AS_HELP_STRING([--disable-lockdown],
154         [Disables the gconf integration work in LibreOffice.]),
157 AC_ARG_ENABLE(vba,
158     AS_HELP_STRING([--disable-vba],
159         [Disables the vba compatibility feature.])
162 AC_ARG_ENABLE(pch,
163     AS_HELP_STRING([--enable-pch],
164         [EXPERIMENTAL: Enables precompiled header support for C++.])
167 AC_ARG_ENABLE(mozilla,
168     AS_HELP_STRING([--disable-mozilla],
169         [LibreOffice usually includes a strangely hacked up Mozilla binary for your
170          platform, to build without this version, use this option.])
173 AC_ARG_ENABLE(epm,
174     AS_HELP_STRING([--enable-epm],
175         [LibreOffice includes self-packaging code, that requires epm, however epm is
176          useless for large scale package building.])
179 AC_ARG_ENABLE(activex_component,
180     AS_HELP_STRING([--disable-activex-component],
181         [Remove support for ActiveX embedding of LibreOffice.])
184 AC_ARG_ENABLE(odk,
185     AS_HELP_STRING([--disable-odk],
186         [LibreOffice includes an ODK, office development kit which some packagers may
187          wish to build without.])
190 AC_ARG_ENABLE(mathmldtd,
191     AS_HELP_STRING([--disable-mathmldtd],
192         [Disable mathmldtd (useful for distributions that want to avoid
193          packaging it).])
196 AC_ARG_ENABLE(evolution2,
197     AS_HELP_STRING([--enable-evolution2],
198         [Allows the built-in evolution 2 addressbook connectivity build to be
199          enabled.])
202 AC_ARG_ENABLE(directx,
203     AS_HELP_STRING([--disable-directx],
204         [Remove DirectX implementation for the new XCanvas interface.
205          The DirectX support requires more stuff installed on Windows to
206          compile. (DirectX SDK, GDI+ libs)])
209 AC_ARG_ENABLE(activex,
210     AS_HELP_STRING([--disable-activex],
211         [Disable the use of ActiveX for a Windows build.
212         This switch is mandatory when using VC++ 2008 Express.])
215 AC_ARG_ENABLE(atl,
216     AS_HELP_STRING([--disable-atl],
217         [Disable the use of ATL for a Windows build.])
218     [
219                           This switch is mandatory when using VC++ 2008 Express.
220     ],
223 AC_ARG_ENABLE(symbols,
224     AS_HELP_STRING([--enable-symbols],
225         [Include debugging symbols in output. WARNING - a complete build needs
226          8 Gb of space and takes much longer (enables -g compiler flag).])
227     [
228                           Enabling symbols disables the stripping of the solver
229                           (--disable-strip-solver).
230     ],
233 AC_ARG_ENABLE(strip-solver,
234     AS_HELP_STRING([--disable-strip-solver],
235         [Disable the stripping of the solver. By default the solver is stripped
236          unless a build with debugging symbols (--enable-symbols) is requested.])
237     [
238                           This switch allows to override this setting.
239     ],
242 AC_ARG_ENABLE(werror,
243     AS_HELP_STRING([--enable-werror],
244         [Turn warnings to errors. (Has no effect in modules where the treating
245          of warnings as errors is disabled explicitly.)]),
248 AC_ARG_ENABLE(debug,
249     AS_HELP_STRING([--enable-debug],
250         [Include debugging symbols from --enable-symbols plus extra debugging
251          code. Extra large build! (enables -g compiler flag and dmake debug=true)
252          If you need even more verbose output, build a module with
253          "build -- debug=true dbglevel=2".]))
255 AC_ARG_ENABLE(dbgutil,
256     AS_HELP_STRING([--enable-dbgutil],
257         [Include additional debugging utilities, such as assertions, object
258          counting, etc. Larger build. Independent from --enable-debug]))
260 AC_ARG_ENABLE(linkoo,
261     AS_HELP_STRING([--disable-linkoo],
262         [Disable linkoo for the smoketest installation.]))
264 AC_ARG_ENABLE(lto,
265     AS_HELP_STRING([--enable-lto],
266         [Enable link-time optimization. Suitable for product builds.
267          Building takes longer but libraries are optimized for speed.
268          (possible only with gcc-4.5 or later,
269           better to use gcc-4.6 and 'gold' as linker)]))
271 AC_ARG_ENABLE(crashdump,
272     AS_HELP_STRING([--enable-crashdump],
273         [Enable the crashdump feature.]))
275 AC_ARG_ENABLE(python,
276     AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
277         [Enables or disables Python support at run-time and build-time.
278          Also specifies what Python to use. 'auto' is the
279          default. Note that Python can be disabled with
280          --disable-python or --enable-python=no only if no
281          translations are required.]))
283 AC_ARG_ENABLE(gtk,
284     AS_HELP_STRING([--disable-gtk],
285         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
286 ,enable_gtk=yes)
288 AC_ARG_ENABLE(gtk3,
289     AS_HELP_STRING([--disable-gtk3],
290         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
291 ,enable_gtk3=no)
293 AC_ARG_ENABLE(systray,
294     AS_HELP_STRING([--disable-systray],
295         [Determines whether to build the systray quickstarter.]),
296 ,enable_systray=yes)
298 AC_ARG_ENABLE(split-app-modules,
299     AS_HELP_STRING([--enable-split-app-modules],
300         [Split file lists for app modules, e.g. base, calc.
301          Has effect only with make distro-pack-install]),
304 AC_ARG_ENABLE(split-opt-features,
305     AS_HELP_STRING([--enable-split-opt-features],
306         [Split file lists for some optional features, .e.g. pyuno, testtool.
307          Has effect only with make distro-pack-install]),
310 AC_ARG_ENABLE(cairo-canvas,
311 [  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
312                           platforms where Cairo is available.
313 ],,enable_cairo_canvas=yes)
315 AC_ARG_ENABLE(librsvg,
316     AS_HELP_STRING([--enable-librsvg=<no/auto/system/internal>],
317         [Enables or disables use of librsvg to render SVG at run-time.
318          Also specificed what librsvg to use. 'auto' is the default.]))
320 AC_ARG_ENABLE(opengl,
321     AS_HELP_STRING([--disable-opengl],
322         [Determines whether to build the OpenGL 3D slide transitions component.]),
323 ,enable_opengl=yes)
325 AC_ARG_ENABLE(dbus,
326     AS_HELP_STRING([--enable-dbus],
327         [Determines whether to enable presentation mode screensaver control
328          under GNOME via DBUS.]),
329 ,enable_dbus=no)
331 AC_ARG_ENABLE(gconf,
332     AS_HELP_STRING([--disable-gconf],
333         [Determines whether to use the GConf support.]),
334 ,enable_gconf=yes)
336 AC_ARG_ENABLE(gnome-vfs,
337     AS_HELP_STRING([--disable-gnome-vfs],
338         [Determines whether to use the Gnome Virtual Filing System on platforms
339          where that VFS is available.]),
340 ,enable_gnome_vfs=yes)
342 AC_ARG_ENABLE(gio,
343     AS_HELP_STRING([--enable-gio],
344         [Determines whether to use the GIO support.]),
345 ,enable_gio=no)
347 AC_ARG_ENABLE(static-gtk,
348     AS_HELP_STRING([--enable-static-gtk],
349         [Modules that are linked against GTK+ libraries use the static libraries
350          instead of the dynamic ones. (Enables -Bstatic linker flag for GTK+ libraries.)]),
353 AC_ARG_ENABLE(layout,
354     AS_HELP_STRING([--enable-layout],
355         [Enable the compilation and use of layout dialogs.]),
358 AC_ARG_ENABLE(build-mozilla,
359     AS_HELP_STRING([--disable-build-mozilla],
360         [Use this option if you do not want to build the Mozilla components from
361          the Mozilla source code but take precompiled zips.]),
364 AC_ARG_ENABLE(nss-module,
365     AS_HELP_STRING([--disable-nss-module],
366         [Whether to use provided NSS module.]),
367 ,enable_nss_module=yes)
369 AC_ARG_ENABLE(kde,
370     AS_HELP_STRING([--enable-kde],
371         [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
372          KDE3 are available.]),
375 AC_ARG_ENABLE(kdeab,
376     AS_HELP_STRING([--disable-kdeab],
377         [Disable the KDE3 address book support.]),
379     if test "$enable_kde" = "yes"; then
380         enable_kdeab=yes;
381     fi
384 AC_ARG_ENABLE(kde4,
385     AS_HELP_STRING([--enable-kde4],
386         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
387          KDE4 are available. May be used with --enable-kde if you want to support
388          both KDE3 and KDE4.]),
391 AC_ARG_ENABLE(unix-qstart-libpng,
392     AS_HELP_STRING([--disable-unix-qstart-libpng],
393         [On UNIX systems, we have a faster splash app, that can use libpng to
394          render its splash, if we can safely link to the system libpng then
395          enabling this is a good idea (ie. for Linux Distro packaging).]),
396 ,enable_unix_libpng=yes)
398 AC_ARG_ENABLE(binfilter,
399     AS_HELP_STRING([--enable-binfilter],
400         [Enable legacy binary file formats filters build.]),
401 ,enable_binfilter=no
404 AC_ARG_ENABLE(ugly,
405     AS_HELP_STRING([--enable-ugly],
406         [Enables ugly pieces of functionality.]),
407 ,enable_ugly=no
410 AC_ARG_ENABLE(rpath,
411     AS_HELP_STRING([--disable-rpath],
412         [Disable the use of relative paths in shared libraries.]),
415 AC_ARG_ENABLE(xrender-link,
416     AS_HELP_STRING([--enable-xrender-link],
417         [Link with libXrender instead of dynamically open it.]),
420 AC_ARG_ENABLE(randr,
421     AS_HELP_STRING([--disable-randr],
422         [Disable RandR support in the vcl project.]),
423 ,enable_randr=yes)
425 AC_ARG_ENABLE(randr-link,
426     AS_HELP_STRING([--disable-randr-link],
427         [Disable linking with libXrandr, instead dynamically open it at runtime.]),
428 ,enable_randr_link=yes)
430 AC_ARG_ENABLE(gstreamer,
431     AS_HELP_STRING([--disable-gstreamer],
432         [Disable building the gstreamer avmedia backend.]),
433 ,enable_gstreamer=yes)
435 AC_ARG_ENABLE(neon,
436     AS_HELP_STRING([--disable-neon],
437         [Disable neon and the compilation of webdav binding.]),
440 AC_ARG_ENABLE(build-unowinreg,
441     AS_HELP_STRING([--enable-build-unowinreg],
442         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
443          compiler is needed on Linux.])
444     [
445                           Usage:     --enable-build-unowinreg
446     ],
449 AC_ARG_ENABLE(verbose,
450     AS_HELP_STRING([--enable-verbose],
451         [Increase build verbosity.])[
452   --disable-verbose       Decrease build verbosity.],
455 AC_ARG_ENABLE(dependency-tracking,
456     AS_HELP_STRING([--enable-dependency-tracking],
457         [Do not reject slow dependency extractors.])[
458   --disable-dependency-tracking
459                           Disables generation of dependency information.
460                           Speed up one-time builds.],
463 AC_ARG_ENABLE(icecream,
464     AS_HELP_STRING([--enable-icecream],
465         [Use the 'icecream' distributed compiling tool to speedup the compilation.
466          It defaults to /opt/icecream for the location of the icecream gcc/g++
467          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
470 AC_ARG_ENABLE(zenity,
471     AS_HELP_STRING([--disable-zenity],
472         [Do not display a build icon in the notification area (on unix) during build.]),
473 ,enable_zenity=yes)
475 AC_ARG_ENABLE(ccache,
476     AS_HELP_STRING([--disable-ccache],
477         [Do not try to use ccache automatically.
478          By default, we will try to detect if ccache is available; in that case if
479          CC/CXX are not yet set, and --enable-icecream is not given, we
480          attempt to use ccache. --disable-ccache disables ccache completely.
484 AC_ARG_ENABLE(cl-x64,
485     AS_HELP_STRING([--enable-cl-x64],
486         [Build a 64-bit LibreOffice using the Microsoft C/C++ x64 compiler.]),
489 AC_ARG_ENABLE(extra-gallery,
490     AS_HELP_STRING([--enable-extra-gallery],
491         [Add extra gallery content.]),
494 AC_ARG_ENABLE(extra-template,
495     AS_HELP_STRING([--enable-extra-template],
496         [Add extra template content.]),
499 AC_ARG_ENABLE(extra-sample,
500     AS_HELP_STRING([--enable-extra-sample],
501         [Add extra sample content.]),
504 AC_ARG_ENABLE(extra-font,
505     AS_HELP_STRING([--enable-extra-font],
506         [Add extra font content.]),
509 AC_ARG_ENABLE(lomenubar,
510     AS_HELP_STRING([--enable-lomenubar],
511         [Enable global menu support.]),
514 AC_ARG_ENABLE(online-update,
515     AS_HELP_STRING([--enable-online-update],
516         [Enable the online update service that will check for new versions of
517          LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
520 AC_ARG_ENABLE(release-build,
521     AS_HELP_STRING([--enable-release-build],
522         [Enable release build.
523          See http://wiki.documentfoundation.org/DevBuild]),
526 dnl ===================================================================
527 dnl Optional Packages (--with/without-)
528 dnl ===================================================================
529 AC_ARG_WITH(gnu-patch,
530     AS_HELP_STRING([--with-gnu-patch],
531         [Specify location of GNU patch on Solaris or FreeBSD.]),
534 AC_ARG_WITH(gnu-cp,
535     AS_HELP_STRING([--with-gnu-cp],
536         [Specify location of GNU cp on Solaris or FreeBSD.]),
539 AC_ARG_WITH(system-graphite,
540     AS_HELP_STRING([--with-system-graphite],
541         [Use graphite library already installed on system.]),
544 AC_ARG_WITH(external-tar,
545     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
546         [Specify path to tarfiles manually.]),
547     TARFILE_LOCATION=$withval ,
550 AC_ARG_WITH(linked-git,
551     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
552         [Specify another checkout's clonedir to re-use. This makes use of
553                  git-new-workdir, and saves a lot of diskspace when having multiple
554                  trees side-by-side.]),
555     GIT_LINK_SRC=$withval ,
558 AC_ARG_WITH(openldap,
559     AS_HELP_STRING([--with-openldap],
560         [Enables the use of the OpenLDAP LDAP SDK instead of the Netscape/Mozilla one.]),
563 AC_ARG_WITH(vba-package-format,
564     AS_HELP_STRING([--with-vba-package-format],
565         [Specify package format for vba compatibility api. Specifying  "builtin"
566          means the api component and associated type library are  part of the
567          installation set. Specifying "extn" creates an uno extension that is
568          part of the installation set (located in the program directory) that
569          MUST be optionly registered using either the unopkg executeable or the
570          extension manager gui.])
571     [
572                           Note: "builtin" is the default, "extn" can cause
573                           problems.
575                           Usage:     --with-vba-package-format="builtin" or
576                                      --with-vba-package-format="extn"
577     ],
580 AC_ARG_WITH(theme,
581     AS_HELP_STRING([--with-theme="theme1 theme2..."],
582         [Choose which themes to include. By default those themes with an '*' are included.
583          Possible choices: *default, *crystal, *hicontrast, *oxygen, *tango, classic, industrial.]),
586 AC_ARG_WITH(helppack-integration,
588   --without-helppack-integration      It will not integrate the helppacks to the installer
589                           of the product.
590                           Please use this switch to use the online help or separate help packages.],
593 AC_ARG_WITH(fonts,
594     AS_HELP_STRING([--without-fonts],
595         [LibreOffice includes some third-party fonts to provide a reliable basis for
596          help content, templates, samples, etc. When these fonts are already
597          known to be available on the system then you should use this option.]),
600 AC_ARG_WITH(ppds,
601     AS_HELP_STRING([--without-ppds],
602         [Removes Postscript Printer definition files from LibreOffice
603          installation set, for people building for specific distributions where
604          PPDs are known to be already available (every recent distro with CUPS backend).]),
607 AC_ARG_WITH(afms,
608     AS_HELP_STRING([--without-afms],
609         [Removes bitmap font files from LibreOffice installation set, for people
610          building for specific distributions where AFM files or TrueType Fonts
611          are known to be available.]),
614 AC_ARG_WITH(agfa-monotype-fonts,
615      AS_HELP_STRING([--with-agfa-monotype-fonts],
616           [This switch should only be enabled for those who have the right
617            to use or distribute the proprietary Agfa Monotype
618            fonts.])
621 AC_ARG_WITH(epm,
622     AS_HELP_STRING([--with-epm],
623         [Decides which epm to use. Default is to use the one from the system if
624          one is built. When either this is not there or you say =internal epm
625          will be built.]),
628 AC_ARG_WITH(package-format,
629     AS_HELP_STRING([--with-package-format],
630         [Specify package format(s) for LibreOffice installsets. Default is the
631          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
632          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
633           installed, msi. Example: --with-package-format="deb dmg"]),
636 AC_ARG_WITH(system-stdlibs,
637     AS_HELP_STRING([--with-system-stdlibs],
638         [Use libstdc++/libgcc_s already on system.]),
641 AC_ARG_WITH(system-cairo,
642     AS_HELP_STRING([--with-system-cairo],
643         [Use Cairo libraries already on system.]),
646 AC_ARG_WITH(mozilla-version,
647     AS_HELP_STRING([--with-mozilla-version],
648         [Choose which version of Mozilla to use while building Mozilla.
649          (default=1.7.5) Note that not all versions are supported.]),
652 AC_ARG_WITH(mozilla-toolkit,
653     AS_HELP_STRING([--with-mozilla-toolkit],
654         [Choose which GUI toolkit to use while building Mozilla components. (default=gtk2)]),
657 AC_ARG_WITH(myspell-dicts,
658     AS_HELP_STRING([--without-myspell-dicts],
659         [Removes myspell dictionaries from LibreOffice installation set, for
660          people building for specific distributions where the myspell dictionaries
661          are installed from other sources.]),
664 AC_ARG_WITH(system-dicts,
665     AS_HELP_STRING([--with-system-dicts],
666         [Use dictionaries from system paths- Specify them via
667          --with-{dict,hyph,thes}-path=/path if you want to override the default ones.]),
670 AC_ARG_WITH(external-dict-dir,
671     AS_HELP_STRING([--with-external-dict-dir],
672         [Specify external dictionary dir.]),
675 AC_ARG_WITH(external-hyph-dir,
676     AS_HELP_STRING([--with-external-hyph-dir],
677         [Specify external hyphenation pattern dir.]),
680 AC_ARG_WITH(external-thes-dir,
681     AS_HELP_STRING([--with-external-thes-dir],
682         [Specify external thesaurus dir.]),
685 AC_ARG_WITH(system-libs,
686     AS_HELP_STRING([--with-system-libs],
687         [Use libraries already on system -- enables all --with-system-* flags except
688          mozilla and translate-toolkit.]),
691 AC_ARG_WITH(system-headers,
692     AS_HELP_STRING([--with-system-headers],
693         [Use headers already on system -- enables all --with-system-* flags for
694          external packages whose headers are the only entities used i.e.
695          boost/vigra/odbc/sane/xrender-header(s).]),
698 AC_ARG_WITH(system-jars,
699     AS_HELP_STRING([--without-system-jars],
700         [When building with --with-system-libs, also the needed jars are expected
701          on the system. Use this to disable that (except for the db case where
702          --with-system-db *has to* imply using the db.jar from there, too).]),
705 AC_ARG_WITH(system-zlib,
706     AS_HELP_STRING([--with-system-zlib],
707         [Use zlib already on system.]),
710 AC_ARG_WITH(system-openssl,
711     AS_HELP_STRING([--with-system-openssl],
712         [Use OpenSSL already on system.]),
715 AC_ARG_WITH(system-jpeg,
716     AS_HELP_STRING([--with-system-jpeg],
717         [Use jpeg already on system.]),
720 AC_ARG_WITH(system-expat,
721     AS_HELP_STRING([--with-system-expat],
722         [Use expat already on system.]),
725 AC_ARG_WITH(system-libcmis,
726     AS_HELP_STRING([--with-system-libcmis],
727         [Use libcmis already on system.]),
730 AC_ARG_WITH(system-libvisio,
731     AS_HELP_STRING([--with-system-libvisio],
732         [Use libvisio already on system.]),
735 AC_ARG_WITH(system-libwpd,
736     AS_HELP_STRING([--with-system-libwpd],
737         [Use libwpd already on system.]),
740 AC_ARG_WITH(system-libwps,
741     AS_HELP_STRING([--with-system-libwps],
742         [Use libwps already on system.]),
745 AC_ARG_WITH(system-libwpg,
746     AS_HELP_STRING([--with-system-libwpg],
747         [Use libwpg already on system.]),
750 AC_ARG_WITH(system-libxml,
751     AS_HELP_STRING([--with-system-libxml],
752         [Use libxml already on system.]),
755 AC_ARG_WITH(system-translate-toolkit,
756     AS_HELP_STRING([--with-system-translate-toolkit],
757         [Use translate-toolkit already on system.]))
759 AC_ARG_WITH(system-icu,
760     AS_HELP_STRING([--with-system-icu],
761         [Use icu already on system.]))
763 AC_ARG_WITH(system-poppler,
764     AS_HELP_STRING([--with-system-poppler],
765         [Use system poppler. (only needed for pdfimport extension)]))
767 AC_ARG_WITH(system-db,
768     AS_HELP_STRING([--with-system-db],
769         [Use Berkeley db already on system.]))
771 AC_ARG_WITH(system-lucene,
772     AS_HELP_STRING([--with-system-lucene],
773         [Use Lucene already on system.]))
775 AC_ARG_WITH(system-apache-commons,
776     AS_HELP_STRING([--with-system-apache-commons],
777         [Use Apache commons libraries already on system.]))
779 AC_ARG_WITH(lucene-core-jar,
780     AS_HELP_STRING([--with-lucene-core-jar=JARFILE],
781         [Specify path to jarfile manually.]),
782     LUCENE_CORE_JAR=$withval)
784 AC_ARG_WITH(lucene-analyzers-jar,
785     AS_HELP_STRING([--with-lucene-analyzers-jar=JARFILE],
786         [Specify path to jarfile manually.]),
787     LUCENE_ANALYZERS_JAR=$withval ,)
789 AC_ARG_WITH(system-mysql,
790     AS_HELP_STRING([--with-system-mysql],
791         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
792          extension. Requires MYSQLCONFIG to point to the mysql_config executable.]))
794 AC_ARG_WITH(libmysql-path,
795     AS_HELP_STRING([--with-libmysql-path],
796         [Use Connector/C (libmysql) installation for building the MySQL
797          Connector/LibreOffice extension.])
798     [
799                           Usage:     --with-libmysql-path=<absolute path to
800                                                   your Connector/C installation>
801     ],
804 AC_ARG_WITH(system-mysql-cppconn,
805     AS_HELP_STRING([--with-system-mysql-cppconn],
806         [Use MySQL C++ Connector libraries already on system.]))
808 AC_ARG_WITH(system-hsqldb,
809     AS_HELP_STRING([--with-system-hsqldb],
810         [Use hsqldb already on system.]))
812 AC_ARG_WITH(hsqldb-jar,
813     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
814         [Specify path to jarfile manually.]),
815     HSQLDB_JAR=$withval)
817 AC_ARG_WITH(system-beanshell,
818     AS_HELP_STRING([--with-system-beanshell],
819         [Use beanshell already on system.]))
821 AC_ARG_WITH(beanshell-jar,
822     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
823         [Specify path to jarfile manually.]),
824     BSH_JAR=$withval)
826 AC_ARG_WITH(commons-codec-jar,
827     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
828         [Specify path to jarfile manually.]),
829     COMMONS_CODEC_JAR=$withval)
831 AC_ARG_WITH(commons-lang-jar,
832     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
833         [Specify path to jarfile manually.]),
834     COMMONS_LANG_JAR=$withval)
836 AC_ARG_WITH(commons-httpclient-jar,
837     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
838         [Specify path to jarfile manually.]),
839     COMMONS_HTTPCLIENT_JAR=$withval)
841 AC_ARG_WITH(commons-logging-jar,
842     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
843         [Specify path to jarfile manually.]),
844     COMMONS_LOGGING_JAR=$withval)
846 AC_ARG_WITH(servlet-api-jar,
847     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
848         [Specify path to jarfile manually.]),
849     SERVLETAPI_JAR=$withval)
851 AC_ARG_WITH(system-jfreereport,
852     AS_HELP_STRING([--with-system-jfreereport],
853         [Use JFreeReport already on system.]))
855 AC_ARG_WITH(sac-jar,
856     AS_HELP_STRING([--with-sac-jar=JARFILE],
857         [Specify path to jarfile manually.]),
858     SAC_JAR=$withval)
860 AC_ARG_WITH(libxml-jar,
861     AS_HELP_STRING([--with-libxml-jar=JARFILE],
862         [Specify path to jarfile manually.]),
863     LIBXML_JAR=$withval)
865 AC_ARG_WITH(flute-jar,
866     AS_HELP_STRING([--with-flute-jar=JARFILE],
867         [Specify path to jarfile manually.]),
868     FLUTE_JAR=$withval)
870 AC_ARG_WITH(jfreereport-jar,
871     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
872         [Specify path to jarfile manually.]),
873     JFREEREPORT_JAR=$withval)
875 AC_ARG_WITH(liblayout-jar,
876     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
877         [Specify path to jarfile manually.]),
878     LIBLAYOUT_JAR=$withval)
880 AC_ARG_WITH(libloader-jar,
881     AS_HELP_STRING([--with-libloader-jar=JARFILE],
882         [Specify path to jarfile manually.]),
883     LIBLOADER_JAR=$withval)
885 AC_ARG_WITH(libloader-jar,
886     AS_HELP_STRING([--with-libloader-jar=JARFILE],
887         [Specify path to jarfile manually.]),
888     LIBLOADER_JAR=$withval)
890 AC_ARG_WITH(libformula-jar,
891     AS_HELP_STRING([--with-libformula-jar=JARFILE],
892         [Specify path to jarfile manually.]),
893     LIBFORMULA_JAR=$withval)
895 AC_ARG_WITH(librepository-jar,
896     AS_HELP_STRING([--with-librepository-jar=JARFILE],
897         [Specify path to jarfile manually.]),
898     LIBREPOSITORY_JAR=$withval)
900 AC_ARG_WITH(libfonts-jar,
901     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
902         [Specify path to jarfile manually.]),
903     LIBFONTS_JAR=$withval)
905 AC_ARG_WITH(libserializer-jar,
906     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
907         [Specify path to jarfile manually.]),
908     LIBSERIALIZER_JAR=$withval)
910 AC_ARG_WITH(libbase-jar,
911     AS_HELP_STRING([--with-libbase-jar=JARFILE],
912         [Specify path to jarfile manually.]),
913     LIBBASE_JAR=$withval)
915 AC_ARG_WITH(system-saxon,
916     AS_HELP_STRING([--with-system-saxon],
917         [Use saxon already on system.]))
919 AC_ARG_WITH(saxon-jar,
920     AS_HELP_STRING([--with-saxon-jar=JARFILE],
921         [Specify path to jarfile manually.]),
922     SAXON_JAR=$withval)
924 AC_ARG_WITH(system-libxslt,
925     AS_HELP_STRING([--with-system-libxslt],
926         [Use libxslt already on system.]))
928 AC_ARG_WITH(system-odbc,
929     AS_HELP_STRING([--with-system-odbc],
930         [Use the odbc headers already on system.]))
932 AC_ARG_WITH(system-sane,
933     AS_HELP_STRING([--with-system-sane],
934         [Use sane.h already on system.]))
936 AC_ARG_WITH(system-xrender-headers,
937     AS_HELP_STRING([--with-system-xrender-headers],
938         [Use XRender headers already on system.]))
940 AC_ARG_WITH(system-mesa-headers,
941     AS_HELP_STRING([--with-system-mesa-headers],
942         [Use Mesa headers already on system.]))
944 AC_ARG_WITH(system-curl,
945     AS_HELP_STRING([--with-system-curl],
946         [Use curl already on system.]))
948 AC_ARG_WITH(system-boost,
949     AS_HELP_STRING([--with-system-boost],
950         [Use boost already on system.]))
952 AC_ARG_WITH(system-mdds,
953     AS_HELP_STRING([--with-system-mdds],
954         [Use mdds already on system.]))
956 AC_ARG_WITH(system-vigra,
957     AS_HELP_STRING([--with-system-vigra],
958         [Use vigra already on system.]))
960 AC_ARG_WITH(system-neon,
961     AS_HELP_STRING([--with-system-neon],
962         [Use neon already on system.]))
964 AC_ARG_WITH(system-hunspell,
965     AS_HELP_STRING([--with-system-hunspell],
966         [Use libhunspell already on system.]))
968 AC_ARG_WITH(system-mythes,
969     AS_HELP_STRING([--with-system-mythes],
970         [Use mythes already on system.]))
972 AC_ARG_WITH(system-altlinuxhyph,
973     AS_HELP_STRING([--with-system-altlinuxhyph],
974         [Use ALTLinuxhyph already on system.]))
976 AC_ARG_WITH(system-lpsolve,
977     AS_HELP_STRING([--with-system-lpsolve],
978         [Use lpsolve already on system.]))
980 AC_ARG_WITH(system-libexttextcat,
981     AS_HELP_STRING([--with-system-libexttextcat],
982         [Use libexttextcat already on system.]))
984 AC_ARG_WITH(system-cppunit,
985     AS_HELP_STRING([--with-system-cppunit],
986         [Use cppunit already on system.]))
988 AC_ARG_WITH(system-redland,
989     AS_HELP_STRING([--with-system-redland],
990         [Use redland library already on system.]))
992 AC_ARG_WITH(system-mozilla,
993     AS_HELP_STRING([--with-system-mozilla],
994         [Use Mozilla already on system. Note that some components cannot be built
995          against a contemporary Mozilla. The flavour used can be specified by
996          --with-system-mozilla=<flavour>. Supported are: libxul (default),
997          xulrunner, firefox, seamonkey, mozilla.]),
998     WITH_SYSTEM_MOZILLA=$withval ,
999 WITH_SYSTEM_MOZILLA=no)
1001 AC_ARG_WITH(system-gettext,
1002     AS_HELP_STRING([--with-system-gettext],
1003         [Use gettext runtime library already on system.]))
1005 AC_ARG_WITH(system-libpng,
1006     AS_HELP_STRING([--with-system-libpng],
1007         [Use libpng already on system.]))
1009 AC_ARG_WITH(linker-hash-style,
1010     AS_HELP_STRING([--with-linker-hash-style],
1011         [Use linker with --hash-style=<style> when linking shared objects.
1012          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1013          if supported on the build system, and "sysv" otherwise.]))
1015 AC_ARG_WITH(stlport,
1016     AS_HELP_STRING([--with-stlport],
1017         [Build the STLPort library for compatibility with old extensions for
1018          architectures where STLPort used to be used.]),
1019     with_stlport=$withval ,
1020 with_stlport=auto)
1022 AC_ARG_WITH(jdk-home,
1023     AS_HELP_STRING([--with-jdk-home],
1024         [If you have installed JDK 1.3 or later on your system please supply the
1025          path here. Note that this is not the location of the java command but the
1026          location of the entire distribution.])
1027     [
1028                           Usage:     --with-jdk-home=<absolute path to JDK home>
1029     ],
1032 AC_ARG_WITH(gxx_include_path,
1033     AS_HELP_STRING([--with-gxx-include-path],
1034         [If you want to override the autodetected g++ include path.])
1035     [
1036                           Usage:     --with-gxx-include-path=<absolute path to
1037                                                                 g++ include dir>
1038     ],
1041 AC_ARG_WITH(help,
1042     AS_HELP_STRING([--with-help],
1043         [Enable the build of help.
1045          To build without help, use --without-help.]))
1047 AC_ARG_WITH(java,
1048     AS_HELP_STRING([--with-java],
1049         [Specify the name of the Java interpreter command. Typically "java"
1050          which is the default.
1052          To build without support for Java components, applets, accessibility
1053          or the XML filters written in Java, use --without-java or --with-java=no.])
1054     [
1055                           Usage:     --with-java==<java command>
1056                                      --without-java
1057     ],
1058     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1059     [ with_java=java ]
1062 AC_ARG_WITH(java_target_version,
1063     AS_HELP_STRING([--with-java-target-version],
1064         [Generate class files that will work on JVMs with the specified version.
1065          For example, use --with-java-target-version=1.4 to make sure that the
1066          application will work with JVM 1.4 even when compiled with JDK 1.5.])
1067     [
1068                           This option is ignored when you compile with gcj/gij.
1070                           Usage:     --with-java-target-version=<jvm version>
1071     ],
1074 AC_ARG_WITH(jvm-path,
1075     AS_HELP_STRING([--with-jvm-path],
1076         [Use a specific JVM search path at runtime.])
1077     [
1078                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1080                           e. g.: --with-jvm-path=/usr/lib/
1081                                  to find JRE/JDK in /usr/lib/jvm/
1082     ],
1085 AC_ARG_WITH(ant-home,
1086     AS_HELP_STRING([--with-ant-home],
1087         [If you have installed Jakarta Ant on your system, please supply the path here.
1088          Note that this is not the location of the Ant binary but the location
1089          of the entire distribution.])
1090     [
1091                           Usage:     --with-ant-home=<absolute path to Ant home>
1092     ],
1095 AC_ARG_WITH(junit,
1096     AS_HELP_STRING([--with-junit],
1097         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1098          --without-junit disables those tests. Not relevant in the --without-java case.])
1099     [
1100                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1101     ],
1102 ,with_junit=yes)
1104 AC_ARG_WITH(perl-home,
1105     AS_HELP_STRING([--with-perl-home],
1106         [If you have installed Perl 5 Distribution, on your system, please
1107          supply the path here. Note that this is not the location of the Perl
1108          binary but the location of the entire distribution.])
1109     [
1110                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1111     ],
1114 AC_ARG_WITH(cl-home,
1115     AS_HELP_STRING([--with-cl-home],
1116         [For Windows NT users, please supply the path for the Microsoft C/C++
1117          compiler. Note that this is not the location of the compiler binary but
1118          the location of the entire distribution.])
1119     [
1120                           Usage:     --with-cl-home=<absolute path to Microsoft
1121                                                             C/C++ compiler home>
1122     ],
1125 AC_ARG_WITH(mspdb-path,
1126     AS_HELP_STRING([--with-mspdb-path],
1127         [For Microsoft C/C++ compiler users, please supply the path pointing to
1128          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1129          Visual Studio 2010).])
1130     [
1131                           Usage:     --with-mspdb-path=<path to
1132                                                        mspdb80.dll/mspdb100.dll>
1133     ],
1136 AC_ARG_WITH(midl-path,
1137     AS_HELP_STRING([--with-midl-path],
1138         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1139     [
1140                           Usage:     --with-midl-path=<abs. path to midl.exe>
1141     ],
1144 AC_ARG_WITH(csc-path,
1145     AS_HELP_STRING([--with-csc-path],
1146         [For Windows builds, please supply the path pointing to the csc.exe.
1147          Usually found automatically when building on Windows.])
1148     [
1149                           Usage:     --with-csc-path=<abs. path to csc.exe>
1150     ],
1153 AC_ARG_WITH(nsis-path,
1154     AS_HELP_STRING([--with-nsis-path],
1155         [For Windows builds, please supply the directory where makensis
1156          is located. If makensis is found in PATH or this option is
1157          properly supplied a self-contained executable installer for
1158          LibreOffice will be created.])
1159     [
1160                           Usage:     --with-nsis-path=<path to directory containing makensis>
1161     ],
1164 AC_ARG_WITH(dotnet-framework-home,
1165     AS_HELP_STRING([--with-dotnet-framework-home],
1166         [For Microsoft compiler users, please supply the path pointing to
1167          lib/mscoree.lib, usually something like:
1168          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1169     [
1170                           Note that in most cases it will be automatically
1171                           found, though.
1173                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1174                                                           Framework>
1175     ],
1178 AC_ARG_WITH(windows-sdk-home,
1179     AS_HELP_STRING([--with-windows-sdk-home],
1180         [For Windows builds, please supply the path to the Windows SDK.
1181          Usually found automatically when building on Windows.])
1182     [
1183                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1184     ],
1187 AC_ARG_WITH(directx-home,
1188     AS_HELP_STRING([--with-directx-home],
1189         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1190     [
1191                           Usage:     --with-directx-home=<absolute path to
1192                                                           Microsoft DirectX SDK>
1193     ],
1196 AC_ARG_WITH(mozilla-build,
1197     AS_HELP_STRING([--with-mozilla-build],
1198         [For Windows users, please supply the path to the Mozilla build tools.])
1199     [
1200                           Usage:     --with-mozilla-build=<absolute path to
1201                                                           Mozilla build tools>
1203                           At the moment of this writing, an installer for the
1204                           mozilla build tools can be obtained from http://ftp.
1205                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1206     ],
1207     MOZILLABUILD=$withval ,
1210 AC_ARG_WITH(local-solver,
1211     AS_HELP_STRING([--with-local-solver],
1212         [If you have solver in a location other than ./solver, please supply the path here.])
1213     [
1214                           Usage:     --with-local-solver=<abs. path to solver>
1215     ],
1218 AC_ARG_WITH(lang,
1219     AS_HELP_STRING([--with-lang],
1220         [Use this option to build LibreOffice with additional language support.
1221          English (US) is always included by default.
1222          Separate multiple languages with space.
1223          For all languages, use --with-lang=ALL.])
1224     [
1225                           Usage:     --with-lang="es sw tu cs sk"
1226     ],
1229 dnl ===================================================================
1230 dnl Branding
1231 dnl ===================================================================
1233 AC_ARG_WITH(intro-bitmap,
1234 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1235                           the default one.
1237                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1238 ],,)
1240 AC_ARG_WITH(intro-progressbar-color,
1241 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1242                                      Comma separated RGB values in decimal format.
1244                           Usage: --with-intro-progressbar-color=126,170,23
1245 ],,)
1247 AC_ARG_WITH(intro-progressbar-size,
1248 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1249                                      Comma separated values in decimal format.
1251                           Usage: --with-intro-progressbar-size=319,10
1252 ],,)
1254 AC_ARG_WITH(intro-progressbar-position,
1255 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1256                                      Comma separated values in decimal format.
1258                           Usage: --with-intro-progressbar-position=164,225
1259 ],,)
1261 AC_ARG_WITH(intro-progressbar-frame-color,
1262 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1263                                            Comma separated RGB values in decimal format.
1265                           Usage: --with-intro-progressbar-frame-color=207,208,211
1266 ],,)
1268 AC_ARG_WITH(about-bitmap,
1269 [  --with-about-bitmap    Similarly to --with-intro-bitmap, this allows
1270                           specification of bitmap for the About box.
1272                           Usage:     --with-about-bitmap=/path/my_ooo_about.png
1273 ],,)
1275 AC_ARG_WITH(startcenter-left-bitmap,
1276 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1277                                      specification of bitmap for the Start center.
1279                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1280 ],,)
1282 AC_ARG_WITH(startcenter-right-bitmap,
1283 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1284                                       specification of bitmap for the Start center.
1286                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1287 ],,)
1289 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1290 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1291                                          specification of bitmap for the Start center.
1293                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1294 ],,)
1296 AC_ARG_WITH(startcenter-rtl-right-bitmap,
1297 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
1298                                           specification of bitmap for the Start center.
1300                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
1301 ],,)
1303 AC_ARG_WITH(startcenter-space-bitmap,
1304 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
1305                                       specification of bitmap for the Start center.
1307                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
1308 ],,)
1310 AC_ARG_WITH(vendor,
1311     AS_HELP_STRING([--with-vendor],
1312         [Set vendor of the build.])
1313     [
1314                           Usage:     --with-vendor="John the Builder"
1315     ],
1318 AC_ARG_WITH(unix-wrapper,
1319     AS_HELP_STRING([--with-unix-wrapper],
1320         [Redefines the name of the UNIX wrapper that will be used in the desktop
1321          files and in the desktop-integration RPMs.])
1322     [
1323                           Usage:     --with-unix-wrapper=ooffice
1324     ],
1327 AC_ARG_WITH(compat-oowrappers,
1328     AS_HELP_STRING([--with-compat-oowrappers],
1329         [Install oo* wrappers in parallel with
1330          lo* ones to keep backward compatibility.
1331          Has effect only with make distro-pack-install]),
1334 AC_ARG_WITH(asm-home,
1335     AS_HELP_STRING([--with-asm-home],
1336         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
1337     [
1338                           Usage:     --with-asm-home=<path to assembler directory>
1339     ],
1342 AC_ARG_WITH(os-version,
1343     AS_HELP_STRING([--with-os-version],
1344         [For FreeBSD users, use this option option to override the detected OSVERSION.])
1345     [
1346                           Usage:     --with-os-version=<OSVERSION>
1347     ],
1350 AC_ARG_WITH(mingw-cross-compiler,
1351     AS_HELP_STRING([--with-mingw-cross-compiler],
1352         [Specify the MinGW cross-compiler to use.])
1353     [
1354                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
1356                           When building on the ODK on Unix and building unowinreg.dll,
1357                           specify the MinGW C++ cross-compiler.
1358     ],
1361 AC_ARG_WITH(build-version,
1362     AS_HELP_STRING([--with-build-version],
1363         [Allows the builder to add a custom version tag that will appear in the
1364          Help/About box for QA purposes.])
1365     [
1366                           Usage:     --with-build-version="Built by Jim"
1367     ],
1368     with_build_version=$withval ,
1371 AC_ARG_WITH(alloc,
1372     AS_HELP_STRING([--with-alloc],
1373         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
1374          Note that on FreeBSD/NetBSD system==jemalloc]),
1377 AC_ARG_WITH(sun-templates,
1378     AS_HELP_STRING([--with-sun-templates],
1379         [Integrate Sun template packages.]),
1382 AC_ARG_WITH(num-cpus,
1383     AS_HELP_STRING([--with-num-cpus],
1384         [Number of build processes/cpus to use (number of projects that will build at the same time).
1385          Multi-process/multi-cpu builds can save a lot of time on multi-cpu machines.
1386          Defaults to the number of CPUs on the machine.]),
1389 AC_ARG_WITH(max-jobs,
1390     AS_HELP_STRING([--with-max-jobs],
1391         [Maximum number of jobs per one CPU that will be issued at the same time by dmake.
1392          The real number of the jobs is affected by the --with-num-cpus too, it can get up to CPUS*max_jobs.
1393          Defaults to 1, unless you configure --enable-icecream - then to 10.]),
1396 dnl ===================================================================
1397 dnl MacOSX build and runtime environment options
1398 dnl ===================================================================
1400 AC_ARG_WITH(macosx-sdk,
1401     AS_HELP_STRING([--with-macosx-sdk],
1402         [Use a specific SDK for building.])
1403     [
1404                           Usage:     --with-macosx-sdk=<version>
1406                           e. g.: --with-macosx-sdk=10.4
1408                           there are 3 options to controle the MacOSX build:
1409                           --with-macosx-sdk (refered as 'sdl' below)
1410                           --with-macosx-version-min-required (refered as 'min' below)
1411                           --with-macosx-version-max-allowed (refered as 'max' below)
1413                           the connection between these value and the default they take is as follow:
1414                           ( ? means not specified on the command line, constraint: x <= y <= z)
1416                           ==========================================
1417                            command line      || config result
1418                           ==========================================
1419                           min  | max  | sdk  || min  | max  | sdk  |
1420                           ?    | ?    | ?    || 10.4 | 10.4 | 10.4 |
1421                           ?    | ?    | 10.x || 10.4 | 10.4 | 10.x |
1422                           ?    | 10.x | ?    || 10.4 | 10.x | 10.x |
1423                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
1424                           10.x | ?    | ?    || 10.x | 10.x | 10.x |
1425                           10.x | ?    | 10.y || 10.x | 10.x | 10.y |
1426                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
1427                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
1430                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
1431                           for a detailled technical explanation of these variables
1433                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
1435     ],
1438 AC_ARG_WITH(macosx-version-min-required,
1439     AS_HELP_STRING([--with-macosx-version-min-required],
1440         [set the minimum OS version needed to run the built LibreOffice])
1441     [
1442                           Usage:     --with-macosx-version-min-required=<version>
1444                           e. g.: --with-macos-version-min-required=10.4
1445                           see --with-macosx-sdk for more info
1446     ],
1449 AC_ARG_WITH(macosx-version-max-allowed,
1450     AS_HELP_STRING([--with-macosx-version-max-allowed],
1451         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
1452     [
1453                           Usage:     --with-macosx-version-max-allowed=<version>
1455                           e. g.: --with-macos-version-max-allowed=10.6
1456                           see --with-macosx-sdk for more info
1457     ],
1461 BUILD_TYPE="LibO"
1462 SCPDEFS=""
1463 GIT_REPO_NAMES=""
1464 MINGW_EXTERNAL_DLLS=""
1466 if test -n "$SOLARENV" ; then
1467     AC_MSG_ERROR([You have sourced Env.Host.sh in this shell.  This may lead to trouble, please run in a fresh (login) shell.])
1470 echo "********************************************************************"
1471 echo "*"
1472 echo "*   Running ${PACKAGE_NAME} build configuration."
1473 echo "*"
1474 echo "********************************************************************"
1475 echo ""
1477 dnl ===================================================================
1478 dnl checks build and host OSes
1479 dnl ===================================================================
1480 AC_CANONICAL_HOST
1482 if test "$cross_compiling" = "yes"; then
1483     CROSS_COMPILING=YES
1484 else
1485     CROSS_COMPILING=
1486     BUILD_TYPE="$BUILD_TYPE NATIVE"
1488 AC_SUBST(CROSS_COMPILING)
1490 if test "$build_os" = "cygwin"; then
1491     EXEEXT_FOR_BUILD=.exe
1492 else
1493     EXEEXT_FOR_BUILD=
1495 AC_SUBST(EXEEXT_FOR_BUILD)
1497 dnl ===================================================================
1498 dnl check for required programs (grep, awk, sed, bash)
1499 dnl ===================================================================
1500 cat /dev/null > warn
1502 if test "z$EUID" = "z0" -a "z`uname -o 2>/dev/null`" = "zCygwin"; then
1503     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
1506 save_CC=$CC
1507 save_CXX=$CXX
1509 AC_PROG_EGREP
1510 AC_PROG_AWK
1511 AC_PATH_PROG( AWK, $AWK)
1512 if test -z "$AWK"; then
1513     AC_MSG_ERROR([install awk to run this script])
1516 AC_PATH_PROGS(SED, sed )
1517 if test -z "$SED"; then
1518     AC_MSG_ERROR([install sed to run this script])
1521 AC_PATH_PROG(BASH, bash)
1522 if test -z "$BASH"; then
1523     AC_MSG_ERROR([bash not found in \$PATH])
1525 AC_SUBST(BASH)
1527 AC_MSG_CHECKING([for GNU or BSD tar])
1528 for a in $GNUTAR gtar gnutar tar; do
1529     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
1530     if test $? -eq 0;  then
1531         GNUTAR=$a
1532         break
1533     fi
1534 done
1535 AC_MSG_RESULT($GNUTAR)
1536 if test -z "$GNUTAR"; then
1537     AC_MSG_ERROR([not found. install GNU or BSD tar.])
1539 AC_SUBST(GNUTAR)
1541 dnl ===================================================================
1542 dnl The following is a list of supported systems.
1543 dnl Sequential to keep the logic very simple
1544 dnl These values may be checked and reset later.
1545 dnl ===================================================================
1546 #defaults unless the os test overrides this:
1547 test_randr=yes
1548 test_cups=yes
1549 test_fontconfig=yes
1551 case "$host_os" in
1553 solaris*)
1554     test_gtk=yes
1555     build_gstreamer=yes
1556     test_kde=yes
1557     test_freetype=yes
1558     test_gstreamer=yes
1559     _os=SunOS
1560     AC_PATH_PROG( GNUTAR, gtar,,$PATH:/usr/sfw/bin)
1561     if test -z "$GNUTAR"; then
1562         AC_MSG_ERROR([gtar (GNU tar) not found but needed. Install it (Sun Freeware package).])
1563     fi
1564     AC_SUBST(GNUTAR)
1566     dnl ===========================================================
1567     dnl Check whether we're using Solaris 6,7,8 - SPARC or Intel.
1568     dnl ===========================================================
1569     AC_MSG_CHECKING([the Solaris operating system release])
1570     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
1571     if test "$_os_release" -lt "6"; then
1572         AC_MSG_ERROR([use Solaris >= 6 to build LibreOffice])
1573     else
1574         AC_MSG_RESULT([ok ($_os_release)])
1575     fi
1577     dnl Check whether we're using a SPARC or i386 processor
1578     AC_MSG_CHECKING([the processor type])
1579     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
1580         AC_MSG_RESULT([ok ($host_cpu)])
1581     else
1582         AC_MSG_ERROR([only SPARC and i386 processors are supported])
1583     fi
1584     ;;
1586 linux-gnu*|k*bsd*-gnu*)
1587     test_gtk=yes
1588     build_gstreamer=yes
1589     test_kde=yes
1590     test_kde4=yes
1591     test_freetype=yes
1592     test_unix_quickstarter=yes
1593     _os=Linux
1594     ;;
1596 gnu)
1597     test_randr=no
1598     _os=GNU
1599      ;;
1601 cygwin*|interix*|mingw32*)
1603     # When building on Windows normally with MSVC under Cygwin,
1604     # configure thinks that the host platform (the platform the
1605     # built code will run on) is Cygwin, even if it obviously is
1606     # Windows, which in Autoconf terminology is called
1607     # "mingw32". (Which is misleading as MinGW is the name of the
1608     # tool-chain, not an operating system.)
1610     # Somewhat confusing, yes. But this configure script doesn't
1611     # look at $host etc that much, it mostly uses its own $_os
1612     # variable, set here in this case statement.
1614     # When cross-compiling to Windows from Unix, the host platform
1615     # is "mingw32" (because in that case it is the MinGW
1616     # tool-chain that is used).
1618     test_cups=no
1619     test_randr=no
1620     test_freetype=no
1621     test_fontconfig=no
1622     _os=WINNT
1624     # If the host OS matches "mingw32*", that means we are using the
1625     # MinGW cross-compiler, because we don't see the point in building
1626     # LibreOffice using MinGW on Windows. If you want to build on
1627     # Windows, use MSVC. If you want to use MinGW, surely you want to
1628     # cross-compile (from Linux or some other Unix).
1630     case "$host_os" in
1631     mingw32*)
1632         WITH_MINGW=yes
1633         if test -z "$CC" ; then
1634             CC="$host_cpu-$host_vendor-$host_os-gcc"
1635         fi
1636         if test -z "$CXX" ; then
1637             CXX="$host_cpu-$host_vendor-$host_os-g++"
1638         fi
1639         ;;
1640     esac
1641     ;;
1643 darwin*) # Mac OS X or iOS
1644     test_gtk=yes
1645     test_randr=no
1646     test_freetype=no
1647     test_fontconfig=no
1648     if test "$host_cpu" = "arm"; then
1649         _os=iOS
1650         test_gtk=no
1651         test_cups=no
1652     else
1653         _os=Darwin
1654     fi
1655     enable_systray=no
1658 freebsd*)
1659     test_gtk=yes
1660     build_gstreamer=yes
1661     test_kde=yes
1662     test_kde4=yes
1663     test_freetype=yes
1664     AC_MSG_CHECKING([the FreeBSD operating system release])
1665     if test -n "$with_os_version"; then
1666         OSVERSION="$with_os_version"
1667     else
1668         OSVERSION=`/sbin/sysctl -n kern.osreldate`
1669     fi
1670     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
1671     AC_MSG_CHECKING([which thread library to use])
1672     if test "$OSVERSION" -lt "500016"; then
1673         PTHREAD_CFLAGS="-D_THREAD_SAFE"
1674         PTHREAD_LIBS="-pthread"
1675     elif test "$OSVERSION" -lt "502102"; then
1676         PTHREAD_CFLAGS="-D_THREAD_SAFE"
1677         PTHREAD_LIBS="-lc_r"
1678     else
1679         PTHREAD_CFLAGS=""
1680         PTHREAD_LIBS="-pthread"
1681     fi
1682     AC_MSG_RESULT([$PTHREAD_LIBS])
1683     _os=FreeBSD
1684     ;;
1686 *netbsd*)
1687     test_gtk=yes
1688     build_gstreamer=yes
1689     test_kde=no
1690     test_kde4=yes
1691     test_freetype=yes
1692     PTHREAD_LIBS="-pthread -lpthread"
1693     _os=NetBSD
1694     ;;
1696 aix*)
1697     test_randr=no
1698     test_freetype=yes
1699     PTHREAD_LIBS=-pthread
1700     _os=AIX
1701     ;;
1703 openbsd*)
1704     test_gtk=yes
1705     test_kde=yes
1706     test_freetype=yes
1707     PTHREAD_CFLAGS="-D_THREAD_SAFE"
1708     PTHREAD_LIBS="-pthread"
1709     _os=OpenBSD
1710     ;;
1712 dragonfly*)
1713     test_gtk=yes
1714     build_gstreamer=yes
1715     test_kde=yes
1716     test_kde4=yes
1717     test_freetype=yes
1718     PTHREAD_LIBS="-pthread"
1719     _os=DragonFly
1720     ;;
1722 linux-androideabi*)
1723     build_gstreamer=no
1724     test_cups=no
1725     test_fontconfig=no
1726     test_freetype=no
1727     test_gtk=no
1728     test_kde=no
1729     test_kde4=no
1730     test_randr=no
1731     test_unix_quickstarter=no
1732     _os=Android
1733     ;;
1736     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
1737     ;;
1738 esac
1740 if test "$_os" = "AIX"; then
1741     AC_PATH_PROG(GAWK, gawk)
1742     if test -z "$GAWK"; then
1743         AC_MSG_ERROR([gawk not found in \$PATH])
1744     fi
1747 AC_SUBST(WITH_MINGW)
1748 AC_SUBST(OSVERSION)
1749 AC_SUBST(PTHREAD_CFLAGS)
1750 AC_SUBST(PTHREAD_LIBS)
1752 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
1753 dnl desktop OSes from "mobile" ones.
1755 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
1756 dnl In other words, that when building for an OS that is not a
1757 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
1759 dnl Note the direction of the implication; there is no assumption that
1760 dnl cross-compiling would imply a non-desktop OS.
1762 if test $_os != iOS -a $_os != Android; then
1763     BUILD_TYPE="$BUILD_TYPE DESKTOP"
1766 dnl ===================================================================
1767 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
1768 dnl although MSVC is used to build other build-time tools and 
1769 dnl LibreOffice itself.
1770 dnl ===================================================================
1771 if test "$build_os" = "cygwin" ; then
1772     AC_MSG_CHECKING([for Cygwin gcc/g++])
1773     if which gcc > /dev/null && which g++ > /dev/null ; then
1774         AC_MSG_RESULT([found])
1775     else
1776         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
1777     fi
1782 dnl ===================================================================
1783 dnl  Checks if ccache is available
1784 dnl ===================================================================
1785 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \) ; then
1786     if test -z "$CC" ; then
1787         if test -z "$CXX" ; then
1788             AC_PATH_PROG([CCACHE],[ccache],[not found])
1789             if test "$CCACHE" = "not found" ; then
1790                 CCACHE=""
1791             else
1792                 CCACHE="ccache"
1793                 # need to check for ccache version: otherwise prevents
1794                 # caching of the results (like "-x objective-c++" for Mac)
1795                 if test $_os = Darwin -o $_os = iOS; then
1796                     # check ccache version
1797                     AC_MSG_CHECKING([whether version of ccache is suitable])
1798                     CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
1799                     CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1800                     if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
1801                         AC_MSG_RESULT([yes])
1802                     else
1803                         AC_MSG_RESULT([no])
1804                         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. ccache will not be used.])
1805                         CCACHE=""
1806                     fi
1807                 fi
1808             fi
1809         else
1810             AC_MSG_NOTICE([Automatic ccache detection ingored: CXX is pre-defined])
1811             CCACHE=""
1812         fi
1813     else
1814         AC_MSG_NOTICE([Automatic ccache detection ingored: CC is pre-defined])
1815         CCACHE=""
1816     fi
1817 else
1818     CCACHE=""
1821 if test "$CCACHE" != "" ; then
1822     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
1823     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
1824     if test "$ccache_size" = "" ; then
1825         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
1826         if test "$ccache_size" = "" ; then
1827             ccache_size=0
1828         fi
1829         # we could not determine the size or it was less than 1GB -> disable auto-ccache
1830         if test $ccache_size -lt 1024 ; then
1831             CCACHE=""
1832             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
1833             echo "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled" >> warn
1834         else
1835             # warn that ccache may be too small for debug build
1836             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1837             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1838         fi
1839     else
1840         if test $ccache_size -lt 5  ; then
1841             #warn that ccache may be too small for debug build
1842             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
1843             echo "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build" >> warn
1844         fi
1845     fi
1848 dnl ===================================================================
1849 dnl  Checks for C compiler,
1850 dnl  The check for the C++ compiler is later on.
1851 dnl ===================================================================
1852 GCC_HOME_SET="true"
1853 AC_MSG_CHECKING([gcc home])
1854 if test -z "$with_gcc_home"; then
1855     if test "$enable_icecream" = "yes" ; then
1856         GCC_HOME="/opt/icecream"
1857     else
1858         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
1859         GCC_HOME_SET="false"
1860     fi
1861 else
1862     GCC_HOME="$with_gcc_home"
1864 AC_MSG_RESULT($GCC_HOME)
1865 AC_SUBST(GCC_HOME)
1867 if test "$GCC_HOME_SET" = "true" ; then
1868     if test -z "$CC"; then
1869         CC="$GCC_HOME/bin/gcc"
1870     fi
1871     if test -z "$CXX"; then
1872         CXX="$GCC_HOME/bin/g++"
1873     fi
1876 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1877 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
1878     AC_PROG_CC
1881 COMPATH=`dirname "$CC"`
1882 if test "$COMPATH" = "." ; then
1883     AC_PATH_PROGS(COMPATH, $CC)
1884     dnl double square bracket to get single because of M4 quote...
1885     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
1887 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
1892 dnl ===================================================================
1893 dnl  Test MacOSX sdk and version requirement
1894 dnl ===================================================================
1895 if test "$_os" = "Darwin" ; then
1897     if test "$with_macosx_version_min_required" = "" ; then
1898         with_macosx_version_min_required="10.4"
1899     fi
1901     if test "$with_macosx_version_max_allowed" = "" ; then
1902         with_macosx_version_max_allowed="$with_macosx_version_min_required"
1903     fi
1905     if test "$with_macosx_sdk" = "" ; then
1906         with_macosx_sdk="$with_macosx_version_max_allowed"
1907     fi
1909     case "$with_macosx_sdk" in
1911     10.4)
1912         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.4u.sdk"
1913         if test ! -d "$MACOSX_SDK_PATH"; then
1914           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.4u.sdk"
1915         fi
1916         macosx_sdk_value="1040"
1917         ;;
1918     10.5)
1919         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.5.sdk"
1920         if test ! -d "$MACOSX_SDK_PATH"; then
1921           MACOSX_SDK_PATH="/Developer-old/SDKs/MacOSX10.5.sdk"
1922         fi
1923         macosx_sdk_value="1050"
1924         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
1925         echo "Building with a SDK > 10.4 is experimental" >> warn
1926         ;;
1927     10.6)
1928         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"
1929         macosx_sdk_value="1060"
1930         AC_MSG_WARN([Building with a SDK > 10.4 is experimental])
1931         echo "Building with a SDK > 10.4 is experimental" >> warn
1932         ;;
1933     10.7)
1934         MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.7.sdk"
1935         macosx_sdk_value="1070"
1936         AC_MSG_WARN([Building with SDK 10.7 is known to fail in vcl])
1937         echo "Building with SDK 10.7 is known to fail in vcl" >> warn
1938         ;;
1939     *)
1940         AC_MSG_ERROR([$with_macosx_sdk is not a supported SDK value, supported value are 10.4, 10.5, 10.6 and 10.7])
1941         ;;
1942     esac
1943     AC_MSG_CHECKING([the presence of the SDK $with_macosx_sdk])
1944     if test -d "$MACOSX_SDK_PATH" ; then
1945         AC_MSG_RESULT([$MACOSX_SDK_PATH ok])
1946     else
1947         AC_MSG_ERROR([$MACOSX_SDK_PATH not found])
1948     fi
1949     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
1951     case "$with_macosx_version_min_required" in
1953     10.4)
1954         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
1955         ;;
1956     10.5)
1957         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
1958         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
1959         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
1960         if [ -z $save_CC ] ; then
1961             CC="gcc-4.2 -m32"
1962             CXX="g++-4.2 -m32"
1963         fi
1964         ;;
1965     10.6)
1966         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
1967         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
1968         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
1969         if [ -z "$save_CC" ] ; then
1970             CC="gcc-4.2 -m32"
1971             CXX="g++-4.2 -m32"
1972         fi
1973         ;;
1974     10.7)
1975         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
1976         AC_MSG_WARN([Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build])
1977         echo "Building with a minimum version requirement > 10.4 break 10.4 compatibility. do not use for deliverable build" >>warn
1978         if [ -z "$save_CC" ] ; then
1979             CC="gcc-4.2 -m32"
1980             CXX="g++-4.2 -m32"
1981         fi
1982         ;;
1983     *)
1984         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])
1985         ;;
1986     esac
1988     case "$with_macosx_version_max_allowed" in
1990     10.4)
1991         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
1992         ;;
1993     10.5)
1994         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
1995         ;;
1996     10.6)
1997         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
1998         ;;
1999     10.7)
2000         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2001         ;;
2002     *)
2003         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])
2004         ;;
2005     esac
2007     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2008     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED ; then
2009         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2010     else
2011         AC_MSG_RESULT([ok])
2012     fi
2014     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent macos-with-sdk])
2015     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $macosx_sdk_value ; then
2016         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2017     else
2018         AC_MSG_RESULT([ok])
2019     fi
2020     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2021     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2023 AC_SUBST(MACOSX_SDK_PATH)
2024 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2025 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2026 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2028 dnl ===================================================================
2029 dnl  Test the gcc version,  3 is OK
2030 dnl ===================================================================
2031 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) -a "$GCC" = "yes"; then
2032     AC_MSG_CHECKING([the GNU C compiler version])
2033     _gcc_version=`$CC -dumpversion`
2034     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2035     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2037     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100" ; then
2038         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0" ; then
2039             export CC="$GCC_HOME/bin/gcc-4.0"
2040             #  export CC to have it available in set_soenv -> config.guess
2041             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2042             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100" ; then
2043                 GCCVER=$GCCVER2
2044             fi
2045         fi
2046         if test "$GCCVER" -ge "040100" ; then
2047             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])
2048         else
2049             AC_MSG_RESULT([implicitly using CC=$CC])
2050         fi
2051     else
2052         AC_MSG_RESULT([checked (gcc $_gcc_version)])
2053     fi
2058 # prefix C with ccache if needed
2060 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" ; then
2061     if test "$CCACHE" != "" ; then
2062         AC_MSG_CHECKING([whether $CC is already ccached])
2065         AC_LANG_PUSH([C])
2066         save_CFLAGS=$CFLAGS
2067         CFLAGS="$CFLAGS --ccache-skip -O2"
2068         dnl an empty program will do, we're checking the compiler flags
2069         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2070                           [use_ccache=yes], [use_ccache=no])
2071         if test $use_ccache = yes ; then
2072             AC_MSG_RESULT([yes])
2073         else
2074             CC="$CCACHE $CC"
2075             AC_MSG_RESULT([no])
2076         fi
2077         CFLAGS=$save_CFLAGS
2078         AC_LANG_POP([C])
2079     fi
2083 HAVE_LD_BSYMBOLIC_FUNCTIONS=
2084 if test "$GCC" = "yes"; then
2085     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
2086     bsymbolic_functions_ldflags_save=$LDFLAGS
2087     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
2088     AC_LINK_IFELSE([AC_LANG_PROGRAM([
2089 #include <stdio.h>
2090         ],[
2091 printf ("hello world\n");
2092         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
2093     if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
2094         AC_MSG_RESULT( found )
2095     else
2096         AC_MSG_RESULT( not found )
2097     fi
2098     LDFLAGS=$bsymbolic_functions_ldflags_save
2100 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
2102 dnl ===================================================================
2103 dnl Set up a different compiler to produce tools to run on the build
2104 dnl machine when doing cross-compilation
2105 dnl ===================================================================
2107 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
2108 if test "$cross_compiling" = "yes"; then
2109     AC_MSG_CHECKING([for BUILD platform configuration])
2110     echo
2111     rm -rf CONF-FOR-BUILD Env.Build.sh
2112     mkdir CONF-FOR-BUILD
2113     tar cf - \
2114         Makefile.in \
2115         bin/repo-list.in \
2116         config.guess \
2117         configure \
2118         ooo.lst.in \
2119         oowintool \
2120         post_download.in \
2121         set_soenv.in \
2122         solenv/inc/langlist.mk \
2123         solenv/inc/postset.mk \
2124         desktop/scripts/soffice.sh.in \
2125     | (cd CONF-FOR-BUILD && tar xf -)
2126     (
2127     unset COM GUI GUIBASE OS CPU CPUNAME
2128     unset CC CXX SYSBASE CFLAGS
2129     unset PYTHON_CFLAGS PYTHON_LIBS
2130     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
2131     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
2132     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
2133     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
2134     cd CONF-FOR-BUILD
2135     sub_conf_opts=""
2136     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
2137     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
2138     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
2139     ./configure \
2140         --disable-mozilla \
2141         --disable-build-mozilla \
2142         --disable-zenity \
2143         --with-num-cpus="$with_num_cpus" \
2144         --with-max-jobs="$with_max_jobs" \
2145         $sub_conf_opts \
2146         2>&1 | sed -e 's/^/    /'
2147     test -f ./Env.Host.sh 2>/dev/null || exit
2148     cp Env.Host.sh ../Env.Build.sh
2149     . ./Env.Host.sh
2150     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
2151              SYSTEM_LIBXSLT; do
2152         VV='$'$V
2153         VV=`eval "echo $VV"`
2154         if test -n "$VV"; then
2155             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
2156             echo "$line" >>build-config
2157         fi
2158     done
2160     for V in OUTDIR PATH SOLARINC SOLARLIB WORKDIR; do
2161         VV='$'$V
2162         VV=`eval "echo $VV"`
2163         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
2164         if test -n "$VV"; then
2165             line="${V}_FOR_BUILD='$VV'"
2166             echo "$line" >>build-config
2167         fi
2168     done
2169     )
2170     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
2171     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])
2172     perl -pi -e 's,/CONF-FOR-BUILD,,g' Env.Build.sh
2173     eval `cat CONF-FOR-BUILD/build-config`
2174     AC_MSG_RESULT([checking for BUILD platform configuration... done])
2175     rm -rf CONF-FOR-BUILD
2176 else
2177     CC_FOR_BUILD="$CC"
2178     CXX_FOR_BUILD="$CXX"
2180 AC_SUBST(COM_FOR_BUILD)
2181 AC_SUBST(GUI_FOR_BUILD)
2182 AC_SUBST(GUIBASE_FOR_BUILD)
2183 AC_SUBST(OS_FOR_BUILD)
2184 AC_SUBST(CPU_FOR_BUILD)
2185 AC_SUBST(CPUNAME_FOR_BUILD)
2186 AC_SUBST(CC_FOR_BUILD)
2187 AC_SUBST(CXX_FOR_BUILD)
2188 AC_SUBST(GXX_INCLUDE_PATH_FOR_BUILD)
2189 AC_SUBST(INPATH_FOR_BUILD)
2190 AC_SUBST(OUTPATH_FOR_BUILD)
2191 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
2192 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
2194 AC_SUBST(OUTDIR_FOR_BUILD)
2195 AC_SUBST(PATH_FOR_BUILD)
2196 AC_SUBST(SOLARINC_FOR_BUILD)
2197 AC_SUBST(SOLARLIB_FOR_BUILD)
2198 AC_SUBST(WORKDIR_FOR_BUILD)
2200 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
2201 SOURCEVERSION="OOO$UPD"
2202 AC_SUBST(UPD)
2203 AC_SUBST(SOURCEVERSION)
2205 dnl ===================================================================
2206 dnl Set the ENABLE_CRASHDUMP variable.
2207 dnl ===================================================================
2208 AC_MSG_CHECKING([whether to enable crashdump feature])
2209 if test "$enable_crashdump" = "yes"; then
2210     ENABLE_CRASHDUMP="TRUE"
2211     BUILD_TYPE="$BUILD_TYPE CRASHREP"
2212     AC_MSG_RESULT([yes])
2213 else
2214     ENABLE_CRASHDUMP=""
2215     AC_MSG_RESULT([no])
2217 AC_SUBST(ENABLE_CRASHDUMP)
2220 dnl ===================================================================
2221 dnl Windows specific tests and stuff
2222 dnl ===================================================================
2223 if test "$_os" = "WINNT"; then
2225     dnl Include twain scanners
2226     BUILD_TYPE="$BUILD_TYPE TWAIN"
2228     dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice.
2229     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2230     if test "z$enable_cl_x64" = "z" -o "$enable_cl_x64" = "no"; then
2231         CL_X64=""
2232         AC_MSG_RESULT([no])
2233     else
2234         CL_X64="TRUE"
2235         AC_MSG_RESULT([yes])
2236     fi
2237     AC_SUBST(CL_X64)
2239     AC_MSG_CHECKING([whether to use DirectX])
2240     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2241         ENABLE_DIRECTX="TRUE"
2242         AC_MSG_RESULT([yes])
2243     else
2244         ENABLE_DIRECTX=""
2245         AC_MSG_RESULT([no])
2246     fi
2247     AC_SUBST(ENABLE_DIRECTX)
2249     AC_MSG_CHECKING([whether to use ActiveX])
2250     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2251         DISABLE_ACTIVEX=""
2252         AC_MSG_RESULT([yes])
2253     else
2254         DISABLE_ACTIVEX="TRUE"
2255         AC_MSG_RESULT([no])
2256     fi
2257     AC_SUBST(DISABLE_ACTIVEX)
2259     AC_MSG_CHECKING([whether to use ATL])
2260     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE"; then
2261         DISABLE_ATL=""
2262         AC_MSG_RESULT([yes])
2263     elif test "$enable_atl" = ""; then
2264         if test "$WITH_MINGW" = "yes"; then
2265             DISABLE_ATL="TRUE"
2266             AC_MSG_RESULT([no])
2267         else
2268             DISABLE_ATL=""
2269             AC_MSG_RESULT([yes])
2270         fi
2271     else
2272         DISABLE_ATL="TRUE"
2273         AC_MSG_RESULT([no])
2274     fi
2275     AC_SUBST(DISABLE_ATL)
2278 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
2279 dnl ===================================================================
2280 AC_MSG_CHECKING([whether to turn warnings to errors])
2281 if test -n "$enable_werror" && test "$enable_werror" != "no"; then
2282     ENABLE_WERROR="TRUE"
2283     AC_MSG_RESULT([yes])
2284 else
2285     ENABLE_WERROR="FALSE"
2286     AC_MSG_RESULT([no])
2288 AC_SUBST(ENABLE_WERROR)
2290 dnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
2291 dnl ===================================================================
2292 AC_MSG_CHECKING([whether to do a debug build])
2293 if test -n "$enable_debug" && test "$enable_debug" != "no"; then
2294     ENABLE_DEBUG="TRUE"
2295     enable_symbols="yes"
2296     AC_MSG_RESULT([yes])
2297 else
2298     ENABLE_DEBUG="FALSE"
2299     AC_MSG_RESULT([no])
2301 AC_SUBST(ENABLE_DEBUG)
2303 dnl Set the ENABLE_DBGUTIL variable
2304 dnl ===================================================================
2305 AC_MSG_CHECKING([whether to build with additional debug utilities])
2306 if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
2307     PROEXT=""
2308     PRODUCT=""
2310     # Compiling with MSVC using --enable-dbgutil (i.e. using the
2311     # debugging runtime, and defining _DEBUG when compiling) just
2312     # causes too many compilation errors. After having spent some
2313     # months slowly fixing them one by one, having reached sw, I give
2314     # up. Feel free to try again.
2315     if test "$_os" = WINNT -a "$WITH_MINGW" != yes; then
2316         AC_MSG_ERROR([Sorry, --enable-dbgutil won't work with MSVC])
2317     fi
2319     AC_MSG_RESULT([yes])
2320     # cppunit and graphite expose STL in public headers
2321     if test "$with_system_cppunit" = "yes"; then
2322         AC_MSG_ERROR([--with-system-cppunit conflicts with DBG_UTIL build])
2323     else
2324         with_system_cppunit=no
2325     fi
2326     if test "$with_system_graphite" = "yes"; then
2327         AC_MSG_ERROR([--with-system-graphite conflicts with DBG_UTIL build])
2328     else
2329         with_system_graphite=no
2330     fi
2331     if test "$with_system_mysql_cppconn" = "yes"; then
2332         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with DBG_UTIL build])
2333     else
2334         with_system_mysql_cppconn=no
2335     fi
2336     if test $_os = WINNT -a \
2337             \( "$enable_mozilla" != no -o \
2338                "$enable_build_mozilla" != no \); then
2339         # We can't build against the Mozilla stuff if using _DEBUG, will get linking errors
2340         # See connectivity/drivers/mozab
2341         AC_MSG_WARN([Also disabling Mozilla stuff then])
2342         enable_mozilla=no
2343         enable_build_mozilla=no
2344     fi
2345 else
2346     PRODUCT="full"
2347     PROEXT=".pro"
2348     AC_MSG_RESULT([no, full product build])
2350 AC_SUBST(PRODUCT)
2351 AC_SUBST(PROEXT)
2353 dnl Determine whether to use linkoo for the smoketest installation
2354 dnl ===================================================================
2355 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
2356 if test "$enable_linkoo" = "no"; then
2357     DISABLE_LINKOO="TRUE"
2358     AC_MSG_RESULT([no])
2359 else
2360     DISABLE_LINKOO=
2361     AC_MSG_RESULT([yes])
2363 AC_SUBST(DISABLE_LINKOO)
2365 # Set the ENABLE_LTO variable
2366 # ===================================================================
2367 AC_MSG_CHECKING([whether to use link-time optimization])
2368 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
2369     ENABLE_LTO="TRUE"
2370     AC_MSG_RESULT([yes])
2371 else
2372     ENABLE_LTO=""
2373     AC_MSG_RESULT([no])
2375 AC_SUBST(ENABLE_LTO)
2377 dnl whether to include symbols into final build.
2378 dnl ===================================================================
2379 AC_MSG_CHECKING([whether to include symbols])
2380 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
2381     ENABLE_SYMBOLS="TRUE"
2382     AC_MSG_RESULT([yes])
2383 else
2384     ENABLE_SYMBOLS=
2385     AC_MSG_RESULT([no])
2387 AC_SUBST(ENABLE_SYMBOLS)
2389 dnl Determine if the solver is to be stripped or not.
2390 dnl ===================================================================
2391 AC_MSG_CHECKING([whether to strip the solver or not.])
2392 if test "z$enable_strip_solver" = "zno"; then
2393     DISABLE_STRIP="TRUE"
2394     AC_MSG_RESULT([no])
2395 else
2396     if test -n "$ENABLE_SYMBOLS"; then
2397         DISABLE_STRIP="TRUE"
2398         AC_MSG_RESULT([no])
2399     else
2400         DISABLE_STRIP=
2401         AC_MSG_RESULT([yes])
2402     fi
2404 AC_SUBST(DISABLE_STRIP)
2406 dnl check for cups support
2407 dnl ===================================================================
2408 if test "$test_cups" = "yes"; then
2409     AC_MSG_CHECKING([whether cups support is present])
2410     AC_CHECK_LIB(cups, cupsPrintFiles)
2411     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
2412     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
2413         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups???-devel.])
2414     fi
2418 # check for fontconfig support
2419 AC_MSG_CHECKING([whether we need fontconfig])
2420 if test "z$test_fontconfig" = "zyes"; then
2421     ENABLE_FONTCONFIG="TRUE"
2422     AC_MSG_RESULT([yes])
2423     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
2424 else
2425     ENABLE_FONTCONFIG=""
2426     AC_MSG_RESULT([no])
2428 AC_SUBST(ENABLE_FONTCONFIG)
2429 AC_SUBST(FONTCONFIG_CFLAGS)
2430 AC_SUBST(FONTCONFIG_LIBS)
2432 dnl whether to find & fetch external tarballs?
2433 dnl ===================================================================
2434 if test -z "$TARFILE_LOCATION"; then
2435     TARFILE_LOCATION="DEFAULT"
2437 AC_SUBST(TARFILE_LOCATION)
2439 if test "z$enable_fetch_external" != "zno" ; then
2440     DO_FETCH_TARBALLS="YES"
2442 AC_SUBST(DO_FETCH_TARBALLS)
2445 dnl git-new-workdir
2446 dnl ===================================================================
2447 AC_SUBST(GIT_LINK_SRC)
2449 dnl Disable legacy binary file formats filters
2450 dnl ===================================================================
2451 AC_MSG_CHECKING([whether to enable filters for legacy binary file formats (StarOffice 5.2)])
2452 if test "$enable_binfilter" = "no"; then
2453     WITH_BINFILTER="NO"
2454     AC_MSG_RESULT([no])
2455 else
2456     WITH_BINFILTER="YES"
2457     BUILD_TYPE="$BUILD_TYPE BINFILTER"
2458     GIT_REPO_NAMES="$GIT_REPO_NAMES binfilter"
2459     AC_MSG_RESULT([yes])
2461 AC_SUBST(WITH_BINFILTER)
2463 AC_MSG_CHECKING([whether to build help])
2464 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
2465     AC_MSG_RESULT([yes])
2466     BUILD_TYPE="$BUILD_TYPE HELP"
2467     SCPDEFS="$SCPDEFS -DWITH_HELP"
2468     GIT_REPO_NAMES="$GIT_REPO_NAMES help"
2469 else
2470     AC_MSG_RESULT([no])
2473 dnl Enable ugly pieces of code we're better off without
2474 dnl ===================================================================
2475 if test "$enable_ugly" = "yes"; then
2476     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2477     SCPDEFS="$SCPDEFS -DWITH_UGLY"
2478     ENABLE_UGLY=YES
2479 else
2480     ENABLE_UGLY=NO
2482 AC_SUBST(ENABLE_UGLY)
2484 dnl ===================================================================
2485 dnl Disable rpath in shared libraries?
2486 dnl ===================================================================
2487 AC_MSG_CHECKING([whether to use RPATH in shared libraries])
2488 if test "$enable_rpath" = "no"; then
2489     ENABLE_RPATH="no"
2490 else
2491     ENABLE_RPATH="yes"
2493 AC_MSG_RESULT([$ENABLE_RPATH])
2494 AC_SUBST(ENABLE_RPATH)
2496 dnl Test whether to include MySpell dictionaries
2497 dnl ===================================================================
2498 AC_MSG_CHECKING([whether to include MySpell dictionaries])
2499 if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then
2500     AC_MSG_RESULT([yes])
2501     WITH_MYSPELL_DICTS=YES
2502     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
2503     GIT_REPO_NAMES="$GIT_REPO_NAMES dictionaries"
2504 else
2505     AC_MSG_RESULT([no])
2506     WITH_MYSPELL_DICTS=NO
2508 AC_SUBST(WITH_MYSPELL_DICTS)
2510 AC_MSG_CHECKING([whether to use dicts from external paths])
2511 if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
2512     AC_MSG_RESULT([yes])
2513     SYSTEM_DICTS=YES
2514     AC_MSG_CHECKING([for spelling dictionary directory])
2515     if test -n "$with_external_dict_dir"; then
2516         DICT_SYSTEM_DIR=file://$with_external_dict_dir
2517     else
2518         DICT_SYSTEM_DIR=file:///usr/share/hunspell
2519     fi
2520     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
2521     AC_MSG_CHECKING([for hyphenation patterns directory])
2522     if test -n "$with_external_hyph_dir"; then
2523         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
2524     else
2525         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
2526     fi
2527     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
2528     AC_MSG_CHECKING([for thesaurus directory])
2529     if test -n "$with_external_thes_dir"; then
2530         THES_SYSTEM_DIR=file://$with_external_thes_dir
2531     else
2532         THES_SYSTEM_DIR=file:///usr/share/mythes
2533     fi
2534     AC_MSG_RESULT([$THES_SYSTEM_DIR])
2535 else
2536     AC_MSG_RESULT([no])
2537     SYSTEM_DICTS=NO
2539 AC_SUBST(SYSTEM_DICTS)
2540 AC_SUBST(DICT_SYSTEM_DIR)
2541 AC_SUBST(HYPH_SYSTEM_DIR)
2542 AC_SUBST(THES_SYSTEM_DIR)
2544 dnl ===================================================================
2545 dnl Set the ENABLE_PCH variable. (Activate --enable-pch)
2546 dnl ===================================================================
2547 AC_MSG_CHECKING([whether to enable pch feature])
2548 if test -n "$enable_pch" && test "$enable_pch" != "no"; then
2549     if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
2550         ENABLE_PCH="TRUE"
2551         AC_MSG_RESULT([yes])
2552 dnl There is no PCH support in GCC versions prior to this
2553     elif test "$GCC" = "yes"; then
2554         ENABLE_PCH="TRUE"
2555         AC_MSG_RESULT([yes])
2556     else
2557         ENABLE_PCH=""
2558         AC_MSG_WARN([Precompiled header not yet supported for your platform/compiler])
2559     fi
2560 else
2561     ENABLE_PCH=""
2562     AC_MSG_RESULT([no])
2564 AC_SUBST(ENABLE_PCH)
2566 dnl ===================================================================
2567 dnl Search all the common names for GNU make
2568 dnl ===================================================================
2569 AC_MSG_CHECKING([for GNU make])
2571 # try to use our own make if it is available and GNUMAKE was not already defined
2572 if test -z "$GNUMAKE"; then
2573     if test -x "/opt/lo/bin/make"; then
2574         GNUMAKE="/opt/lo/bin/make"
2575     fi
2578 for a in "$MAKE" $GNUMAKE make gmake gnumake; do
2579     $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
2580     if test $? -eq 0;  then
2581         GNUMAKE=$a
2582         break
2583     fi
2584 done
2585 AC_MSG_RESULT($GNUMAKE)
2586 if test -z "$GNUMAKE"; then
2587     AC_MSG_ERROR([not found. install GNU make.])
2590 AC_MSG_CHECKING([the GNU make version])
2591 _make_version=`$GNUMAKE --version | grep GNU | grep -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
2592 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2593 if test "$_make_longver" -ge "038200" ; then
2594     AC_MSG_RESULT([$GNUMAKE $_make_version])
2596 elif test "$_make_longver" -ge "038100" ; then
2597     AC_MSG_RESULT([$GNUMAKE $_make_version])
2598     AC_MSG_CHECKING([for GNU make bug 20033])
2599     TESTGMAKEBUG20033=`mktemp -d`
2600     cat > $TESTGMAKEBUG20033/Makefile << EOF
2601 A := \$(wildcard *.a)
2603 .PHONY: all
2604 all: \$(A:.a=.b)
2605         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
2607 .PHONY: setup
2608 setup:
2609         @touch 1.a 2.a 3.a 4.a 5.a 6.a
2611 define d1
2612 @echo lala \$(1)
2613 @sleep 1
2614 endef
2616 define d2
2617 @echo tyty \$(1)
2618 @sleep 1
2619 endef
2621 %.b : %.a
2622         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | sha1sum))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
2623         \$(call d1,\$(CHECKSUM)),\
2624         \$(call d2,\$(CHECKSUM)))
2626     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
2627         no_parallelism_make="YES"
2628         AC_MSG_RESULT([yes, disable parallelism])
2629     else
2630         AC_MSG_RESULT([no, keep parallelism enabled])
2631     fi
2632     rm -rf $TESTGMAKEBUG20033
2633 else
2634     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
2636 AC_SUBST(GNUMAKE)
2638 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`;
2639 STALE_MAKE=
2640 make_warning=
2641 if test "z$_make_ver_check" = "z"; then
2642    STALE_MAKE=TRUE
2644 AC_SUBST(STALE_MAKE)
2646 dnl ===================================================================
2647 dnl  Test the Solaris compiler version
2648 dnl ===================================================================
2649 if test "$_os" = "SunOS"; then
2650     if test "$CC" = "cc"; then
2651         AC_PATH_PROGS(_cc, cc)
2652         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2653         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2654         dnl cc -V outputs to standard error!!!!
2655         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2656         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2657         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2658         if test "$_sunstudio_major" != "5"; then
2659             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2660         else
2661             _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" }'`
2662             if test "$_sunstudio_minor" = "false"; then
2663                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2664             else
2665                 dnl compiler will do
2666                 AC_MSG_RESULT([checked])
2667             fi
2668         fi
2669     fi
2672 HAVE_LD_HASH_STYLE=FALSE
2673 WITH_LINKER_HASH_STYLE=
2674 AC_MSG_CHECKING( for --hash-style gcc linker support )
2675 if test "$GCC" = "yes" ; then
2676     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes" ; then
2677         hash_styles="gnu sysv"
2678     elif test "$with_linker_hash_style" = "no" ; then
2679         hash_styles=
2680     else
2681         hash_styles="$with_linker_hash_style"
2682     fi
2684     for hash_style in $hash_styles ; do
2685         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
2686         hash_style_ldflags_save=$LDFLAGS
2687         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
2689         AC_LINK_IFELSE([AC_LANG_PROGRAM(
2690             [
2691 #include <stdio.h>
2692             ],[
2693 printf ("");
2694             ])],
2695             [ if ./conftest$EXEEXT; then
2696                   HAVE_LD_HASH_STYLE=TRUE
2697                   WITH_LINKER_HASH_STYLE=$hash_style
2698               fi],
2699             [HAVE_LD_HASH_STYLE=FALSE])
2700         LDFLAGS=$hash_style_ldflags_save
2701     done
2703     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
2704         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
2705     else
2706         AC_MSG_RESULT( no )
2707     fi
2708     LDFLAGS=$hash_style_ldflags_save
2709 else
2710     AC_MSG_RESULT( no )
2712 AC_SUBST(HAVE_LD_HASH_STYLE)
2713 AC_SUBST(WITH_LINKER_HASH_STYLE)
2715 dnl ===================================================================
2716 dnl Check whether there's a Perl version available.
2717 dnl ===================================================================
2718 if test -z "$with_perl_home"; then
2719     AC_PATH_PROG(PERL, perl)
2720 else
2721     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
2722     _perl_path="$with_perl_home/bin/perl"
2723     if test -x "$_perl_path"; then
2724         PERL=$_perl_path
2725     else
2726         AC_MSG_ERROR([$_perl_path not found])
2727     fi
2730 dnl ===================================================================
2731 dnl Testing for Perl version 5 or greater.
2732 dnl $] is the Perl version variable, it is returned as an integer
2733 dnl ===================================================================
2734 if test "$PERL"; then
2735     AC_MSG_CHECKING([the Perl version])
2736     ${PERL} -e "exit($]);"
2737     _perl_version=$?
2738     if test "$_perl_version" -lt 5; then
2739         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
2740     fi
2741     AC_MSG_RESULT([checked (perl $_perl_version)])
2742 else
2743     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
2745 AC_SUBST(PERL)
2747 dnl ===================================================================
2748 dnl Testing for required Perl modules
2749 dnl ===================================================================
2751 AC_MSG_CHECKING([for required Perl modules])
2752 if `$PERL -e 'use Archive::Zip; use Cwd;'`; then
2753     AC_MSG_RESULT([all modules found])
2754 else
2755     AC_MSG_ERROR([Failed to find some modules])
2758 dnl ===================================================================
2759 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2760 dnl ===================================================================
2761 SHOWINCLUDES_PREFIX=
2762 if test "$_os" = "WINNT"; then
2763     if test "$WITH_MINGW" != "yes"; then
2764         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
2765         if test -z "$with_cl_home"; then
2766             vctest=`./oowintool --msvc-productdir`;
2767             if test "$CL_X64" = ""; then
2768                 if test -x "$vctest/bin/cl.exe"; then
2769                     with_cl_home=$vctest;
2770                 fi
2771             else
2772                 if test -x "$vctest/bin/amd64/cl.exe"; then
2773                     with_cl_home=$vctest;
2774                 fi
2775             fi
2776         else
2777             with_cl_home=`cygpath -u "$with_cl_home"`
2778         fi
2779         with_cl_home=`cygpath -d "$with_cl_home"`
2780         with_cl_home=`cygpath -u "$with_cl_home"`
2781         AC_MSG_RESULT([$with_cl_home])
2783         dnl ===========================================================
2784         dnl  Check for mspdb80.dll/mspdb100.dll
2785         dnl ===========================================================
2786         dnl MSVS 2008/10 Compiler
2787         if test -n "$with_mspdb_path";then
2788             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2789         fi
2790         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll"; then
2791             MSPDB_PATH="$with_mspdb_path"
2792         fi
2793         dnl MSVS 2008 case
2794         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2795             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2796         fi
2797         dnl Windows SDK 6.0 case
2798         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2799             MSPDB_PATH="$with_cl_home/bin"
2800         fi
2801         dnl MSVS 2010 case
2802         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
2803             MSPDB_PATH="$with_cl_home/../Common7/IDE"
2804         fi
2806         if test -z "$MSPDB_PATH";then
2807             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2808             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2809             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
2810             MSPDB_PATH=`dirname "$MSPDB_PATH"`
2811         fi
2813         if test -z "$MSPDB_PATH"; then
2814             AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path])
2815         fi
2816         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2817         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2818         dnl The path needs to be added before cl is called
2819         PATH="$MSPDB_PATH:$PATH"
2821         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2822         if test -z "$CC"; then
2823             if test "$CL_X64" = ""; then
2824                 if test -x "$with_cl_home/bin/cl.exe"; then
2825                     CC="$with_cl_home/bin/cl.exe"
2826                 fi
2827             else
2828                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
2829                     CC="$with_cl_home/bin/amd64/cl.exe"
2830                 fi
2831             fi
2832             if test -z "$CC"; then
2833                 AC_PATH_PROG(CC, cl.exe)
2834             fi
2835             # This gives us a posix path with 8.3 filename restrictions
2836             CC=`cygpath -d "$CC"`
2837             CC=`cygpath -u "$CC"`
2838         fi
2840         if test -n "$CC"; then
2841             # Remove /cl.exe from CC case insensitive
2842             AC_MSG_RESULT([found ($CC)])
2843             if test "$CL_X64" = ""; then
2844                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
2845             else
2846                 if test -n "$with_cl_home"; then
2847                     COMPATH=`echo $with_cl_home`
2848                 fi
2849             fi
2850             export INCLUDE=`cygpath -d "$COMPATH/Include"`
2851             dnl  Check which Microsoft C/C++ compiler is found
2852             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2853             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
2854             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
2855                             x = match( \\\$0, /..\\...\\...../ )
2856                             CCversion = substr( \\\$0, RSTART, RLENGTH)
2857                             tokencount = split (CCversion,vertoken,\".\")
2858                             for ( i = 1 ; i <= tokencount ; i++ ) {
2859                                 printf (\"%04d\",vertoken[[i]] )
2860                             }
2861                             }"`
2862             if test "$CCNUMVER" -ge "001600000000"; then
2863                 COMEX=13
2864                 MSVSVER=2010
2865             elif test "$CCNUMVER" -ge "001500000000"; then
2866                 COMEX=12
2867                 MSVSVER=2008
2868             else
2869                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
2870             fi
2871             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
2872         else
2873             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
2874         fi
2876         dnl We need to guess the prefix of the -showIncludes output, it can be
2877         dnl localized
2878         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
2879         echo "#include <stdlib.h>" > conftest.c
2880         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
2881             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
2882         rm -f conftest.c conftest.obj
2883         if test -z "$SHOWINCLUDES_PREFIX" ; then
2884             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
2885         else
2886             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
2887         fi
2889         # Check for 64-bit (cross-)compiler to use to build the 64-bit
2890         # version of the Explorer extension (and maybe other small
2891         # bits, too) needed when installing a 32-bit LibreOffice on a
2892         # 64-bit OS. The 64-bit Explorer extension is a feature that
2893         # has been present since long in OOo. Don't confuse it with
2894         # building LibreOffice itself as 64-bit code, which is
2895         # unfished work and highly experimental.
2897         BUILD_X64=
2898         CC_X64_BINARY=
2899         LINK_X64_BINARY=
2900         LIBMGR_X64_BINARY=
2902         AC_MSG_CHECKING([for a x64 compiler and libraries for 64bit ActiveX component])
2903         if test "$CL_X64" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
2904             # Prefer native x64 compiler to cross-compiler, in case we are running
2905             # the build on a 64-bit OS.
2906             if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2907                 BUILD_X64=TRUE
2908                 CC_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2909                 CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
2910                 LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
2911                 LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
2912             elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
2913                 BUILD_X64=TRUE
2914                 CC_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
2915                 CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
2916                 LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
2917                 LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
2918             fi
2919         fi
2920         if test "$BUILD_X64" = TRUE; then
2921             AC_MSG_RESULT([found])
2922         else
2923             AC_MSG_RESULT([not found])
2924             AC_MSG_WARN([Installation set will not contain the 64-bit Explorer extension])
2925         fi
2926         AC_SUBST(BUILD_X64)
2928         # These are passed to the environment through set_soenv.in as usual, and then
2929         # used in set_wntx64.mk
2930         AC_SUBST(CC_X64_BINARY)
2931         AC_SUBST(CXX_X64_BINARY)
2932         AC_SUBST(LINK_X64_BINARY)
2933         AC_SUBST(LIBMGR_X64_BINARY)
2935     else
2936         AC_MSG_CHECKING([the compiler is MinGW])
2937         MACHINE_PREFIX=`$CC -dumpmachine`
2938         if echo $MACHINE_PREFIX | grep -q mingw32; then
2939             AC_MSG_RESULT([yes])
2940         else
2941             AC_MSG_ERROR([Compiler is not MinGW.])
2942         fi
2943     fi
2945 AC_SUBST(COMEX)
2946 AC_SUBST(MSPDB_PATH)
2947 AC_SUBST(SHOWINCLUDES_PREFIX)
2949 dnl ===================================================================
2950 dnl Check for pkg-config
2951 dnl ===================================================================
2952 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2953     PKG_PROG_PKG_CONFIG
2956 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2958     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
2959     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
2960     # explicitly. Or put /path/to/compiler in PATH yourself.
2962     AC_CHECK_TOOL(AR,ar)
2963     AC_CHECK_TOOL(NM,nm)
2964     AC_CHECK_TOOL(OBJDUMP,objdump)
2965     AC_CHECK_TOOL(RANLIB,ranlib)
2966     AC_CHECK_TOOL(STRIP,strip)
2967     if test "$_os" = "WINNT"; then
2968         AC_CHECK_TOOL(DLLTOOL,dlltool)
2969         AC_CHECK_TOOL(WINDRES,windres)
2970     fi
2972 AC_SUBST(AR)
2973 AC_SUBST(DLLTOOL)
2974 AC_SUBST(NM)
2975 AC_SUBST(OBJDUMP)
2976 AC_SUBST(PKG_CONFIG)
2977 AC_SUBST(RANLIB)
2978 AC_SUBST(STRIP)
2979 AC_SUBST(WINDRES)
2981 dnl ===================================================================
2982 dnl pkg-config checks on Mac OS X
2983 dnl ===================================================================
2985 if test $_os = Darwin; then
2986     AC_MSG_CHECKING([for bogus pkg-config])
2987     if test -n "$PKG_CONFIG"; then
2988         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | grep -q Mono.framework; then
2989             AC_MSG_RESULT([yes, from Mono])
2990         else
2991             AC_MSG_RESULT([yes, from unknown origin])
2992         fi
2993         AC_MSG_WARN([This might have unexpected consequences, please consider hiding $PKG_CONFIG])
2994         echo "Having a $PKG_CONFIG might have unexpected consequences, please consider hiding it" >>warn
2995     else
2996         AC_MSG_RESULT([no])
2997     fi
3000 dnl ===================================================================
3001 dnl  .NET needs special treatment
3002 dnl (does the above comment really mean .NET, or is it misusing
3003 dnl that to mean Visual Studio .NET 2003 ? And does this also
3004 dnl in fact apply equally to what we actually support, i.e.
3005 dnl Visual Studio 2008 and 2010?)
3006 dnl ===================================================================
3007 if test "$build_os" = "cygwin"; then
3008     dnl Check midl.exe
3009     AC_PATH_PROG(MIDL_PATH, midl.exe)
3010     if test -n "$MIDL_PATH";then
3011         MIDL_PATH=`dirname "$MIDL_PATH"`
3012     fi
3013     if test -n "$with_midl_path";then
3014         with_midl_path=`cygpath -u "$with_midl_path"`
3015     fi
3016     if test -x "$with_midl_path/midl.exe"; then
3017         MIDL_PATH="$with_midl_path"
3018     fi
3019     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
3020         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
3021     fi
3022     if test -z "$MIDL_PATH" ; then
3023         vstest=`./oowintool --msvs-productdir`;
3024         if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
3025             MIDL_PATH="$vstest/Common7/Tools/Bin"
3026         fi
3027     fi
3028     if test -z "$MIDL_PATH" ; then
3029         winsdktest=`./oowintool --windows-sdk-home`
3030         if test -x "$winsdktest/Bin/midl.exe" ; then
3031             MIDL_PATH="$winsdktest/Bin"
3032         fi
3033     fi
3034     if test ! -x "$MIDL_PATH/midl.exe"; then
3035         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
3036     fi
3037     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3038     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
3039     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
3041     dnl Check csc.exe
3042     AC_PATH_PROG(CSC_PATH, csc.exe)
3043     if test -n "$CSC_PATH";then
3044         CSC_PATH=`dirname "$CSC_PATH"`
3045     fi
3046     if test -n "$with_csc_path";then
3047         with_csc_path=`cygpath -u "$with_csc_path"`
3048     fi
3049     if test -x "$with_csc_path/csc.exe"; then
3050         CSC_PATH="$with_csc_path"
3051     else
3052        csctest=`./oowintool --csc-compilerdir`;
3053        if test -x "$csctest/csc.exe"; then
3054            CSC_PATH="$csctest"
3055        fi
3056     fi
3057     if test ! -x "$CSC_PATH/csc.exe"; then
3058         AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
3059     fi
3060     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3061     CSC_PATH=`cygpath -d "$CSC_PATH"`
3062     CSC_PATH=`cygpath -u "$CSC_PATH"`
3064     dnl Check mscoree.lib / .NET Framework dir
3065     AC_MSG_CHECKING(.NET Framework)
3066     if test -n "$with_dotnet_framework_home"; then
3067         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
3068     fi
3069     if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
3070         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
3071     fi
3072     if test -z "$DOTNET_FRAMEWORK_HOME" ; then
3073         frametest=`./oowintool --dotnetsdk-dir`
3074         if test -f "$frametest/lib/mscoree.lib"; then
3075             DOTNET_FRAMEWORK_HOME="$frametest"
3076         else
3077             frametest=`./oowintool --windows-sdk-home`
3078             if test -f "$frametest/lib/mscoree.lib"; then
3079                 DOTNET_FRAMEWORK_HOME="$frametest"
3080             fi
3081         fi
3082     fi
3083     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
3084         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
3085     fi
3086     AC_MSG_RESULT(found)
3087     # Convert to posix path with 8.3 filename restrictions ( No spaces )
3088     DOTNET_FRAMEWORK_HOME=`cygpath -d "$DOTNET_FRAMEWORK_HOME"`
3089     DOTNET_FRAMEWORK_HOME=`cygpath -u "$DOTNET_FRAMEWORK_HOME"`
3090     AC_SUBST(MIDL_PATH)
3091     AC_SUBST(CSC_PATH)
3092     AC_SUBST(DOTNET_FRAMEWORK_HOME)
3095 dnl ===================================================================
3096 dnl Check if stdc headers are available excluding MSVC.
3097 dnl ===================================================================
3098 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3099     AC_HEADER_STDC
3102 dnl ===================================================================
3103 dnl Testing for C++ compiler and version...
3104 dnl ===================================================================
3106 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3107     AC_PROG_CXX
3108 else
3109     if test -n "$CC" -a -z "$CXX"; then
3110         CXX="$CC"
3111     fi
3114 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
3115 if test "$GXX" = "yes"; then
3116     AC_MSG_CHECKING([the GNU C++ compiler version])
3118     _gpp_version=`$CXX -dumpversion`
3119     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
3121     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401" ; then
3122         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0" ; then
3123             export CXX="$GCC_HOME/bin/g++-4.0"
3124             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
3125             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401" ; then
3126                 _gpp_majmin=$_gpp_majmin_2
3127             fi
3128         fi
3129         if test "$_gpp_majmin" -ge "401" ; then
3130             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])
3131         else
3132             AC_MSG_RESULT([implicitly using CXX=$CXX])
3133         fi
3134     else
3135         AC_MSG_RESULT([checked (g++ $_gpp_version)])
3136     fi
3138     if test "$_gpp_majmin" = "304"; then
3139         AC_MSG_CHECKING([whether $CXX has the enum bug])
3140         AC_RUN_IFELSE([AC_LANG_SOURCE([[
3141             extern "C" void abort (void);
3142             extern "C" void exit (int status);
3144             enum E { E0, E1, E2, E3, E4, E5 };
3146             void test (enum E e)
3147             {
3148                 if (e == E2 || e == E3 || e == E1)
3149                     exit (1);
3150             }
3152             int main (void)
3153             {
3154                 test (E4);
3155                 test (E5);
3156                 test (E0);
3157                 return 0;
3158             }
3159             ]])],[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])],[])
3160     fi
3164 # prefx CXX with ccache if needed
3166 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3167     if test "$CCACHE" != "" ; then
3168         AC_MSG_CHECKING([whether $CXX is already ccached])
3169         AC_LANG_PUSH([C++])
3170         save_CXXFLAGS=$CXXFLAGS
3171         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
3172         dnl an empty program will do, we're checking the compiler flags
3173         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3174                           [use_ccache=yes], [use_ccache=no])
3175         if test $use_ccache = yes ; then
3176             AC_MSG_RESULT([yes])
3177         else
3178             CXX="$CCACHE $CXX"
3179             AC_MSG_RESULT([no])
3180         fi
3181         CXXFLAGS=$save_CXXFLAGS
3182         AC_LANG_POP([C++])
3183     fi
3186 dnl ===================================================================
3187 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
3188 dnl ===================================================================
3190 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3191     AC_PROG_CXXCPP
3193     dnl Check whether there's a C pre-processor.
3194     dnl ===================================================================
3195     dnl When using SunStudio compiler, there is a bug with the cc
3196     dnl preprocessor, so use CC preprocessor as the cc preprocessor
3197     dnl See Issuezilla #445.
3198     dnl ===================================================================
3199     if test "$_os" = "SunOS"; then
3200         CPP=$CXXCPP
3201     else
3202         AC_PROG_CPP
3203     fi
3207 dnl ===================================================================
3208 dnl Find integral type sizes and alignments
3209 dnl ===================================================================
3211 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
3213     AC_CHECK_SIZEOF(long)
3214     AC_CHECK_SIZEOF(short)
3215     AC_CHECK_SIZEOF(int)
3216     AC_CHECK_SIZEOF(long long)
3217     AC_CHECK_SIZEOF(double)
3218     AC_CHECK_SIZEOF(void*)
3220     SIZEOF_SHORT=$ac_cv_sizeof_short
3221     SIZEOF_INT=$ac_cv_sizeof_int
3222     SIZEOF_LONG=$ac_cv_sizeof_long
3223     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
3224     SIZEOF_DOUBLE=$ac_cv_sizeof_double
3225     SIZEOF_POINTER=$ac_cv_sizeof_voidp
3227     dnl Allow build without AC_CHECK_ALIGNOF, grrr
3228     m4_pattern_allow([AC_CHECK_ALIGNOF])
3229     m4_ifdef([AC_CHECK_ALIGNOF],
3230       ,
3231       [
3232          dnl We know that the ALIGNOF_ variables are used only when cross-compiling
3233          dnl in sal/typesconfig/makefile.mk...
3234          if test "$cross_compiling" = "yes"; then
3235             AC_MSG_ERROR([When cross-compiling you must use a recent Autoconf with [AC_][CHECK_ALIGNOF]])
3236          fi
3237          m4_define([AC_CHECK_ALIGNOF],
3238             [
3239                AC_MSG_WARN([Cannot determine alignment of $1])
3240                AS_TR_SH([ac_cv_alignof_$3])=unknown
3241             ])
3242       ])
3244     AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
3245     AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
3246     AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
3247     AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
3249     ALIGNOF_SHORT=$ac_cv_alignof_short
3250     ALIGNOF_INT=$ac_cv_alignof_int
3251     ALIGNOF_LONG=$ac_cv_alignof_long
3252     ALIGNOF_DOUBLE=$ac_cv_alignof_double
3254     AC_C_BIGENDIAN
3255     WORDS_BIGENDIAN=$ac_cv_c_bigendian
3257     dnl Check for large file support
3258     AC_SYS_LARGEFILE
3259     if test -n "$ac_cv_sys_file_offset_bits"; then
3260         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
3261     fi
3262     if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
3263         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
3264     fi
3265 else
3266     # Hardcode for MSVC
3267     SIZEOF_SHORT=2
3268     SIZEOF_INT=4
3269     SIZEOF_LONG=4
3270     SIZEOF_LONGLONG=8
3271     if test "$CL_X64" = ""; then
3272         SIZEOF_POINTER=4
3273     else
3274         SIZEOF_POINTER=8
3275     fi
3276     ALIGNOF_SHORT=2
3277     ALIGNOF_INT=4
3278     ALIGNOF_LONG=4
3279     ALIGNOF_DOUBLE=8
3280     WORDS_BIGENDIAN=no
3281     LFS_CFLAGS=''
3283 AC_SUBST(WORDS_BIGENDIAN)
3284 AC_SUBST(LFS_CFLAGS)
3286 AC_SUBST(SIZEOF_SHORT)
3287 AC_SUBST(SIZEOF_INT)
3288 AC_SUBST(SIZEOF_LONG)
3289 AC_SUBST(SIZEOF_LONGLONG)
3290 AC_SUBST(SIZEOF_DOUBLE)
3291 AC_SUBST(SIZEOF_POINTER)
3292 AC_SUBST(ALIGNOF_SHORT)
3293 AC_SUBST(ALIGNOF_INT)
3294 AC_SUBST(ALIGNOF_LONG)
3295 AC_SUBST(ALIGNOF_DOUBLE)
3297 dnl ===================================================================
3298 dnl Check if valgrind.h is available
3299 dnl ===================================================================
3300 if test "$cross_compiling" != "yes" -a "$enable_dbgutil" != "no" -a \
3301         -z "$VALGRIND_CFLAGS"; then
3302     dnl Test $prefix (currently only testing for /usr and /usr/local)
3303     dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
3304     prev_cppflags=$CPPFLAGS
3305     CPPFLAGS="-I/usr/include/valgrind"
3306     AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
3307     if test -z "$VALGRIND_CFLAGS"; then
3308         CPPFLAGS="-I/usr/local/include/valgrind"
3309         AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
3310     fi
3311     if test -n "$VALGRIND_CFLAGS"; then
3312         CPPFLAGS=$VALGRIND_CFLAGS
3313         AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
3314     fi
3315     CPPFLAGS=$prev_cppflags
3317 AC_SUBST([VALGRIND_CFLAGS])
3319 dnl ===================================================================
3320 dnl Set the gcc/gxx include directories
3321 dnl ===================================================================
3322 # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
3323 # often contains an i386 which is expanded as a macro.
3324 if test "$GXX" = "yes"; then
3325     AC_MSG_CHECKING([for g++ include path])
3326     if test -z "$with_gxx_include_path"; then
3327         with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
3328         if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
3329             with_gxx_include_path="/usr/include"
3330         fi
3331         if echo $with_gxx_include_path | grep -q linux; then
3332             # workaround for Mandriva - issue 100049
3333             with_gxx_include_path=`cd $with_gxx_include_path && pwd`
3334         fi
3335     fi
3336     dnl This is the original code...
3337     dnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
3338     if test -z "$with_gxx_include_path"; then
3339         with_gxx_include_path="NO_GXX_INCLUDE"
3340         AC_MSG_RESULT([none])
3341     else
3342         AC_MSG_RESULT([$with_gxx_include_path])
3343     fi
3344 else
3345     with_gxx_include_path="NO_GXX_INCLUDE"
3347 GXX_INCLUDE_PATH="$with_gxx_include_path"
3348 AC_SUBST(GXX_INCLUDE_PATH)
3350 dnl ===================================================================
3351 dnl Set the MinGW include directories
3352 dnl ===================================================================
3353 if test "$WITH_MINGW" = "yes"; then
3354     AC_MSG_CHECKING([for MinGW include path])
3355     cat >conftest.$ac_ext <<_ACEOF
3356 #include <stddef.h>
3357 #include <bits/c++config.h>
3358 _ACEOF
3359     _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`
3360     rm conftest.$ac_ext
3361     if test -z "$_mingw_lib_include_path"; then
3362         _mingw_lib_include_path="NO_LIB_INCLUDE"
3363         AC_MSG_RESULT([no MinGW include path])
3364     else
3365         AC_MSG_RESULT([$_mingw_lib_include_path])
3366     fi
3367     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
3368     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
3370     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
3371     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
3373     AC_LANG_PUSH([C++])
3375     AC_MSG_CHECKING([for dynamic libgcc])
3376     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3377 #include <iostream>
3378 using namespace std;
3379 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[   
3380             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
3381             if test -n "$MINGW_GCCDLL"; then
3382                 MINGW_SHARED_GCCLIB=YES
3383                 AC_MSG_RESULT([ $MINGW_GCCDLL])
3384             else
3385                 MINGW_SHARED_GCCLIB=NO
3386                 AC_MSG_RESULT([no])
3387             fi
3388        ],[ AC_MSG_RESULT([no])
3389        
3390     ])
3392     AC_MSG_CHECKING([for dynamic libstdc++])
3393     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3394 #include <iostream>
3395 using namespace std;
3396 ]], [[ cout << "Hello there." << endl; ]])],[   
3397             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
3398             if test -n "$MINGW_GXXDLL"; then
3399                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
3400                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
3401                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
3402                 MINGW_SHARED_GXXLIB=YES
3403                 AC_MSG_RESULT([$MINGW_GXXDLL])
3404             else
3405                 MINGW_SHARED_GXXLIB=NO
3406                 AC_MSG_RESULT([no])
3407             fi
3408        ],[ AC_MSG_RESULT([no])
3409        
3410     ])
3412     AC_LANG_POP([C++])
3414     AC_SUBST(MINGW_CLIB_DIR)
3415     AC_SUBST(MINGW_SHARED_GCCLIB)
3416     AC_SUBST(MINGW_SHARED_GXXLIB)
3417     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
3418     AC_SUBST(MINGW_GCCDLL)
3419     AC_SUBST(MINGW_GXXDLL)
3422 dnl ===================================================================
3423 dnl Extra checking for the SunOS compiler
3424 dnl ===================================================================
3425 if test "$_os" = "SunOS"; then
3426     dnl SunStudio C++ compiler packaged with SunStudio C compiler
3427     if test "$CC" = "cc"; then
3428     AC_MSG_CHECKING([SunStudio C++ Compiler])
3429         if test "$CXX" != "CC"; then
3430             AC_MSG_WARN([SunStudio C++ was not found])
3431             echo "SunStudio C++ was not found" >> warn
3432         else
3433             AC_MSG_RESULT([checked])
3434         fi
3435     fi
3438 dnl *************************************************************
3439 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
3440 dnl *************************************************************
3441 if test "$WITH_MINGW" = "yes"; then
3442     AC_MSG_CHECKING([exception type])
3443     AC_LANG_PUSH([C++])
3444     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
3446         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
3448         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
3449     ])
3450     AC_MSG_RESULT($exceptions_type)
3451     AC_LANG_POP([C++])
3454 EXCEPTIONS="$exceptions_type"
3455 AC_SUBST(EXCEPTIONS)
3457 dnl ===================================================================
3458 dnl Checks for what the default STL should be
3459 dnl ===================================================================
3460 AC_MSG_CHECKING([Whether building STLPort library makes sense])
3461 BUILD_STLPORT="no"
3462 if test "$_os" = "Linux"; then
3463     case "$host_cpu" in
3464     i?86)
3465         case "$host_os" in
3466         k*bsd*-gnu*)
3467             BUILD_STLPORT="no"
3468             ;;
3469         *)
3470             BUILD_STLPORT="yes"
3471             ;;
3472         esac
3473         ;;
3474     *)
3475         BUILD_STLPORT="no"
3476         ;;
3477     esac
3478 elif test "$_os" = "SunOS"; then
3479     BUILD_STLPORT="yes"
3480 elif test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
3481     BUILD_STLPORT="yes"
3482 elif test "$_os" = "FreeBSD"; then
3483     BUILD_STLPORT="yes"
3485 if test "$BUILD_STLPORT" = "yes" ; then
3486     AC_MSG_RESULT([yes])
3487 else
3488     AC_MSG_RESULT([no])
3491 AC_MSG_CHECKING([Whether STLPort library will be actually built])
3492 if test "$with_stlport" = "auto" -o "$BUILD_STLPORT" = "no"; then
3493     with_stlport=$BUILD_STLPORT
3495 if test "$with_stlport" = "yes" ; then
3496     AC_MSG_RESULT([yes])
3497     WITH_STLPORT=YES
3498     SCPDEFS="$SCPDEFS -DWITH_STLPORT"
3499     BUILD_TYPE="$BUILD_TYPE STLPORT"
3500 else
3501     WITH_STLPORT=NO
3502     AC_MSG_RESULT([no])
3505 AC_SUBST(WITH_STLPORT)
3507 dnl ===================================================================
3508 dnl thread-safe statics
3509 dnl ===================================================================
3510 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
3511 unset HAVE_THREADSAFE_STATICS
3512 if test "$GCC" = "yes"; then
3513     save_CXXFLAGS=$CXXFLAGS
3514     CXXFLAGS="$CXXFLAGS -fthreadsafe-statics"
3515     AC_LANG_PUSH([C++])
3516     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],[HAVE_THREADSAFE_STATICS=TRUE],[])
3517     AC_LANG_POP([C++])
3518     CXXFLAGS=$save_CXXFLAGS
3519     if test "$HAVE_THREADSAFE_STATICS" = "TRUE"; then
3520         dnl Some C++ runtimes use a single lock for all static variables, which
3521         dnl can cause deadlock in multi-threaded applications.  This is not
3522         dnl easily tested here; for POSIX-based systems, if executing the
3523         dnl following C++ program does not terminate then the tool chain
3524         dnl apparently has this problem:
3525         dnl
3526         dnl   #include <pthread.h>
3527         dnl   int h() { return 0; }
3528         dnl   void * g(void * unused) {
3529         dnl     static int n = h();
3530         dnl     return &n;
3531         dnl   }
3532         dnl   int f() {
3533         dnl     pthread_t t;
3534         dnl     pthread_create(&t, 0, g, 0);
3535         dnl     pthread_join(t, 0);
3536         dnl     return 0;
3537         dnl   }
3538         dnl   int main() {
3539         dnl     static int n = f();
3540         dnl     return n;
3541         dnl   }
3542         dnl
3543         dnl Mac OS X up to at least 10.7.1 is known to have this problem:
3544         if test "$_os" = "Darwin"; then
3545             unset HAVE_THREADSAFE_STATICS
3546             AC_MSG_RESULT([broken (i.e., no)])
3547         else
3548             AC_MSG_RESULT([yes])
3549         fi
3550     else
3551         AC_MSG_RESULT([no])
3552     fi
3553 else
3554     AC_MSG_RESULT([unknown (assuming no)])
3556 AC_SUBST(HAVE_THREADSAFE_STATICS)
3558 dnl ===================================================================
3559 dnl visibility and c++0x features
3560 dnl ===================================================================
3561 if test "$GCC" = "yes"; then
3562     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
3563     save_CFLAGS=$CFLAGS
3564     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
3565     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
3566     CFLAGS=$save_CFLAGS
3567     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3568         AC_MSG_RESULT([yes])
3569     else
3570         AC_MSG_RESULT([no])
3571     fi
3573     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
3574     save_CFLAGS=$CFLAGS
3575     CFLAGS="$CFLAGS -Werror -Wno-long-double"
3576     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
3577     CFLAGS=$save_CFLAGS
3578     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
3579         AC_MSG_RESULT([yes])
3580     else
3581         AC_MSG_RESULT([no])
3582     fi
3584     AC_MSG_CHECKING([whether $CC supports -mno-avx])
3585     save_CFLAGS=$CFLAGS
3586     CFLAGS="$CFLAGS -Werror -mno-avx"
3587     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
3588     CFLAGS=$save_CFLAGS
3589     if test "$HAVE_GCC_AVX" = "TRUE"; then
3590         AC_MSG_RESULT([yes])
3591     else
3592         AC_MSG_RESULT([no])
3593     fi
3595     AC_MSG_CHECKING([whether $CC supports -std=c++0x without Language Defect 757])
3596     save_CXXFLAGS=$CXXFLAGS
3597     CXXFLAGS="$CXXFLAGS -std=c++0x"
3598     AC_LANG_PUSH([C++])
3600     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3601 #include <stddef.h>
3603 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
3605 namespace
3607         struct b
3608         {
3609                 int i;
3610                 int j;
3611         };
3613 ]], [[
3614 struct a
3616         int i;
3617         int j;
3619 a thinga[]={{0,0}, {1,1}};
3620 b thingb[]={{0,0}, {1,1}};
3621 size_t i = sizeof(sal_n_array_size(thinga));
3622 size_t j = sizeof(sal_n_array_size(thingb));
3623 return !(i != 0 && j != 0);
3624 ]])],[HAVE_CXX0X=TRUE],[])
3626     AC_LANG_POP([C++])
3627     CXXFLAGS=$save_CXXFLAGS
3628     if test "$HAVE_CXX0X" = "TRUE"; then
3629         AC_MSG_RESULT([yes])
3630     else
3631         AC_MSG_RESULT([no])
3632     fi
3635 AC_SUBST(HAVE_CXX0X)
3636 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
3637 AC_SUBST(HAVE_GCC_AVX)
3639 dnl ===================================================================
3640 dnl system stl sanity tests
3641 dnl ===================================================================
3642 HAVE_GCC_VISIBILITY_BROKEN=
3643 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \) ; then
3645     AC_LANG_PUSH([C++])
3647     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3648         AC_MSG_CHECKING([if STL headers are visibility safe])
3649         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
3650         AC_MSG_RESULT([$stlvisok])
3651         if test "$stlvisok" = "no"; then
3652             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
3653             echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
3654             unset HAVE_GCC_VISIBILITY_FEATURE
3655         fi
3656     fi
3658     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3659         sharedlink_ldflags_save=$LDFLAGS
3660         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
3662         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
3663         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3664 #include <sstream>
3665 using namespace std;
3666             ]], [[
3667 istringstream strm( "test" ); return 0;
3668             ]])],[$EGREP -q  unresolvable conftest.err;
3669             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
3670         ])
3671         AC_MSG_RESULT([$gccvisok])
3672         if test "$gccvisok" = "no"; then
3673             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
3674             echo "Your gcc is not -fvisibility-inlines-hidden safe, disabling that." >> warn
3675             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
3676         fi
3678         LDFLAGS=$sharedlink_ldflags_save
3679     fi
3681     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
3682         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
3683         cat >visibility.cxx <<_ACEOF
3684 #pragma GCC visibility push(hidden)
3685 struct __attribute__ ((visibility ("default"))) TestStruct {
3686   static void Init();
3688 __attribute__ ((visibility ("default"))) void TestFunc() {
3689   TestStruct::Init();
3691 _ACEOF
3692         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
3693             gccvisbroken=yes
3694         else
3695             case "$host_cpu" in
3696             i?86|x86_64)
3697                 if test "$_os" = "Darwin"; then
3698                     gccvisbroken=no
3699                 else
3700                     if $EGREP -q '@PLT' visibility.s; then
3701                         gccvisbroken=no
3702                     else
3703                         gccvisbroken=yes
3704                     fi
3705                 fi
3706                 ;;
3707             *)
3708                 gccvisbroken=no
3709                 ;;
3710             esac
3711         fi
3712         rm -f visibility.s visibility.cxx
3714         AC_MSG_RESULT([$gccvisbroken])
3715         if test "$gccvisbroken" = "yes"; then
3716             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
3717             echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
3718             unset HAVE_GCC_VISIBILITY_FEATURE
3719         fi
3720     fi
3722     AC_LANG_POP([C++])
3725 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
3726 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
3728 dnl ===================================================================
3729 dnl allocator
3730 dnl ===================================================================
3731 AC_MSG_CHECKING([which memory allocator to use])
3732 if test "$with_alloc" = "system"; then
3733     AC_MSG_RESULT([system])
3734     ALLOC="SYS_ALLOC";
3735     AC_CHECK_FUNCS([malloc realloc calloc free])
3737 if test "$with_alloc" = "tcmalloc"; then
3738     AC_MSG_RESULT(tcmalloc)
3739     if ! echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
3740         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
3741     fi
3742     AC_CHECK_LIB(tcmalloc, malloc, [],
3743         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
3744     ALLOC="TCMALLOC";
3746 if test "$with_alloc" = "jemalloc"; then
3747     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
3748         AC_MSG_RESULT(jemalloc)
3749         save_CFLAGS=$CFLAGS
3750         CFLAGS="$CFLAGS -pthread"
3751         AC_CHECK_LIB(jemalloc, malloc, [],
3752             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
3753         ALLOC="JEMALLOC";
3754         CFLAGS=$save_CFLAGS
3755     else
3756         AC_MSG_RESULT([system])
3757         ALLOC="SYS_ALLOC";
3758         AC_CHECK_FUNCS([malloc realloc calloc free])
3759     fi
3761 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
3762     AC_MSG_RESULT([internal])
3764 AC_SUBST(ALLOC)
3766 dnl ===================================================================
3767 dnl Custom build version
3768 dnl ===================================================================
3770 AC_MSG_CHECKING([whether to add custom build version])
3771 if test "z$with_build_version" != "z"; then
3772     BUILD_VER_STRING=$with_build_version
3773     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
3774 else
3775     BUILD_VER_STRING=
3776     AC_MSG_RESULT([no])
3778 AC_SUBST(BUILD_VER_STRING)
3780 dnl ===================================================================
3781 dnl Java support enable
3782 dnl ===================================================================
3783 AC_MSG_CHECKING([whether to build with Java support])
3784 if test "$with_java" != "no"; then
3785     AC_MSG_RESULT([yes])
3786     SOLAR_JAVA="TRUE"
3787 else
3788     AC_MSG_RESULT([no])
3789     SOLAR_JAVA=""
3792 AC_SUBST(SOLAR_JAVA)
3794 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
3795 dnl want there to be *run-time* (and build-time) support for Java extensions in the
3796 dnl built LibreOffice.
3797 dnl SOLAR_JAVA="BUILD" indicate build-time only support (no runtime support)
3798 dnl SOLAR_JAVA="" indicate no java support at all
3800 if test "$_os" = "Linux" && test "$host_cpu" = "powerpc"; then
3801     # IBMs JDK needs this...
3802     JITC_PROCESSOR_TYPE=6
3803     export JITC_PROCESSOR_TYPE
3805 AC_SUBST([JITC_PROCESSOR_TYPE])
3807 if test $_os = "WINNT"; then
3808     WITH_VC_REDIST="TRUE"
3810 AC_SUBST(WITH_VC_REDIST)
3812 dnl ===================================================================
3813 dnl Checks for Java
3814 dnl ===================================================================
3815 if test "$SOLAR_JAVA" != ""; then
3817     # Windows-specific tests
3818     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3819         if test "$CL_X64" != ""; then
3820             bitness="64-bit"
3821             otherbitness="32-bit"
3822         else
3823             bitness="32-bit"
3824             otherbitness="64-bit"
3825         fi
3827         if test -z "$with_jdk_home"; then
3829             # Unfortunately apparently no way to find, if needed, the 64-bit
3830             # JDK in the Registry from the 32-bit Perl oowintool
3832             _jdk_home=`./oowintool --jdk-home`
3833             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
3834                 with_jdk_home="$_jdk_home"
3835                 howfound="found by oowintool"
3836             else
3837                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
3838             fi
3839         else
3840             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
3841             howfound="you passed"
3842         fi
3843     fi
3845     JAVA_HOME=; export JAVA_HOME
3846     if test -z "$with_jdk_home"; then
3847         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
3848     else
3849         _java_path="$with_jdk_home/bin/$with_java"
3850         dnl Check if there is a Java interpreter at all.
3851         if test -x "$_java_path"; then
3852             JAVAINTERPRETER=$_java_path
3853         else
3854             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
3855         fi
3856     fi
3858     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
3859         # Check that the JDK found is correct architecture
3860         # Why is this necessary, we don't link with any library from the JDK I think,
3862         shortjdkhome=`cygpath -d "$with_jdk_home"`
3863         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
3864             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
3865             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
3866         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
3867             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
3868             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
3869         fi
3871         if test x`echo "$JAVAINTERPRETER" | grep -i '\.exe$'` = x; then
3872             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
3873         fi
3874         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
3875         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
3876     elif test "$_os" = "Darwin"; then
3877         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
3878         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
3879         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
3880         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
3881         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
3882             AC_MSG_RESULT([yes])
3883             JAVAIFLAGS=-d32
3884         else
3885             AC_MSG_RESULT([no])
3886         fi
3887     fi
3890 dnl ===================================================================
3891 dnl Checks for JDK.
3892 dnl ===================================================================
3893 if test "$SOLAR_JAVA" != ""; then
3894     _gij_longver=0
3895     AC_MSG_CHECKING([the installed JDK])
3896     if test -n "$JAVAINTERPRETER"; then
3897         dnl java -version sends output to stderr!
3898         if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
3899             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3900         elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then
3901             JDK=gcj
3902             AC_MSG_RESULT([checked (gcj)])
3903             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
3904             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3906         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "BEA"` -gt 0; then
3907             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3908         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | grep -c "IBM"` -gt 0; then
3909             JDK=ibm
3911             dnl IBM JDK specific tests
3912             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3913             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3915             if test "$_jdk_ver" -lt 10500; then
3916                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
3917             fi
3919             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
3921             if test "$with_jdk_home" = ""; then
3922                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
3923 you must use the "--with-jdk-home" configure option explicitly])
3924             fi
3926            JAVA_HOME=$with_jdk_home
3928         else
3929             JDK=sun
3931             dnl Sun JDK specific tests
3932             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3933             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3935             if test "$_jdk_ver" -lt 10500; then
3936                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
3937             fi
3938             AC_MSG_RESULT([checked (JDK $_jdk)])
3939             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
3940             if test "$_os" = "WINNT"; then
3941                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
3942             fi
3943         fi
3944     else
3945         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
3946     fi
3947 else
3948     dnl Java disabled
3949     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
3952 _java_target_ver="1.5"
3953 dnl ===================================================================
3954 dnl Check for target Java bytecode version
3955 dnl ===================================================================
3956 if test "$SOLAR_JAVA" != ""; then
3957     AC_MSG_CHECKING([for target Java bytecode version])
3958     if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
3959     AC_MSG_RESULT([default by $JDK])
3960     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
3961         AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
3962     fi
3963     else
3964     if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
3965         _java_target_ver="$with_java_target_version"
3966         AC_MSG_RESULT([$_java_target_ver])
3967     elif test $_jdk_ver -gt 10000 ; then
3968         _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
3969         AC_MSG_RESULT([$_java_target_ver])
3970     else
3971         AC_MSG_ERROR([Unable to guess Java bytecode version from Java version!])
3972     fi
3973     fi
3975     if ! test -z "$_java_target_ver" -o \
3976         "$_java_target_ver" = "1.1" -o \
3977             "$_java_target_ver" = "1.2" -o \
3978         "$_java_target_ver" = "1.3" -o \
3979         "$_java_target_ver" = "1.4" -o \
3980         "$_java_target_ver" = "1.5" -o \
3981         "$_java_target_ver" = "1.6" -o \
3982         "$_java_target_ver" = "5" ; then
3983         AC_MSG_ERROR([$_java_target_ver is not a supported Java bytecode version!])
3984     fi
3986     JAVA_SOURCE_VER="$_java_target_ver"
3987     JAVA_TARGET_VER="$_java_target_ver"
3990 dnl ===================================================================
3991 dnl Checks for javac
3992 dnl ===================================================================
3993 if test "$SOLAR_JAVA" != ""; then
3994     if test "$JDK" = "gcj"; then
3995         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
3996     else
3997         javacompiler="javac"
3998     fi
3999     if test -z "$with_jdk_home"; then
4000         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
4001     else
4002         _javac_path="$with_jdk_home/bin/$javacompiler"
4003         dnl Check if there is a Java compiler at all.
4004         if test -x "$_javac_path"; then
4005             JAVACOMPILER=$_javac_path
4006         fi
4007     fi
4008     if test -z "$JAVACOMPILER"; then
4009         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
4010     fi
4011     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4012         if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then
4013             JAVACOMPILER="${JAVACOMPILER}.exe"
4014         fi
4015         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
4016         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
4017     fi
4019     if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then
4020         AC_MSG_CHECKING([re-checking JDK])
4021         JDK=gcj
4022         AC_MSG_RESULT([checked (ecj)])
4023         #TODO: what's to do here? some switch to do 1.5 compiling?
4024         JAVAFLAGS="-source 1.5 -target 1.5"
4025         _gij_longver="40200"
4026     fi
4029 JAVACISGCJ=""
4030 dnl ===================================================================
4031 dnl Checks that javac is gcj
4032 dnl ===================================================================
4033 if test "$SOLAR_JAVA" != ""; then
4034     if test `$JAVACOMPILER --version 2>&1 | grep -c "GCC"` -gt 0; then
4035         JAVACISGCJ="yes"
4036     fi
4038 AC_SUBST(JAVACISGCJ)
4040 JAVACISKAFFE=""
4041 dnl ===================================================================
4042 dnl Checks that javac is kaffe
4043 dnl ===================================================================
4044 if test "$SOLAR_JAVA" != ""; then
4045     if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
4046         JAVACISKAFFE="yes"
4047     fi
4049 AC_SUBST(JAVACISKAFFE)
4051 dnl ===================================================================
4052 dnl Checks for javadoc
4053 dnl ===================================================================
4054 if test "$SOLAR_JAVA" != ""; then
4055     if test -z "$with_jdk_home"; then
4056         AC_PATH_PROG(JAVADOC, javadoc)
4057     else
4058         _javadoc_path="$with_jdk_home/bin/javadoc"
4059         dnl Check if there is a javadoc at all.
4060         if test -x "$_javadoc_path"; then
4061             JAVADOC=$_javadoc_path
4062         else
4063             AC_PATH_PROG(JAVADOC, javadoc)
4064         fi
4065     fi
4066     if test -z "$JAVADOC"; then
4067         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
4068     fi
4069     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
4070         if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then
4071             JAVADOC="${JAVADOC}.exe"
4072         fi
4073         JAVADOC=`cygpath -d "$JAVADOC"`
4074         JAVADOC=`cygpath -u "$JAVADOC"`
4075     fi
4078 if test "$SOLAR_JAVA" != ""; then
4079     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
4080     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
4081         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
4082            # try to recover first by looking whether we have a alternatives
4083            # system as in Debian or newer SuSEs where following /usr/bin/javac
4084            # over /etc/alternatives/javac leads to the right bindir where we
4085            # just need to strip a bit away to get a valid JAVA_HOME
4086            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
4087         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
4088             # maybe only one level of symlink (e.g. on Mac)
4089             JAVA_HOME=$(readlink $JAVACOMPILER)
4090             if test "$(dirname $JAVA_HOME)" = "."; then
4091                 # we've got no path to trim back
4092                 JAVA_HOME=""
4093             fi
4094         else
4095             # else warn
4096             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
4097             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
4098             echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
4099             echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
4100         fi
4101         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
4102         if test "$JAVA_HOME" != "/usr"; then
4103             if test "$_os" = "Darwin"; then
4104                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
4105                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
4106                 dnl Tiger already returns a JDK path..
4107                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
4108             else
4109                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
4110             fi
4111         fi
4112     fi
4113     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
4115     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
4116     if test -z "$JAVA_HOME"; then
4117         if test "x$with_jdk_home" = "x"; then
4118             cat > findhome.java <<_ACEOF
4119 [import java.io.File;
4121 class findhome
4123     public static void main(String args[])
4124     {
4125         String jrelocation = System.getProperty("java.home");
4126         File jre = new File(jrelocation);
4127         System.out.println(jre.getParent());
4128     }
4130 _ACEOF
4131             AC_MSG_CHECKING([if javac works])
4132             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
4133             AC_TRY_EVAL(javac_cmd)
4134             if test $? = 0 && test -f ./findhome.class ; then
4135                 AC_MSG_RESULT([javac works])
4136             else
4137                 echo "configure: javac test failed" >&5
4138                 cat findhome.java >&5
4139                 AC_MSG_ERROR([javac does not work - java projects will not build!])
4140             fi
4141             AC_MSG_CHECKING([if gij knows its java.home])
4142             JAVA_HOME=`$JAVAINTERPRETER findhome`
4143             if test $? = 0 && test "$JAVA_HOME" != "" ; then
4144                 AC_MSG_RESULT([$JAVA_HOME])
4145             else
4146                 echo "configure: java test failed" >&5
4147                 cat findhome.java >&5
4148                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
4149             fi
4150             # clean-up after ourselves
4151             rm -f ./findhome.java ./findhome.class
4152         else
4153             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
4154         fi
4155     fi
4157     dnl second sanity check JAVA_HOME if possible
4158     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
4159         # now check if $JAVA_HOME is really valid
4160         if test "$_os" = "Darwin"; then
4161             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
4162                 JAVA_HOME_OK="NO"
4163             fi
4164         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
4165             JAVA_HOME_OK="NO"
4166         fi
4167         if test "$JAVA_HOME_OK" = "NO"; then
4168             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
4169             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
4170             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
4171             echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
4172             echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
4173             echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
4174         fi
4175     fi
4178 AWTLIB=
4180 if test "$SOLAR_JAVA" != ""; then
4181     AC_MSG_CHECKING([for jawt lib name])
4182     if test "$JDK" = "gcj"; then
4183         save_CFLAGS=$CFLAGS
4184         save_LDFLAGS=$LDFLAGS
4185         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4186         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
4187         exec 6>/dev/null # no output
4188         AC_CHECK_HEADER(jni.h, [],
4189                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
4190         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
4191         exec 6>&1 # output on again
4192         CFLAGS=$save_CFLAGS
4193         LDFLAGS=$save_LDFLAGS
4194     fi
4195     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
4196     # A workaround is to link also against libpmawt.so
4197     if test "$JDK" = "ibm" ; then
4198         save_CFLAGS=$CFLAGS
4199         save_LDFLAGS=$LDFLAGS
4200         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
4201         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
4202         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
4203         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
4204         export LD_LIBRARY_PATH
4205         exec 6>/dev/null # no output
4206         AC_CHECK_HEADER(jni.h, [],
4207                     [AC_MSG_ERROR([jni.h could not be found.])], [])
4208         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
4209         if test -z "$AWTLIB"; then
4210             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
4211             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
4212         fi
4213         exec 6>&1 # output on again
4214         CFLAGS=$save_CFLAGS
4215         LDFLAGS=$save_LDFLAGS
4216         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
4217     fi
4218     if test -z "$AWTLIB"; then
4219         AWTLIB=-ljawt
4220     fi
4221     AC_MSG_RESULT([$AWTLIB])
4222     AC_SUBST(AWTLIB)
4225 AC_SUBST(JAVA_HOME)
4226 AC_SUBST(JDK)
4227 AC_SUBST(JAVAFLAGS)
4228 AC_SUBST(JAVA_SOURCE_VER)
4229 AC_SUBST(JAVA_TARGET_VER)
4230 AC_SUBST(JAVAINTERPRETER)
4231 AC_SUBST(JAVAIFLAGS)
4232 AC_SUBST(JAVACOMPILER)
4233 AC_SUBST(JAVADOC)
4235 dnl ===================================================================
4236 dnl Checks for specific files.
4237 dnl ===================================================================
4239 dnl ===================================================================
4240 dnl Checks for programs.
4241 dnl ===================================================================
4243 dnl ===================================================================
4244 dnl Check whether we already have dmake
4245 dnl ===================================================================
4246 AC_PATH_PROG(DMAKE, dmake, no)
4247 if test "$DMAKE" = "no"; then
4248     BUILD_DMAKE=YES
4249     echo "dmake will be built on ./bootstrap"
4250 else
4251     AC_MSG_CHECKING([whether the found dmake is the right dmake])
4252     # we need to find out whether that dmake we found is "our" dmake
4253     # or the dmake from Sun's SunStudio Compiler which is something
4254     # different
4255     # This test _should_ work because the one accepts -V (ours) and one
4256     # (the other) not...
4257     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
4258     if test $? -eq 0; then
4259         BUILD_DMAKE=NO
4260         AC_MSG_RESULT([yes])
4261         AC_MSG_CHECKING([the dmake version])
4262         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
4263         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
4264             AC_MSG_RESULT([OK, >= 4.11])
4265         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
4266             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
4267             AC_MSG_RESULT([OK, >= 4.11])
4268         else
4269             AC_MSG_RESULT([too old. >= 4.11 is needed])
4270             echo "A newer dmake will be built on ./bootstrap"
4271             BUILD_DMAKE=YES
4272         fi
4273     else
4274         AC_MSG_RESULT([no])
4275         echo "dmake will be built on ./bootstrap"
4276         BUILD_DMAKE=YES
4277     fi
4279 AC_SUBST(BUILD_DMAKE)
4281 AC_MSG_CHECKING([whether to enable EPM for packing])
4282 BUILD_EPM=NO
4283 if test "$enable_epm" = "yes"; then
4284     AC_MSG_RESULT([yes])
4285     dnl ===================================================================
4286     dnl Check for epm - not needed for Windows
4287     dnl ===================================================================
4288     if test "$_os" != "WINNT"; then
4289         if test -n "$with_epm"; then
4290             EPM=$with_epm
4291         else
4292             AC_PATH_PROG(EPM, epm, no)
4293         fi
4294         if test "$EPM" = "no" || test "$EPM" = "internal"; then
4295             echo "EPM will be built."
4296             BUILD_EPM=YES
4297             BUILD_TYPE="$BUILD_TYPE EPM"
4298         else
4299             # Gentoo has some epm which is something different...
4300             AC_MSG_CHECKING([whether the found epm is the right epm])
4301             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
4302                 AC_MSG_RESULT([yes])
4303             else
4304                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
4305             fi
4306             AC_MSG_CHECKING([epm version])
4307             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
4308             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
4309                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
4310                 AC_MSG_RESULT([OK, >= 3.7])
4311                 BUILD_EPM=NO
4312                 if test "$_os" = "Darwin"; then
4313                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
4314                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
4315                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4316                         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)])
4317                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
4318                         AC_MSG_RESULT([$_pm, ok])
4319                     else # we never should get here, but go safe
4320                         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)])
4321                     fi
4322                 fi
4323             else
4324                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
4325                 echo "EPM will be built."
4326                 BUILD_EPM=YES
4327                 BUILD_TYPE="$BUILD_TYPE EPM"
4328             fi
4329         fi
4330     fi
4332     # test which package format to use
4333     AC_MSG_CHECKING([which package format to use])
4335     # defaults
4336     case "$_os" in
4337     Darwin)
4338         PKGFORMAT=dmg
4339         ;;
4340     SunOS)
4341         PKGFORMAT=pkg
4342         ;;
4343     Linux)
4344         # if building on Debian, default should be deb...
4345         if test -e /etc/debian_version; then
4346             PKGFORMAT=deb
4347         else
4348             PKGFORMAT=rpm
4349         fi
4350         ;;
4351     AIX)
4352         PKGFORMAT=rpm
4353         ;;
4354     OpenBSD|DragonFly)
4355         PKGFORMAT=portable
4356         ;;
4357     *BSD)
4358         PKGFORMAT=bsd
4359         ;;
4360     WINNT)
4361         PKGFORMAT=msi
4362         ;;
4363     # we never should get here since we check the arciecture/os at the beginning,
4364     # but go sure...
4365     *)
4366         AC_MSG_ERROR([unknown system])
4367     esac
4368     if test -n "$with_package_format"; then
4369         for i in $with_package_format; do
4370             case "$i" in
4371             aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
4372                 ;;
4373             *)
4374                 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4375 aix - AIX software distribution
4376 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4377 deb - Debian software distribution
4378 inst or tardist - IRIX software distribution
4379 osx - MacOS X software distribution
4380 pkg - Solaris software distribution
4381 rpm - RedHat software distribution
4382 setld - Tru64 (setld) software distribution
4383 native - "Native" software distribution for the platform
4384 portable - Portable software distribution
4385 LibreOffice additionally supports:
4386 archive - .tar.gz or .zip
4387 dmg - Mac OS X .dmg
4388 installed - installation tree
4389 msi - Windows .msi
4390             ])
4391                 ;;
4392             esac
4393         done
4394         PKGFORMAT="$with_package_format"
4395     fi
4396     AC_MSG_RESULT([$PKGFORMAT])
4397     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
4398         AC_MSG_CHECKING([for rpm])
4399         for a in "$RPM" rpmbuild rpm; do
4400             $a --usage >/dev/null 2> /dev/null
4401             if test $? -eq 0; then
4402                 RPM=$a
4403                 break
4404             else
4405                 $a --version >/dev/null 2> /dev/null
4406                 if test $? -eq 0; then
4407                     RPM=$a
4408                     break
4409                 fi
4410             fi
4411         done
4412         if test -z "$RPM" ; then
4413             AC_MSG_ERROR([not found])
4414         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
4415             RPM_PATH=`which $RPM`
4416             AC_MSG_RESULT([$RPM_PATH])
4417         else
4418             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
4419         fi
4420     fi
4421     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
4422         AC_PATH_PROG(DPKG, dpkg, no)
4423         if test "$DPKG" = "no"; then
4424             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
4425         fi
4426     fi
4427     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
4428         if test "$_os" = "Darwin"; then
4429             AC_MSG_CHECKING([for PackageMaker availability])
4430             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
4431                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
4432             else
4433                 AC_MSG_RESULT([ok])
4434             fi
4435         else
4436             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
4437         fi
4438     fi
4439     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
4440        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4441         if test "$EPM" != "no" && test "$EPM" != "internal"; then
4442             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
4443                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
4444                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
4445                     AC_MSG_RESULT([yes])
4446                 else
4447                     AC_MSG_RESULT([no])
4448                     if echo "$PKGFORMAT" | grep -q rpm; then
4449                         _pt="rpm"
4450                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
4451                         echo "the rpms will need to be installed with --nodeps" >> warn
4452                     else
4453                         _pt="pkg"
4454                     fi
4455                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
4456                     echo "the ${_pt}s will not be relocateable" >> warn
4457                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
4458                                  relocation will work, you need to patch your epm with the
4459                                  patch in epm/epm-3.7.patch or build with
4460                                  --with-epm=internal which will build a suitable epm])
4461                 fi
4462             fi
4463         fi
4464     fi
4465     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
4466         AC_PATH_PROG(PKGMK, pkgmk, no)
4467         if test "$PKGMK" = "no"; then
4468             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
4469         fi
4470     fi
4471     AC_SUBST(RPM)
4472     AC_SUBST(DPKG)
4473     AC_SUBST(PKGMK)
4474 else
4475     AC_MSG_RESULT([no])
4476     EPM=NO
4477     PKGFORMAT=native
4479 AC_SUBST(EPM)
4480 AC_SUBST(BUILD_EPM)
4481 AC_SUBST(PKGFORMAT)
4483 dnl ===================================================================
4484 dnl Check for gperf
4485 dnl ===================================================================
4486 AC_PATH_PROG(GPERF, gperf)
4487 if test -z "$GPERF"; then
4488     AC_MSG_ERROR([gperf not found but needed. Install it.])
4490 AC_MSG_CHECKING([gperf version])
4491 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
4492     AC_MSG_RESULT([OK])
4493 else
4494     AC_MSG_ERROR([too old, you need at least 3.0.0])
4496 AC_SUBST(GPERF)
4498 dnl ===================================================================
4499 dnl Check for building stax
4500 dnl ===================================================================
4501 AC_MSG_CHECKING([whether to build the stax])
4502 if test "$with_system_saxon" = "no" -a "$with_system_jars" = "no" -a "$SOLAR_JAVA" != ""; then
4503     if test -f "./stax/download/jsr173_1.0_api.jar"; then
4504         BUILD_STAX=NO
4505         AC_MSG_RESULT([no, will use the prebuilt stax/download/jsr173_1.0_api.jar])
4506     else
4507         BUILD_STAX=YES
4508         AC_MSG_RESULT([yes])
4509     fi
4511 AC_SUBST(BUILD_STAX)
4513 dnl ===================================================================
4514 dnl Check for building ODK
4515 dnl ===================================================================
4516 AC_MSG_CHECKING([whether to build the ODK])
4517 if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
4518     AC_MSG_RESULT([yes])
4520     if test "$with_java" != "no"; then
4521         AC_MSG_CHECKING([whether to build unowinreg.dll])
4522         if test "$_os" = "WINNT" -a "z$enable_build_unowinreg" = "z" ; then
4523             # build on Win by default
4524             enable_build_unowinreg=yes
4525         fi
4526         if test "z$enable_build_unowinreg" = "z" -o "$enable_build_unowinreg" = "no"; then
4527             AC_MSG_RESULT([no])
4528             BUILD_UNOWINREG=NO
4529         else
4530             AC_MSG_RESULT([yes])
4531             BUILD_UNOWINREG=YES
4532         fi
4533         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
4534             if test -z "$with_mingw_cross_compiler"; then
4535                 dnl Guess...
4536                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
4537             elif test -x "$with_mingw_cross_compiler"; then
4538                  MINGWCXX="$with_mingw_cross_compiler"
4539             else
4540                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
4541             fi
4543             if test "$MINGWCXX" = "false"; then
4544                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
4545             fi
4547             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
4548             if test -x "$mingwstrip_test"; then
4549                 MINGWSTRIP="$mingwstrip_test"
4550             else
4551                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
4552             fi
4554             if test "$MINGWSTRIP" = "false"; then
4555                 AC_MSG_ERROR(MinGW32 binutils not found.)
4556             fi
4557         fi
4558     fi
4559     BUILD_TYPE="$BUILD_TYPE ODK"
4560 else
4561     AC_MSG_RESULT([no])
4562     BUILD_UNOWINREG=NO
4564 AC_SUBST(BUILD_UNOWINREG)
4565 AC_SUBST(MINGWCXX)
4566 AC_SUBST(MINGWSTRIP)
4568 dnl ===================================================================
4569 dnl Check for system stdlibs
4570 dnl ===================================================================
4571 AC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
4572 if test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \
4573     test "$with_system_stdlibs" != "no"; then
4574     AC_MSG_RESULT([no])
4575     SYSTEM_STDLIBS=YES
4576 else
4577     AC_MSG_RESULT([yes])
4578     SYSTEM_STDLIBS=NO
4580 AC_SUBST(SYSTEM_STDLIBS)
4582 dnl ===================================================================
4583 dnl Check for system zlib
4584 dnl ===================================================================
4585 AC_MSG_CHECKING([which zlib to use])
4586 if test -n "$with_system_zlib" -o -n "$with_system_libs" -o \
4587         "$_os" != "WINNT" && \
4588     test "$with_system_zlib" != "no"; then
4589     AC_MSG_RESULT([external])
4590     SYSTEM_ZLIB=YES
4591     AC_CHECK_HEADER(zlib.h, [],
4592         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
4593     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
4594         [AC_MSG_ERROR(zlib not found or functional)], [])
4595 else
4596     AC_MSG_RESULT([internal])
4597     SYSTEM_ZLIB=NO
4598     BUILD_TYPE="$BUILD_TYPE ZLIB"
4600 AC_SUBST(SYSTEM_ZLIB)
4602 dnl ===================================================================
4603 dnl Check for system jpeg
4604 dnl ===================================================================
4605 AC_MSG_CHECKING([which jpeg to use])
4606 if test -n "$with_system_jpeg" -o -n "$with_system_libs" -o \
4607         "$_os" = "Linux" && \
4608     test "$with_system_jpeg" != "no"; then
4609     AC_MSG_RESULT([external])
4610     SYSTEM_JPEG=YES
4611     AC_CHECK_HEADER(jpeglib.h, [],
4612         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
4613     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
4614     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
4615 else
4616     AC_MSG_RESULT([internal])
4617     SYSTEM_JPEG=NO
4618     BUILD_TYPE="$BUILD_TYPE JPEG"
4620 AC_SUBST(SYSTEM_JPEG)
4622 dnl ===================================================================
4623 dnl Check for system expat
4624 dnl ===================================================================
4625 AC_MSG_CHECKING([which expat to use])
4626 if test -n "$with_system_expat" -o -n "$with_system_libs" && \
4627     test "$with_system_expat" != "no"; then
4628     AC_MSG_RESULT([external])
4629     SYSTEM_EXPAT=YES
4630     AC_CHECK_HEADER(expat.h, [],
4631         [AC_MSG_ERROR(expat.h not found. install expat)], [])
4632     AC_CHECK_LIB(expat, XML_ParserCreate, [],
4633     [AC_MSG_RESULT(expat library not found or functional.)], [])
4634     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libexpat-1.dll"
4635 else
4636     AC_MSG_RESULT([internal])
4637     SYSTEM_EXPAT=NO
4638     BUILD_TYPE="$BUILD_TYPE EXPAT"
4640 AC_SUBST(SYSTEM_EXPAT)
4642 dnl ===================================================================
4643 dnl Check for system libvisio
4644 dnl ===================================================================
4645 AC_MSG_CHECKING([which libvisio to use])
4646 if test -n "$with_system_libvisio" -o -n "$with_system_libs" && \
4647     test "$with_system_libvisio" != "no"; then
4648     AC_MSG_RESULT([external])
4649     SYSTEM_LIBVISIO=YES
4650     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
4651 else
4652     AC_MSG_RESULT([internal])
4653     SYSTEM_LIBVISIO=NO
4654     BUILD_TYPE="$BUILD_TYPE LIBVISIO"
4656 AC_SUBST(SYSTEM_LIBVISIO)
4657 AC_SUBST(VISIO_CFLAGS)
4658 AC_SUBST(VISIO_LIBS)
4660 dnl ===================================================================
4661 dnl Check for system libcmis
4662 dnl ===================================================================
4663 AC_MSG_CHECKING([which libcmis to use])
4664 if test -n "$with_system_libcmis" -o -n "$with_system_libs" && \
4665         test "$with_system_libcmis" != "no"; then
4666     AC_MSG_RESULT([external])
4667     SYSTEM_LIBCMIS=YES
4668     PKG_CHECK_MODULES( LIBCMIS, libcmis-0.2 )
4669 else
4670     AC_MSG_RESULT([internal])
4671     SYSTEM_LIBCMIS=NO
4672     BUILD_TYPE="$BUILD_TYPE LIBCMIS"
4674 AC_SUBST(SYSTEM_LIBCMIS)
4675 AC_SUBST(LIBCMIS_CFLAGS)
4676 AC_SUBST(LIBCMIS_LIBS)
4679 dnl ===================================================================
4680 dnl Check for system libwpd
4681 dnl ===================================================================
4682 AC_MSG_CHECKING([which libwpd to use])
4683 if test -n "$with_system_libwpd" -o -n "$with_system_libs" && \
4684         test "$with_system_libwpd" != "no"; then
4685     AC_MSG_RESULT([external])
4686     SYSTEM_LIBWPD=YES
4687     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
4688 else
4689     AC_MSG_RESULT([internal])
4690     SYSTEM_LIBWPD=NO
4691     BUILD_TYPE="$BUILD_TYPE LIBWPD"
4693 AC_SUBST(SYSTEM_LIBWPD)
4694 AC_SUBST(WPD_CFLAGS)
4695 AC_SUBST(WPD_LIBS)
4697 dnl ===================================================================
4698 dnl Check for system cppunit
4699 dnl ===================================================================
4700 AC_MSG_CHECKING([which cppunit to use])
4701 if test -n "$with_system_cppunit" -o -n "$with_system_libs" && \
4702         test "$with_system_cppunit" != "no"; then
4703     AC_MSG_RESULT([external])
4704     SYSTEM_CPPUNIT=YES
4705     # might work for earlier, too but go sure:
4706     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
4707 else
4708     AC_MSG_RESULT([internal])
4709     SYSTEM_CPPUNIT=NO
4710     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
4712 AC_SUBST(SYSTEM_CPPUNIT)
4713 AC_SUBST(CPPUNIT_CFLAGS)
4714 AC_SUBST(CPPUNIT_LIBS)
4716 dnl ===================================================================
4717 dnl Check whether freetype is available
4718 dnl ===================================================================
4719 if test  "$test_freetype" = "yes"; then
4720     AC_MSG_CHECKING([whether freetype is available])
4721     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
4723 AC_SUBST(FREETYPE_CFLAGS)
4724 AC_SUBST(FREETYPE_LIBS)
4726 dnl ===================================================================
4727 dnl Check for system libwps
4728 dnl ===================================================================
4729 AC_MSG_CHECKING([which libwps to use])
4730 if test -n "$with_system_libwps" -o -n "$with_system_libs" && \
4731         test "$with_system_libwps" != "no"; then
4732     AC_MSG_RESULT([external])
4733     SYSTEM_LIBWPS=YES
4734     PKG_CHECK_MODULES( WPS, libwps-0.2 )
4735 else
4736     AC_MSG_RESULT([internal])
4737     SYSTEM_LIBWPS=NO
4738     BUILD_TYPE="$BUILD_TYPE LIBWPS"
4740 AC_SUBST(SYSTEM_LIBWPS)
4741 AC_SUBST(WPS_CFLAGS)
4742 AC_SUBST(WPS_LIBS)
4744 dnl ===================================================================
4745 dnl Check for system libwpg
4746 dnl ===================================================================
4747 AC_MSG_CHECKING([which libwpg to use])
4748 if test -n "$with_system_libwpg" -o -n "$with_system_libs" && \
4749         test "$with_system_libwpg" != "no"; then
4750     AC_MSG_RESULT([external])
4751     SYSTEM_LIBWPG=YES
4752     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
4753 else
4754     AC_MSG_RESULT([internal])
4755     SYSTEM_LIBWPG=NO
4756     BUILD_TYPE="$BUILD_TYPE LIBWPG"
4758 AC_SUBST(SYSTEM_LIBWPG)
4759 AC_SUBST(WPG_CFLAGS)
4760 AC_SUBST(WPG_LIBS)
4762 dnl ===================================================================
4763 dnl Check whether freetype2 supports emboldening
4764 dnl ===================================================================
4765 if test  "$test_freetype" = "yes"; then
4766     save_CPPFLAGS="$CPPFLAGS"
4767     save_LDFLAGS="$LDFLAGS"
4768     save_LIBS="$LIBS"
4769     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
4770     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
4771     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
4772                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
4773     LDFLAGS="$save_LDFLAGS"
4774     CPPFLAGS="$save_CPPFLAGS"
4775     LIBS="$save_LIBS"
4777 AC_SUBST(USE_FT_EMBOLDEN)
4779 if test -n "$with_system_libxslt" -o -n "$with_system_libs" && \
4780        test "$with_system_libxslt" != "no"; then
4781     if test -z "$with_system_libxml" -a -z "$with_system_libs" || \
4782            test "$with_system_libxml" = "no"; then
4783         # somehow AC_MSG_WARN won't work...
4784         echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml"
4785         echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml" >> warn
4786         with_system_libxml=yes
4787     fi
4789 if test -n "$with_system_libxml" -o -n "$with_system_libs" && \
4790        test "$with_system_libxml" != "no"; then
4791     if test -z "$with_system_libxslt" -a -z "$with_system_libs" || \
4792            test "$with_system_libxslt" = "no"; then
4793         # somehow AC_MSG_WARN won't work...
4794         echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt"
4795         echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt" >> warn
4796         with_system_libxslt=yes
4797     fi
4800 # ===================================================================
4801 # Check for system libxslt
4802 # ===================================================================
4803 AC_MSG_CHECKING([which libxslt to use])
4804 if test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \
4805        "$_os" = "Darwin" && \
4806        test "$with_system_libxslt" != "no"; then
4807     AC_MSG_RESULT([external])
4808     SYSTEM_LIBXSLT=YES
4809     if test "$_os" = "Darwin"; then
4810         dnl make sure to use SDK path
4811         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4812         dnl omit -L/usr/lib
4813         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
4814     else
4815         PKG_CHECK_MODULES(LIBXSLT, libxslt)
4816     fi
4818     dnl Check for xsltproc
4819     AC_PATH_PROG(XSLTPROC, xsltproc, no)
4820     if test "$XSLTPROC" = "no"; then
4821         AC_MSG_ERROR([xsltproc is required])
4822     fi
4824     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libxslt-1.dll"
4825 else
4826     AC_MSG_RESULT([internal])
4827     SYSTEM_LIBXSLT=NO
4828     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
4830     if test "$cross_compiling" = "yes"; then
4831         AC_PATH_PROG(XSLTPROC, xsltproc, no)
4832         if test "$XSLTPROC" = "no"; then
4833             AC_MSG_ERROR([xsltproc is required])
4834         fi
4835     fi
4837 AC_SUBST(SYSTEM_LIBXSLT)
4838 AC_SUBST(LIBXSLT_CFLAGS)
4839 AC_SUBST(LIBXSLT_LIBS)
4840 AC_SUBST(XSLTPROC)
4842 # ===================================================================
4843 # Check for system libxml
4844 # ===================================================================
4845 AC_MSG_CHECKING([which libxml to use])
4846 if test -n "$with_system_libxml" -o -n "$with_system_libs" -o \
4847             "$_os" = "Darwin" -o $_os = iOS && \
4848         test "$with_system_libxml" != "no"; then
4849     AC_MSG_RESULT([external])
4850     SYSTEM_LIBXML=YES
4851     if test "$_os" = "Darwin"; then
4852         dnl make sure to use SDK path
4853         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
4854         dnl omit -L/usr/lib
4855         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
4856     elif test $_os = iOS; then
4857         dnl make sure to use SDK path
4858         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
4859         LIBXML_CFLAGS="-I$usr/include/libxml2"
4860         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
4861     else
4862         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
4863     fi
4864     BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
4865     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS zlib1.dll libxml2-2.dll"
4866 else
4867     AC_MSG_RESULT([internal])
4868     SYSTEM_LIBXML=NO
4869     BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC"
4871 AC_SUBST(SYSTEM_LIBXML)
4872 AC_SUBST(LIBXML_CFLAGS)
4873 AC_SUBST(LIBXML_LIBS)
4875 dnl ===================================================================
4876 dnl Checks for Python
4877 dnl ===================================================================
4879 AC_MSG_CHECKING([which Python to use])
4881 case "$enable_python" in
4882 no|disable)
4883     enable_python=no
4884     AC_MSG_RESULT([none])
4885     DISABLE_PYTHON=TRUE
4886     ;;
4887 ""|yes|auto)
4888     if test $build_os = cygwin; then
4889         dnl When building on Windows we don't attempt to use any installed
4890         dnl "system"  Python.
4891         dnl
4892         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
4893         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
4894         dnl MinGW cross-compilation setups.)
4895         AC_MSG_RESULT([internal])
4896         enable_python=internal
4897     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4898         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4899         enable_python=internal
4900     else
4901         AC_MSG_RESULT([checking below])
4902         enable_python=auto
4903     fi
4904     ;;
4905 internal)
4906     AC_MSG_RESULT([internal])
4907     ;;
4908 system)
4909     if test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
4910         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
4911     fi
4912     AC_MSG_RESULT([system])
4913     ;;
4915     AC_MSG_ERROR([Incorrect --enable-python option])
4916     ;;
4917 esac
4919 AC_SUBST(DISABLE_PYTHON)
4921 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
4922     AC_MSG_ERROR([Must use internal Python when building with MSVC])
4925 if test $enable_python != no; then
4926     BUILD_TYPE="$BUILD_TYPE PYUNO"
4929 if test "$cross_compiling" = yes; then
4930     if test $enable_python = auto; then
4931         enable_python=system
4932     fi
4933 else
4934     if test $enable_python = system; then
4935         # This causes an error if no python command is found
4936         # Note that this takes the system python called just "python",
4937         # which isn't actually what we want on MacOSX when building
4938         # against the 10.6 SDK. But that shouldn't matter, we
4939         # select the correct python command manually below anyway.
4940         AM_PATH_PYTHON([2.6])
4941     elif test $enable_python = auto; then
4942         dnl This allows lack of system Python
4943         AM_PATH_PYTHON([2.6],, [:])
4945         if test "$PYTHON" = :; then
4946             enable_python=internal
4947         else
4948             enable_python=system
4949         fi
4950     fi
4953 if test $enable_python = system; then
4954     if test $_os = Darwin; then
4955         # We already have logic above to make sure the system Python
4956         # is used only when building against SDK 10.6 or newer.
4958         # Make sure we use the 2.6 Python when building against the
4959         # 10.6 SDK.
4960         case $with_macosx_sdk in
4961         10.6)
4962             python_version=2.6;;
4963         10.7)
4964             python_version=2.7;;
4965         *)
4966             # ???
4967             python_version=2.7;;
4968         esac
4969         PYTHON=python$python_version
4971         PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
4972         PYTHON_LIBS="-framework Python"
4973     fi
4974     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
4975         # Fallback: Accept these in the environment, or as set above
4976         # for MacOSX.
4977         :
4978     elif test "$cross_compiling" != yes; then
4979         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
4980         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
4981         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
4982         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
4983         if $PKG_CONFIG --exists python-$python_version; then
4984             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
4985             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version`"
4986         else
4987             PYTHON_CFLAGS="-I$python_include"
4988             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
4989         fi
4990     elif test "$cross_compiling" = yes; then
4991         dnl How to find out the cross-compilation Python installation path?
4992         dnl Let's hardocode what we know for different distributions for now...
4994         for python_sysroot in /usr/i686-w64-mingw32/sys-root/mingw ; do
4995             for python_version in 2.6 ; do
4996                 if test -f ${python_sysroot}/include/python${python_version}/Python.h; then
4997                     PYTHON_CFLAGS="-I ${python_sysroot}/include/python$python_version"
4998                     PYTHON_LIBS="-L ${python_sysroot}lib -lpython$python_version $python_libs"
4999                     break
5000                 fi
5001             done
5002             test -n "$PYTHON_CFLAGS" && break
5003         done
5004     fi
5007 dnl By now enable_python should be "system", "internal" or "no"
5008 case $enable_python in
5009 system)
5010     SYSTEM_PYTHON=YES
5012     dnl Check if the headers really work
5013     save_CPPFLAGS="$CPPFLAGS"
5014     CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
5015     AC_CHECK_HEADER(Python.h, [],
5016        [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
5017        [])
5018     CPPFLAGS="$save_CPPFLAGS"
5020     dnl FIXME Check if the Python library can be linked with, too?
5021     ;;
5023 internal)
5024     SYSTEM_PYTHON=NO
5025     BUILD_TYPE="$BUILD_TYPE PYTHON"
5026     # Embedded Python dies without Home set
5027     if test "z$HOME" = "z"; then
5028         export HOME="";
5029     fi
5030     # bz2 tarball and bzip2 is not standard
5031     if test -z "$BZIP2"; then
5032         AC_PATH_PROG( BZIP2, bzip2)
5033         if test -z "$BZIP2"; then
5034             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
5035         fi
5036     fi
5037     ;;
5039     SYSTEM_PYTHON=NO
5040     ;;
5042     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
5043     ;;
5044 esac
5046 AC_SUBST(SYSTEM_PYTHON)
5047 AC_SUBST(PYTHON_CFLAGS)
5048 AC_SUBST(PYTHON_LIBS)
5050 dnl ===================================================================
5051 dnl Check for system translate-toolkit
5052 dnl ===================================================================
5053 AC_MSG_CHECKING([which translate-toolkit to use])
5054 if test "$with_system_translate_toolkit" = "yes" ; then
5055     AC_MSG_RESULT([system])
5056     SYSTEM_TRANSLATE_TOOLKIT=YES
5058     AC_PATH_PROGS(OO2PO, oo2po)
5059     if test -z "$OO2PO"; then
5060         AC_MSG_ERROR([install translate-toolkit or use --without-system-translate-toolkit])
5061     fi
5063     AC_PATH_PROGS(PO2OO, po2oo)
5064     if test -z "$PO2OO"; then
5065         AC_MSG_ERROR([install translate-toolkit or use --without-system-translate-toolkit])
5066     fi
5068     $PO2OO --help | grep -q '\-\-skipsource'
5069     if test $? -ne 0 ;  then
5070         AC_MSG_ERROR([$PO2OO does not support --skipsource; use translate-toolkit >= 1.9 or use --without-system-translate-toolkit])
5071     fi
5072 else
5073     AC_MSG_RESULT([internal])
5074     SYSTEM_TRANSLATE_TOOLKIT=NO
5075     BUILD_TYPE="$BUILD_TYPE TRANSLATE_TOOLKIT"
5077 AC_SUBST(SYSTEM_TRANSLATE_TOOLKIT)
5079 dnl ===================================================================
5080 dnl Check for system Berkeley db
5081 dnl ===================================================================
5082 AC_MSG_CHECKING([which db to use])
5083 if test -n "$with_system_db" -o -n "$with_system_libs" && \
5084     test "$with_system_db" != "no"; then
5085     SYSTEM_DB=YES
5086     AC_MSG_RESULT([external])
5088     db_header=
5089     for dbver in 5.1 5.0 5 4.8 4.7 4; do
5090         for dash in - ''; do
5091             AC_CHECK_HEADER([db$dash$dbver/db.h],
5092                 [ db_header="db$dash$dbver/db.h"; break 2 ])
5093         done
5094     done
5096     if test -z "$db_header"; then
5097         AC_CHECK_HEADER([db/db.h], [db_header='db/db.h'; dbver=''])
5098     fi
5100     if test -z "$db_header"; then
5101        AC_CHECK_HEADER(db.h, [ db_header='db.h'; dbver='' ])
5102     fi
5104     if test -z "$db_header"; then
5105         AC_MSG_ERROR([db.h not found. Use the correct -I flag, or install the Berkeley db development package.])
5106     fi
5108     AC_MSG_CHECKING([whether db is at least 4.1])
5109     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])])
5111     SYSTEM_DB_CFLAGS="-DSYSTEM_DB_HEADER='<$db_header>'"
5113     DB_LIB=
5114     dnl At least on OpenBSD dbver is not appended to the library
5115     if test "$_os" = "OpenBSD"; then
5116         dbver=''
5117     fi
5118     for dash in - ''; do
5119         AC_CHECK_LIB(db$dash$dbver, dbopen,
5120             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5121         AC_CHECK_LIB(db$dash$dbver, __db185_open,
5122             [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ])
5123     done
5125     if test -z "$DB_LIB" ; then
5126         AC_MSG_ERROR([db library not found. Use the correct -L flag,
5127 or install the Berkeley db development package.])
5128     fi
5130     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
5131     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libdb-4.8.dll"
5132 else
5133     AC_MSG_RESULT([internal])
5134     SYSTEM_DB=NO
5135     BUILD_TYPE="$BUILD_TYPE BERKELEYDB"
5137 AC_SUBST(SYSTEM_DB)
5138 AC_SUBST(SYSTEM_DB_CFLAGS)
5139 AC_SUBST(DB_LIB)
5140 AC_SUBST(DB_CPPLIB)
5142 dnl ===================================================================
5143 dnl Check for system lucene
5144 dnl ===================================================================
5145 if test "$with_java" != "no"; then
5146 AC_MSG_CHECKING([which lucene to use])
5147 if test -n "$with_system_lucene" -o -n "$with_system_libs" && \
5148         test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then
5149     AC_MSG_RESULT([external])
5150     SYSTEM_LUCENE=YES
5151     if test -z $LUCENE_CORE_JAR; then
5152          AC_CHECK_FILE(/usr/share/java/lucene-core-2.3.jar,
5153             [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar ],
5154             [
5155               AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
5156                 [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
5157                 [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
5158                    [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
5159                    [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
5160                   )
5161                 ]
5162               )
5163             ]
5164          )
5165     else
5166         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5167                [AC_MSG_ERROR(lucene-core.jar not found.)], [])
5168     fi
5170     if test -z $LUCENE_ANALYZERS_JAR; then
5171         AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
5172             [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
5173             [
5174               AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
5175                 [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
5176                 [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
5177               )
5178             ]
5179         )
5180     else
5181         AC_CHECK_FILE($LUCENE_CORE_JAR, [],
5182                [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
5183     fi
5184     AC_MSG_CHECKING([whether lucene is version 2.x])
5185     export LUCENE_CORE_JAR
5186     if $PERL -e 'use Archive::Zip;
5187             my $file = "$ENV{'LUCENE_CORE_JAR'}";
5188             my $zip = Archive::Zip->new( $file );
5189             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5190             if ( $mf =~ m/Specification-Version: 2.*/ ) {
5191                 exit 0;
5192             } else {
5193                 exit 1;
5194             }'; then
5195         AC_MSG_RESULT([yes])
5196     else
5197         AC_MSG_ERROR([no, you need lucene 2])
5198     fi
5200 else
5201     AC_MSG_RESULT([internal])
5202     SYSTEM_LUCENE=NO
5203     BUILD_TYPE="$BUILD_TYPE LUCENE"
5206 AC_SUBST(SYSTEM_LUCENE)
5207 AC_SUBST(LUCENE_CORE_JAR)
5208 AC_SUBST(LUCENE_ANALYZERS_JAR)
5210 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
5211 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
5212     AC_MSG_RESULT([yes])
5213     ENABLE_MYSQLC=YES
5214     BUILD_TYPE="$BUILD_TYPE MYSQLC"
5215 else
5216     AC_MSG_RESULT([no])
5217     ENABLE_MYSQLC=NO
5219 AC_SUBST(ENABLE_MYSQLC)
5221 if test "$ENABLE_MYSQLC" = "YES"; then
5223     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
5225     dnl ===================================================================
5226     dnl Check for system MySQL
5227     dnl ===================================================================
5228     AC_MSG_CHECKING([for mysql pre-requisites])
5229     if test -n "$with_system_mysql" -o -n "$with_system_libs" && \
5230            test "$with_system_mysql" != "no" && test "$with_system_libs" != "no"; then
5231         AC_MSG_RESULT([external MySQL])
5232         SYSTEM_MYSQL=YES
5233         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
5234         AC_MSG_CHECKING([MySQL version])
5235         MYSQL_VERSION=`$MYSQLCONFIG --version`
5236         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
5237         if test "$MYSQL_MAJOR" -ge "5"; then
5238             AC_MSG_RESULT([OK])
5239         else
5240             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
5241         fi
5242         AC_MSG_CHECKING([for MySQL Client library])
5243         MYSQL_INC=`$MYSQLCONFIG --include`
5244         MYSQL_LIB=`$MYSQLCONFIG --libs`
5245         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
5246         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
5247     else
5248         SYSTEM_MYSQL=NO
5249         if test -n "$with_libmysql_path"; then
5250             AC_MSG_RESULT([external Connector/C (libmysql)])
5251             LIBMYSQL=libmysql.so
5252             if test "$_os" = "Darwin"; then
5253                 LIBMYSQL=libmysql.dylib
5254             elif test "$_os" = "WINNT"; then
5255                 LIBMYSQL=libmysql.dll
5256             fi
5257             AC_MSG_CHECKING([for $LIBMYSQL])
5258             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
5259                 AC_MSG_RESULT([found.])
5260                 LIBMYSQL_PATH=$with_libmysql_path
5261             else
5262                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
5263             fi
5264         else
5265             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
5266         fi
5267     fi
5268     AC_SUBST(SYSTEM_MYSQL)
5269     AC_SUBST(MYSQL_INC)
5270     AC_SUBST(MYSQL_LIB)
5271     AC_SUBST(MYSQL_DEFINES)
5272     AC_SUBST(LIBMYSQL_PATH)
5274     AC_LANG_PUSH([C++])
5275     dnl ===================================================================
5276     dnl Check for system MySQL C++ Connector
5277     dnl ===================================================================
5278     # FIXME!
5279     # who thought this too-generic cppconn dir was a good idea?
5280     AC_MSG_CHECKING([MySQL Connector/C++])
5281     if test -n "$with_system_mysql_cppconn" -o -n "$with_system_libs" && \
5282             test "$with_system_mysql_cppconn" != "no" && test "$with_system_libs" != "no"; then
5283         AC_MSG_RESULT([external])
5284         SYSTEM_MYSQL_CPPCONN=YES
5285         AC_LANG_PUSH([C++])
5286         AC_CHECK_HEADER(mysql_driver.h, [],
5287                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
5288         AC_CHECK_LIB(mysqlcppconn, main, [],
5289                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
5290         AC_MSG_CHECKING([version])
5291         AC_RUN_IFELSE([AC_LANG_SOURCE([[
5292 #include <mysql_driver.h>
5294 int main(int argc, char **argv) {
5295     sql::Driver *driver;
5296     driver = get_driver_instance();
5297     if (driver->getMajorVersion() > 1 || \
5298        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
5299        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
5300         return 0;
5301       else
5302         return 1;
5304       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
5306         AC_LANG_POP([C++])
5308     else
5309         AC_MSG_RESULT([internal])
5310         AC_MSG_CHECKING([for mysqlcppconn module])
5311         if test -d mysqlcppconn; then
5312             AC_MSG_RESULT([OK])
5313         else
5314             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
5315         fi
5316         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
5317         SYSTEM_MYSQL_CPPCONN=NO
5318     fi
5319     AC_LANG_POP([C++])
5320     AC_SUBST(SYSTEM_MYSQL_CPPCONN)
5323 dnl ===================================================================
5324 dnl Check for system hsqldb
5325 dnl ===================================================================
5326 if test "$with_java" != "no"; then
5327 AC_MSG_CHECKING([which hsqldb to use])
5328 if test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \
5329        test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then
5330     AC_MSG_RESULT([external])
5331     SYSTEM_HSQLDB=YES
5332     if test -z $HSQLDB_JAR; then
5333         HSQLDB_JAR=/usr/share/java/hsqldb.jar
5334     fi
5335     AC_CHECK_FILE($HSQLDB_JAR, [],
5336                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
5337     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
5338     export HSQLDB_JAR
5339     if $PERL -e 'use Archive::Zip;
5340             my $file = "$ENV{'HSQLDB_JAR'}";
5341             my $zip = Archive::Zip->new( $file );
5342             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
5343             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
5344                push @l, split(/\n/, $mf);
5345                foreach my $line (@l) {
5346                   if ($line =~ m/Specification-Version:/) {
5347                       ($t, $version) = split (/:/,$line);
5348                       $version =~ s/^\s//;
5349                       ($a, $b, $c, $d) = split (/\./,$version);
5350                       if ($c == "0" && $d > "8")  {
5351                           exit 0;
5352                       } else {
5353                           exit 1;
5354                       }
5355                   }
5356                }
5357             } else {
5358                 exit 1;
5359             }'; then
5360         AC_MSG_RESULT([yes])
5361     else
5362         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
5363     fi
5364 else
5365     AC_MSG_RESULT([internal])
5366     SYSTEM_HSQLDB=NO
5367     BUILD_TYPE="$BUILD_TYPE HSQLDB"
5369 AC_SUBST(SYSTEM_HSQLDB)
5370 AC_SUBST(HSQLDB_JAR)
5373 dnl ===================================================================
5374 dnl Check for system beanshell
5375 dnl ===================================================================
5376 if test "$with_java" != "no"; then
5377 AC_MSG_CHECKING([which beanshell to use])
5378 if test -n "$with_system_beanshell" -o -n "$with_system_libs" && \
5379        test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then
5380     AC_MSG_RESULT([external])
5381     SYSTEM_BSH=YES
5382     if test -z $BSH_JAR; then
5383         BSH_JAR=/usr/share/java/bsh.jar
5384     fi
5385     AC_CHECK_FILE($BSH_JAR, [],
5386                [AC_MSG_ERROR(bsh.jar not found.)], [])
5387 else
5388     AC_MSG_RESULT([internal])
5389     SYSTEM_BSH=NO
5390     BUILD_TYPE="$BUILD_TYPE BSH"
5393 AC_SUBST(SYSTEM_BSH)
5394 AC_SUBST(BSH_JAR)
5397 dnl ===================================================================
5398 dnl Check for system saxon
5399 dnl ===================================================================
5400 if test "$with_java" != "no"; then
5401 AC_MSG_CHECKING([which saxon to use])
5402 if test -n "$with_system_saxon" -o -n "$with_system_libs" && \
5403        test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then
5404     AC_MSG_RESULT([external])
5405     SYSTEM_SAXON=YES
5406     if test -z $SAXON_JAR; then
5407         AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5408             [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5409             [
5410               AC_CHECK_FILE(/usr/share/java/saxon.jar,
5411                 [ SAXON_JAR=/usr/share/java/saxon.jar ],
5412                 [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
5413                     [ SAXON_JAR=/usr/share/java/saxon9.jar ],
5414                     [ AC_MSG_ERROR(saxon.jar replacement not found)]
5415                   )
5416                 ]
5417               )
5418             ]
5419           )
5420     else
5421         AC_CHECK_FILE($SAXON_JAR, [],
5422                [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
5423     fi
5424     if test -n "$SERIALIZER_JAR"; then
5425         AC_CHECK_FILE($SERIALIZER_JAR, [],
5426                [AC_MSG_ERROR(serializer.jar not found.)], [])
5427         AC_SUBST(SERIALIZER_JAR)
5428     fi
5430     dnl Saxon comes in two practically available versions, the out-of-date saxonb which
5431     dnl supports the Java extensions that LibreOffice uses, and the up-to-date saxon he
5432     dnl "home edition" version, which is crippled to not support those Java extensions.
5433     dnl And as an aside the he one also needs to be tweaked to include
5434     dnl a META-INF/services to broadcast that it supports the jaxp transform factory
5436     AC_MSG_CHECKING([if saxon works])
5437     cat > saxontest.java <<_ACEOF
5438 [import javax.xml.transform.TransformerFactory;
5439 import javax.xml.transform.Transformer;
5440 import javax.xml.transform.stream.StreamSource;
5441 import java.io.*;
5443 import net.sf.saxon.FeatureKeys;
5445 class saxontest {
5446     public static void main(String[] args) {
5447       System.setProperty("javax.xml.transform.TransformerFactory",
5448         "net.sf.saxon.TransformerFactoryImpl");
5449       try {
5450         TransformerFactory tfactory = TransformerFactory.newInstance();
5451     // some external saxons (Debian, Ubuntu, ...) have this disabled
5452     // per default
5453     tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
5454         System.out.println("TransformerFactory is" +
5455           tfactory.getClass().getName());
5456         Transformer transformer = tfactory.newTransformer(
5457           new StreamSource(new File(args[0])));
5458       } catch(Exception e){
5459         e.printStackTrace(System.err);
5460         System.exit(-1);
5461       }
5462       System.exit(0);
5463     }
5466 _ACEOF
5468     cat > saxontest.xsl<<_ACEOF
5469 [<?xml version="1.0" encoding="UTF-8"?>
5470 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5471  <xsl:template match="/">
5472   <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
5473  </xsl:template>
5474 </xsl:stylesheet>
5476 _ACEOF
5478     javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
5479     AC_TRY_EVAL(javac_cmd)
5480     if test $? = 0 && test -f ./saxontest.class ; then
5481         java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
5482         AC_TRY_EVAL(java_cmd)
5483         if test $? = 0; then
5484             AC_MSG_RESULT([yes])
5485         else
5486             cat saxontest.java >&5
5487             AC_MSG_RESULT([no])
5488             AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
5489         fi
5490     else
5491         AC_MSG_RESULT([no])
5492         cat saxontest.java >&5
5493         AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
5494     fi
5495 else
5496     AC_MSG_RESULT([internal])
5497     SYSTEM_SAXON=NO
5498     NEED_SAXON=TRUE
5501 AC_SUBST(SYSTEM_SAXON)
5502 AC_SUBST(SAXON_JAR)
5504 if test -n "$NEED_SAXON"; then
5505     BUILD_TYPE="$BUILD_TYPE SAXON"
5508 dnl ===================================================================
5509 dnl Check for system curl
5510 dnl ===================================================================
5511 if test "$_os" = "Darwin" -a "$with_system_curl" != "no"; then
5512     with_system_curl=yes
5514 AC_MSG_CHECKING([which libcurl to use])
5515 if test -n "$with_system_curl" -o -n "$with_system_libs" && \
5516     test "$with_system_curl" != "no"; then
5517     AC_MSG_RESULT([external])
5518     SYSTEM_CURL=YES
5520     curl_version=""
5521     if test "$cross_compiling" = "yes"; then
5522         dnl At least the OBS mingw32-libcurl-devel package
5523         dnl comes with a proper .pc file
5524         PKG_CHECK_MODULES(CURL, libcurl,, [:])
5525         if test -n "$CURL_PKG_ERRORS"; then
5526             AC_MSG_RESULT([no])
5527         else
5528             curl_version=`$PKG_CONFIG --modversion libcurl`
5529         fi
5530     fi
5531     if test -z "$curl_version"; then
5532         AC_PATH_PROG(CURLCONFIG, curl-config)
5533         if test -z "$CURLCONFIG"; then
5534             AC_MSG_ERROR([install the libcurl development package])
5535         fi
5536         CURL_LIBS=`$CURLCONFIG --libs`
5537         CURL_CFLAGS=`$CURLCONFIG --cflags`
5538         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
5539     fi
5541     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
5543     case $curl_version in
5544     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
5545     dnl so they need to be doubled to end up in the configure script
5546     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
5547         AC_MSG_RESULT([yes, you have $curl_version])
5548         ;;
5549     *)
5550         AC_MSG_ERROR([no, you have $curl_version])
5551         ;;
5552     esac
5554     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"
5555 else
5556     AC_MSG_RESULT([internal])
5557     SYSTEM_CURL=NO
5558     BUILD_TYPE="$BUILD_TYPE CURL"
5560 AC_SUBST(SYSTEM_CURL)
5561 AC_SUBST(CURL_CFLAGS)
5562 AC_SUBST(CURL_LIBS)
5564 dnl ===================================================================
5565 dnl Check for system boost
5566 dnl ===================================================================
5567 AC_MSG_CHECKING([which boost to use])
5568 if test -n "$with_system_boost" -o -n "$with_system_headers" && \
5569         test "$with_system_boost" != "no"; then
5570     AC_MSG_RESULT([external])
5571     SYSTEM_BOOST=YES
5572     AC_LANG_PUSH([C++])
5573     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
5574        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
5575     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
5576        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
5577     AC_CHECK_HEADER(boost/function.hpp, [],
5578        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
5579     AC_CHECK_HEADER([boost/unordered_map.hpp], [HAVE_BOOST_UNORDERED_MAP=TRUE],
5580                    [AC_MSG_WARN([boost/unordered_map.hpp not found])], [])
5582     save_CXXFLAGS=$CXXFLAGS
5583     CXXFLAGS="$CXXFLAGS -fno-exceptions"
5584     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
5585     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
5586 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
5588     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
5589         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
5590     else
5591         AC_MSG_RESULT([yes])
5592     fi
5593     CXXFLAGS=$save_CXXFLAGS
5594     AC_LANG_POP([C++])
5595 else
5596     AC_MSG_RESULT([internal])
5597     BUILD_TYPE="$BUILD_TYPE BOOST"
5598     SYSTEM_BOOST=NO
5599     HAVE_BOOST_UNORDERED_MAP=TRUE
5601 AC_SUBST([HAVE_BOOST_UNORDERED_MAP])
5602 AC_SUBST(SYSTEM_BOOST)
5604 dnl ===================================================================
5605 dnl Check for system mdds
5606 dnl ===================================================================
5607 AC_MSG_CHECKING([which mdds to use])
5608 if test -n "$with_system_mdds" -o -n "$with_system_headers" && \
5609         test "$with_system_mdds" != "no"; then
5610     AC_MSG_RESULT([external])
5611     SYSTEM_MDDS=YES
5613     dnl ===================================================================
5614     dnl Determine which hash container mdds shall use
5615     dnl ===================================================================
5616     AC_MSG_CHECKING([which hash container mdds shall use])
5617     if test "x$HAVE_CXX0X" = "xTRUE"; then
5618         MDDS_CPPFLAGS="-std=c++0x"
5619         AC_MSG_RESULT([std::unordered_map])
5620     else
5621         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5622         AC_MSG_RESULT([boost::unordered_map])
5623     fi
5625     AC_LANG_PUSH([C++])
5626     save_CPPFLAGS="$CPPFLAGS"
5627     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
5628     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
5629         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
5630     AC_CHECK_HEADER(mdds/mixed_type_matrix.hpp, [],
5631         [AC_MSG_ERROR(mdds/mixed_type_matrix.hpp not found. install mdds >= 0.4.0)], [])
5632     CPPFLAGS="$save_CPPFLAGS"
5633     save_CXXFLAGS="$CXXFLAGS"
5634     CXXFLAGS="$CXXFLAGS $MDDS_CPPFLAGS"
5635     AC_MSG_CHECKING([for correct signature of ::mdds::flat_segment_tree])
5636     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mdds/flat_segment_tree.hpp>
5638     int main(int argc, char **argv) {
5639         ::mdds::flat_segment_tree<long, short> db(0, 100, 0);
5640         short val;
5641         if (!db.search(5, val).second)
5642             return 1;
5643         return 0;
5644     }
5645 ]])],[ac_cv_cxx_mdds_flat_segment_tree_correct=yes],[ac_cv_cxx_mdds_flat_segment_tree_correct=no],[])
5647     if test "$ac_cv_cxx_mdds_flat_segment_tree_correct" = "yes"; then
5648         AC_MSG_RESULT([yes])
5649     else
5650         AC_MSG_ERROR([no, install mdds >= 0.5.0])
5651     fi
5652     CXXFLAGS=$save_CXXFLAGS
5653     AC_LANG_POP([C++])
5654 else
5655     AC_MSG_RESULT([internal])
5656     BUILD_TYPE="$BUILD_TYPE MDDS"
5657     SYSTEM_MDDS=NO
5659     dnl ===================================================================
5660     dnl Determine which hash container mdds shall use
5661     dnl ===================================================================
5662     AC_MSG_CHECKING([which hash container mdds shall use])
5663     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
5664     AC_MSG_RESULT([boost::unordered_map])
5666 AC_SUBST(SYSTEM_MDDS)
5667 AC_SUBST([MDDS_CPPFLAGS])
5669 dnl ===================================================================
5670 dnl Check for system vigra
5671 dnl ===================================================================
5672 AC_MSG_CHECKING([which vigra to use])
5673 if test -n "$with_system_vigra" -o -n "$with_system_headers" && \
5674         test "$with_system_vigra" != "no"; then
5675     AC_MSG_RESULT([external])
5676     SYSTEM_VIGRA=YES
5677     AC_LANG_PUSH([C++])
5678     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
5679        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
5680     AC_LANG_POP([C++])
5681 else
5682     AC_MSG_RESULT([internal])
5683     BUILD_TYPE="$BUILD_TYPE VIGRA"
5684     SYSTEM_VIGRA=NO
5686 AC_SUBST(SYSTEM_VIGRA)
5688 dnl ===================================================================
5689 dnl Check for system odbc
5690 dnl ===================================================================
5691 AC_MSG_CHECKING([which odbc headers to use])
5692 if test -n "$with_system_odbc" -o -n "$with_system_headers" && \
5693         test "$with_system_odbc" != "no"; then
5694     AC_MSG_RESULT([external])
5695     SYSTEM_ODBC_HEADERS=YES
5697     AC_CHECK_HEADER(sqlext.h, [],
5698       [AC_MSG_ERROR(odbc not found. install odbc)], [])
5699 else
5700     AC_MSG_RESULT([internal])
5701     SYSTEM_ODBC_HEADERS=NO
5702     BUILD_TYPE="$BUILD_TYPE UNIXODBC"
5704 AC_SUBST(SYSTEM_ODBC_HEADERS)
5706 AC_MSG_CHECKING([whether to enable build of Mozilla])
5707 if test "$enable_mozilla" = "no"; then
5708     AC_MSG_RESULT([no])
5709     WITH_MOZILLA=NO
5710 else
5711     AC_MSG_RESULT([yes])
5712     WITH_MOZILLA=YES
5714 AC_SUBST(WITH_MOZILLA)
5716 AC_MSG_CHECKING([whether to build Mozilla addressbook connectivity])
5717 if test "$enable_mozilla" = "no"; then
5718     AC_MSG_RESULT([no])
5719 elif test "$with_system_mozilla" = "yes"; then
5720     AC_MSG_RESULT([no, not possible with system-mozilla])
5721 else
5722     AC_MSG_RESULT([yes])
5725 AC_MSG_CHECKING([whether to build XML Security support])
5726 if test "$enable_nss_module" = "no"; then
5727     AC_MSG_RESULT([no, NSS disabled])
5728 else
5729     AC_MSG_RESULT([yes])
5732 AC_MSG_CHECKING([whether to build LDAP configuration backend])
5733 if test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then
5734     if test "$enable_mozilla" = "yes" || test "$with_openldap" = "yes"; then
5735         AC_MSG_RESULT([yes])
5736         WITH_LDAP=YES
5737     else
5738         AC_MSG_RESULT([no. Either Mozilla or OpenLDAP needed])
5739         WITH_LDAP=NO
5740     fi
5741 else
5742     AC_MSG_RESULT([no])
5743     WITH_LDAP=NO
5746 if test "$WITH_LDAP" = "YES"; then
5747     dnl ===================================================================
5748     dnl Test whether we want to use the Mozilla or the OpenLDAP LDAP SDK
5749     dnl ===================================================================
5750     AC_MSG_CHECKING([which LDAP SDK to use])
5751     if test -n "$with_openldap" && test "$with_openldap" != "no"; then
5752         AC_MSG_RESULT([OpenLDAP])
5753         WITH_OPENLDAP=YES
5754         AC_CHECK_HEADERS(ldap.h, [],
5755            [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
5756         AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
5757            [AC_MSG_ERROR(openldap lib not found or functional)], [])
5758         # rumours say that OpenLDAP doesn't have that function. I looked and
5759         # it has it. Test for it to be sure
5760         AC_CHECK_LIB(ldap, ldap_set_option, [],
5761                 [AC_MSG_ERROR(openldap lib not found or functional)], [])
5762     else
5763         AC_MSG_RESULT([Netscape/Mozilla])
5764         # TODO. Actually do a sanity check and check for
5765         # LDAP_OPT_SIZELIMIT and LDAP_X_OPT_CONNECT_TIMEOUT
5766         WITH_OPENLDAP=NO
5767     fi
5769 AC_SUBST(WITH_LDAP)
5770 AC_SUBST(WITH_OPENLDAP)
5772 dnl ===================================================================
5773 dnl Check for system mozilla
5774 dnl ===================================================================
5775 AC_MSG_CHECKING([which Mozilla to use])
5776 if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then
5777     AC_MSG_RESULT([external])
5778     SYSTEM_MOZILLA=YES
5779     ENABLE_NSS_MODULE=NO
5780     enable_nss_module=no
5781     AC_MSG_CHECKING([which Mozilla flavour to use])
5782     if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then
5783         MOZ_FLAVOUR=libxul
5784     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then
5785         MOZ_FLAVOUR=xulrunner
5786     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "seamonkey"; then
5787         MOZ_FLAVOUR=seamonkey
5788     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "firefox"; then
5789         MOZ_FLAVOUR=firefox
5790     elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "mozilla"; then
5791         MOZ_FLAVOUR=mozilla
5792     else
5793         MOZ_FLAVOUR=libxul
5794     fi
5795     tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst(<STDIN>);'`
5796     AC_MSG_RESULT($tmp)
5798     PKG_CHECK_MODULES( MOZ_NSS, nss, STANDALONENSS="TRUE", STANDALONENSS="" )
5799     if test -z "$STANDALONENSS"; then
5800         PKG_CHECK_MODULES( MOZ_NSS, $MOZ_FLAVOUR-nss )
5801     else
5802         NSS_LIB="-L`$PKG_CONFIG --variable=libdir nss`"
5803         AC_SUBST(NSS_LIB)
5804     fi
5806     if $PKG_CONFIG --exists nspr ; then
5807         PKG_CHECK_MODULES( MOZ_NSPR, nspr )
5808         NSPR_LIB="-L`$PKG_CONFIG --variable=libdir nspr`"
5809         AC_SUBST(NSPR_LIB)
5810     else
5811         PKG_CHECK_MODULES( MOZ_NSPR, $MOZ_FLAVOUR-nspr )
5812     fi
5814     if test "$MOZ_FLAVOUR" != "libxul"; then
5815         PKG_CHECK_MODULES( MOZILLAXPCOM, $MOZ_FLAVOUR-xpcom, HASXPCOM="TRUE", HASXPCOM="" )
5816         MOZ_INC=`$PKG_CONFIG --variable=includedir $MOZ_FLAVOUR-xpcom`
5817         MOZ_LIB=`$PKG_CONFIG --variable=libdir $MOZ_FLAVOUR-xpcom`
5818     fi
5820     if test -z "$HASXPCOM"; then
5821         PKG_CHECK_MODULES( MOZILLAXPCOM, libxul )
5822         MOZ_INC=`$PKG_CONFIG --variable=includedir libxul`
5823         MOZ_LIB=`$PKG_CONFIG --variable=libdir libxul`
5824         if ! test -e "$MOZ_LIB/libxul.so"; then
5825             MOZ_LIB=`$PKG_CONFIG --variable=sdkdir libxul`
5826             if test -e "$MOZ_LIB/sdk/lib/libxul.so"; then
5827                 MOZ_LIB="$MOZ_LIB/sdk/lib"
5828             fi
5829         fi
5830     fi
5832     save_CPPFLAGS="$CPPFLAGS"
5833     save_LDFLAGS="$LDFLAGS"
5834     save_LIBS="$LIBS"
5835     CPPFLAGS="$CPPFLAGS $MOZ_NSS_CFLAGS"
5836     LDFLAGS="$LDFLAGS $MOZ_NSS_LIBS"
5837     AC_CHECK_LIB(nss3, PK11_GetCertFromPrivateKey, [],
5838       [AC_MSG_ERROR(PK11_GetCertFromPrivateKey missing but needed.
5839 See https://bugzilla.mozilla.org/show_bug.cgi?id=262274.
5840 Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5))], [])
5841     LDFLAGS="$save_LDFLAGS"
5842     CPPFLAGS="$save_CPPFLAGS"
5843     LIBS="$save_LIBS"
5845     MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS
5846     if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then
5847         AC_MSG_CHECKING([whether $tmp was compiled with --enable-ldap])
5848         if test -d "$MOZ_INC/ldap"; then
5849             AC_MSG_RESULT([yes])
5850             MOZ_LDAP_CFLAGS="-I$MOZ_INC"
5851         else
5852             AC_MSG_ERROR([no.
5853 Could not find LDAP header include files in $MOZ_INC/ldap.
5854 Please recompile $tmp with --enable-ldap or use --with-openldap.])
5855         fi
5856     fi
5858     #e.g. http://fedoraproject.org/wiki/Releases/FeatureXULRunnerAPIChanges
5859     #the plugin pkg-config etc. reverts to "mozilla-plugin" with libxul
5860     if test "$MOZ_FLAVOUR" = "libxul"; then
5861         MOZ_FLAVOUR="mozilla"
5862     fi
5864 elif test "$enable_mozilla" = "no"; then
5865     AC_MSG_RESULT([none])
5866     WITH_MOZILLA=NO
5867 else
5868     AC_MSG_RESULT([internal])
5869     SYSTEM_MOZILLA=NO
5870     BUILD_TYPE="$BUILD_TYPE MOZ"
5871 if test -z "$with_mozilla_version"; then
5872     MOZILLA_VERSION=
5873 else
5874     AC_MSG_CHECKING([which Mozilla version to build])
5875     MOZILLA_VERSION=$with_mozilla_version
5876     enable_build_mozilla=1
5877     AC_MSG_RESULT([$MOZILLA_VERSION])
5880 AC_SUBST(MOZILLA_VERSION)
5882 AC_MSG_CHECKING([for toolkit Mozilla should use])
5883 if test -z "$with_mozilla_toolkit"; then
5884     if test "$_os" != "WINNT" ; then
5885         if test "$_os" = "Darwin" ; then
5886             MOZILLA_TOOLKIT=mac
5887             AC_MSG_RESULT([mac])
5888         else
5889             MOZILLA_TOOLKIT=gtk2
5890             AC_MSG_RESULT([gtk2])
5891         fi
5892     fi
5893 else
5894     MOZILLA_TOOLKIT=$with_mozilla_toolkit
5895     enable_build_mozilla=1
5896     AC_MSG_RESULT([$MOZILLA_TOOLKIT])
5899 AC_SUBST(MOZILLA_TOOLKIT)
5901 # default to enabling build mozilla
5902 if test "$enable_build_mozilla" != "no"; then
5903     enable_build_mozilla=yes
5904 else
5905     enable_build_mozilla=
5908 AC_MSG_CHECKING([whether to build Mozilla/SeaMonkey])
5909 if test -n "$enable_build_mozilla"; then
5910     BUILD_MOZAB="TRUE"
5911     AC_MSG_RESULT([yes])
5912 else
5913     BUILD_MOZAB=""
5914     AC_MSG_RESULT([no])
5917 if test "$BUILD_MOZAB" = "TRUE"; then
5918     if test "$_os" = "WINNT"; then
5919         if test "$WITH_MINGW" != "yes"; then
5920             # compiling with MSVC. Only supported platform here is MSVS2005 at the moment.
5921             if test "$MSVSVER" != "2005"; then
5922                 AC_MSG_ERROR([Building SeaMonkey is supported with Microsoft Visual Studio 2005 only.])
5923             fi
5924         else
5925             AC_MSG_WARN([Building SeaMonkey with MinGW is not tested, and likely to break.])
5926             echo "Building SeaMonkey with MinGW is not tested, and likely to break." >> warn
5927         fi
5928     fi
5930     if test -z "$MOZILLA_VERSION"; then
5931         MOZILLA_VERSION=1.1.14
5932     fi
5933     MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"
5934     MOZILLA_FETCH_FILE=`grep $MOZILLA_SOURCE_VERSION ooo.lst.in`
5935     AC_MSG_CHECKING([for Mozilla sources])
5936     if test -z "$MOZILLA_FETCH_FILE"; then
5937         AC_MSG_RESULT([not found])
5938         HAVE_MOZILLA_TARBALL=n
5939     else
5940         AC_MSG_CHECKING([for $MOZILLA_FETCH_FILE])
5941         if test ! -e "$TARFILE_LOCATION/$MOZILLA_FETCH_FILE"; then
5942             if test -z "$DO_FETCH"; then
5943                 AC_MSG_RESULT([will be fetched])
5944                 HAVE_MOZILLA_TARBALL=y
5945             else
5946                 AC_MSG_RESULT([not found])
5947                 HAVE_MOZILLA_TARBALL=n
5948             fi
5949         else
5950             AC_MSG_RESULT([found])
5951             HAVE_MOZILLA_TARBALL=y
5952         fi
5953     fi
5954     if test "$HAVE_MOZILLA_TARBALL" != "y"; then
5955         AC_MSG_ERROR([Mozilla/SeaMonkey source archive not found.
5956 Use "./download" to download.])
5957     fi
5958     if test "$_os" = "WINNT"; then
5959         AC_MSG_CHECKING([for moztools binaries])
5960         if test ! -e "$TARFILE_LOCATION/vc8-moztools.zip" ; then
5961             AC_MSG_ERROR([The following file is missing in $TARFILE_LOCATION: vc8-moztools.zip
5962 (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)])
5963         else
5964             AC_MSG_RESULT([ok])
5965         fi
5966     elif test "$_os" = "Darwin"; then
5967         PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.6.3,  MOZIDL="TRUE", MOZIDL="")
5968         if test -z "$MOZIDL"; then
5969             AC_MSG_ERROR([libIDL 0.6.3 or newer is needed to build Mozilla with Mac toolkit.])
5970         fi
5971     else
5972         # Generic Unix/Linux section
5973         if test "$MOZILLA_TOOLKIT" = "gtk2"; then
5974             PKG_CHECK_MODULES(MOZLIBREQ, gtk+-2.0, MOZGTK="TRUE", MOZGTK="")
5975             if test -z "$MOZGTK"; then
5976                 AC_MSG_ERROR([GTK2 is needed to build Mozilla.])
5977             fi
5978             PKG_CHECK_MODULES(MOZLIBREQ, libIDL-2.0 >= 0.8.0, MOZIDL="TRUE", MOZIDL="")
5979             if test -z "$MOZIDL"; then
5980                 AC_MSG_ERROR([libIDL >= 0.8.0 is needed when using GTK2 to build Mozilla.])
5981             fi
5982         else
5983             PKG_CHECK_MODULES(MOZLIBREQ, gtk+ >= 1.2.3, MOZGTK="TRUE", MOZGTK="")
5984             if test -z "$MOZGTK"; then
5985                 AC_MSG_ERROR([GTK+ 1.2 is needed when not using GTK2 to build Mozilla.])
5986             fi
5987             PKG_CHECK_MODULES(MOZLIBREQ, libidl >= 0.6.3 libidl <= 0.6.8, MOZIDL="TRUE", MOZIDL="")
5988             if test -z "$MOZIDL"; then
5989                 AC_MSG_ERROR([libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build Mozilla.])
5990             fi
5991         fi
5992     fi
5995 AC_SUBST(BUILD_MOZAB)
5998 AC_SUBST(MOZILLABUILD)
5999 AC_SUBST(SYSTEM_MOZILLA)
6000 AC_SUBST(MOZ_FLAVOUR)
6001 AC_SUBST(MOZ_INC)
6002 AC_SUBST(MOZ_LIB)
6003 AC_SUBST(MOZ_LIB_XPCOM)
6004 AC_SUBST(MOZ_NSPR_CFLAGS)
6005 AC_SUBST(MOZ_NSS_CFLAGS)
6006 AC_SUBST(MOZ_LDAP_CFLAGS)
6008 dnl ===================================================================
6009 dnl Check for system NSS
6010 dnl ===================================================================
6011 AC_MSG_CHECKING([whether to build provided NSS module])
6012 if test "$enable_nss_module" != "no"; then
6013     ENABLE_NSS_MODULE="YES"
6014     BUILD_TYPE="$BUILD_TYPE NSS"
6015     AC_MSG_RESULT([yes])
6016     if test "$build_os" = "cygwin"; then
6017         AC_MSG_CHECKING([for Mozilla build tooling])
6018         if test -z "$MOZILLABUILD" ; then
6019             AC_MSG_ERROR([Mozilla build tooling not found.
6020 Use the --with-mozilla-build option after installing the tools obtained
6021 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
6022         else
6023             if test \( "$WITH_MINGW" = "yes" \) ; then
6024                 if test ! -d "$MOZILLABUILD" ; then
6025                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
6026                 else
6027                     AC_MSG_RESULT([ok])
6028                 fi
6029             else
6030                 if test ! -d "$MOZILLABUILD/moztools" \
6031                         -o ! -d "$MOZILLABUILD/msys" ; then
6032                     AC_MSG_ERROR([Mozilla build tooling incomplete!])
6033                 else
6034                     AC_MSG_RESULT([ok])
6035                 fi
6036             fi
6037         fi
6038     fi
6039 else
6040     ENABLE_NSS_MODULE="NO"
6041     AC_MSG_RESULT([no])
6043 AC_SUBST(ENABLE_NSS_MODULE)
6045 dnl ===================================================================
6046 dnl Check for system sane
6047 dnl ===================================================================
6048 AC_MSG_CHECKING([which sane header to use])
6049 if test -n "$with_system_sane" -o -n "$with_system_headers" && \
6050         test "$with_system_sane" != "no"; then
6051     AC_MSG_RESULT([external])
6052     SYSTEM_SANE_HEADER=YES
6053     AC_CHECK_HEADER(sane/sane.h, [],
6054       [AC_MSG_ERROR(sane not found. install sane)], [])
6055 else
6056     AC_MSG_RESULT([internal])
6057     SYSTEM_SANE_HEADER=NO
6058     BUILD_TYPE="$BUILD_TYPE SANE"
6060 AC_SUBST(SYSTEM_SANE_HEADER)
6062 dnl ===================================================================
6063 dnl Check for system icu
6064 dnl ===================================================================
6065 SYSTEM_GENBRK=
6066 SYSTEM_GENCCODE=
6067 SYSTEM_GENCMN=
6068 ICU_MAJOR=
6069 ICU_MINOR=
6070 ICU_MICRO=
6071 ICU_RECLASSIFIED_CLOSE_PARENTHESIS=
6072 AC_MSG_CHECKING([which icu to use])
6073 if test -n "$with_system_icu" -o -n "$with_system_libs" && \
6074         test "$with_system_icu" != "no"; then
6075     AC_MSG_RESULT([external])
6076     SYSTEM_ICU=YES
6077     AC_LANG_PUSH([C++])
6078     AC_MSG_CHECKING([for unicode/rbbi.h])
6079     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
6080     AC_LANG_POP([C++])
6082     ICUPATH="$PATH"
6083     if test "$WITH_MINGW" = "yes" ; then
6084         ICUPATH="/usr/i686-w64-mingw32/sys-root/mingw/bin:$ICUPATH"
6085     fi
6086     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
6088     AC_MSG_CHECKING([ICU version])
6089     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
6090     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
6091     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
6092     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
6094     if test "$ICU_MAJOR" -ge "4"; then
6095         AC_MSG_RESULT([OK, $ICU_VERSION])
6096     else
6097         AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
6098     fi
6100     if test "$cross_compiling" != "yes"; then
6101         # using the system icu tools can lead to version confusion, use the
6102         # ones from the build environment when cross-compiling
6103         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
6104         if test -z "$SYSTEM_GENBRK"; then
6105             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
6106         fi
6107         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6108         if test -z "$SYSTEM_GENCCODE"; then
6109             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
6110         fi
6111         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
6112         if test -z "$SYSTEM_GENCMN"; then
6113             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
6114         fi
6115         if test "$ICU_MAJOR" -ge "5" -o "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4"; then
6116             ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6117         fi
6118     fi
6120     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS icui18n$ICU_MAJOR$ICU_MINOR.dll icuuc$ICU_MAJOR$ICU_MINOR.dll icudata$ICU_MAJOR$ICU_MINOR.dll"
6121 else
6122     AC_MSG_RESULT([internal])
6123     SYSTEM_ICU="NO"
6124     ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
6125     BUILD_TYPE="$BUILD_TYPE ICU"
6127 AC_SUBST(SYSTEM_ICU)
6128 AC_SUBST(SYSTEM_GENBRK)
6129 AC_SUBST(SYSTEM_GENCCODE)
6130 AC_SUBST(SYSTEM_GENCMN)
6131 AC_SUBST(ICU_MAJOR)
6132 AC_SUBST(ICU_MINOR)
6133 AC_SUBST(ICU_MICRO)
6134 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
6136 dnl ===================================================================
6137 dnl Graphite
6138 dnl ===================================================================
6140 AC_MSG_CHECKING([whether to enable graphite support])
6141 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" = "z" -o "$enable_graphite" != "no" ; then
6142     AC_MSG_RESULT([yes])
6143     ENABLE_GRAPHITE="TRUE"
6144     AC_MSG_CHECKING([which graphite to use])
6145     if test -n "$with_system_graphite" -o -n "$with_system_libs" && \
6146         test "$with_system_graphite" != "no"; then
6147         AC_MSG_RESULT([external])
6148         SYSTEM_GRAPHITE=YES
6149         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
6150         MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libgraphite2.dll"
6151     else
6152         AC_MSG_RESULT([internal])
6153         SYSTEM_GRAPHITE=NO
6154         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
6155     fi
6156 else
6157     AC_MSG_RESULT([no])
6159 AC_SUBST(ENABLE_GRAPHITE)
6160 AC_SUBST(SYSTEM_GRAPHITE)
6161 AC_SUBST(GRAPHITE_LIBS)
6162 AC_SUBST(GRAPHITE_CFLAGS)
6164 dnl ===================================================================
6165 dnl Checks for libraries.
6166 dnl ===================================================================
6167 dnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
6168 dnl See if we have the AppKit framework for building with Quartz graphics.
6170 if test  "$_os" = "Darwin"; then
6171     if test "x$with_x" = "xyes"; then
6172         AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
6173     else
6174         AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
6175         if test -d "/System/Library/Frameworks/AppKit.framework/"; then
6176             AC_MSG_RESULT([yes])
6177             x_includes="no_x_includes"
6178             x_libraries="no_x_libraries"
6179             dnl disable some things used on other Unix versions but not on the aqua build
6180             enable_gtk=no
6181         else
6182             AC_MSG_ERROR([No AppKit.framewrok found])
6183         fi
6184     fi
6187 if test $_os = iOS -o $_os = Android; then
6188     enable_gtk=no
6191 dnl ***************************************
6192 dnl testing for X libraries and includes...
6193 dnl ***************************************
6194 if test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
6195     dnl Mac OS X using Aqua graphics. Don't check for X11.
6196     :
6197 elif test "$_os" != "WINNT" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6198     AC_PATH_X
6199     AC_PATH_XTRA
6200     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6202     if test "x$x_includes" = "x"; then
6203         x_includes="default_x_includes"
6204     fi
6205     if test "x$x_libraries" = "x"; then
6206         x_libraries="default_x_libraries"
6207     fi
6208     dnl The variables $x_libraries and $x_includes are set.
6209     if test -z "$x_libraries"; then
6210         AC_MSG_ERROR([No X libraries found]) # Exit
6211     fi
6212     if test -z "$x_includes"; then
6213         AC_MSG_ERROR([No X includes found]) # Exit
6214     fi
6215     CFLAGS="$CFLAGS $X_CFLAGS"
6216     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
6217     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
6218     dnl Check if the XauDisposeAuth symbol is provided by libXau.
6219     AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
6220 else
6221     x_includes="no_x_includes"
6222     x_libraries="no_x_libraries"
6224 if test -z "$x_includes"; then
6225     x_includes="no_x_includes"
6227 if test -z "$x_libraries"; then
6228     x_libraries="no_x_libraries"
6230 if test "$x_includes" = "default_x_includes"; then
6231     XINC="/usr/include"
6232 else
6233     XINC="$x_includes"
6235 AC_SUBST(XINC)
6236 if test "$x_libraries" = "default_x_libraries"; then
6237     XLIB=`$PKG_CONFIG --variable=libdir x11`
6238     if test "x$XLIB" = x; then
6239         XLIB="/usr/lib"
6240     fi
6241 else
6242     XLIB="$x_libraries"
6244 AC_SUBST(XLIB)
6245 AC_SUBST(XAU_LIBS)
6247 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "Android" -a "$_os" != "iOS"; then
6248     dnl ===================================================================
6249     dnl Check for Composite.h for Mozilla plugin
6250     dnl ===================================================================
6251     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
6252      [#include <X11/Intrinsic.h>])
6256 dnl ===================================================================
6257 dnl Check for system Xrender
6258 dnl ===================================================================
6259 AC_MSG_CHECKING([whether to link to Xrender])
6260 if test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then
6261     AC_MSG_RESULT([yes])
6262     XRENDER_LINK=YES
6263     with_system_xrender_headers=yes
6264 else
6265     AC_MSG_RESULT([no, dynamically open it])
6266     XRENDER_LINK=NO
6268 AC_MSG_CHECKING([which Xrender headers to use])
6269 if test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \
6270         test "$with_system_xrender_headers" != "no"; then
6271     AC_MSG_RESULT([external])
6272     SYSTEM_XRENDER_HEADERS=YES
6273     AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
6274       [AC_MSG_ERROR(Xrender not found. install X)], [])
6275 else
6276     AC_MSG_RESULT([internal])
6277     SYSTEM_XRENDER_HEADERS=NO
6278     BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
6280 if test "$XRENDER_LINK" = "YES"; then
6281     AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
6282       [AC_MSG_ERROR(libXrender not found or functional)], [])
6284 AC_SUBST(SYSTEM_XRENDER_HEADERS)
6285 AC_SUBST(XRENDER_LINK)
6287 dnl ===================================================================
6288 dnl Check for XRandr
6289 dnl ===================================================================
6290 AC_MSG_CHECKING([whether to enable RandR support])
6291 if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
6292     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
6293         XRANDR_DLOPEN="TRUE"
6294         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
6295     else
6296         AC_MSG_RESULT([yes])
6297         XRANDR_DLOPEN="FALSE"
6298         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
6299         if test "$ENABLE_RANDR" != "TRUE"; then
6300             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
6301                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
6302             XRANDR_CFLAGS=" "
6303             AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
6304               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
6305             XRANDR_LIBS="-lXrandr "
6306             ENABLE_RANDR="TRUE"
6307         fi
6308     fi
6309 else
6310     ENABLE_RANDR=""
6311     AC_MSG_RESULT([no])
6313 AC_SUBST(XRANDR_DLOPEN)
6314 AC_SUBST(XRANDR_CFLAGS)
6315 AC_SUBST(XRANDR_LIBS)
6316 AC_SUBST(ENABLE_RANDR)
6318 dnl ===================================================================
6319 dnl Check for building neon
6320 dnl ===================================================================
6321 AC_MSG_CHECKING([whether to use neon])
6322 if test "$enable_neon" = "no"; then
6323     AC_MSG_RESULT([no])
6324     DISABLE_NEON=TRUE
6325     AC_SUBST(DISABLE_NEON)
6326 else
6327     AC_MSG_RESULT([yes])
6328 dnl ===================================================================
6329 dnl Check for system neon
6330 dnl ===================================================================
6331 AC_MSG_CHECKING([which neon to use])
6332 if test -n "$with_system_neon" -o -n "$with_system_libs" && \
6333         test "$with_system_neon" != "no"; then
6334     AC_MSG_RESULT([external])
6335     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
6336     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
6337     NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1"
6338     SYSTEM_NEON=YES
6339     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libtasn1-3.dll libgnutls-26.dll libneon-27.dll"
6340 else
6341     AC_MSG_RESULT([internal])
6342     SYSTEM_NEON=NO
6343     NEON_LIBS=-lneon
6344     NEON_CFLAGS=
6345     BUILD_TYPE="$BUILD_TYPE NEON"
6347 AC_SUBST(SYSTEM_NEON)
6348 AC_SUBST(NEON_VERSION)
6349 AC_SUBST(NEON_LIBS)
6350 AC_SUBST(NEON_CFLAGS)
6353 dnl ===================================================================
6354 dnl Check for system openssl
6355 dnl ===================================================================
6356 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6357         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
6358     with_system_openssl=yes
6360 AC_MSG_CHECKING([which libssl to use])
6361 if test -n "$with_system_openssl" -o -n "$with_system_libs" && \
6362         test "$with_system_openssl" != "no"; then
6363     AC_MSG_RESULT([external])
6364     # Mac OS builds should get out without extra stuff is the Mac porters'
6365     # wish. And pkg-config is although Xcode ships a .pc for openssl
6366     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
6367             "$_os" = "DragonFly"; then
6368         OPENSSL_CFLAGS=
6369         OPENSSL_LIBS="-lssl -lcrypto"
6370     else
6371         PKG_CHECK_MODULES( OPENSSL, openssl )
6372     fi
6373     SYSTEM_OPENSSL=YES
6374     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libssl-8.dll libcrypto-8.dll"
6375 else
6376     AC_MSG_RESULT([internal])
6377     SYSTEM_OPENSSL=NO
6378     BUILD_TYPE="$BUILD_TYPE OPENSSL"
6380 AC_SUBST(SYSTEM_OPENSSL)
6381 AC_SUBST(OPENSSL_CFLAGS)
6382 AC_SUBST(OPENSSL_LIBS)
6384 dnl ===================================================================
6385 dnl Check for system redland
6386 dnl ===================================================================
6387 AC_MSG_CHECKING([which redland library to use])
6388 if test -n "$with_system_redland" -o -n "$with_system_libs" && \
6389         test "$with_system_redland" != "no"; then
6390     AC_MSG_RESULT([external])
6391     SYSTEM_REDLAND=YES
6392     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
6393     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
6394     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libraptor-1.dll librasqal-2.dll libsqlite3-0.dll librdf-0.dll"
6395 else
6396     AC_MSG_RESULT([internal])
6397     BUILD_TYPE="$BUILD_TYPE REDLAND"
6398     SYSTEM_REDLAND=NO
6400 AC_SUBST(SYSTEM_REDLAND)
6401 AC_SUBST(REDLAND_CFLAGS)
6402 AC_SUBST(REDLAND_LIBS)
6404 dnl ===================================================================
6405 dnl Check for system hunspell
6406 dnl ===================================================================
6407 AC_MSG_CHECKING([which libhunspell to use])
6408 if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \
6409         test "$with_system_hunspell" != "no"; then
6410     AC_MSG_RESULT([external])
6411     SYSTEM_HUNSPELL=YES
6412     AC_LANG_PUSH([C++])
6413     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
6414     if test "$HUNSPELL_PC" != "TRUE"; then
6415         AC_CHECK_HEADER(hunspell.hxx, [],
6416             [
6417             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
6418             [AC_MSG_ERROR(hunspell headers not found.)], [])
6419             ], [])
6420         AC_CHECK_LIB(hunspell, main, [],
6421            [ AC_MSG_ERROR(hunspell library not found.) ], [])
6422         HUNSPELL_LIBS=-lhunspell
6423     fi
6424     AC_LANG_POP([C++])
6425     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhunspell-1.3-0.dll"
6426 else
6427     AC_MSG_RESULT([internal])
6428     SYSTEM_HUNSPELL=NO
6429     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
6431 AC_SUBST(SYSTEM_HUNSPELL)
6432 AC_SUBST(HUNSPELL_CFLAGS)
6433 AC_SUBST(HUNSPELL_LIBS)
6435 dnl ===================================================================
6436 dnl Checking for altlinuxhyph
6437 dnl ===================================================================
6438 AC_MSG_CHECKING([which altlinuxhyph to use])
6439 if test -n "$with_system_altlinuxhyph" -o -n "$with_system_libs" && \
6440         test "$with_system_altlinuxhyph" != "no"; then
6441     AC_MSG_RESULT([external])
6442     SYSTEM_HYPH=YES
6443     AC_CHECK_HEADER(hyphen.h, [],
6444        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
6445     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
6446        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
6447        [#include <hyphen.h>])
6448     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
6449         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6450     if test -z "$HYPHEN_LIB"; then
6451         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
6452            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6453     fi
6454     if test -z "$HYPHEN_LIB"; then
6455         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
6456            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
6457     fi
6458     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libhyphen-0.dll"
6459 else
6460     AC_MSG_RESULT([internal])
6461     SYSTEM_HYPH=NO
6462     BUILD_TYPE="$BUILD_TYPE HYPHEN"
6464 AC_SUBST(SYSTEM_HYPH)
6465 AC_SUBST(HYPHEN_LIB)
6467 dnl ===================================================================
6468 dnl Checking for mythes
6469 dnl ===================================================================
6470 AC_MSG_CHECKING([which mythes to use])
6471 if test -n "$with_system_mythes" -o -n "$with_system_libs" && \
6472        test "$with_system_mythes" != "no"; then
6473     AC_MSG_RESULT([external])
6474     SYSTEM_MYTHES=YES
6475     AC_LANG_PUSH([C++])
6476     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
6477     if test "$MYTHES_PKGCONFIG" = "no"; then
6478         AC_CHECK_HEADER(mythes.hxx, [],
6479             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
6480         AC_CHECK_LIB(mythes-1.2, main, [],
6481             [ MYTHES_FOUND=no], [])
6482     if test "$MYTHES_FOUND" = "no"; then
6483         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
6484                 [ MYTHES_FOUND=no], [])
6485     fi
6486     if test "$MYTHES_FOUND" = "no"; then
6487         AC_MSG_ERROR([mythes library not found!.])
6488     fi
6489     fi
6490     AC_LANG_POP([C++])
6491     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libmythes-1.2-0.dll"
6492 else
6493     AC_MSG_RESULT([internal])
6494     SYSTEM_MYTHES=NO
6495     BUILD_TYPE="$BUILD_TYPE MYTHES"
6497 AC_SUBST(SYSTEM_MYTHES)
6498 AC_SUBST(MYTHES_CFLAGS)
6499 AC_SUBST(MYTHES_LIBS)
6501 dnl ===================================================================
6502 dnl Checking for lpsolve
6503 dnl ===================================================================
6504 AC_MSG_CHECKING([which lpsolve to use])
6505 if test -n "$with_system_lpsolve" -o -n "$with_system_libs" && \
6506         test "$with_system_lpsolve" != "no"; then
6507     AC_MSG_RESULT([external])
6508     SYSTEM_LPSOLVE=YES
6509     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
6510        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
6511     # some systems need this. Like Ubuntu....
6512     AC_CHECK_LIB(m, floor)
6513     AC_CHECK_LIB(dl, dlopen)
6514     AC_CHECK_LIB(lpsolve55, make_lp, ,
6515         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
6516     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS lpsolve55.dll"
6517 else
6518     AC_MSG_RESULT([internal])
6519     SYSTEM_LPSOLVE=NO
6520     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
6522 AC_SUBST(SYSTEM_LPSOLVE)
6524 dnl ===================================================================
6525 dnl Checking for libexttextcat
6526 dnl ===================================================================
6527 AC_MSG_CHECKING([which libexttextcat to use])
6528 if test -n "$with_system_libexttextcat" -o -n "$with_system_libs" && \
6529         test "$with_system_libexttextcat" != "no"; then
6530     AC_MSG_RESULT([external])
6531     SYSTEM_LIBEXTTEXTCAT=YES
6532     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
6533     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
6534 else
6535     AC_MSG_RESULT([internal])
6536     SYSTEM_LIBEXTTEXTCAT=NO
6537     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
6539 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
6540 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
6541 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
6542 AC_SUBST(LIBEXTTEXTCAT_LIBS)
6544 dnl ***************************************
6545 dnl testing libc version for Linux...
6546 dnl ***************************************
6547 if test "$_os" = "Linux"; then
6548     AC_MSG_CHECKING([whether libc is >= 2.1.1])
6549     exec 6>/dev/null # no output
6550     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
6551     exec 6>&1 # output on again
6552     if test "$HAVE_LIBC"; then
6553         AC_MSG_RESULT([yes])
6554     else
6555         AC_MSG_ERROR([no, upgrade libc])
6556     fi
6559 if test "$_os" != "WINNT"; then
6560     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
6561     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
6562     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
6563         SYSTEM_LIBC=YES
6564     fi
6565 else
6566     HAVE_GETOPT=NO
6567     HAVE_READDIR_R=NO
6568     SYSTEM_LIBC=YES
6570 AC_SUBST(HAVE_GETOPT)
6571 AC_SUBST(HAVE_READDIR_R)
6572 AC_SUBST(SYSTEM_LIBC)
6574 dnl =========================================
6575 dnl Check for the Windows  SDK.
6576 dnl =========================================
6577 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
6578 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
6579 if test "$_os" = "WINNT"; then
6580     AC_MSG_CHECKING([for Windows SDK])
6581     if test "$build_os" = "cygwin"; then
6582         if test -z "$with_windows_sdk_home"; then
6583             # This first line will detect a February 2003 Microsoft Platform SDK
6584             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
6585             # But there might be also an April 2005 PSDK, unfortunately MS changed
6586             # the registry entry. (we prefer the old version!?)
6587             if test -z "$WINDOWS_SDK_HOME"; then
6588                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
6589             fi
6590             # normalize if found
6591             if test -n "$WINDOWS_SDK_HOME"; then
6592                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
6593                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
6594             fi
6595         else
6596             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
6597         fi
6598     fi
6599     if test -n "$WINDOWS_SDK_HOME"; then
6600         # Remove a possible trailing backslash
6601         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6602         # Problem with current PSDK (iz 49865)
6603         # (What "current" does that mean?)
6604         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
6605             AC_MSG_ERROR([
6606 Some modules do not build correctly with MS Platform SDK - April 2005
6607 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
6608 Remove/rename/backup that file and restart configure. Details about this
6609 problem can be found in issue 49856.])
6610         fi
6612         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6613              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6614              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6615             HAVE_PSDK_H="yes"
6616         else
6617             HAVE_PSDK_H="no"
6618         fi
6619         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
6620             HAVE_PSDK_LIB="yes"
6621         else
6622             HAVE_PSDK_LIB="no"
6623         fi
6625         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
6626             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
6627 the  Windows SDK are installed.])
6628         fi
6630         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
6631              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
6632              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
6633              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe" ; then
6634             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
6635         fi
6636     fi
6638     if test -z "$WINDOWS_SDK_HOME"; then
6639         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6640     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
6641         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
6642     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
6643         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
6644     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
6645         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
6646     else
6647         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
6648     fi
6650 AC_SUBST(WINDOWS_SDK_HOME)
6652 dnl =========================================
6653 dnl Check for the Microsoft DirectX SDK.
6654 dnl =========================================
6655 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
6656     AC_MSG_CHECKING([for DirectX SDK])
6657     if test "$build_os" = "cygwin"; then
6658         if test -z "$with_directx_home"; then
6659             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
6660             if test -n "$DXSDK_DIR"; then
6661                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
6662                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
6663             fi
6664             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
6665             # the "DirectX SDK not found" error later
6666         else
6667             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
6668         fi
6669         # Remove a possible trailing backslash
6670         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
6671     elif test -n "$with_directx_home"; then
6672         DIRECTXSDK_HOME="$with_directx_home"
6673     fi
6675     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
6676         HAVE_DIRECTXSDK_H="yes"
6677     else
6678         HAVE_DIRECTXSDK_H="no"
6679     fi
6681     # MS changed the location of the libraries with Dec 2004 DirectX SDK
6682     if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
6683         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
6684     else
6685         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
6686     fi
6688     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
6689         HAVE_DIRECTXSDK_LIB="yes"
6690     else
6691         HAVE_DIRECTXSDK_LIB="no"
6692     fi
6694     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
6695         AC_MSG_RESULT([found])
6696     else
6697         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
6698     fi
6700 AC_SUBST(DIRECTXSDK_HOME)
6701 AC_SUBST(DIRECTXSDK_LIB)
6703 dnl ============================================
6704 dnl Check for Nullsoft Scriptable Install System
6705 dnl ============================================
6706 NSIS_PATH=""
6707 if test "$_os" = "WINNT" ; then
6708     if test -z "$with_nsis_path"; then
6709         AC_PATH_PROG(NSIS_PATH, makensis)
6710         if test -n "$NSIS_PATH"; then
6711             NSIS_PATH=`dirname "$NSIS_PATH"`
6712         elif test "$build_os" = "cygwin"; then
6713             AC_MSG_CHECKING([for NSIS])
6714             nsistest=`./oowintool --nsis-dir`;
6715             nsistest=`cygpath -d -m "$nsistest"`
6716             nsistest=`cygpath -u "$nsistest"`
6717             if test -x "$nsistest/nsis.exe"; then
6718                 NSIS_PATH="$nsistest"
6719                 AC_MSG_RESULT([found ($NSIS_PATH)])
6720             else
6721                 AC_MSG_RESULT([no, no self-contained installer will be built.])
6722             fi
6723         fi
6724     else
6725         AC_MSG_CHECKING([for NSIS])
6726         if test "$build_os" = "cygwin"; then
6727             with_nsis_path=`cygpath -u "$with_nsis_path"`
6728         fi
6729         if test -e "$with_nsis_path/makensis$EXEEXT_FOR_BUILD"; then
6730             NSIS_PATH="$with_nsis_path"
6731         fi
6732         if test -z "$NSIS_PATH"; then
6733             AC_MSG_RESULT([no, no self-contained installer will be built.])
6734         else
6735             if test "$build_os" = "cygwin"; then
6736                 NSIS_PATH=`cygpath -d "$NSIS_PATH"`
6737                 NSIS_PATH=`cygpath -u "$NSIS_PATH"`
6738             fi
6739             AC_MSG_RESULT([found ($NSIS_PATH)])
6740         fi
6741     fi
6743 AC_SUBST(NSIS_PATH)
6745 dnl ***************************************
6746 dnl Checking for bison and flex
6747 dnl ***************************************
6748 AC_PATH_PROG(BISON, bison)
6749 if test -z "$BISON"; then
6750     AC_MSG_ERROR([no bison found in \$PATH, install it])
6751 else
6752     AC_MSG_CHECKING([the bison version])
6753     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
6754     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
6755     # Accept newer than 1.875 or older(equal) than 1.75
6756     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
6757         if test "$_bison_version" = "1.875" ; then
6758             AC_MSG_WARN([suspect ($BISON $_bison_version)])
6759             echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
6760         else
6761             AC_MSG_RESULT([checked ($BISON $_bison_version)])
6762         fi
6763     else
6764         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
6765     fi
6767 AC_PATH_PROG(FLEX, flex)
6768 if test -z "$FLEX"; then
6769     AC_MSG_ERROR([no flex found in \$PATH, install it])
6771 dnl ***************************************
6772 dnl Checking for patch
6773 dnl ***************************************
6774 AC_PATH_PROG(PATCH, patch)
6775 if test -z "$PATCH"; then
6776     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
6779 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
6780 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
6781     if test -z "$with_gnu_patch"; then
6782         GNUPATCH=$PATCH
6783     else
6784         if test -x "$with_gnu_patch"; then
6785             GNUPATCH=$with_gnu_patch
6786         else
6787             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
6788         fi
6789     fi
6791     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
6792     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
6793         AC_MSG_RESULT([yes])
6794     else
6795         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
6796     fi
6799 dnl We also need to check for --with-gnu-cp
6801 if test -z "$with_gnu_cp"; then
6802     # check the place where the good stuff is hidden on Solaris...
6803     if test -x /usr/gnu/bin/cp; then
6804         GNUCP=/usr/gnu/bin/cp
6805     else
6806         AC_PATH_PROGS(GNUCP, gnucp cp)
6807     fi
6808     if test -z $GNUCP; then
6809         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
6810     fi
6811 else
6812     if test -x "$with_gnu_cp"; then
6813         GNUCP=$with_gnu_cp
6814     else
6815         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
6816     fi
6819 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
6820 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
6821     AC_MSG_RESULT([yes])
6822 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
6823     AC_MSG_RESULT([yes])
6824 else
6825     case "$build_os" in
6826     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
6827         GNUCP=''
6828         AC_MSG_RESULT([no gnucp found - using the system's cp command])
6829         ;;
6830     *)
6831         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
6832         ;;
6833     esac
6836 AC_SUBST(GNUPATCH)
6837 AC_SUBST(GNUCP)
6839 dnl ***************************************
6840 dnl testing assembler path
6841 dnl ***************************************
6842 ML_EXE=""
6843 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
6844     if test "$CL_X64" = ""; then
6845         assembler=ml.exe
6846         assembler_bin=bin
6847     else
6848         assembler=ml64.exe
6849         assembler_bin=bin/amd64
6850     fi
6851     if test -n "$with_asm_home"; then
6852         with_asm_home=`cygpath -u "$with_asm_home"`
6853     fi
6854     if test -x "$with_asm_home/$assembler"; then
6855         AC_MSG_CHECKING([$assembler assembler path])
6856         AC_MSG_RESULT([$with_asm_home/$assembler])
6857         ML_EXE="$with_asm_home/$assembler"
6858     else
6859         AC_PATH_PROG(ML_EXE, $assembler)
6860         if test -z "$ML_EXE"; then
6861             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
6862             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
6863                 with_asm_home=$with_cl_home/$assembler_bin
6864                 AC_MSG_RESULT([found])
6865                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
6866             else
6867                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
6868             fi
6869         else
6870             with_asm_home="ASM_IN_PATH"
6871             ML_EXE="$assembler"
6872         fi
6873     fi
6874 else
6875     with_asm_home="NO_ASM_HOME"
6877 ASM_HOME="$with_asm_home"
6878 AC_SUBST(ASM_HOME)
6879 AC_SUBST(ML_EXE)
6881 dnl ===================================================================
6882 dnl We need zip and unzip
6883 dnl ===================================================================
6884 AC_PATH_PROG(ZIP, zip)
6885 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
6886 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
6887     AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
6890 AC_PATH_PROG(UNZIP, unzip)
6891 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
6893 dnl ===================================================================
6894 dnl Zip must be a specific type for different build types.
6895 dnl ===================================================================
6896 if test $build_os = cygwin; then
6897     if test -n "`$ZIP -h | grep -i WinNT`" ; then
6898         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
6899     fi
6902 dnl ===================================================================
6903 dnl Test which vclplugs have to be built.
6904 dnl ===================================================================
6905 R=""
6906 GTK3_CFLAGS=""
6907 GTK3_LIBS=""
6908 ENABLE_GTK3=""
6909 if test "x$enable_gtk3" = "xyes"; then
6910     if test "$with_system_cairo" != yes; then
6911         echo "System cairo required for gtk3 support, please use --system-cairo"
6912     fi
6913     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
6914     if test "x$ENABLE_GTK3" = "xTRUE"; then
6915         R="gtk3"
6916     fi
6918 AC_SUBST(GTK3_LIBS)
6919 AC_SUBST(GTK3_CFLAGS)
6920 AC_SUBST(ENABLE_GTK3)
6922 AC_MSG_CHECKING([which VCLplugs shall be built])
6923 ENABLE_GTK=""
6924 if test "x$enable_gtk" = "xyes"; then
6925     ENABLE_GTK="TRUE"
6926     R="gtk $R"
6928 AC_SUBST(ENABLE_GTK)
6930 ENABLE_KDE=""
6931 if test "x$enable_kde" = "xyes"; then
6932     ENABLE_KDE="TRUE"
6933     R="$R kde"
6935 AC_SUBST(ENABLE_KDE)
6937 ENABLE_KDE4=""
6938 if test "x$enable_kde4" = "xyes"; then
6939     ENABLE_KDE4="TRUE"
6940     R="$R kde4"
6942 AC_SUBST(ENABLE_KDE4)
6944 if test -z "$R"; then
6945     AC_MSG_RESULT([none])
6946 else
6947     AC_MSG_RESULT([$R])
6950 dnl ===================================================================
6951 dnl GCONF check
6952 dnl ===================================================================
6954 ENABLE_GCONF=""
6955 AC_MSG_CHECKING([whether to enable GConf support])
6956 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
6957     ENABLE_GCONF="TRUE"
6958     AC_MSG_RESULT([yes])
6959     PKG_CHECK_MODULES( GCONF, gconf-2.0 ORBit-2.0 )
6960 else
6961     AC_MSG_RESULT([no])
6963 AC_SUBST(ENABLE_GCONF)
6965 dnl ===================================================================
6966 dnl Gnome VFS check
6967 dnl ===================================================================
6969 ENABLE_GNOMEVFS=""
6970 AC_MSG_CHECKING([whether to enable GNOME VFS support])
6971 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
6972     ENABLE_GNOMEVFS="TRUE"
6973     AC_MSG_RESULT([yes])
6974     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
6975 else
6976     AC_MSG_RESULT([no])
6978 AC_SUBST(ENABLE_GNOMEVFS)
6980 dnl ===================================================================
6981 dnl Check whether the gtk 2.0 libraries are available.
6982 dnl ===================================================================
6984 GTK_CFLAGS=""
6985 GTK_LIBS=""
6986 ENABLE_SYSTRAY_GTK=""
6987 ENABLE_DBUS=""
6988 if test  "$test_gtk" = "yes"; then
6990     if test "$ENABLE_GTK" = "TRUE" ; then
6991         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]))
6992         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]))
6993         BUILD_TYPE="$BUILD_TYPE GTK"
6995         if test "x$enable_systray" = "xyes"; then
6996             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
6997                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
6998                             [ ENABLE_SYSTRAY_GTK="" ])
6999         fi
7001         AC_MSG_CHECKING([whether to enable DBUS support])
7002         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
7003             ENABLE_DBUS="TRUE"
7004             AC_MSG_RESULT([yes])
7005             PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
7006         else
7007             AC_MSG_RESULT([no])
7008         fi
7010         AC_MSG_CHECKING([whether to enable GIO support])
7011         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
7012             if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
7013                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
7014             fi
7015             ENABLE_GIO="TRUE"
7016             AC_MSG_RESULT([yes])
7017             PKG_CHECK_MODULES( GIO, gio-2.0 )
7018         else
7019             AC_MSG_RESULT([no])
7020         fi
7021     fi
7023 AC_SUBST(ENABLE_GIO)
7024 AC_SUBST(ENABLE_DBUS)
7025 AC_SUBST(ENABLE_SYSTRAY_GTK)
7026 AC_SUBST(GTK_CFLAGS)
7027 AC_SUBST(GTK_LIBS)
7028 AC_SUBST(GTHREAD_CFLAGS)
7029 AC_SUBST(GTHREAD_LIBS)
7031 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
7032 AC_SUBST(LIBPNG_LIBS)
7033 AC_SUBST(LIBPNG_CFLAGS)
7035 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
7036 if test "x$enable_unix_libpng" = "xyes"; then
7037     AC_MSG_RESULT([yes])
7038 else
7039     AC_MSG_RESULT([no])
7040     ENABLE_QUICKSTART_LIBPNG=""
7042 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
7044 SPLIT_APP_MODULES=""
7045 if test "$enable_split_app_modules" = "yes"; then
7046     SPLIT_APP_MODULES="YES"
7048 AC_SUBST(SPLIT_APP_MODULES)
7050 SPLIT_OPT_FEATURES=""
7051 if test "$enable_split_opt_features" = "yes"; then
7052     SPLIT_OPT_FEATURES="YES"
7054 AC_SUBST(SPLIT_OPT_FEATURES)
7056 ENABLE_CAIRO_CANVAS="FALSE"
7057 if test "$enable_cairo_canvas" = "yes" ; then
7058    ENABLE_CAIRO_CANVAS="TRUE"
7060 AC_SUBST(ENABLE_CAIRO_CANVAS)
7062 dnl ===================================================================
7063 dnl Check whether the GStreamer libraries are available.
7064 dnl ===================================================================
7066 ENABLE_GSTREAMER=""
7068 if test  "$build_gstreamer" = "yes"; then
7070     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
7071     if test "x$enable_gstreamer" != "xno" ; then
7072         ENABLE_GSTREAMER="TRUE"
7073         AC_MSG_RESULT([yes])
7074         PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 )
7075     else
7076         AC_MSG_RESULT([no])
7077     fi
7080 AC_SUBST(ENABLE_GSTREAMER)
7082 dnl ===================================================================
7083 dnl Check whether the OpenGL libraries are available
7084 dnl ===================================================================
7086 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
7087 ENABLE_OPENGL=
7089 if test "$_os" = "Darwin" ; then
7090     # We use frameworks on Mac OS X, no need for detail checks
7091     ENABLE_OPENGL=TRUE
7092     SYSTEM_MESA_HEADERS=YES
7093     AC_MSG_RESULT([yes])
7094 else
7095     if test "x$enable_opengl" != "xno" ; then
7096         if test "$_os" != "WINNT"; then
7097             save_LDFLAGS=$LDFLAGS
7098             LDFLAGS="$LDFLAGS -lm"
7099             AC_MSG_RESULT([yes])
7100             AC_CHECK_LIB(GL, main, [],
7101                       [AC_MSG_ERROR(libGL not installed or functional)], [])
7102             AC_CHECK_LIB(GLU, main, [],
7103                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
7104             ENABLE_OPENGL=TRUE
7105             LDFLAGS=$save_LDFLAGS
7107             dnl ===================================================================
7108             dnl Check for system Mesa
7109             dnl ===================================================================
7110             AC_MSG_CHECKING([which Mesa headers to use])
7111             if test -n "$with_system_mesa_headers" -o -n "$with_system_headers" && \
7112                     test "$with_system_mesa_headers" != "no"; then
7113                 AC_MSG_RESULT([external])
7114                 SYSTEM_MESA_HEADERS=YES
7115                 AC_LANG_PUSH(C)
7116                 AC_CHECK_HEADER(GL/glxext.h, [],
7117                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
7118                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
7119                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
7120                 AC_LANG_POP(C)
7121             else
7122                 AC_MSG_RESULT([internal])
7123                 SYSTEM_MESA_HEADERS=NO
7124                 BUILD_TYPE="$BUILD_TYPE MESA"
7125             fi
7126         else
7127             AC_MSG_RESULT([not on Windows])
7128         fi
7129     else
7130        AC_MSG_RESULT([no])
7131     fi
7134 AC_SUBST(SYSTEM_MESA_HEADERS)
7135 AC_SUBST(ENABLE_OPENGL)
7137 # presenter minimizer extension?
7138 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
7139 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
7140    AC_MSG_RESULT([yes])
7141    ENABLE_MINIMIZER=YES
7142 else
7143    AC_MSG_RESULT([no])
7144    ENABLE_MINIMIZER=NO
7145    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
7147 AC_SUBST(ENABLE_MINIMIZER)
7149 # presenter console extension?
7150 AC_MSG_CHECKING([whether to build the Presenter Console extension])
7151 if test "x$enable_ext_presenter_console" != "xno" -a "x$enable_extension_integration" != "xno"; then
7152    AC_MSG_RESULT([yes])
7153    ENABLE_PRESENTER_SCREEN=YES
7154 else
7155    AC_MSG_RESULT([no])
7156    ENABLE_PRESENTER_SCREEN=NO
7157    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PRESENTER_SCREEN"
7159 AC_SUBST(ENABLE_PRESENTER_SCREEN)
7161 # pdf import extension?
7162 AC_MSG_CHECKING([whether to build the PDF Import extension])
7163 if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" != "xno"; then
7164   AC_MSG_RESULT([yes])
7165   ENABLE_PDFIMPORT=YES
7167   dnl ===================================================================
7168   dnl Check for system poppler
7169   dnl ===================================================================
7170   AC_MSG_CHECKING([which pdf backend to use])
7171   if test -n "$with_system_poppler" -o -n "$with_system_libs" && \
7172        test "$with_system_poppler" != "no"; then
7173       AC_MSG_RESULT([external])
7174       SYSTEM_POPPLER=YES
7175       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
7176       AC_LANG_PUSH([C++])
7177       save_CXXFLAGS=$CXXFLAGS
7178       save_CPPFLAGS=$CPPFLAGS
7179       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
7180       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
7181       AC_CHECK_HEADER([cpp/poppler-version.h], [],
7182                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
7183       CXXFLAGS=$save_CXXFLAGS
7184       CPPFLAGS=$save_CPPFLAGS
7185       AC_LANG_POP([C++])
7186   else
7187       AC_MSG_RESULT([internal])
7188       SYSTEM_POPPLER=NO
7189       BUILD_TYPE="$BUILD_TYPE XPDF"
7190   fi
7191 else
7192   AC_MSG_RESULT([no])
7193   ENABLE_PDFIMPORT=NO
7194   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PDFIMPORT"
7196 AC_SUBST(ENABLE_PDFIMPORT)
7197 AC_SUBST(SYSTEM_POPPLER)
7198 AC_SUBST(POPPLER_CFLAGS)
7199 AC_SUBST(POPPLER_LIBS)
7202 if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then
7203    AC_MSG_CHECKING([for sdext module])
7204    BUILD_TYPE="$BUILD_TYPE SDEXT"
7207 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
7208 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7209   AC_MSG_RESULT([yes])
7210   AC_MSG_CHECKING([for swext module])
7211   ENABLE_MEDIAWIKI=YES
7212   BUILD_TYPE="$BUILD_TYPE SWEXT"
7213   if test  "x$with_java" = "xno"; then
7214     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
7215   fi
7216 else
7217   AC_MSG_RESULT([no])
7218   ENABLE_MEDIAWIKI=NO
7219   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
7221 AC_SUBST(ENABLE_MEDIAWIKI)
7223 if test "$ENABLE_MEDIAWIKI" = "YES"; then
7224     AC_MSG_CHECKING([which Servlet API Jar to use])
7225     if test -n "$with_system_servlet_api"; then
7226         AC_MSG_RESULT([external])
7227         SYSTEM_SERVLETAPI=YES
7228         if test -z "$SERVLETAPI_JAR"; then
7229             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
7230         fi
7231         AC_CHECK_FILE($SERVLETAPI_JAR, [],
7232               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
7233     else
7234         AC_MSG_RESULT([internal])
7235         SYSTEM_SERVLETAPI=NO
7236         BUILD_TYPE="$BUILD_TYPE TOMCAT"
7237     fi
7239 AC_SUBST(SYSTEM_SERVLETAPI)
7240 AC_SUBST(SERVLETAPI_JAR)
7242 AC_MSG_CHECKING([whether to build the Report Builder extension])
7243 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
7244     AC_MSG_RESULT([yes])
7245     ENABLE_REPORTBUILDER=YES
7246     AC_MSG_CHECKING([for reportbuilder module])
7247     AC_MSG_CHECKING([which jfreereport libs to use])
7248     if test "$with_system_jfreereport" = "yes" -o "x$with_system_jars" = "xyes"; then
7249         SYSTEM_JFREEREPORT=YES
7250         AC_MSG_RESULT([external])
7251         if test -z $SAC_JAR; then
7252             SAC_JAR=/usr/share/java/sac.jar
7253         fi
7254         AC_CHECK_FILE($SAC_JAR, [],
7255              [AC_MSG_ERROR(sac.jar not found.)], [])
7257         if test -z $LIBXML_JAR; then
7258             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
7259                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
7260                 [
7261                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
7262                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
7263                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
7264                     )
7265                 ]
7266             )
7267         else
7268             AC_CHECK_FILE($LIBXML_JAR, [],
7269                  [AC_MSG_ERROR(libxml.jar not found.)], [])
7270         fi
7272         if test -z $FLUTE_JAR; then
7273             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
7274                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
7275                 [
7276                     AC_CHECK_FILE(/usr/share/java/flute.jar,
7277                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
7278                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
7279                     )
7280                 ]
7281             )
7282         else
7283             AC_CHECK_FILE($FLUTE_JAR, [],
7284                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
7285         fi
7287         if test -z $JFREEREPORT_JAR; then
7288             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
7289                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
7290                 [
7291                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
7292                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
7293                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
7294                     )
7295                 ]
7296             )
7297         else
7298             AC_CHECK_FILE($JFREEREPORT_JAR, [],
7299                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
7300         fi
7302         if test -z $LIBLAYOUT_JAR; then
7303             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
7304                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
7305                 [
7306                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
7307                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
7308                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
7309                     )
7310                 ]
7311             )
7312         else
7313             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
7314                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
7315         fi
7317         if test -z $LIBLOADER_JAR; then
7318             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
7319                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
7320                 [
7321                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
7322                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
7323                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
7324                     )
7325                 ]
7326             )
7327         else
7328             AC_CHECK_FILE($LIBLOADER_JAR, [],
7329                 [AC_MSG_ERROR(libloader.jar not found.)], [])
7330         fi
7332         if test -z $LIBFORMULA_JAR; then
7333             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
7334                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
7335                  [
7336                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
7337                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
7338                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
7339                      )
7340                  ]
7341             )
7342         else
7343             AC_CHECK_FILE($LIBFORMULA_JAR, [],
7344                 [AC_MSG_ERROR(libformula.jar not found.)], [])
7345         fi
7347         if test -z $LIBREPOSITORY_JAR; then
7348             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
7349                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
7350                 [
7351                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
7352                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
7353                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
7354                     )
7355                 ]
7356             )
7357         else
7358             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
7359                 [AC_MSG_ERROR(librepository.jar not found.)], [])
7360         fi
7362         if test -z $LIBFONTS_JAR; then
7363             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
7364                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
7365                 [
7366                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
7367                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
7368                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
7369                     )
7370                 ]
7371             )
7372         else
7373             AC_CHECK_FILE($LIBFONTS_JAR, [],
7374                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
7375         fi
7377         if test -z $LIBSERIALIZER_JAR; then
7378             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
7379                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
7380                 [
7381                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
7382                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
7383                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
7384                     )
7385                 ]
7386             )
7387         else
7388             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
7389                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
7390         fi
7393         if test -z $LIBBASE_JAR; then
7394             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
7395                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
7396                 [
7397                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
7398                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
7399                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
7400                     )
7401                 ]
7402             )
7403         else
7404             AC_CHECK_FILE($LIBBASE_JAR, [],
7405                 [AC_MSG_ERROR(libbase.jar not found.)], [])
7406         fi
7408     else
7409         AC_MSG_RESULT([internal])
7410         AC_MSG_CHECKING([for jfreereport module])
7411         SYSTEM_JFREEREPORT=NO
7412         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
7413     fi
7414     BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
7415 else
7416     AC_MSG_RESULT([no])
7417     ENABLE_REPORTBUILDER=NO
7418     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
7419     SYSTEM_JFREEREPORT=NO
7421 AC_SUBST(ENABLE_REPORTBUILDER)
7422 AC_SUBST(SYSTEM_JFREEREPORT)
7423 AC_SUBST(SAC_JAR)
7424 AC_SUBST(LIBXML_JAR)
7425 AC_SUBST(FLUTE_JAR)
7426 AC_SUBST(JFREEREPORT_JAR)
7427 AC_SUBST(LIBBASE_JAR)
7428 AC_SUBST(LIBLAYOUT_JAR)
7429 AC_SUBST(LIBLOADER_JAR)
7430 AC_SUBST(LIBFORMULA_JAR)
7431 AC_SUBST(LIBREPOSITORY_JAR)
7432 AC_SUBST(LIBFONTS_JAR)
7433 AC_SUBST(LIBSERIALIZER_JAR)
7435 # this has to be here because both the Wiki Publisher and the SRB use
7436 # commons-logging
7437 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7438     AC_MSG_CHECKING([which Apache commons-* libs to use])
7439     if test "x$with_system_apache_commons" = "xyes" -o "x$with_system_jars" = "xyes"; then
7440         SYSTEM_APACHE_COMMONS=YES
7441         AC_MSG_RESULT([external])
7442         if test "$ENABLE_MEDIAWIKI" = "YES"; then
7443             if test -z $COMMONS_CODEC_JAR; then
7444                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
7445                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
7446                     [
7447                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
7448                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
7449                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
7450                         )
7451                     ]
7452                 )
7453             else
7454                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
7455                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
7456             fi
7458             if test -z $COMMONS_LANG_JAR; then
7459                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
7460                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
7461                     [
7462                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
7463                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
7464                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
7465                             )
7466                     ]
7467                 )
7468             else
7469                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
7470                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
7471             fi
7473             if test -z $COMMONS_HTTPCLIENT_JAR; then
7474                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
7475                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
7476                     [
7477                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
7478                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
7479                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
7480                         )
7481                     ]
7482                 )
7483             else
7484                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
7485                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
7486             fi
7487         fi
7488         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
7489             if test -z $COMMONS_LOGGING_JAR; then
7490                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
7491                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
7492                    [
7493                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
7494                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
7495                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
7496                         )
7497                     ]
7498                 )
7499             else
7500                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
7501                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
7502             fi
7503         fi
7504     else
7505         AC_MSG_RESULT([internal])
7506         SYSTEM_APACHE_COMMONS=NO
7507         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
7508     fi
7510 AC_SUBST(SYSTEM_APACHE_COMMONS)
7511 AC_SUBST(COMMONS_CODEC_JAR)
7512 AC_SUBST(COMMONS_LANG_JAR)
7513 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
7514 AC_SUBST(COMMONS_LOGGING_JAR)
7516 # scripting provider for BeanShell extension?
7517 AC_MSG_CHECKING([whether to build extension for support of scripts in BeanShell])
7518 if test "x$enable_ext_scripting_beanshell" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7519    AC_MSG_RESULT([yes])
7520    ENABLE_SCRIPTING_BEANSHELL=YES
7521 else
7522    AC_MSG_RESULT([no])
7523    ENABLE_SCRIPTING_BEANSHELL=NO
7524    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_BEANSHELL"
7526 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
7528 # scripting provider for JavaScript extension?
7529 AC_MSG_CHECKING([whether to build extension for support of scripts in JavaScript])
7530 if test "x$enable_ext_scripting_javascript" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7531    AC_MSG_RESULT([yes])
7532    ENABLE_SCRIPTING_JAVASCRIPT=YES
7533 else
7534    AC_MSG_RESULT([no])
7535    ENABLE_SCRIPTING_JAVASCRIPT=NO
7536    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_SCRIPTING_JAVASCRIPT"
7538 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
7540 dnl Scripting provider for Python extension?
7541 dnl We always provide this unless we have disabled Python completely
7542 if test $enable_python = no; then
7543     ENABLE_SCRIPTING_PYTHON=NO
7544 else
7545     ENABLE_SCRIPTING_PYTHON=YES
7547 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
7549 supports_multilib=
7550 case "$host_cpu" in
7551 x86_64 | powerpc64 | s390x)
7552     if test "$SIZEOF_LONG" = "8"; then
7553         supports_multilib="yes"
7554     fi
7555     ;;
7557     ;;
7558 esac
7560 dnl ===================================================================
7561 dnl Check whether the Qt3 and KDE3 libraries are available.
7562 dnl ===================================================================
7564 KDE_CFLAGS=""
7565 KDE_LIBS=""
7566 if test "$_os" != "OpenBSD"; then
7567     MOC="moc"
7569 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
7570     dnl Search paths for Qt3 and KDE3
7571     if test -z "$supports_multilib" ; then
7572         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"
7573         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"
7574     else
7575         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"
7576         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"
7577     fi
7578     if test -n "$QTDIR" ; then
7579         qt_incdirs="$QTDIR/include $qt_incdirs"
7580         if test -z "$supports_multilib" ; then
7581             qt_libdirs="$QTDIR/lib $qt_libdirs"
7582         else
7583             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7584         fi
7585     fi
7586     if test -z "$supports_multilib" ; then
7587         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"
7588         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"
7589     else
7590         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"
7591         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"
7592     fi
7593     if test -n "$KDEDIR" ; then
7594         kde_incdirs="$KDEDIR/include $kde_incdirs"
7595         if test -z "$supports_multilib" ; then
7596             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7597         else
7598             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7599         fi
7600     fi
7602     dnl What to test
7603     qt_test_include="qstyle.h"
7604     kde_test_include="kapp.h"
7606     if test "$_os" != "OpenBSD"; then
7607         qt_test_library="libqt-mt.so"
7608         kde_test_library="libDCOP.so"
7609     else
7610         qt_test_library="libqt-mt.so*"
7611         kde_test_library="libDCOP.so*"
7612     fi
7614     dnl Check for Qt3 headers
7615     AC_MSG_CHECKING([for Qt3 headers])
7616     qt_incdir="no"
7617     for kde_check in $qt_incdirs ; do
7618         if test -r "$kde_check/$qt_test_include" ; then
7619             qt_incdir="$kde_check"
7620             break
7621         fi
7622     done
7623     AC_MSG_RESULT([$qt_incdir])
7624     if test "x$qt_incdir" = "xno" ; then
7625         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
7626 your Qt3 installation by exporting QTDIR before running "configure".])
7627     fi
7629     dnl Check for Qt3 libraries
7630     AC_MSG_CHECKING([for Qt3 libraries])
7631     qt_libdir="no"
7632     for qt_check in $qt_libdirs ; do
7633         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`" ; then
7634             qt_libdir="$qt_check"
7635             break
7636         fi
7637     done
7638     AC_MSG_RESULT([$qt_libdir])
7639     if test "x$qt_libdir" = "xno" ; then
7640         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
7641 your Qt3 installation by exporting QTDIR before running "configure".])
7642     fi
7644     dnl Check for Meta Object Compiler
7645     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
7646     if test "$MOC" = "no" ; then
7647         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
7648 the root of your Qt3 installation by exporting QTDIR before running "configure".])
7649     fi
7651     dnl Check for KDE3 headers
7652     AC_MSG_CHECKING([for KDE3 headers])
7653     kde_incdir="no"
7654     for kde_check in $kde_incdirs ; do
7655         if test -r "$kde_check/$kde_test_include" ; then
7656             kde_incdir="$kde_check"
7657             break
7658         fi
7659     done
7660     AC_MSG_RESULT([$kde_incdir])
7661     if test "x$kde_incdir" = "xno" ; then
7662         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
7663 your KDE3 installation by exporting KDEDIR before running "configure".])
7664     fi
7666     dnl Check for KDE3 libraries
7667     AC_MSG_CHECKING([for KDE3 libraries])
7668     kde_libdir="no"
7669     for kde_check in $kde_libdirs ; do
7670         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`" ; then
7671             kde_libdir="$kde_check"
7672             break
7673         fi
7674     done
7675     AC_MSG_RESULT([$kde_libdir])
7676     if test "x$kde_libdir" = "xno" ; then
7677         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
7678 your KDE3 installation by exporting KDEDIR before running "configure".])
7679     fi
7681     dnl Set the variables
7682     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7683     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
7685 AC_SUBST(KDE_CFLAGS)
7686 AC_SUBST(KDE_LIBS)
7687 AC_SUBST(MOC)
7689 dnl ===================================================================
7690 dnl KDE4 Integration
7691 dnl ===================================================================
7693 KDE4_CFLAGS=""
7694 KDE4_LIBS=""
7695 MOC4="moc"
7696 KDE_GLIB_CFLAGS=""
7697 KDE_GLIB_LIBS=""
7698 KDE_HAVE_GLIB=""
7699 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
7700     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
7701     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
7703     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
7704     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
7706     if test -n "$supports_multilib" ; then
7707         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
7708         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
7709     fi
7711     if test -n "$QTDIR" ; then
7712         qt_incdirs="$QTDIR/include $qt_incdirs"
7713         if test -z "$supports_multilib" ; then
7714             qt_libdirs="$QTDIR/lib $qt_libdirs"
7715         else
7716             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
7717         fi
7718     fi
7719     if test -n "$QT4DIR" ; then
7720         qt_incdirs="$QT4DIR/include $qt_incdirs"
7721         if test -z "$supports_multilib" ; then
7722             qt_libdirs="$QT4DIR/lib $qt_libdirs"
7723         else
7724             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
7725         fi
7726     fi
7728     if test -n "$KDEDIR" ; then
7729         kde_incdirs="$KDEDIR/include $kde_incdirs"
7730         if test -z "$supports_multilib" ; then
7731             kde_libdirs="$KDEDIR/lib $kde_libdirs"
7732         else
7733             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
7734         fi
7735     fi
7736     if test -n "$KDE4DIR" ; then
7737         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
7738         if test -z "$supports_multilib" ; then
7739             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
7740         else
7741             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
7742         fi
7743     fi
7745     qt_test_include="Qt/qobject.h"
7746     qt_test_library="libQtCore.so"
7747     kde_test_include="kwindowsystem.h"
7748     kde_test_library="libsolid.so"
7750     AC_MSG_CHECKING([for Qt4 headers])
7751     qt_header_dir="no"
7752     for inc_dir in $qt_incdirs ; do
7753         if test -r "$inc_dir/$qt_test_include" ; then
7754             qt_header_dir="$inc_dir"
7755             break
7756         fi
7757     done
7759     AC_MSG_RESULT([$qt_header_dir])
7760     if test "x$qt_header_dir" = "xno" ; then
7761         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7762     fi
7764     AC_MSG_CHECKING([for Qt4 libraries])
7765     qt_lib_dir="no"
7766     for lib_dir in $qt_libdirs ; do
7767         if test -r "$lib_dir/$qt_test_library" ; then
7768             qt_lib_dir="$lib_dir"
7769             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
7770             break
7771         fi
7772     done
7774     AC_MSG_RESULT([$qt_lib_dir])
7776     if test "x$qt_lib_dir" = "xno" ; then
7777         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
7778     fi
7780     dnl Check for Meta Object Compiler
7782     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7783     MOC4="$MOCQT4"
7784     if test "$MOC4" = "no" ; then
7785         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
7786         if test "$MOC4" = "no" ; then
7787             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
7788 the root of your Qt installation by exporting QT4DIR before running "configure".])
7789         fi
7790     fi
7792     dnl Check for KDE4 headers
7793     AC_MSG_CHECKING([for KDE4 headers])
7794     kde_incdir="no"
7795     for kde_check in $kde_incdirs ; do
7796         if test -r "$kde_check/$kde_test_include" ; then
7797             kde_incdir="$kde_check"
7798             break
7799         fi
7800     done
7801     AC_MSG_RESULT([$kde_incdir])
7802     if test "x$kde_incdir" = "xno" ; then
7803         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7804     fi
7806     dnl Check for KDE4 libraries
7807     AC_MSG_CHECKING([for KDE4 libraries])
7808     kde_libdir="no"
7809     for kde_check in $kde_libdirs ; do
7810         if test -r "$kde_check/$kde_test_library" ; then
7811             kde_libdir="$kde_check"
7812             break
7813         fi
7814     done
7816     AC_MSG_RESULT([$kde_libdir])
7817     if test "x$kde_libdir" = "xno" ; then
7818         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
7819     fi
7821     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
7822     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
7824     AC_LANG_PUSH([C++])
7825     save_CXXFLAGS=$CXXFLAGS
7826     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
7827     AC_MSG_CHECKING([whether KDE is >= 4.2])
7828        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7829 #include <kdeversion.h>
7831 int main(int argc, char **argv) {
7832        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
7833        else return 1;
7835        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
7836     CXXFLAGS=$save_CXXFLAGS
7837     AC_LANG_POP([C++])
7839    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
7840     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
7841         [KDE_HAVE_GLIB=1],
7842         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
7844 AC_SUBST(KDE4_CFLAGS)
7845 AC_SUBST(KDE4_LIBS)
7846 AC_SUBST(MOC4)
7847 AC_SUBST(KDE_GLIB_CFLAGS)
7848 AC_SUBST(KDE_GLIB_LIBS)
7849 AC_SUBST(KDE_HAVE_GLIB)
7851 dnl ===================================================================
7852 dnl Test for the enabling the lockdown pieces
7853 dnl ===================================================================
7854 AC_MSG_CHECKING([whether to enable the lockdown pieces])
7855 ENABLE_LOCKDOWN=""
7856 if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
7857     ENABLE_LOCKDOWN=YES
7858     AC_MSG_RESULT([yes])
7859 else
7860     AC_MSG_RESULT([no])
7862 AC_SUBST(ENABLE_LOCKDOWN)
7864 dnl ===================================================================
7865 dnl Test whether to include Evolution 2 support
7866 dnl ===================================================================
7867 AC_MSG_CHECKING([whether to enable evolution 2 support])
7868 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
7869     AC_MSG_RESULT([yes])
7870     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
7871     ENABLE_EVOAB2="TRUE"
7872 else
7873     ENABLE_EVOAB2=""
7874     AC_MSG_RESULT([no])
7876 AC_SUBST(ENABLE_EVOAB2)
7877 AC_SUBST(GOBJECT_CFLAGS)
7878 AC_SUBST(GOBJECT_LIBS)
7880 dnl ===================================================================
7881 dnl Test whether to include KDE AB support
7882 dnl ===================================================================
7883 AC_MSG_CHECKING([whether to enable KDE address book support])
7884 if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then
7885     AC_MSG_RESULT([yes])
7886     AC_LANG_PUSH([C++])
7887     save_CXXFLAGS=$CXXFLAGS
7888     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
7889     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
7890        AC_RUN_IFELSE([AC_LANG_SOURCE([[
7891 #include <kdeversion.h>
7893 int main(int argc, char **argv) {
7894        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
7895        else return 1;
7897        ]])],[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])],[])
7898     CXXFLAGS=$save_CXXFLAGS
7899     AC_LANG_POP([C++])
7900     ENABLE_KAB=TRUE
7901 else
7902     AC_MSG_RESULT([no])
7903     ENABLE_KAB=
7905 AC_SUBST(ENABLE_KAB)
7907 dnl ===================================================================
7908 dnl Test whether to include MathMLDTD
7909 dnl ===================================================================
7910 AC_MSG_CHECKING([whether to include MathMLDTD])
7911 if test -n "$enable_mathmldtd"; then
7912     if test "$enable_mathmldtd" = "no"; then
7913         AC_MSG_RESULT([no])
7914         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
7915     else
7916         AC_MSG_RESULT([yes])
7917         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
7918     fi
7919 else
7920     AC_MSG_RESULT([no])
7921     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
7924 dnl ===================================================================
7925 dnl Test which themes to include
7926 dnl ===================================================================
7927 AC_MSG_CHECKING([which themes to include])
7928 # if none given, use all available themes
7929 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
7930     with_theme="default crystal hicontrast oxygen tango"
7933 WITH_THEMES=""
7934 for theme in $with_theme; do
7935     case $theme in
7936         default|crystal|hicontrast|oxygen|tango) : ;;
7937         *) AC_MSG_ERROR([Unknown value for --with-themes: $theme]) ;;
7938     esac
7939     WITH_THEMES="$WITH_THEMES $theme"
7940     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
7941 done
7942 AC_MSG_RESULT([$WITH_THEMES])
7943 AC_SUBST([WITH_THEMES])
7945 dnl ===================================================================
7946 dnl Test whether to integrate helppacks into the product's installer
7947 dnl ===================================================================
7948 AC_MSG_CHECKING([for helppack integration])
7949 if test "z$with_helppack_integration" = "zno" ; then
7950     WITH_HELPPACK_INTEGRATION=NO
7951     AC_MSG_RESULT([no integration])
7952 else
7953     WITH_HELPPACK_INTEGRATION=YES
7954     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
7955     AC_MSG_RESULT([integration])
7957 AC_SUBST(WITH_HELPPACK_INTEGRATION)
7959 ###############################################################################
7960 # Extensions checking
7961 ###############################################################################
7962 dnl ===================================================================
7963 dnl Test whether to integrate extensions into the product's installer
7964 dnl ===================================================================
7965 AC_MSG_CHECKING([for extensions integration])
7966 if test "x$enable_extension_integration" != "xno"; then
7967     WITH_EXTENSION_INTEGRATION=YES
7968     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
7969     AC_MSG_RESULT([yes, use integration])
7970 else
7971     WITH_EXTENSION_INTEGRATION=NO
7972     AC_MSG_RESULT([no, do not integrate])
7974 AC_SUBST(WITH_EXTENSION_INTEGRATION)
7976 dnl ===================================================================
7977 dnl Test whether to include Lightproof extensions
7978 dnl ===================================================================
7979 AC_MSG_CHECKING([for Lightproof extensions integration (only supported languages displayed)])
7980 LIGHTPROOF_LANG=
7981 LIGHTPROOF_HU_PACK=
7982 LIGHTPROOF_RU_PACK=
7983 LIGHTPROOF_EN_US_PACK=
7984 if test "x$enable_ext_lightproof" = "xno" -o "x$enable_extension_integration" = "xno"; then
7985     AC_MSG_RESULT([no integration])
7986 else
7987     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LIGHTPROOF"
7988     if test "x$enable_ext_lightproof" = "xyes" -o "x$enable_ext_lightproof" = "x"; then
7989         wanted_lightproof="en-US hu ru"
7990     else
7991         for lang in $enable_ext_lightproof ; do
7992             case $lang in
7993                 en-US|hu|ru)
7994                     wanted_lightproof="$wanted_lightproof $lang"
7995                     ;;
7996                 *)
7997                     AC_MSG_ERROR([Unknown value for --enable-ext-lightproof: $lang])
7998                     ;;
7999                 esac
8000         done
8001     fi
8002     for lang in $wanted_lightproof ; do
8003         LIGHTPROOF_LANG="$LIGHTPROOF_LANG $lang"
8004         case $lang in
8005             en-US) LIGHTPROOF_EN_US_PACK="0ab55ac8e88f04258f1d3e79e984382f-lightproof-en_US-0.1.oxt" ;;
8006             hu) LIGHTPROOF_HU_PACK="76345f925e34fef2d29bade4f29108e9-lightproof-hu_1.3.oxt" ;;
8007             ru) LIGHTPROOF_RU_PACK="673860e8649cff2ebdc68bd46f2f7f1a-lightproof-ru_0.1.oxt" ;;
8008             *) AC_MSG_ERROR([Unknown value for --enable-ext-lightproof: $lang]) ;;
8009         esac
8010     done
8011     AC_MSG_RESULT([$LIGHTPROOF_LANG])
8013 AC_SUBST(LIGHTPROOF_LANG)
8014 AC_SUBST(LIGHTPROOF_HU_PACK)
8015 AC_SUBST(LIGHTPROOF_RU_PACK)
8016 AC_SUBST(LIGHTPROOF_EN_US_PACK)
8018 dnl ===================================================================
8019 dnl Test whether to include Watch Window extension
8020 dnl ===================================================================
8021 AC_MSG_CHECKING([for Watch Window extension integration])
8022 WATCH_WINDOW_EXTENSION_PACK=
8023 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8024     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
8025     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
8026     AC_MSG_RESULT([yes])
8027 else
8028     AC_MSG_RESULT([no])
8030 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
8032 dnl ===================================================================
8033 dnl Test whether to include SmART Gallery (Diagram) extension
8034 dnl ===================================================================
8035 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
8036 DIAGRAM_EXTENSION_PACK=
8037 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8038     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
8039     DIAGRAM_EXTENSION_PACK="4a433efb6d385264ebc1d5513782d51c-SmART_0.9.4.oxt"
8040     AC_MSG_RESULT([yes])
8041 else
8042     AC_MSG_RESULT([no])
8044 AC_SUBST(DIAGRAM_EXTENSION_PACK)
8046 dnl ===================================================================
8047 dnl Test whether to include Validator extension
8048 dnl ===================================================================
8049 AC_MSG_CHECKING([for Validator extension integration])
8050 VALIDATOR_EXTENSION_PACK=
8051 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8052     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
8053     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
8054     AC_MSG_RESULT([yes])
8055 else
8056     AC_MSG_RESULT([no])
8058 AC_SUBST(VALIDATOR_EXTENSION_PACK)
8060 dnl ===================================================================
8061 dnl Test whether to include Barcode extension
8062 dnl ===================================================================
8063 AC_MSG_CHECKING([for Barcode extension integration])
8064 BARCODE_EXTENSION_PACK=
8065 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8066     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
8067     BARCODE_EXTENSION_PACK="7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt"
8068     AC_MSG_RESULT([yes])
8069 else
8070     AC_MSG_RESULT([no])
8072 AC_SUBST([BARCODE_EXTENSION_PACK])
8074 dnl ===================================================================
8075 dnl Test whether to include ConvertTextToNumber extension
8076 dnl ===================================================================
8077 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
8078 CT2N_EXTENSION_PACK=
8079 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8080     BUILD_TYPE="$BUILD_TYPE CT2N"
8081     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
8082     CT2N_EXTENSION_PACK="451ccf439a36a568653b024534669971-ConvertTextToNumber_1.3.2.oxt"
8083     AC_MSG_RESULT([yes])
8084 else
8085     AC_MSG_RESULT([no])
8087 AC_SUBST(CT2N_EXTENSION_PACK)
8089 dnl ===================================================================
8090 dnl Test whether to include Numbertext extension
8091 dnl ===================================================================
8092 AC_MSG_CHECKING([for Numbertext extension integration])
8093 NUMBERTEXT_EXTENSION_PACK=
8094 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8095     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
8096     NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt"
8097     AC_MSG_RESULT([yes])
8098 else
8099     AC_MSG_RESULT([no])
8101 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
8103 dnl ===================================================================
8104 dnl Test whether to include Hungarian Cross-reference Toolbar extension
8105 dnl ===================================================================
8106 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
8107 HUNART_EXTENSION_PACK=
8108 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8109     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
8110     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
8111     AC_MSG_RESULT([yes])
8112 else
8113     AC_MSG_RESULT([no])
8115 AC_SUBST(HUNART_EXTENSION_PACK)
8117 dnl ===================================================================
8118 dnl Test whether to include Typography Toolbar extension
8119 dnl ===================================================================
8120 AC_MSG_CHECKING([for Typography Toolbar extension integration])
8121 TYPO_EXTENSION_PACK=
8122 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8123     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
8124     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
8125     AC_MSG_RESULT([yes])
8126 else
8127     AC_MSG_RESULT([no])
8129 AC_SUBST(TYPO_EXTENSION_PACK)
8131 dnl ===================================================================
8132 dnl Test whether to include Google Docs extension
8133 dnl ===================================================================
8134 AC_MSG_CHECKING([for Google Docs extension integration])
8135 GOOGLE_DOCS_EXTENSION_PACK=
8136 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8137     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
8138     GOOGLE_DOCS_EXTENSION_PACK="cea0f63d5985ba4fcbd882031df44346-gdocs_3.0.0_modified.oxt"
8139     AC_MSG_RESULT([yes])
8140 else
8141     AC_MSG_RESULT([no])
8143 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
8145 dnl ===================================================================
8146 dnl Test whether to include NLPSolver extension
8147 dnl ===================================================================
8148 AC_MSG_CHECKING([for NLPSolver extension integration])
8149 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8150     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
8151     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
8152     AC_MSG_RESULT([yes])
8153 else
8154     AC_MSG_RESULT([no])
8157 dnl ===================================================================
8158 dnl Test whether to include LanguageTool extension
8159 dnl ===================================================================
8160 AC_MSG_CHECKING([for LanguageTool extension integration])
8161 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8162     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
8163     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
8164     AC_MSG_RESULT([yes])
8165 else
8166     AC_MSG_RESULT([no])
8169 dnl ===================================================================
8170 dnl Test whether to include oooblogger extension
8171 dnl ===================================================================
8172 AC_MSG_CHECKING([for oooblogger extension integration])
8173 OOOBLOGGER_EXTENSION_PACK=
8174 if test "x$enable_ext_oooblogger" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8175     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_OOOBLOGGER"
8176     OOOBLOGGER_EXTENSION_PACK="b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt"
8177     AC_MSG_RESULT([yes])
8178 else
8179     AC_MSG_RESULT([no])
8181 AC_SUBST(OOOBLOGGER_EXTENSION_PACK)
8182 ###############################################################################
8184 dnl ===================================================================
8185 dnl Test whether to include Sun Professional Template Pack
8186 dnl ===================================================================
8187 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
8188 if test "z$with_sun_templates" = "z" -o "z$with_sun_templates" = "zno" ; then
8189     SUNTEMPLATES_LANG=""
8190     AC_MSG_RESULT([no integration])
8191 else
8192     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
8193     sun_supported_langs="en-US de it fr es hu"
8194     if test "z$with_sun_templates" = "zyes" ; then
8195         wanted_sun_templates="$sun_supported_langs"
8196     else
8197         # check whether the langs are supported by Sun
8198         wanted_sun_templates=
8199         for lang in $with_sun_templates ; do
8200             if test -n "`echo $sun_supported_langs | grep "$lang"`" ; then
8201                 wanted_sun_templates="$wanted_sun_templates $lang"
8202             fi
8203         done
8204     fi
8205     SUNTEMPLATES_LANG=
8206     SUNTEMPLATES_DE_PACK=
8207     SUNTEMPLATES_EN_US_PACK=
8208     SUNTEMPLATES_ES_PACK=
8209     SUNTEMPLATES_FR_PACK=
8210     SUNTEMPLATES_HU_PACK=
8211     SUNTEMPLATES_IT_PACK=
8212     # check whether the langs are requested at all
8213     for lang in $wanted_sun_templates ; do
8214     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`" ; then
8215         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
8216         case $lang in
8217         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
8218         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
8219         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
8220         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
8221         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
8222         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
8223         esac
8224     fi
8225     done
8226     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
8228 AC_SUBST(SUNTEMPLATES_LANG)
8229 AC_SUBST(SUNTEMPLATES_DE_PACK)
8230 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
8231 AC_SUBST(SUNTEMPLATES_ES_PACK)
8232 AC_SUBST(SUNTEMPLATES_FR_PACK)
8233 AC_SUBST(SUNTEMPLATES_HU_PACK)
8234 AC_SUBST(SUNTEMPLATES_IT_PACK)
8236 dnl ===================================================================
8237 dnl Test whether to include fonts
8238 dnl ===================================================================
8239 AC_MSG_CHECKING([whether to include third-party fonts])
8240 if test "$with_fonts" != "no" ; then
8241     AC_MSG_RESULT([yes])
8242     WITH_FONTS=YES
8243     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
8244 else
8245     AC_MSG_RESULT([no])
8246     WITH_FONTS=NO
8247     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
8249 AC_SUBST(WITH_FONTS)
8251 AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
8252 if test "$with_agfa_monotype_fonts" = "yes" ; then
8253     AC_MSG_RESULT([yes])
8254     WITH_AGFA_MONOTYPE_FONTS=YES
8255     SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
8256     BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
8257 else
8258     AC_MSG_RESULT([no])
8259     WITH_AGFA_MONOTYPE_FONTS=NO
8261 AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
8263 dnl ===================================================================
8264 dnl Test whether to include ppds
8265 dnl ===================================================================
8266 AC_MSG_CHECKING([whether to include PPDs])
8267 if test "$with_ppds" != "no"; then
8268     AC_MSG_RESULT([yes])
8269 else
8270     AC_MSG_RESULT([no])
8271     WITHOUT_PPDS=YES
8272     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
8274 AC_SUBST(WITHOUT_PPDS)
8276 dnl ===================================================================
8277 dnl Test whether to include afms
8278 dnl ===================================================================
8279 AC_MSG_CHECKING([whether to include AFMs])
8280 if test "$with_afms" != "no"; then
8281     AC_MSG_RESULT([yes])
8282     BUILD_TYPE="$BUILD_TYPE AFMS"
8283 else
8284     AC_MSG_RESULT([no])
8285     WITHOUT_AFMS=YES
8286     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
8288 AC_SUBST(WITHOUT_AFMS)
8290 dnl ===================================================================
8291 dnl Test whether to include extra galleries
8292 dnl ===================================================================
8293 AC_MSG_CHECKING([whether to include extra galleries])
8294 if test "z$enable_extra_gallery" = "z" -o "z$enable_extra_gallery" = "zno" ; then
8295     AC_MSG_RESULT([no])
8296     WITH_EXTRA_GALLERY=NO
8297     OOOP_GALLERY_PACK=""
8298 else
8299     AC_MSG_RESULT([yes])
8300     WITH_EXTRA_GALLERY=YES
8301     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
8302     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
8303     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
8305 AC_SUBST(WITH_EXTRA_GALLERY)
8306 AC_SUBST(OOOP_GALLERY_PACK)
8308 dnl ===================================================================
8309 dnl Test whether to include extra templates
8310 dnl ===================================================================
8311 AC_MSG_CHECKING([whether to include extra templates])
8312 if test "z$enable_extra_template" = "z" -o "z$enable_extra_template" = "zno" ; then
8313     AC_MSG_RESULT([no])
8314     WITH_EXTRA_TEMPLATE=NO
8315     OOOP_TEMPLATES_PACK=""
8316 else
8317     AC_MSG_RESULT([yes])
8318     WITH_EXTRA_TEMPLATE=YES
8319     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
8320     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
8321     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
8323 AC_SUBST(WITH_EXTRA_TEMPLATE)
8324 AC_SUBST(OOOP_TEMPLATES_PACK)
8326 dnl ===================================================================
8327 dnl Test whether to include extra samples
8328 dnl ===================================================================
8329 AC_MSG_CHECKING([whether to include extra samples])
8330 if test "z$enable_extra_sample" = "z" -o "z$enable_extra_sample" = "zno" ; then
8331     AC_MSG_RESULT([no])
8332     WITH_EXTRA_SAMPLE=NO
8333     OOOP_SAMPLES_PACK=""
8334 else
8335     AC_MSG_RESULT([yes])
8336     WITH_EXTRA_SAMPLE=YES
8337     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
8338     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
8339     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
8341 AC_SUBST(WITH_EXTRA_SAMPLE)
8342 AC_SUBST(OOOP_SAMPLES_PACK)
8344 dnl ===================================================================
8345 dnl Test whether to include extra fonts
8346 dnl ===================================================================
8347 AC_MSG_CHECKING([whether to include extra fonts])
8348 if test "z$enable_extra_font" = "z" -o "z$enable_extra_font" = "zno" ; then
8349     AC_MSG_RESULT([no])
8350     WITH_EXTRA_FONT=NO
8351     OOOP_FONTS_PACK=""
8352 else
8353     AC_MSG_RESULT([yes])
8354     WITH_EXTRA_FONT=YES
8355     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
8356     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
8357     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
8359 AC_SUBST(WITH_EXTRA_FONT)
8360 AC_SUBST(OOOP_FONTS_PACK)
8362 dnl ===================================================================
8363 dnl Test whether to build global menu support
8364 dnl ===================================================================
8365 AC_MSG_CHECKING([whether to build global menu support])
8366 if test "z$enable_lomenubar" = "z" -o "z$enable_lomenubar" = "zno" ; then
8367     AC_MSG_RESULT([no])
8368     ENABLE_LOMENUBAR="FALSE"
8369 else
8370     AC_MSG_RESULT([yes])
8371     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]))
8372     ENABLE_LOMENUBAR="TRUE"
8374 AC_SUBST(ENABLE_LOMENUBAR)
8376 dnl ===================================================================
8377 dnl Test whether to enable online update service
8378 dnl ===================================================================
8379 AC_MSG_CHECKING([whether to enable online update])
8380 ENABLE_ONLINE_UPDATE=
8381 if test "z$enable_online_update" = "z" ; then
8382     if test "$_os" = "WINNT" -o "$_os" = "Darwin" ; then
8383         AC_MSG_RESULT([yes])
8384         ENABLE_ONLINE_UPDATE="TRUE"
8385     else
8386         AC_MSG_RESULT([no])
8387     fi
8388 else
8389     if test "z$enable_online_update" = "zyes" ; then
8390         AC_MSG_RESULT([yes])
8391         ENABLE_ONLINE_UPDATE="TRUE"
8392     else
8393         AC_MSG_RESULT([no])
8394     fi
8396 AC_SUBST(ENABLE_ONLINE_UPDATE)
8398 dnl ===================================================================
8399 dnl Test whether build target is Release Build
8400 dnl ===================================================================
8401 AC_MSG_CHECKING([whether build target is Release Build])
8402 if test "z$enable_release_build" = "z" -o "z$enable_release_build" = "zno" ; then
8403     AC_MSG_RESULT([no])
8404     ENABLE_RELEASE_BUILD="FALSE"
8405 else
8406     AC_MSG_RESULT([yes])
8407     ENABLE_RELEASE_BUILD="TRUE"
8409 AC_SUBST(ENABLE_RELEASE_BUILD)
8411 dnl ===================================================================
8412 dnl Test whether to enable ActiveX embedding
8413 dnl ===================================================================
8414 if test "$_os" = "WINNT"; then
8415     AC_MSG_CHECKING([whether to enable ActiveX embedding of LibreOffice components])
8416     if test "$enable_activex_component" = "yes" -o "$enable_activex_component" = "TRUE" -o "$enable_activex_component" = ""; then
8417         ENABLE_ACTIVEX_COMPONENT="TRUE"
8418         AC_MSG_RESULT([yes])
8419         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
8420     else
8421         ENABLE_ACTIVEX_COMPONENT=""
8422         AC_MSG_RESULT([no])
8423     fi
8424     AC_SUBST(ENABLE_ACTIVEX_COMPONENT)
8425     AC_SUBST(SCPDEFS)
8428 AC_MSG_CHECKING([whether and how to use Xinerama])
8429 if test "$_os" = "Darwin"; then
8430     USE_XINERAMA=YES
8431     XINERAMA_LINK=dynamic
8432     AC_MSG_RESULT([yes])
8433 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
8434     if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then
8435         # we have both versions, let the user decide but use the dynamic one
8436         # per default
8437         USE_XINERAMA=YES
8438         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
8439             XINERAMA_LINK=dynamic
8440         else
8441             XINERAMA_LINK=static
8442         fi
8443     elif test -e "$XLIB/libXinerama.so" -a ! -e "$XLIB/libXinerama.a"; then
8444         # we have only the dynamic version
8445         USE_XINERAMA=YES
8446         XINERAMA_LINK=dynamic
8447     elif test -e "$XLIB/libXinerama.a"; then
8448         # static version
8449         if echo $host_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
8450             USE_XINERAMA=YES
8451             XINERAMA_LINK=static
8452         else
8453             USE_XINERAMA=NO
8454             XINERAMA_LINK=none
8455         fi
8456     else
8457         # no Xinerama
8458         USE_XINERAMA=NO
8459         XINERAMA_LINK=none
8460     fi
8461     if test "$USE_XINERAMA" = "YES"; then
8462         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
8463         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
8464             [AC_MSG_ERROR(Xinerama header not found.)], [])
8465         XINERAMA_EXTRA_LIBS="-L$XLIB -lXext"
8466         if test "$_os" = "FreeBSD"; then
8467             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
8468         fi
8469         if test "$_os" = "Linux"; then
8470             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
8471         fi
8472         AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
8473             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
8474     else
8475         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
8476     fi
8477 else
8478     USE_XINERAMA=NO
8479     XINERAMA_LINK=none
8480     AC_MSG_RESULT([no])
8482 AC_SUBST(USE_XINERAMA)
8483 AC_SUBST(XINERAMA_LINK)
8485 dnl ===================================================================
8486 dnl Checks for librsvg
8487 dnl ===================================================================
8489 dnl ENABLE_LIBRSVG is set to "" (for NO), SYSTEM or INTERNAL. The
8490 dnl SYSTEM_LIBRSVG, SYSTEM_GDKPIXBUF etc are redundant.
8492 ENABLE_LIBRSVG=""
8493 LIBRSVG_CFLAGS=""
8494 LIBRSVG_LIBS=""
8496 AC_MSG_CHECKING([what librsvg to use])
8498 case "$enable_librsvg" in
8499 no|disable)
8500     AC_MSG_RESULT([none])
8501     enable_librsvg=no
8502     ;;
8504 ""|yes|auto)
8505     if test $build_os = cygwin -o \
8506            $_os = Darwin; then
8507         dnl When building on/for these OSes always use the internal one,
8508         dnl if at all. Add more OSes above as needed.
8509         AC_MSG_RESULT([internal])
8510         enable_librsvg=internal
8511     elif test  $_os = iOS -o $_os = Android; then
8512         AC_MSG_RESULT([none])
8513         enable_librsvg=no
8514     else
8515         if test "$with_system_libs" = yes; then
8516             AC_MSG_RESULT([system])
8517             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8518             enable_librsvg=system
8519         elif test "$with_system_libs" = no; then
8520             AC_MSG_RESULT([internal])
8521             enable_librsvg=internal
8522         else
8523             AC_MSG_RESULT([checking further])
8524             PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14,, [:])
8525             if test -z "$LIBRSVG_PKG_ERRORS"; then
8526                 enable_librsvg=system
8527             else
8528                 enable_librsvg=internal
8529             fi
8530         fi
8531     fi
8532     ;;
8534 internal)
8535     AC_MSG_RESULT([internal])
8536     ;;
8538 system)
8539     if test $_os = WINNT -a "$WITH_MINGW" != yes; then
8540         AC_MSG_ERROR([Must use internal librsvg when building with MSVC])
8541     fi
8542     AC_MSG_RESULT([system])
8543     PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0 >= 2.14)
8544     ;;
8547     AC_MSG_ERROR([Incorrect --enable-librsvg option])
8548     ;;
8549 esac
8551 dnl By now enable_librsvg should be "system", "internal" or "no"
8552 case $enable_librsvg in
8553 system)
8554     ENABLE_LIBRSVG=SYSTEM
8555     SYSTEM_LIBRSVG=YES
8556     ;;
8558 internal)
8559     ENABLE_LIBRSVG=INTERNAL
8560     SYSTEM_LIBRSVG=NO
8561     BUILD_TYPE="$BUILD_TYPE LIBRSVG"
8562     ;;
8565     ENABLE_LIBRSVG=NO
8566     SYSTEM_LIBRSVG=NO
8567     ;;
8570     AC_MSG_ERROR([Internal configure script error, invalid enable_librsvg value "$enable_librsvg"])
8571     ;;
8572 esac
8574 AC_SUBST(ENABLE_LIBRSVG)
8575 AC_SUBST(LIBRSVG_CFLAGS)
8576 AC_SUBST(LIBRSVG_LIBS)
8577 AC_SUBST(SYSTEM_LIBRSVG)
8579 dnl ===================================================================
8580 dnl Test whether to build cairo or rely on the system version
8581 dnl ===================================================================
8583 SYSTEM_CAIRO=""
8585 AC_MSG_CHECKING([whether to use the system cairo])
8587 if test "$with_system_cairo" = yes -o \( "$with_system_libs" = yes -a "$with_system_cairo" != no \); then
8588     SYSTEM_CAIRO=YES
8589     AC_MSG_RESULT([yes])
8591     PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
8593     if test "$with_system_xrender_headers" = "yes"; then
8594          AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
8595          AC_RUN_IFELSE([AC_LANG_SOURCE([[
8596 #include <X11/extensions/Xrender.h>
8598 int main(int argc, char **argv) {
8599 #ifdef PictStandardA8
8600       return 0;
8601 #else
8602       return 1;
8603 #endif
8605         ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])
8606         ],[])
8607     fi
8608     MINGW_EXTERNAL_DLLS="$MINGW_EXTERNAL_DLLS libfontconfig-1.dll libfreetype-6.dll libpixman-1-0.dll libpng15-15.dll libcairo-2.dll"
8609 else
8610     AC_MSG_RESULT([no])
8612     if test $_os = Android; then
8613         dnl For Android cairo isn't
8614         dnl buildable yet.
8615         :
8616     elif test $_os = WINNT; then
8617         dnl We only need cairo for Windows if we
8618         dnl build librsvg or directx disabled
8619         if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
8620             BUILD_TYPE="$BUILD_TYPE CAIRO"
8621         fi
8622     else
8623         BUILD_TYPE="$BUILD_TYPE CAIRO"
8624     fi
8627 AC_SUBST(SYSTEM_CAIRO)
8628 AC_SUBST(CAIRO_CFLAGS)
8629 AC_SUBST(CAIRO_LIBS)
8632 dnl ===================================================================
8633 dnl Test whether to build gdk-pixbuf or rely on the system version
8634 dnl ===================================================================
8636 AC_MSG_CHECKING([whether to use the system gdk-pixbuf])
8638 dnl As long as the only thing we need gdk-pixbuf for is below
8639 dnl librsvg, use the same --enable-librsvg (possibly implied
8640 dnl by --with-system-libs) to override this.
8642 if test "$SYSTEM_LIBRSVG" = YES; then
8643     SYSTEM_GDKPIXBUF=YES
8644     AC_MSG_RESULT([yes])
8645 else
8646     case "$_os" in
8647     WINNT|Darwin|iOS|Android)
8648         SYSTEM_GDKPIXBUF=NO
8649         AC_MSG_RESULT([no])
8650         ;;
8651     *)
8652         SYSTEM_GDKPIXBUF=YES
8653         AC_MSG_RESULT([yes])
8654         ;;
8655     esac
8657 AC_SUBST(SYSTEM_GDKPIXBUF)
8659 dnl ===================================================================
8660 dnl Test whether to build GLib or rely on the system version
8661 dnl ===================================================================
8663 AC_MSG_CHECKING([whether to use the system GLib])
8665 dnl As long as the only thing we need GLib for is below
8666 dnl librsvg, use the same --enable-librsvg (possibly implied
8667 dnl by --with-system-libs) to override this.
8669 if test "$SYSTEM_LIBRSVG" = YES; then
8670     SYSTEM_GLIB=YES
8671     AC_MSG_RESULT([yes])
8672 else
8673     case "$_os" in
8674     WINNT|Darwin|iOS|Android)
8675         SYSTEM_GLIB=NO
8676         AC_MSG_RESULT([no])
8677         ;;
8678     *)
8679         SYSTEM_GLIB=YES
8680         AC_MSG_RESULT([yes])
8681         ;;
8682     esac
8684 AC_SUBST(SYSTEM_GLIB)
8686 dnl ===================================================================
8687 dnl Test whether to build gettext runtime (libintl) or rely on the
8688 dnl system version
8689 dnl ===================================================================
8691 AC_MSG_CHECKING([whether to use the system gettext runtime])
8693 if test "$with_system_gettext" = yes -o \( "$with_system_libs" = yes -a "$with_system_gettext" != no \); then
8694     SYSTEM_GETTEXT=YES
8695     AC_MSG_RESULT([yes])
8696 else
8697     case "$_os" in
8698     WINNT|Darwin|iOS|Android)
8699         SYSTEM_GETTEXT=NO
8700         AC_MSG_RESULT([no])
8701         ;;
8702     *)
8703         SYSTEM_GETTEXT=YES
8704         AC_MSG_RESULT([yes])
8705         ;;
8706     esac
8708 AC_SUBST(SYSTEM_GETTEXT)
8710 dnl ===================================================================
8711 dnl Test whether to build libcroco or rely on the system version
8712 dnl ===================================================================
8714 AC_MSG_CHECKING([whether to use the system libcroco])
8716 dnl As long as the only thing we need libcroco for is below
8717 dnl librsvg, use the same --enable-librsvg (possibly implied
8718 dnl by --with-system-libs) to override this.
8720 if test "$SYSTEM_LIBRSVG" = YES; then
8721     SYSTEM_LIBCROCO=YES
8722     AC_MSG_RESULT([yes])
8723 else
8724     case "$_os" in
8725     WINNT|Darwin|iOS|Android)
8726         SYSTEM_LIBCROCO=NO
8727         AC_MSG_RESULT([no])
8728         ;;
8729     *)
8730         SYSTEM_LIBCROCO=YES
8731         AC_MSG_RESULT([yes])
8732         ;;
8733     esac
8735 AC_SUBST(SYSTEM_LIBCROCO)
8737 dnl ===================================================================
8738 dnl Test whether to build Pango or rely on the system version
8739 dnl ===================================================================
8741 AC_MSG_CHECKING([whether to use the system pango])
8743 dnl As long as the only thing we need Pango for is below
8744 dnl librsvg, use the same --enable-librsvg (possibly implied
8745 dnl by --with-system-libs) to override this.
8747 if test "$SYSTEM_LIBRSVG" = YES; then
8748     SYSTEM_PANGO=YES
8749     AC_MSG_RESULT([yes])
8750 else
8751     case "$_os" in
8752     WINNT|Darwin|iOS|Android)
8753         SYSTEM_PANGO=NO
8754         AC_MSG_RESULT([no])
8755         ;;
8756     *)
8757         SYSTEM_PANGO=YES
8758         AC_MSG_RESULT([yes])
8759         ;;
8760     esac
8762 AC_SUBST(SYSTEM_PANGO)
8764 dnl ===================================================================
8765 dnl Test whether to build libgsf or rely on the system version
8766 dnl ===================================================================
8768 AC_MSG_CHECKING([whether to use the system libgsf])
8770 dnl As long as the only thing we need libgsf for is below librsvg (is
8771 dnl it?), use the same --enable-librsvg (possibly implied by
8772 dnl --with-system-libs) to override this.
8774 if test "$SYSTEM_LIBRSVG" = YES; then
8775     SYSTEM_LIBGSF=YES
8776     AC_MSG_RESULT([yes])
8777 else
8778     case "$_os" in
8779     WINNT|Darwin|iOS|Android)
8780         SYSTEM_LIBGSF=NO
8781         AC_MSG_RESULT([no])
8782         ;;
8783     *)
8784         SYSTEM_LIBGSF=YES
8785         AC_MSG_RESULT([yes])
8786         ;;
8787     esac
8789 AC_SUBST(SYSTEM_LIBGSF)
8791 dnl ===================================================================
8792 dnl Test whether to build libpng or rely on the system version
8793 dnl ===================================================================
8795 AC_MSG_CHECKING([whether to use the system libpng])
8797 dnl How should and does this interact with the checks for libpng
8798 dnl related to use of libpng in the quickstarter above? This needs to
8799 dnl be unified.
8801 if test "$with_system_libpng" = yes -o \( "$with_system_libs" = yes -a "$with_system_libpng" != no \); then
8802     SYSTEM_LIBPNG=YES
8803     AC_MSG_RESULT([yes])
8804 else
8805     case "$_os" in
8806     WINNT|Darwin|iOS|Android)
8807         SYSTEM_LIBPNG=NO
8808         AC_MSG_RESULT([no])
8809         ;;
8810     *)
8811         SYSTEM_LIBPNG=YES
8812         AC_MSG_RESULT([no])
8813         ;;
8814     esac
8816 AC_SUBST(SYSTEM_LIBPNG)
8818 dnl ===================================================================
8819 dnl Test whether to build libjpeg or rely on the system version
8820 dnl ===================================================================
8821 dnl FIXME: this is currently because we have jpeg-6b for our filters
8822 dnl        and jpeg-8 as dependency for librsvg
8823 dnl        this should be unified into using only one version for both
8825 AC_MSG_CHECKING([whether to use the system libjpeg])
8827 if test "$SYSTEM_JPEG" == "YES"; then
8828     SYSTEM_LIBJPEG=YES
8829     AC_MSG_RESULT([yes])
8830 else
8831     case "$_os" in
8832     WINNT|Darwin|iOS|Android)
8833         SYSTEM_LIBJPEG=NO
8834         AC_MSG_RESULT([no])
8835         ;;
8836     *)
8837         SYSTEM_LIBJPEG=YES
8838         AC_MSG_RESULT([yes])
8839         ;;
8840     esac
8842 AC_SUBST(SYSTEM_LIBJPEG)
8844 dnl ===================================================================
8845 dnl Check for runtime JVM search path
8846 dnl ===================================================================
8847 if test "$SOLAR_JAVA" != ""; then
8848     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
8849     if test -n "$with_jvm_path" && test "$with_jvm_path" != "no"; then
8850         AC_MSG_RESULT([yes])
8851         if ! test -d "$with_jvm_path"; then
8852             AC_MSG_ERROR(["$with_jvm_path" not a directory])
8853         fi
8854         if ! test -d "$with_jvm_path"jvm; then
8855             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
8856         fi
8857         JVM_ONE_PATH_CHECK="$with_jvm_path"
8858         AC_SUBST(JVM_ONE_PATH_CHECK)
8859     else
8860         AC_MSG_RESULT([no])
8861     fi
8864 dnl ===================================================================
8865 dnl Test for the presence of Ant and that it works
8866 dnl ===================================================================
8868 if test "$SOLAR_JAVA" != ""; then
8869     ANT_HOME=; export ANT_HOME
8870     WITH_ANT_HOME=; export WITH_ANT_HOME
8871     if test -z "$with_ant_home"; then
8872         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
8873     else
8874         if test "$_os" = "WINNT"; then
8875             with_ant_home=`cygpath -u "$with_ant_home"`
8876         fi
8877         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
8878         WITH_ANT_HOME=$with_ant_home
8879         ANT_HOME=$with_ant_home
8880     fi
8882     if test -z "$ANT"; then
8883         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
8884     else
8885         # resolve relative or absolute symlink
8886         while test -h "$ANT"; do
8887             a_cwd=`pwd`
8888             a_basename=`basename "$ANT"`
8889             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
8890             cd "`dirname "$ANT"`"
8891             cd "`dirname "$a_script"`"
8892             ANT="`pwd`"/"`basename "$a_script"`"
8893             cd "$a_cwd"
8894         done
8896         AC_MSG_CHECKING([if $ANT works])
8897         cat > conftest.java << EOF
8898         public class conftest {
8899             int testmethod(int a, int b) {
8900                     return a + b;
8901             }
8902         }
8905         cat > conftest.xml << EOF
8906         <project name="conftest" default="conftest">
8907         <target name="conftest">
8908             <javac srcdir="." includes="conftest.java">
8909             </javac>
8910         </target>
8911         </project>
8914         oldJAVA_HOME=$JAVA_HOME
8915         if test "$JAVACISGCJ" = "yes"; then
8916             JAVA_HOME=; export JAVA_HOME
8917             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
8918         else
8919             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
8920         fi
8921         AC_TRY_EVAL(ant_cmd)
8922         if test $? = 0 && test -f ./conftest.class ; then
8923             AC_MSG_RESULT([Ant works])
8924             if test -z "$WITH_ANT_HOME"; then
8925                 ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
8926                 if test -z "$ANT_HOME"; then
8927                     ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
8928                 fi
8929             else
8930                 ANT_HOME="$WITH_ANT_HOME"
8931             fi
8932         else
8933             echo "configure: Ant test failed" >&5
8934             cat conftest.java >&5
8935             cat conftest.xml >&5
8936             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
8937             ANT_HOME=""
8938             echo "Ant does not work - Some Java projects will not build!" >>warn
8939         fi
8940         JAVA_HOME=$oldJAVA_HOME
8941         rm -f conftest* core core.* *.core
8942     fi
8943     if test -z "$ANT_HOME"; then
8944         ANT_HOME="NO_ANT_HOME"
8945     fi
8946     AC_SUBST(ANT_HOME)
8948     dnl Checking for ant.jar
8949     if test "$ANT_HOME" != "NO_ANT_HOME"; then
8950         AC_MSG_CHECKING([Ant lib directory])
8951         if test -f $ANT_HOME/lib/ant.jar; then
8952             ANT_LIB="$ANT_HOME/lib"
8953         else
8954             if test -f $ANT_HOME/ant.jar; then
8955                 ANT_LIB="$ANT_HOME"
8956             else
8957                 if test -f /usr/share/java/ant.jar; then
8958                     ANT_LIB=/usr/share/java
8959                 else
8960                     if test -f /usr/share/ant-core/lib/ant.jar; then
8961                         ANT_LIB=/usr/share/ant-core/lib
8962                     else
8963                         if test -f $ANT_HOME/lib/ant/ant.jar; then
8964                             ANT_LIB="$ANT_HOME/lib/ant"
8965                         else
8966                             if test -f /usr/share/lib/ant/ant.jar; then
8967                                 ANT_LIB=/usr/share/lib/ant
8968                             else
8969                                 AC_MSG_ERROR([Ant libraries not found!])
8970                             fi
8971                         fi
8972                     fi
8973                 fi
8974             fi
8975         fi
8976         AC_MSG_RESULT([Ant lib directory found.])
8977     fi
8978     AC_SUBST(ANT_LIB)
8980     ant_minver=1.6.0
8981     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
8983     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
8984     ant_version=`$ANT -version | $AWK '{ print $4; }'`
8985     ant_version_major=`echo $ant_version | cut -d. -f1`
8986     ant_version_minor=`echo $ant_version | cut -d. -f2`
8987     echo "configure: ant_version $ant_version " >&5
8988     echo "configure: ant_version_major $ant_version_major " >&5
8989     echo "configure: ant_version_minor $ant_version_minor " >&5
8990     if test "$ant_version_major" -ge "2"; then
8991         AC_MSG_RESULT([yes, $ant_version])
8992     elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
8993         AC_MSG_RESULT([yes, $ant_version])
8994     else
8995         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
8996     fi
8998     if test "$ENABLE_MEDIAWIKI" = "YES"; then
8999         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
9000         rm -rf confdir
9001         mkdir confdir
9002         cat > conftest.java << EOF
9003             public class conftest {
9004                 int testmethod(int a, int b) {
9005                     return a + b;
9006                 }
9007             }
9010         cat > conftest.xml << EOF
9011             <project name="conftest" default="conftest">
9012             <target name="conftest" depends="copytest">
9013                 <javac srcdir="." includes="conftest.java">
9014                 </javac>
9015             </target>
9016             <target name="copytest">
9017                  <copy todir="confdir">
9018                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
9019                  <filterset/>
9020                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
9021                  </copy>
9022             </target>
9023             </project>
9026         if test "$JAVACISGCJ" = "yes"; then
9027             JAVA_HOME=; export JAVA_HOME
9028             ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
9029         else
9030             ant_cmd="$ANT -buildfile conftest.xml 1>&2"
9031         fi
9032         AC_TRY_EVAL(ant_cmd)
9033         if test $? = 0 && test -f ./conftest.class ; then
9034             AC_MSG_RESULT([yes])
9035             rm -rf confdir
9036         else
9037             echo "configure: Ant test failed" >&5
9038             cat conftest.java >&5
9039             cat conftest.xml >&5
9040             rm -rf confdir
9041             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
9042         fi
9043     fi
9044     rm -f conftest* core core.* *.core
9047 OOO_JUNIT_JAR=
9048 if test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
9049     AC_MSG_CHECKING([for JUnit 4])
9050     if test "$with_junit" = "yes"; then
9051         if test -e /usr/share/java/junit4.jar; then
9052             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
9053         else
9054            if test -e /usr/share/lib/java/junit.jar; then
9055               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
9056            else
9057               OOO_JUNIT_JAR=/usr/share/java/junit.jar
9058            fi
9059         fi
9060     else
9061         OOO_JUNIT_JAR=$with_junit
9062     fi
9063     if test "$_os" = "WINNT"; then
9064         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
9065     fi
9066     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
9067         grep org/junit/Before.class > /dev/null 2>&5
9068     if test $? -eq 0; then
9069         # check if either class-path entry is available for hamcrest or
9070         # it's bundled
9071         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |grep -q hamcrest || \
9072             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |grep -q 'Class-Path: hamcrest'; then
9073             AC_MSG_RESULT([$OOO_JUNIT_JAR])
9074         else
9075             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
9076 provide a full junit jar or use --without-junit])
9077         fi
9078     else
9079         AC_MSG_RESULT([no])
9080         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
9081 location (/usr/share/java), specify its pathname via
9082 --with-junit=..., or disable it via --without-junit])
9083     fi
9085 AC_SUBST(OOO_JUNIT_JAR)
9087 dnl ===================================================================
9088 dnl Product version
9089 dnl ===================================================================
9090 AC_MSG_CHECKING([for product version])
9091 PRODUCTVERSION=AC_PACKAGE_VERSION
9092 AC_MSG_RESULT([$PRODUCTVERSION])
9093 AC_SUBST(PRODUCTVERSION)
9095 dnl ===================================================================
9096 dnl Dealing with l10n options
9097 dnl ===================================================================
9098 AC_MSG_CHECKING([which languages to be built])
9099 # get list of all languages
9100 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
9101 # the sed command does the following:
9102 #   + if a line ends with a backslash, append the next line to it
9103 #   + adds " on the beginning of the value (after =)
9104 #   + adds " at the end of the value
9105 #   + removes en-US; we want to put it on the beginning
9106 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
9107 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
9108 ALL_LANGS="en-US $completelangiso"
9109 # check the configured localizations
9110 WITH_LANG="$with_lang"
9111 if test -z "$WITH_LANG"; then
9112     AC_MSG_RESULT([en-US])
9113 else
9114     AC_MSG_RESULT([$WITH_LANG])
9115     GIT_REPO_NAMES="$GIT_REPO_NAMES translations"
9117 # check that the list is valid
9118 for lang in $WITH_LANG ; do
9119     test "$lang" = "ALL" && continue;
9120     # need to check for the exact string, so add space before and after the list of all languages
9121     for vl in $ALL_LANGS ; do
9122         if test "$vl" = "$lang" ; then
9123            break;
9124         fi
9125     done
9126     if test "$vl" != "$lang" ; then
9127         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
9128     fi
9129 done
9130 # list with substituted ALL
9131 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
9132 # this variable is used only by bin/distro-install-* helper scripts
9133 # they need a real list of languages
9134 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
9135 AC_SUBST(ALL_LANGS)
9136 AC_SUBST(WITH_LANG)
9137 AC_SUBST(WITH_LANG_LIST)
9138 AC_SUBST(GIT_REPO_NAMES)
9140 AC_MSG_CHECKING([for another 'intro' bitmap])
9141 INTRO_BITMAP=
9142 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no" ; then
9143     INTRO_BITMAP=
9144     AC_MSG_RESULT([none])
9145 else
9146     case "$with_intro_bitmap" in
9147     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
9148     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
9149     esac
9150     AC_MSG_RESULT([$INTRO_BITMAP])
9152 AC_SUBST(INTRO_BITMAP)
9154 AC_MSG_CHECKING([for custom 'intro' progress bar color])
9155 PROGRESSBARCOLOR=
9156 if test -z "$with_intro_progressbar_color" ; then
9157    PROGRESSBARCOLOR="126,170,23"
9158    AC_MSG_RESULT([none])
9159 else
9160    PROGRESSBARCOLOR="$with_intro_progressbar_color"
9161    AC_MSG_RESULT([$PROGRESSBARCOLOR])
9163 AC_SUBST(PROGRESSBARCOLOR)
9165 AC_MSG_CHECKING([for custom 'intro' progress bar size])
9166 PROGRESSSIZE=
9167 if test -z "$with_intro_progressbar_size" ; then
9168    PROGRESSSIZE="319,10"
9169    AC_MSG_RESULT([none])
9170 else
9171    PROGRESSSIZE="$with_intro_progressbar_size"
9172    AC_MSG_RESULT([$PROGRESSSIZE])
9174 AC_SUBST(PROGRESSSIZE)
9176 AC_MSG_CHECKING([for custom 'intro' progress bar position])
9177 PROGRESSPOSITION=
9178 if test -z "$with_intro_progressbar_position" ; then
9179    PROGRESSPOSITION="164,225"
9180    AC_MSG_RESULT([none])
9181 else
9182    PROGRESSPOSITION="$with_intro_progressbar_position"
9183    AC_MSG_RESULT([$PROGRESSPOSITION])
9185 AC_SUBST(PROGRESSPOSITION)
9187 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
9188 PROGRESSFRAMECOLOR=
9189 if test -z "$with_intro_progressbar_frame_color" ; then
9190    PROGRESSFRAMECOLOR="207,208,211"
9191    AC_MSG_RESULT([none])
9192 else
9193    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
9194    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
9196 AC_SUBST(PROGRESSFRAMECOLOR)
9198 AC_MSG_CHECKING([for another 'about' bitmap])
9199 ABOUT_BITMAP=
9200 if test -z "$with_about_bitmap" -o "$with_about_bitmap" = "no" ; then
9201     ABOUT_BITMAP=
9202     AC_MSG_RESULT([none])
9203 else
9204    case "$with_about_bitmap" in
9205    *.png) ABOUT_BITMAP="$with_about_bitmap" ;;
9206    *)     AC_MSG_WARN([About bitmap should be a .png file!]) ;;
9207    esac
9208    AC_MSG_RESULT([$ABOUT_BITMAP])
9210 AC_SUBST(ABOUT_BITMAP)
9212 AC_MSG_CHECKING([for another 'start center left' bitmap])
9213 STARTCENTER_LEFT_BITMAP=
9214 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no" ; then
9215    STARTCENTER_LEFT_BITMAP=
9216    AC_MSG_RESULT([none])
9217 else
9218    case "$with_startcenter_left_bitmap" in
9219       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
9220       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9221    esac
9222    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
9224 AC_SUBST(STARTCENTER_LEFT_BITMAP)
9226 AC_MSG_CHECKING([for another 'start center right' bitmap])
9227 STARTCENTER_RIGHT_BITMAP=
9228 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no" ; then
9229    STARTCENTER_RIGHT_BITMAP=
9230    AC_MSG_RESULT([none])
9231 else
9232    case "$with_startcenter_right_bitmap" in
9233       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
9234       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
9235    esac
9236    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
9238 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
9240 AC_MSG_CHECKING([for another 'start center rtl left' bitmap])
9241 STARTCENTER_RTL_LEFT_BITMAP=
9242 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no" ; then
9243    STARTCENTER_RTL_LEFT_BITMAP=
9244    AC_MSG_RESULT([none])
9245 else
9246    case "$with_startcenter_rtl_left_bitmap" in
9247       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
9248       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
9249    esac
9250    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
9252 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
9254 AC_MSG_CHECKING([for another 'start center rtl right' bitmap])
9255 STARTCENTER_RTL_RIGHT_BITMAP=
9256 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no" ; then
9257    STARTCENTER_RTL_RIGHT_BITMAP=
9258    AC_MSG_RESULT([none])
9259 else
9260    case "$with_startcenter_rtl_right_bitmap" in
9261       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
9262       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
9263    esac
9264    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
9266 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
9268 AC_MSG_CHECKING([for another 'start center space' bitmap])
9269 STARTCENTER_SPACE_BITMAP=
9270 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no" ; then
9271    STARTCENTER_SPACE_BITMAP=
9272    AC_MSG_RESULT([none])
9273 else
9274    case "$with_startcenter_space_bitmap" in
9275       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
9276       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
9277    esac
9278    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
9280 AC_SUBST(STARTCENTER_SPACE_BITMAP)
9282 OOO_VENDOR=
9283 AC_MSG_CHECKING([for vendor])
9284 if test -z "$with_vendor" -o "$with_vendor" = "no" ; then
9285     AC_MSG_RESULT([not set])
9286 else
9287     OOO_VENDOR="$with_vendor"
9288     AC_MSG_RESULT([$OOO_VENDOR])
9290 AC_SUBST(OOO_VENDOR)
9292 UNIXWRAPPERNAME=
9293 AC_MSG_CHECKING([for UNIX wrapper name])
9294 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes" ; then
9295     AC_MSG_RESULT([not set])
9296 else
9297     UNIXWRAPPERNAME="$with_unix_wrapper"
9298     AC_MSG_RESULT([$UNIXWRAPPERNAME])
9300 AC_SUBST(UNIXWRAPPERNAME)
9302 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
9303 if test "$with_compat_oowrappers" = "yes" ; then
9304     WITH_COMPAT_OOWRAPPERS=YES
9305     AC_MSG_RESULT(yes)
9306 else
9307     WITH_COMPAT_OOWRAPPERS=
9308     AC_MSG_RESULT(no)
9310 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
9312 AC_MSG_CHECKING([for product name])
9313 PRODUCTNAME=AC_PACKAGE_NAME
9314 AC_MSG_RESULT([$PRODUCTNAME])
9315 AC_SUBST(PRODUCTNAME)
9317 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
9318 AC_MSG_CHECKING([for install dirname])
9319 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes" ; then
9320    INSTALLDIRNAME="$with_install_dirname"
9322 AC_MSG_RESULT([$INSTALLDIRNAME])
9323 AC_SUBST(INSTALLDIRNAME)
9325 AC_MSG_CHECKING([for prefix])
9326 test "x$prefix" = xNONE && prefix=$ac_default_prefix
9327 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
9328 PREFIXDIR="$prefix"
9329 AC_MSG_RESULT([$PREFIXDIR])
9330 AC_SUBST(PREFIXDIR)
9332 AC_MSG_CHECKING([for libdir])
9333 LIBDIR=[$(eval echo $(eval echo $libdir))]
9334 AC_MSG_RESULT([$LIBDIR])
9335 AC_SUBST(LIBDIR)
9337 AC_MSG_CHECKING([for data dir])
9338 DATADIR=[$(eval echo $(eval echo $datadir))]
9339 AC_MSG_RESULT([$DATADIR])
9340 AC_SUBST(DATADIR)
9342 AC_MSG_CHECKING([for man dir])
9343 MANDIR=[$(eval echo $(eval echo $mandir))]
9344 AC_MSG_RESULT([$MANDIR])
9345 AC_SUBST(MANDIR)
9347 AC_MSG_CHECKING([for doc dir])
9348 DOCDIR=[$(eval echo $(eval echo $docdir))]
9349 AC_MSG_RESULT([$DOCDIR])
9350 AC_SUBST(DOCDIR)
9352 AC_MSG_CHECKING([for install dir])
9353 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
9354 AC_MSG_RESULT([$INSTALLDIR])
9355 AC_SUBST(INSTALLDIR)
9357 AC_MSG_CHECKING([whether to statically link to Gtk])
9358 if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
9359     ENABLE_STATIC_GTK="TRUE"
9360     AC_MSG_RESULT([yes])
9361 else
9362     ENABLE_STATIC_GTK="FALSE"
9363     AC_MSG_RESULT([no])
9365 AC_SUBST(ENABLE_STATIC_GTK)
9367 AC_MSG_CHECKING([whether to use layout dialogs])
9368 if test -n "$enable_layout" && test "$enable_layout" != "no"; then
9369     ENABLE_LAYOUT="TRUE"
9370     AC_MSG_RESULT([yes])
9371 else
9372     ENABLE_LAYOUT="FALSE"
9373     AC_MSG_RESULT([no])
9375 AC_SUBST(ENABLE_LAYOUT)
9377 # ===================================================================
9378 # De- or increase default verbosity of build process
9379 # ===================================================================
9380 AC_MSG_CHECKING([build verbosity])
9381 if test -n "$enable_verbose"; then
9382     if test "$enable_verbose" = "yes"; then
9383         VERBOSE="TRUE"
9384         AC_MSG_RESULT([high])
9385     fi
9386     if test "$enable_verbose" = "no"; then
9387         VERBOSE="FALSE"
9388         AC_MSG_RESULT([low])
9389     fi
9390 else
9391     AC_MSG_RESULT([not set])
9393 AC_SUBST(VERBOSE)
9395 dnl ===================================================================
9396 dnl Use zenity during build
9397 dnl ===================================================================
9398 AC_MSG_CHECKING([whether to use zenity during build])
9399 if test "$enable_zenity" = "yes"; then
9400     AC_MSG_RESULT([yes])
9401     AC_PATH_PROGS( ZNTY, zenity )
9402     if test -z "$ZNTY"; then
9403         ENABLE_ZENITY=FALSE
9404     else
9405         ENABLE_ZENITY=TRUE
9406     fi
9407 else
9408     ENABLE_ZENITY=FALSE
9409     AC_MSG_RESULT([no])
9411 AC_SUBST(ENABLE_ZENITY)
9414 dnl ===================================================================
9415 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
9416 dnl --enable-dependency-tracking configure option
9417 dnl ===================================================================
9418 AC_MSG_CHECKING([whether to enable dependency tracking])
9419 if test "$enable_dependency_tracking" = "no"; then
9420     nodep=TRUE
9421     AC_MSG_RESULT([no])
9422 else
9423     AC_MSG_RESULT([yes])
9425 AC_SUBST(nodep)
9427 dnl ===================================================================
9428 dnl Number of CPUs to use during the build
9429 dnl ===================================================================
9430 AC_MSG_CHECKING([for number of processors to use])
9431 if test -n "$with_num_cpus"; then
9432     BUILD_NCPUS=$with_num_cpus
9433 else
9434     case `uname -s` in
9436     Darwin|FreeBSD|NetBSD|OpenBSD)
9437         BUILD_NCPUS=`sysctl -n hw.ncpu`
9438         ;;
9440     Linux)
9441         BUILD_NCPUS=`getconf _NPROCESSORS_ONLN`
9442         ;;
9443     # what else than above does profit here *and* has /proc?
9444     *)
9445         BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
9446         ;;
9447     esac
9449     # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
9450     # unexpected format, 'wc -l' will have returned 0.
9451     if test "$BUILD_NCPUS" -eq 0; then
9452         BUILD_NCPUS=1
9453     fi
9455 AC_MSG_RESULT([$BUILD_NCPUS])
9456 AC_SUBST(BUILD_NCPUS)
9458 # ===================================================================
9459 # Creating bigger shared library to link against
9460 # ===================================================================
9461 AC_MSG_CHECKING([whether to create a big library for better performance])
9462 MERGELIBS=
9463 if test "$enable_mergelibs" = "yes"; then
9464     MERGELIBS="TRUE"
9465     AC_MSG_RESULT([yes])
9466 else
9467     AC_MSG_RESULT([no])
9469 AC_SUBST(MERGELIBS)
9471 dnl ===================================================================
9472 dnl Number of parallel jobs to be executed by dmake
9473 dnl ===================================================================
9474 AC_MSG_CHECKING([for maximum of jobs per processor])
9475 BUILD_MAX_JOBS="1"
9476 if test "z$with_max_jobs" != "z"; then
9477     BUILD_MAX_JOBS="$with_max_jobs"
9478 else
9479     if test "$enable_icecream" = "yes" ; then
9480         BUILD_MAX_JOBS="10"
9481     fi
9483 AC_MSG_RESULT([$BUILD_MAX_JOBS])
9484 AC_SUBST(BUILD_MAX_JOBS)
9486 # =====================================================================
9487 # determine the parallelism for gnu make
9488 # =====================================================================
9489 AC_MSG_CHECKING([for maximum parallelism for gmake])
9490 if test $BUILD_MAX_JOBS -gt $BUILD_NCPUS ; then
9491     GMAKE_PARALLELISM="$BUILD_MAX_JOBS"
9492 else
9493     GMAKE_PARALLELISM="$BUILD_NCPUS"
9495 GMAKE_MODULE_PARALLELISM="$BUILD_MAX_JOBS"
9496 if test "$no_parallelism_make" = "YES" ; then
9497     if test -z "$with_num_cpus"; then
9498         GMAKE_PARALLELISM="1";
9499         if test $GMAKE_MODULE_PARALLELISM -gt 1 ; then
9500             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
9501             if test -z "$with_num_cpus"; then
9502                 echo "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this." >> warn
9503             fi
9504             GMAKE_MODULE_PARALLELISM="1"
9505         fi
9506     else
9507         GMAKE_PARALLELISM="$BUILD_NCPUS";
9508         echo "make 3.81 is prone to crashes with parallelism > 1. Since --with-num-cpus was explicitely given, it is honored, but do not complain when make segfault on you." >> warn
9509     fi
9512 # GMAKE_PARALLELISM is used in tail_build
9513 # GMAKE_MODULE_PARALLELISM is used when building individual gbuildified module
9514 AC_MSG_RESULT([per module:$GMAKE_MODULE_PARALLELISM, for tail_build:$GMAKE_PARALLELISM])
9515 AC_SUBST(GMAKE_PARALLELISM)
9516 AC_SUBST(GMAKE_MODULE_PARALLELISM)
9518 dnl ===================================================================
9519 dnl Setting up the environment.
9520 dnl ===================================================================
9521 echo "setting up the build environment variables..."
9523 if test -z "$COMPATH"; then
9524     AC_MSG_ERROR([No compiler found.])
9526 AC_SUBST(COMPATH)
9528 AC_MSG_CHECKING([solver path])
9529 if test -z "$with_local_solver"; then
9530     LOCAL_SOLVER="DEFAULT"
9531     AC_MSG_RESULT([default])
9532 else
9533     LOCAL_SOLVER=$with_local_solver
9534     AC_MSG_RESULT([$with_local_solver])
9536 AC_SUBST(LOCAL_SOLVER)
9538 AC_SUBST(BUILD_TYPE)
9540 if test "$WITH_MINGW" != "yes" ; then
9541     MINGW_EXTERNAL_DLLS=
9542 else
9543     mingw_dlldir=`$CC -print-sysroot`/mingw/bin
9544     for DLL in $MINGW_EXTERNAL_DLLS ; do
9545         AC_MSG_CHECKING([for $DLL])
9546         if ! test -f "$mingw_dlldir/$DLL" ; then
9547             AC_MSG_ERROR([Could not find $DLL, install the appropriate mingw32-<package>, not only mingw32-<package>-devel.])
9548         fi
9549         AC_MSG_RESULT([$mingw_dlldir/$DLL])
9550     done
9552 AC_SUBST(MINGW_EXTERNAL_DLLS)
9554 # make sure config.guess is +x; we execute config.guess, so it has to be so;
9555 chmod +x ./config.guess
9557 dnl Setting up the post_download check script
9558 dnl Using autoconf here, so that the migration from the previous state
9559 dnl (checks for the additional Windows downloads were directly in
9560 dnl configure.in) is as easy as possible
9561 echo "setting up the post_download check script"
9562 autoconf post_download.in > post_download
9563 chmod +x post_download
9565 # Generate a configuration timestamp we can use for deps
9566 if test -f set_soenv; then
9567     mv -f set_soenv set_soenv.last
9568 else
9569     echo > set_soenv.last
9572 AC_CONFIG_FILES([ooo.lst set_soenv Makefile bin/repo-list desktop/scripts/soffice.sh])
9573 AC_OUTPUT
9575 # make sure this is executable
9576 chmod +x desktop/scripts/soffice.sh
9578 # touch the config timestamp file set_soenv.stamp
9579 if test ! -f set_soenv.stamp; then
9580     echo > set_soenv.stamp
9581 elif diff set_soenv set_soenv.last >/dev/null 2>&1; then
9582     echo "Configuration unchanged - avoiding scp2 stamp update"
9583 else
9584     echo > set_soenv.stamp
9587 dnl Run the set_soenv script to setup the Env.Host.sh script that sets
9588 dnl environment variables for the build.
9589 chmod +x set_soenv
9591 ./set_soenv
9593 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: