xref: /AOO41X/main/configure.ac (revision 18079e30b8b24feb8c2f91ba3d60b14cee02cdfe)
17aa0a607SDon Lewisdnl * *************************************************************
27aa0a607SDon Lewisdnl *
37aa0a607SDon Lewisdnl *  Licensed to the Apache Software Foundation (ASF) under one
47aa0a607SDon Lewisdnl *  or more contributor license agreements.  See the NOTICE file
57aa0a607SDon Lewisdnl *  distributed with this work for additional information
67aa0a607SDon Lewisdnl *  regarding copyright ownership.  The ASF licenses this file
77aa0a607SDon Lewisdnl *  to you under the Apache License, Version 2.0 (the
87aa0a607SDon Lewisdnl *  "License"); you may not use this file except in compliance
97aa0a607SDon Lewisdnl *  with the License.  You may obtain a copy of the License at
107aa0a607SDon Lewisdnl *
117aa0a607SDon Lewisdnl *    http://www.apache.org/licenses/LICENSE-2.0
127aa0a607SDon Lewisdnl *
137aa0a607SDon Lewisdnl *  Unless required by applicable law or agreed to in writing,
147aa0a607SDon Lewisdnl *  software distributed under the License is distributed on an
157aa0a607SDon Lewisdnl *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167aa0a607SDon Lewisdnl *  KIND, either express or implied.  See the License for the
177aa0a607SDon Lewisdnl *  specific language governing permissions and limitations
187aa0a607SDon Lewisdnl *  under the License.
197aa0a607SDon Lewisdnl *
207aa0a607SDon Lewisdnl * *************************************************************
217aa0a607SDon LewisAC_REVISION( $Revision: 1.290 $ )
227aa0a607SDon LewisAC_PREREQ(2.50)
237aa0a607SDon LewisAC_INIT()
247aa0a607SDon Lewisecho "$@" >config.parms
257aa0a607SDon LewisAC_ARG_WITH(dmake-path,
267aa0a607SDon Lewis[  --with-dmake-path=<PATH TO EXECUTABLE>   Specify the location of dmake ],
277aa0a607SDon Lewis[  DMAKE_PATH="$withval"
287aa0a607SDon Lewis])
297aa0a607SDon LewisAC_ARG_WITH(dmake-url,
307aa0a607SDon Lewis[  --with-dmake-url=<URL>   Specify the location of downloadable dmake source code. For example:
317aa0a607SDon Lewis                          http://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2
327aa0a607SDon Lewis                          Note that dmake is under GPL license.],
337aa0a607SDon Lewis[  DMAKE_URL="$withval"
347aa0a607SDon Lewis])
357aa0a607SDon LewisAC_ARG_WITH(packager-list,
367aa0a607SDon Lewis[  --with-packager-list=<PATH TO PACK LIST>   Specify a file to drive the packaging process.
377aa0a607SDon Lewis                          The file must follow the format explained in
387aa0a607SDon Lewis                          instsetoo_native/util/pack.lst
397aa0a607SDon Lewis],,)
407aa0a607SDon LewisAC_ARG_WITH(gnu-patch,
417aa0a607SDon Lewis[  --with-gnu-patch        Specify location of GNU patch on Solaris or FreeBSD
427aa0a607SDon Lewis],,)
437aa0a607SDon LewisAC_ARG_WITH(gnu-cp,
447aa0a607SDon Lewis[  --with-gnu-cp           Specify location of GNU cp on Solaris
457aa0a607SDon Lewis],,)
467aa0a607SDon LewisAC_ARG_WITH(gperf,
477aa0a607SDon Lewis[  --with-gperf           Specify location of gperf on Solaris or FreeBSD
487aa0a607SDon Lewis],,)
497aa0a607SDon LewisAC_ARG_ENABLE(graphite,
507aa0a607SDon Lewis[  --enable-graphite       Enables the compilation of Graphite smart font rendering
517aa0a607SDon Lewis],,)
527aa0a607SDon LewisAC_ARG_WITH(system-graphite,
537aa0a607SDon Lewis[  --with-system-graphite    use graphite library already installed on system
547aa0a607SDon Lewis],,)
557aa0a607SDon LewisAC_ARG_WITH(system-apache-commons,
567aa0a607SDon Lewis[  --with-system-apache-commons    use apache-commons jar files already installed on system
577aa0a607SDon Lewis],,)
587aa0a607SDon LewisAC_ARG_ENABLE(online-update,
597aa0a607SDon Lewis[  --disable-online-update Disables the Online Update feature.
607aa0a607SDon Lewis],,enable_online_update=yes)
617aa0a607SDon LewisAC_ARG_ENABLE(ldap,
627aa0a607SDon Lewis[  --disable-ldap          Disables the use of LDAP backend via OpenLDAP
637aa0a607SDon Lewis],,)
647aa0a607SDon LewisAC_ARG_ENABLE(fetch-external,
657aa0a607SDon Lewis[  --disable-fetch-external Disables fetching external tarballs from web sources.
667aa0a607SDon Lewis],,)
677aa0a607SDon LewisAC_ARG_WITH(external-tar,
687aa0a607SDon Lewis[  --with-external-tar=<TARFILE PATH>   Specify path to tarfiles manually ],
697aa0a607SDon Lewis[ TARFILE_LOCATION="$withval"
707aa0a607SDon Lewis])
717aa0a607SDon LewisAC_ARG_WITH(openldap,
727aa0a607SDon Lewis[  --with-openldap         Enables the use of the OpenLDAP
737aa0a607SDon Lewis],,)
747aa0a607SDon LewisAC_ARG_ENABLE(lockdown,
757aa0a607SDon Lewis[  --enable-lockdown       Enables the gconf integration work in OOo
767aa0a607SDon Lewis],,)
777aa0a607SDon LewisAC_ARG_ENABLE(vba,
787aa0a607SDon Lewis[  --disable-vba           disables the vba compatibility feature
797aa0a607SDon Lewis],,)
807aa0a607SDon LewisAC_ARG_WITH(vba-package-format,
817aa0a607SDon Lewis[  --with-vba-package-format   specify package format for vba compatibility api.
827aa0a607SDon Lewis                          Specifying  "builtin" means the api component and
837aa0a607SDon Lewis                          associated type library are  part of the installation set.
847aa0a607SDon Lewis                          Specifying "extn" creates an uno extension that is
857aa0a607SDon Lewis                          part of the installation set ( located in the program
867aa0a607SDon Lewis                          directory ) that MUST be optionly registered using
877aa0a607SDon Lewis                          either the unopkg executeable or the extension manager
887aa0a607SDon Lewis                          gui.
897aa0a607SDon Lewis
907aa0a607SDon Lewis                          Note: "builtin" is the default, "extn" can cause
917aa0a607SDon Lewis                          problems.
927aa0a607SDon Lewis                          Usage: --with-vba-package-format="builtin" or
937aa0a607SDon Lewis                                 --with-vba-package-format="extn"
947aa0a607SDon Lewis],,)
957aa0a607SDon LewisAC_ARG_ENABLE(pch,
967aa0a607SDon Lewis[  --enable-pch            EXPERIMENTAL: Enables precompiled header support for C++.
977aa0a607SDon Lewis],,)
987aa0a607SDon LewisAC_ARG_WITH(fonts,
997aa0a607SDon Lewis[  --without-fonts         OOo includes some third-party fonts to provide a reliable
1007aa0a607SDon Lewis                          basis for help content, templates, samples, etc.
1017aa0a607SDon Lewis                          When these fonts are already known to be available on the
1027aa0a607SDon Lewis                          system then you should use this option.
1037aa0a607SDon Lewis],,)
1047aa0a607SDon LewisAC_ARG_WITH(ppds,
1057aa0a607SDon Lewis[  --without-ppds          Removes Postscript Printer definition files from
1067aa0a607SDon Lewis                          Apache Openoffice installation set, for people building
1077aa0a607SDon Lewis                          for specific distributions where PPDs are known to be
1087aa0a607SDon Lewis                          already available (every recent distro with CUPS
1097aa0a607SDon Lewis                          backend)
1107aa0a607SDon Lewis],,)
1117aa0a607SDon LewisAC_ARG_WITH(afms,
1127aa0a607SDon Lewis[  --without-afms          Removes bitmap font files from Apache Openoffice
1137aa0a607SDon Lewis                          installation set, for people building for specific
1147aa0a607SDon Lewis                          distributions where AFM files or TrueType Fonts
1157aa0a607SDon Lewis                          are known to be available.
1167aa0a607SDon Lewis],,)
1177aa0a607SDon LewisAC_ARG_ENABLE(epm,
1187aa0a607SDon Lewis[  --disable-epm           AOO includes self-packaging code, that requires
1197aa0a607SDon Lewis                          epm, however epm is useless for large scale
1207aa0a607SDon Lewis                          package building.
1217aa0a607SDon Lewis],,enable_epm="yes")
1227aa0a607SDon LewisAC_ARG_WITH(epm,
1237aa0a607SDon Lewis[  --with-epm		  Decides which epm to use. Default is to use
1247aa0a607SDon Lewis			  the one from the system if one is built. When
1257aa0a607SDon Lewis			  either this is not there or you say =internal
1267aa0a607SDon Lewis			  epm will be built.
1277aa0a607SDon Lewis],,)
1287aa0a607SDon LewisAC_ARG_WITH(epm-url,
1297aa0a607SDon Lewis[  --with-epm-url=<URL>    Specify the location of downloadable epm 3.7 source code. For example:
1307aa0a607SDon Lewis                            https://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz
1317aa0a607SDon Lewis                          Note that epm is under GPL license.
1327aa0a607SDon Lewis],[  EPM_URL="$withval"
1337aa0a607SDon Lewis])
1347aa0a607SDon LewisAC_ARG_WITH(package-format,
1357aa0a607SDon Lewis[  --with-package-format   specify package format(s) for OOo installsets.
1367aa0a607SDon Lewis                          Default is "normal" one of the OS/Distribution.
1377aa0a607SDon Lewis
1387aa0a607SDon Lewis                          Usage: --with-package-format="foo bar"
1397aa0a607SDon Lewis],,)
1407aa0a607SDon LewisAC_ARG_ENABLE(odk,
1417aa0a607SDon Lewis[  --disable-odk           OO.o includes an ODK, office development kit
1427aa0a607SDon Lewis                          which some packagers may with to build without
1437aa0a607SDon Lewis],,enable_odk="yes")
1447aa0a607SDon LewisAC_ARG_ENABLE(mathmldtd,
1457aa0a607SDon Lewis[  --disable-mathmldtd     disable mathmldtd
1467aa0a607SDon Lewis                          (useful for distributions that want to avoid packaging
1477aa0a607SDon Lewis                          it)
1487aa0a607SDon Lewis],,enable_mathmldtd="yes")
1497aa0a607SDon LewisAC_ARG_ENABLE(evolution2,
1507aa0a607SDon Lewis[  --enable-evolution2     Allows the built-in evolution 2 addressbook
1517aa0a607SDon Lewis                          connectivity build to be enabled.
1527aa0a607SDon Lewis],,)
1537aa0a607SDon LewisAC_ARG_WITH(system-stdlibs,
1547aa0a607SDon Lewis[  --with-system-stdlibs   use libstdc++/libgcc_s already on system
1557aa0a607SDon Lewis],,)
1567aa0a607SDon LewisAC_ARG_ENABLE(cups,
1577aa0a607SDon Lewis[  --disable-cups          disable CUPS support (for printing on UNIX)
1587aa0a607SDon Lewis],,enable_cups=yes)
1597aa0a607SDon LewisAC_ARG_ENABLE(fontconfig,
1607aa0a607SDon Lewis[  --disable-fontconfig    disable support for the fontconfig library
1617aa0a607SDon Lewis],,enable_fontconfig=yes)
1627aa0a607SDon LewisAC_ARG_ENABLE(directx,
1637aa0a607SDon Lewis[  --disable-directx       Remove DirectX implementation for the new XCanvas
1647aa0a607SDon Lewis                          interface. The DirectX support requires more stuff
1657aa0a607SDon Lewis                          installed on Windows to compile.
1667aa0a607SDon Lewis                          (DirectX SDK, GDI+ libs)
1677aa0a607SDon Lewis],,enable_directx=yes)
1687aa0a607SDon LewisAC_ARG_ENABLE(activex,
1697aa0a607SDon Lewis[  --disable-activex       Disable the use of ActiveX for windows build.
1707aa0a607SDon Lewis                          This switch is mandatory when using VC++ 2005/2008 Express.
1717aa0a607SDon Lewis                          Alternatively you can use the Windows Driver Kit (WDK) and
1727aa0a607SDon Lewis                          configure with the following switches:
1737aa0a607SDon Lewis                          --with-atl-include-dir=$WDK_HOME\inc\atl71
1747aa0a607SDon Lewis                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
1757aa0a607SDon Lewis                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
1767aa0a607SDon Lewis                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
1777aa0a607SDon Lewis],,)
1787aa0a607SDon Lewis
1797aa0a607SDon LewisAC_ARG_ENABLE(atl,
1807aa0a607SDon Lewis[  --disable-atl          Disable the use of ATL for windows build.
1817aa0a607SDon Lewis                          This switch is mandatory when using VC++ 2005/2008 Express.
1827aa0a607SDon Lewis                          Alternatively you can use the Windows Driver Kit (WDK) and
1837aa0a607SDon Lewis                          configure with the following switches:
1847aa0a607SDon Lewis                          --with-atl-include-dir=$WDK_HOME\inc\atl71
1857aa0a607SDon Lewis                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
1867aa0a607SDon Lewis                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
1877aa0a607SDon Lewis                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
1887aa0a607SDon Lewis],,)
1897aa0a607SDon Lewis
1907aa0a607SDon LewisAC_ARG_WITH(atl-include-dir,
1917aa0a607SDon Lewis[  --with-atl-include-dir      Path to ATL include directory for windows build.
1927aa0a607SDon Lewis                          This switch is mandatory when using VC++ 2008 Express
1937aa0a607SDon Lewis                          and configuring with ATL/ActiveX enabled.
1947aa0a607SDon Lewis                          You can use the Windows Driver Kit (WDK) and
1957aa0a607SDon Lewis                          configure with the following switch:
1967aa0a607SDon Lewis                          --with-atl-include-dir=$WDK_HOME\inc\atl71
1977aa0a607SDon Lewis],,)
1987aa0a607SDon Lewis
1997aa0a607SDon LewisAC_ARG_WITH(atl-lib-dir,
2007aa0a607SDon Lewis[  --with-atl-lib-dir          Path to ATL libraries directory for windows build.
2017aa0a607SDon Lewis                          This switch is mandatory when using VC++ 2008 Express
2027aa0a607SDon Lewis                          and configuring with ATL/ActiveX enabled.
2037aa0a607SDon Lewis                          You can use the Windows Driver Kit (WDK) and
2047aa0a607SDon Lewis                          configure with the following switch:
2057aa0a607SDon Lewis                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
2067aa0a607SDon Lewis],,)
2077aa0a607SDon Lewis
2087aa0a607SDon LewisAC_ARG_WITH(mfc-include-dir,
2097aa0a607SDon Lewis[  --with-mfc-include-dir       Path to MFC include directory for windows build.
2107aa0a607SDon Lewis                          This switch is mandatory when using VC++ 2008 Express
2117aa0a607SDon Lewis                          and configuring with ATL/ActiveX enabled.
2127aa0a607SDon Lewis                          You can use the Windows Driver Kit (WDK) and
2137aa0a607SDon Lewis                          configure with the following switch:
2147aa0a607SDon Lewis                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
2157aa0a607SDon Lewis],,)
2167aa0a607SDon Lewis
2177aa0a607SDon LewisAC_ARG_WITH(mfc-lib-dir,
2187aa0a607SDon Lewis[  --with-mfc-lib-dir          Path to MFC libraries directory for windows build.
2197aa0a607SDon Lewis                          This switch is mandatory when using VC++ 2008 Express
2207aa0a607SDon Lewis                          and configuring with ATL/ActiveX enabled.
2217aa0a607SDon Lewis                          You can use the Windows Driver Kit (WDK) and
2227aa0a607SDon Lewis                          configure with the following switch:
2237aa0a607SDon Lewis                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
2247aa0a607SDon Lewis],,)
2257aa0a607SDon Lewis
2267aa0a607SDon Lewis
2277aa0a607SDon LewisAC_ARG_ENABLE(symbols,
2287aa0a607SDon Lewis[  --enable-symbols        Include debugging symbols in output.
2297aa0a607SDon Lewis                          WARNING - a complete build needs 8 Gb of space and
2307aa0a607SDon Lewis                          takes much longer. (enables -g compiler flag)
2317aa0a607SDon Lewis
2327aa0a607SDon Lewis                          --enable-symbols=SMALL sets the gcc -g1 setting
2337aa0a607SDon Lewis                          which is smaller.
2347aa0a607SDon Lewis
2357aa0a607SDon Lewis                          Enabling symbols disables the stripping of the solver
2367aa0a607SDon Lewis                          (--disable-strip-solver).
2377aa0a607SDon Lewis],,)
2387aa0a607SDon LewisAC_ARG_ENABLE(strip-solver,
2397aa0a607SDon Lewis[  --disable-strip-solver  Disable the stripping of the solver.
2407aa0a607SDon Lewis                          By default the solver is stripped unless a build with
2417aa0a607SDon Lewis                          debugging symbols (--enable-symbols) is requested.
2427aa0a607SDon Lewis
2437aa0a607SDon Lewis                          This switch allows to override this setting.
2447aa0a607SDon Lewis],,)
2457aa0a607SDon LewisAC_ARG_ENABLE(werror,
2467aa0a607SDon Lewis[  --enable-werror         Turn warnings to errors. (Has no effect in modules
2477aa0a607SDon Lewis                          where the treating of warnings as errors is disabled
2487aa0a607SDon Lewis                          explicitly)
2497aa0a607SDon Lewis],,)
2507aa0a607SDon LewisAC_ARG_ENABLE(debug,
2517aa0a607SDon Lewis[  --enable-debug          Include debugging symbols from --enable-symbols
2527aa0a607SDon Lewis                          plus extra debugging code.  Extra large build!
2537aa0a607SDon Lewis                          (enables -g compiler flag and dmake debug=true)
2547aa0a607SDon Lewis],,)
2557aa0a607SDon LewisAC_ARG_ENABLE(dbgutil,
2567aa0a607SDon Lewis[  --enable-dbgutil        Include additional debugging utilities, such as
2577aa0a607SDon Lewis                          assertions, object counting, etc. Larger build.
2587aa0a607SDon Lewis                          Independent from --enable-debug
2597aa0a607SDon Lewis],,)
2607aa0a607SDon LewisAC_ARG_ENABLE(crashdump,
2617aa0a607SDon Lewis[  --enable-crashdump      Enable the crashdump feature code.
2627aa0a607SDon Lewis],,)
2637aa0a607SDon LewisAC_ARG_ENABLE(cl-standard,
2647aa0a607SDon Lewis[  --enable-cl-standard    For Microsoft C/C++ compiler users, use non-optimizing
2657aa0a607SDon Lewis                          standard compiler. ( This just disables optimization
2667aa0a607SDon Lewis                          options and therefore removes a lot of warnings when
2677aa0a607SDon Lewis                          using the cheaper standard compiler. )
2687aa0a607SDon Lewis],,)
2697aa0a607SDon LewisAC_ARG_ENABLE(win-x64-shellext,
2707aa0a607SDon Lewis[  --enable-win-x64-shellext    Enable the build/usage of Windows 64bit shell extensions.
2717aa0a607SDon Lewis                          These extension are used for the system integration on a
2727aa0a607SDon Lewis			  Windows 64bit systems. For example supporting the search
2737aa0a607SDon Lewis			  in ODF files with the standard Windows search feature.
2747aa0a607SDon Lewis],,)
2757aa0a607SDon LewisAC_ARG_ENABLE(gtk,
2767aa0a607SDon Lewis[  --disable-gtk           Determines whether to use Gtk+ vclplug on platforms
2777aa0a607SDon Lewis                          where Gtk+ is available.
2787aa0a607SDon Lewis],,enable_gtk=yes)
2797aa0a607SDon LewisAC_ARG_ENABLE(gstreamer,
2807aa0a607SDon Lewis[  --enable-gstreamer      Determines whether to use the GStreamer media
2817aa0a607SDon Lewis                          backend on platforms where GStreamer is available.
2827aa0a607SDon Lewis],,enable_gstreamer=no)
2837aa0a607SDon LewisAC_ARG_ENABLE(systray,
2847aa0a607SDon Lewis[  --disable-systray       Determines whether to build the systray quickstarter.
2857aa0a607SDon Lewis],,enable_systray=yes)
2867aa0a607SDon LewisAC_ARG_ENABLE(cairo,
2877aa0a607SDon Lewis[  --enable-cairo          Determines whether to use Cairo library on
2887aa0a607SDon Lewis                          platforms where Cairo is available.
2897aa0a607SDon Lewis],,enable_cairo=no)
2907aa0a607SDon LewisAC_ARG_WITH(system-cairo,
2917aa0a607SDon Lewis[  --with-system-cairo      Use Cairo libraries already on system
2927aa0a607SDon Lewis],,)
2937aa0a607SDon LewisAC_ARG_ENABLE(cairo-canvas,
2947aa0a607SDon Lewis[  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
2957aa0a607SDon Lewis                          platforms where Cairo is available.
2967aa0a607SDon Lewis],,enable_cairo_canvas=yes)
2977aa0a607SDon LewisAC_ARG_ENABLE(opengl,
2987aa0a607SDon Lewis[  --enable-opengl         Determines whether to build the OpenGL 3D slide
2997aa0a607SDon Lewis                          transitions component
3007aa0a607SDon Lewis],,enable_opengl=no)
3017aa0a607SDon LewisAC_ARG_ENABLE(dbus,
3027aa0a607SDon Lewis[  --enable-dbus           Determines whether to enable presentation mode
3037aa0a607SDon Lewis                          screensaver control under GNOME via DBUS
3047aa0a607SDon Lewis],,enable_dbus=no)
3057aa0a607SDon LewisAC_ARG_ENABLE(gconf,
3067aa0a607SDon Lewis[  --disable-gconf         Determines whether to use the GConf support
3077aa0a607SDon Lewis],,enable_gconf=yes)
3087aa0a607SDon LewisAC_ARG_ENABLE(gnome-vfs,
3097aa0a607SDon Lewis[  --disable-gnome-vfs     Determines whether to use the Gnome Virtual Filing
3107aa0a607SDon Lewis                          System on platforms where that VFS is available
3117aa0a607SDon Lewis],,enable_gnome_vfs=yes)
3127aa0a607SDon LewisAC_ARG_ENABLE(gio,
3137aa0a607SDon Lewis[  --enable-gio            Determines whether to use the GIO support
3147aa0a607SDon Lewis],,enable_gio=no)
3157aa0a607SDon LewisAC_ARG_ENABLE(static-gtk,
3167aa0a607SDon Lewis[  --enable-static-gtk     Modules that are linked against gtk libraries use
3177aa0a607SDon Lewis                          the static libraries instead of the dynamic ones.
3187aa0a607SDon Lewis                          (enables -Bstatic linker flag for gtk libraries)
3197aa0a607SDon Lewis],,)
3207aa0a607SDon LewisAC_ARG_ENABLE(layout,
3217aa0a607SDon Lewis[  --enable-layout         Enable the compilation and use of layout dialogs
3227aa0a607SDon Lewis],,)
3237aa0a607SDon LewisAC_ARG_ENABLE(nss-module,
3247aa0a607SDon Lewis[  --disable-nss-module    Whether to use the NSS module that is used for xml-security
3257aa0a607SDon Lewis],,enable_nss_module=yes)
3267aa0a607SDon LewisAC_ARG_ENABLE(kde,
3277aa0a607SDon Lewis[  --enable-kde            Determines whether to use Qt/KDE vclplug on platforms
3287aa0a607SDon Lewis                          where Qt and KDE are available.
3297aa0a607SDon Lewis],,)
3307aa0a607SDon LewisAC_ARG_ENABLE(kdeab,
3317aa0a607SDon Lewis[  --disable-kdeab         Disable the KDE address book support
3327aa0a607SDon Lewis],,if test "$enable_kde" = "yes"; then enable_kdeab=yes; fi)
3337aa0a607SDon LewisAC_ARG_ENABLE(kde4,
3347aa0a607SDon Lewis[  --enable-kde4            Determines whether to use Qt4/KDE4 vclplug on platforms
3357aa0a607SDon Lewis                          where Qt4 and KDE4 are available. May be used with --enable-kde
3367aa0a607SDon Lewis                          if you want to support both KDE3 and KDE4.
3377aa0a607SDon Lewis],,)
3387aa0a607SDon LewisAC_ARG_ENABLE(rpath,
3397aa0a607SDon Lewis[  --disable-rpath         Disable the use of relative paths in shared libraries
3407aa0a607SDon Lewis],,)
3417aa0a607SDon LewisAC_ARG_ENABLE(pam,
3427aa0a607SDon Lewis[  --disable-pam           Disable pam support.
3437aa0a607SDon Lewis],,)
3447aa0a607SDon LewisAC_ARG_ENABLE(pam-link,
3457aa0a607SDon Lewis[  --enable-pam-link       link with libpam instead of dynamically open it
3467aa0a607SDon Lewis],,)
3477aa0a607SDon LewisAC_ARG_ENABLE(crypt-link,
3487aa0a607SDon Lewis[  --disable-crypt-link    disable linking with libcrypt instead of dynamically
3497aa0a607SDon Lewis                          open it (needed for ancient GNU/Linux distributions
3507aa0a607SDon Lewis                          without crypt()/libcrypt)
3517aa0a607SDon Lewis],,enable_crypt_link=yes)
3527aa0a607SDon LewisAC_ARG_ENABLE(xrender-link,
3537aa0a607SDon Lewis[  --enable-xrender-link   link with libXrender instead of dynamically open it
3547aa0a607SDon Lewis],,)
3557aa0a607SDon LewisAC_ARG_ENABLE(randr,
3567aa0a607SDon Lewis[  --disable-randr         disable RandR support in the vcl project
3577aa0a607SDon Lewis],,enable_randr=yes)
3587aa0a607SDon LewisAC_ARG_ENABLE(randr-link,
3597aa0a607SDon Lewis[  --disable-randr-link    disable linking with libXrandr, instead dynamically
3607aa0a607SDon Lewis                           open it at runtime
3617aa0a607SDon Lewis],,enable_randr_link=yes)
3627aa0a607SDon LewisAC_ARG_WITH(bundled-extension-blobs,
3637aa0a607SDon Lewis[  --with-bundled-extension-blobs Whitespace seperated list of files in the tarball directory
3647aa0a607SDon Lewis                          that are to be bundled as-is for installation as extensions
3657aa0a607SDon Lewis                          at the first program start. Make sure to only bundle extensions
3667aa0a607SDon Lewis                          which can be installed without requiring a license dialog
3677aa0a607SDon Lewis                          and comply with their distribution requirements by updating the
3687aa0a607SDon Lewis                          files LICENSE_aggregated and NOTICE_aggregated accordingly
3697aa0a607SDon Lewis],,)
3707aa0a607SDon Lewis#AC_ARG_WITH(bundled-prereg-extensions,
3717aa0a607SDon Lewis#[  --with-bundled-prereg-extensions Whitespace seperated list of files in the tarball directory that
3727aa0a607SDon Lewis#                          are to be bundled as pre-registered extensions. Make sure to only bundle
3737aa0a607SDon Lewis#                          extensions which can be installed without requiring a license dialog
3747aa0a607SDon Lewis#],,)
3757aa0a607SDon LewisAC_ARG_ENABLE(bundled-dictionaries,
3767aa0a607SDon Lewis[  --enable-bundled-dictionaries  Download dictionaries (spelling, hyphenation, thesaurus)
3777aa0a607SDon Lewis                           according to main/extensions.lst and bundle them. Make sure to
3787aa0a607SDon Lewis                           comply with their distribution requirements and update the
3797aa0a607SDon Lewis                           files LICENSE_aggregated and NOTICE_aggregated accordingly
3807aa0a607SDon Lewis],,enable_bundled_dictionaries=no)
3817aa0a607SDon Lewis
3827aa0a607SDon Lewis# Remove the following switches when not in release mode.
3837aa0a607SDon LewisAC_ARG_WITH(system-dicts,
3847aa0a607SDon Lewis[  --with-system-dicts    Use dictionaries from system paths- Specify
3857aa0a607SDon Lewis                         them via --with-{dict,hyph,thes}-path=/path
3867aa0a607SDon Lewis                        if you want to override the default ones
3877aa0a607SDon Lewis],,)
3887aa0a607SDon LewisAC_ARG_WITH(external-dict-dir,
3897aa0a607SDon Lewis[  --with-external-dict-dir Specify external dictionary dir
3907aa0a607SDon Lewis],,)
3917aa0a607SDon LewisAC_ARG_WITH(external-hyph-dir,
3927aa0a607SDon Lewis[  --with-external-hyph-dir Specify external hyphenation pattern dir
3937aa0a607SDon Lewis],,)
3947aa0a607SDon LewisAC_ARG_WITH(external-thes-dir,
3957aa0a607SDon Lewis[  --with-external-thes-dir Specify external thesaurus dir
3967aa0a607SDon Lewis],,)
3977aa0a607SDon Lewis# End of remove.
3987aa0a607SDon Lewis
3997aa0a607SDon Lewis
4007aa0a607SDon LewisAC_ARG_WITH(system-libs,
4017aa0a607SDon Lewis[  --with-system-libs      Use libs already on system -- enables all
4027aa0a607SDon Lewis                          --with-system-* flags except
4037aa0a607SDon Lewis                          odbc/sane/xrender-header(s)
4047aa0a607SDon Lewis],,)
4057aa0a607SDon LewisAC_ARG_WITH(system-headers,
4067aa0a607SDon Lewis[  --with-system-headers   Use headers already on system -- enables all
4077aa0a607SDon Lewis                          --with-system-* flags for external packages
4087aa0a607SDon Lewis                          whose headers are the only entities used i.e.
4097aa0a607SDon Lewis                          boost/vigra/odbc/sane/xrender-header(s)
4107aa0a607SDon Lewis],,)
4117aa0a607SDon LewisAC_ARG_WITH(system-jars,
4127aa0a607SDon Lewis[  --without-system-jars   When building with --with-system-libs, also the
4137aa0a607SDon Lewis                          needed jars are expected on the system. Use this to
4147aa0a607SDon Lewis                          disable that.
4157aa0a607SDon Lewis                          (except for the db case where --with-system-db
4167aa0a607SDon Lewis                          *has to* imply using the db.jar from there, too)
4177aa0a607SDon Lewis],,)
4187aa0a607SDon LewisAC_ARG_WITH(system-zlib,
4197aa0a607SDon Lewis[  --with-system-zlib      Use zlib already on system
4207aa0a607SDon Lewis],,)
4217aa0a607SDon LewisAC_ARG_WITH(system-nss,
4227aa0a607SDon Lewis[  --with-system-nss       Use NSS already on system
4237aa0a607SDon Lewis],,)
4247aa0a607SDon LewisAC_ARG_WITH(system-openssl,
4257aa0a607SDon Lewis[  --with-system-openssl   Use OpenSSL already on system
4267aa0a607SDon Lewis],,)
4277aa0a607SDon LewisAC_ARG_WITH(system-jpeg,
4287aa0a607SDon Lewis[  --with-system-jpeg      Use jpeg already on system
4297aa0a607SDon Lewis],,)
4307aa0a607SDon LewisAC_ARG_WITH(system-expat,
4317aa0a607SDon Lewis[  --with-system-expat     Use expat already on system
4327aa0a607SDon Lewis],,)
4337aa0a607SDon LewisAC_ARG_WITH(system-libwpd,
4347aa0a607SDon Lewis[  --with-system-libwpd    Use libwpd already on system
4357aa0a607SDon Lewis],,)
4367aa0a607SDon LewisAC_ARG_WITH(system-libxml,
4377aa0a607SDon Lewis[  --with-system-libxml    Use libxml already on system
4387aa0a607SDon Lewis],,)
4397aa0a607SDon LewisAC_ARG_WITH(system-python,
4407aa0a607SDon Lewis[  --with-system-python    Use python already on system
4417aa0a607SDon Lewis],,)
4427aa0a607SDon LewisAC_ARG_WITH(system-icu,
4437aa0a607SDon Lewis[  --with-system-icu       Use icu already on system
4447aa0a607SDon Lewis],,)
4457aa0a607SDon LewisAC_ARG_WITH(system-poppler,
4467aa0a607SDon Lewis[  --with-system-poppler   Use poppler already on system
4477aa0a607SDon Lewis],,)
4487aa0a607SDon LewisAC_ARG_WITH(system-lucene,
4497aa0a607SDon Lewis[  --with-system-lucene    Use lucene already on system
4507aa0a607SDon Lewis],,)
4517aa0a607SDon LewisAC_ARG_WITH(lucene-core-jar,
4527aa0a607SDon Lewis[  --with-lucene-core-jar=JARFILE   Specify path to jarfile manually ],
4537aa0a607SDon Lewis[ LUCENE_CORE_JAR="$withval"
4547aa0a607SDon Lewis])
4557aa0a607SDon LewisAC_ARG_WITH(lucene-analyzers-jar,
4567aa0a607SDon Lewis[  --with-lucene-analyzers-jar=JARFILE   Specify path to jarfile manually ],
4577aa0a607SDon Lewis[ LUCENE_ANALYZERS_JAR="$withval"
4587aa0a607SDon Lewis])
4597aa0a607SDon LewisAC_ARG_ENABLE(mysql-connector,
4607aa0a607SDon Lewis[  --enable-mysql-connector     enables the build of the MySQL Connector/OOo extension.
4617aa0a607SDon Lewis                                This requires access to the MySQL Connector/C (aka libmysql) to be given, too, with
4627aa0a607SDon Lewis                                either the --with-system-mysql or --with-libmysql-path option.
4637aa0a607SDon Lewis],,)
4647aa0a607SDon LewisAC_ARG_WITH(system-mysql,
4657aa0a607SDon Lewis[  --with-system-mysql          Use MySQL libraries already on system, for building the MySQL Connector/OOo extension.
4667aa0a607SDon Lewis                                Requires MYSQLCONFIG to point to the mysql_config executable.
4677aa0a607SDon Lewis],,)
4687aa0a607SDon LewisAC_ARG_WITH(libmysql-path,
4697aa0a607SDon Lewis[  --with-libmysql-path         Use Connector/C (libmysql) installation for building the MySQL Connector/OOo extension.
4707aa0a607SDon Lewis
4717aa0a607SDon Lewis                                Usage: --with-libmysql-path=<absolute path to your Connector/C installation>
4727aa0a607SDon Lewis],,)
4737aa0a607SDon LewisAC_ARG_WITH(system-mysql-cppconn,
4747aa0a607SDon Lewis[  --with-system-mysql-cppconn  Use MySQL C++ Connector libraries already on system
4757aa0a607SDon Lewis],,)
4767aa0a607SDon LewisAC_ARG_WITH(system-hsqldb,
4777aa0a607SDon Lewis[  --with-system-hsqldb    Use hsqldb already on system
4787aa0a607SDon Lewis],,)
4797aa0a607SDon LewisAC_ARG_WITH(hsqldb-jar,
4807aa0a607SDon Lewis[  --with-hsqldb-jar=JARFILE   Specify path to jarfile manually ],
4817aa0a607SDon Lewis[ HSQLDB_JAR="$withval"
4827aa0a607SDon Lewis])
4837aa0a607SDon LewisAC_ARG_WITH(system-beanshell,
4847aa0a607SDon Lewis[  --with-system-beanshell Use beanshell already on system (default)
4857aa0a607SDon Lewis],,)
4867aa0a607SDon LewisAC_ARG_ENABLE(beanshell,
4877aa0a607SDon Lewis[  --disable-beanshell     Disable the use of beanshell.
4887aa0a607SDon Lewis],,)
4897aa0a607SDon LewisAC_ARG_WITH(beanshell-jar,
4907aa0a607SDon Lewis[  --with-beanshell-jar=JARFILE   Specify path to jarfile manually ],
4917aa0a607SDon Lewis[ BSH_JAR="$withval"
4927aa0a607SDon Lewis])
4937aa0a607SDon LewisAC_ARG_ENABLE(pdfimport,
4947aa0a607SDon Lewis[  --enable-pdfimport          enables the build of the PDF Import extension
4957aa0a607SDon Lewis],,)
4967aa0a607SDon LewisAC_ARG_ENABLE(wiki-publisher,
4977aa0a607SDon Lewis[  --enable-wiki-publisher      enables the build of the Wiki Publisher extension
4987aa0a607SDon Lewis],,)
4997aa0a607SDon LewisAC_ARG_WITH(commons-codec-jar,
5007aa0a607SDon Lewis[  --with-commons-codec-jar=JARFILE   Specify path to jarfile manually ],
5017aa0a607SDon Lewis[ COMMONS_CODEC_JAR="$withval"
5027aa0a607SDon Lewis])
5037aa0a607SDon LewisAC_ARG_WITH(commons-lang-jar,
5047aa0a607SDon Lewis[  --with-commons-lang-jar=JARFILE   Specify path to jarfile manually ],
5057aa0a607SDon Lewis[ COMMONS_LANG_JAR="$withval"
5067aa0a607SDon Lewis])
5077aa0a607SDon LewisAC_ARG_WITH(commons-httpclient-jar,
5087aa0a607SDon Lewis[  --with-commons-httpclient-jar=JARFILE   Specify path to jarfile manually ],
5097aa0a607SDon Lewis[ COMMONS_HTTPCLIENT_JAR="$withval"
5107aa0a607SDon Lewis])
5117aa0a607SDon LewisAC_ARG_WITH(commons-logging-jar,
5127aa0a607SDon Lewis[  --with-commons-logging-jar=JARFILE   Specify path to jarfile manually ],
5137aa0a607SDon Lewis[ COMMONS_LOGGING_JAR="$withval"
5147aa0a607SDon Lewis])
5157aa0a607SDon LewisAC_ARG_WITH(servlet-api-jar,
5167aa0a607SDon Lewis[  --servlet-api-jar=JARFILE   Specify path to jarfile manually ],
5177aa0a607SDon Lewis[ SERVLETAPI_JAR="$withval"
5187aa0a607SDon Lewis])
5197aa0a607SDon LewisAC_ARG_ENABLE(report-builder,
5207aa0a607SDon Lewis[  --enable-report-builder  enables the build of the Report Builder extension
5217aa0a607SDon Lewis],,)
5227aa0a607SDon LewisAC_ARG_WITH(sac-jar,
5237aa0a607SDon Lewis[  --with-sac-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5247aa0a607SDon Lewis[ SAC_JAR="$withval"
5257aa0a607SDon Lewis])
5267aa0a607SDon LewisAC_ARG_WITH(libxml-jar,
5277aa0a607SDon Lewis[  --with-libxml-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5287aa0a607SDon Lewis[ LIBXML_JAR="$withval"
5297aa0a607SDon Lewis])
5307aa0a607SDon LewisAC_ARG_WITH(flute-jar,
5317aa0a607SDon Lewis[  --with-flute-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5327aa0a607SDon Lewis[ FLUTE_JAR="$withval"
5337aa0a607SDon Lewis])
5347aa0a607SDon LewisAC_ARG_WITH(jfreereport-jar,
5357aa0a607SDon Lewis[  --with-jfreereport-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5367aa0a607SDon Lewis[ JFREEREPORT_JAR="$withval"
5377aa0a607SDon Lewis])
5387aa0a607SDon LewisAC_ARG_WITH(liblayout-jar,
5397aa0a607SDon Lewis[  --with-liblayout-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5407aa0a607SDon Lewis[ LIBLAYOUT_JAR="$withval"
5417aa0a607SDon Lewis])
5427aa0a607SDon LewisAC_ARG_WITH(libloader-jar,
5437aa0a607SDon Lewis[  --with-libloader-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5447aa0a607SDon Lewis[ LIBLOADER_JAR="$withval"
5457aa0a607SDon Lewis])
5467aa0a607SDon LewisAC_ARG_WITH(libloader-jar,
5477aa0a607SDon Lewis[  --with-libloader-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5487aa0a607SDon Lewis[ LIBLOADER_JAR="$withval"
5497aa0a607SDon Lewis])
5507aa0a607SDon LewisAC_ARG_WITH(libformula-jar,
5517aa0a607SDon Lewis[  --with-libformula-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5527aa0a607SDon Lewis[ LIBFORMULA_JAR="$withval"
5537aa0a607SDon Lewis])
5547aa0a607SDon LewisAC_ARG_WITH(librepository-jar,
5557aa0a607SDon Lewis[  --with-librepository-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5567aa0a607SDon Lewis[ LIBREPOSITORY_JAR="$withval"
5577aa0a607SDon Lewis])
5587aa0a607SDon LewisAC_ARG_WITH(libfonts-jar,
5597aa0a607SDon Lewis[  --with-libfonts-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5607aa0a607SDon Lewis[ LIBFONTS_JAR="$withval"
5617aa0a607SDon Lewis])
5627aa0a607SDon LewisAC_ARG_WITH(libserializer-jar,
5637aa0a607SDon Lewis[  --with-libserializer-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5647aa0a607SDon Lewis[ LIBSERIALIZER_JAR="$withval"
5657aa0a607SDon Lewis])
5667aa0a607SDon LewisAC_ARG_WITH(libbase-jar,
5677aa0a607SDon Lewis[  --with-libbase-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
5687aa0a607SDon Lewis[ LIBBASE_JAR="$withval"
5697aa0a607SDon Lewis])
5707aa0a607SDon LewisAC_ARG_WITH(system-saxon,
5717aa0a607SDon Lewis[  --with-system-saxon     Use saxon already on system (default)
5727aa0a607SDon Lewis],,)
5737aa0a607SDon LewisAC_ARG_ENABLE(saxon,
5747aa0a607SDon Lewis[  --disable-saxon         Disable use of saxon
5757aa0a607SDon Lewis],,)
5767aa0a607SDon LewisAC_ARG_WITH(saxon-jar,
5777aa0a607SDon Lewis[  --with-saxon-jar=JARFILE   Specify path to jarfile manually. This implies --with-system-saxon ],
5787aa0a607SDon Lewis[ SAXON_JAR="$withval"
5797aa0a607SDon Lewis])
5807aa0a607SDon LewisAC_ARG_WITH(system-libxslt,
5817aa0a607SDon Lewis[  --with-system-libxslt   Use libxslt already on system
5827aa0a607SDon Lewis],,)
5837aa0a607SDon LewisAC_ARG_WITH(system-odbc,
5847aa0a607SDon Lewis[  --with-system-odbc-headers     Use the odbc headers already on system
5857aa0a607SDon Lewis],,)
5867aa0a607SDon LewisAC_ARG_WITH(system-sane,
5877aa0a607SDon Lewis[  --with-system-sane-header      Use sane.h already on system
5887aa0a607SDon Lewis],,)
5897aa0a607SDon LewisAC_ARG_WITH(system-xrender,
5907aa0a607SDon Lewis[  --with-system-xrender-headers  Use XRender headers already on system
5917aa0a607SDon Lewis],,)
5927aa0a607SDon LewisAC_ARG_WITH(system-curl,
5937aa0a607SDon Lewis[  --with-system-curl      Use curl already on system
5947aa0a607SDon Lewis],,)
5957aa0a607SDon LewisAC_ARG_WITH(system-boost,
5967aa0a607SDon Lewis[  --with-system-boost     Use boost already on system
5977aa0a607SDon Lewis],,)
5987aa0a607SDon LewisAC_ARG_WITH(system-mdds,
5997aa0a607SDon Lewis[  --with-system-mdds      Use mdds already on system
6007aa0a607SDon Lewis],,)
6017aa0a607SDon LewisAC_ARG_WITH(system-vigra,
6027aa0a607SDon Lewis[  --with-system-vigra     Use vigra already on system
6037aa0a607SDon Lewis],,)
6047aa0a607SDon LewisAC_ARG_ENABLE(hunspell,
6057aa0a607SDon Lewis[  --enable-hunspell       Determines whether to enable the Hunspell library.
6067aa0a607SDon Lewis                          If enabled, the library will be built unless you
6077aa0a607SDon Lewis                          specify --with-system-hunspell to use the library
6087aa0a607SDon Lewis                          already present on your system.
6097aa0a607SDon Lewis                          If disabled, the Spell Checking component will also
6107aa0a607SDon Lewis                          be disabled.
6117aa0a607SDon Lewis                          (Default: hunspell disabled)
6127aa0a607SDon Lewis],,enable_hunspell=no)
6137aa0a607SDon LewisAC_ARG_WITH(system-hunspell,
6147aa0a607SDon Lewis[  --with-system-hunspell  Use libhunspell already on system
6157aa0a607SDon Lewis],,)
6167aa0a607SDon LewisAC_ARG_WITH(system-mythes,
6177aa0a607SDon Lewis[  --with-system-mythes    Use mythes already on system
6187aa0a607SDon Lewis],,)
6197aa0a607SDon LewisAC_ARG_ENABLE(hyphen,
6207aa0a607SDon Lewis[  --enable-hyphen         Determines whether to enable the Hyphen library.
6217aa0a607SDon Lewis                          If enabled, the library will be built unless you
6227aa0a607SDon Lewis                          specify --with-system-hyphen to use the library
6237aa0a607SDon Lewis                          already present on your system.
6247aa0a607SDon Lewis                          If disabled, the Hyphenator component will also
6257aa0a607SDon Lewis                          be disabled.
6267aa0a607SDon Lewis                          (Default: hyphen disabled)
6277aa0a607SDon Lewis],,enable_hyphen=no)
6287aa0a607SDon LewisAC_ARG_WITH(system-hyphen,
6297aa0a607SDon Lewis[  --with-system-hyphen    Use libhypeh already on system
6307aa0a607SDon Lewis],,)
6317aa0a607SDon LewisAC_ARG_WITH(system-libtextcat,
6327aa0a607SDon Lewis[  --with-system-libtextcat      Use libtextcat already on system
6337aa0a607SDon Lewis],,)
6347aa0a607SDon LewisAC_ARG_WITH(external-libtextcat-data,
6357aa0a607SDon Lewis[  --with-system-libtextcat-data Use libtextcat data already on system
6367aa0a607SDon Lewis],,)
6377aa0a607SDon LewisAC_ARG_WITH(system-cppunit,
6387aa0a607SDon Lewis[  --with-system-cppunit         Use cppunit already on system
6397aa0a607SDon Lewis],,)
6407aa0a607SDon LewisAC_ARG_WITH(system-redland,
6417aa0a607SDon Lewis[  --with-system-redland   Use redland library already on system
6427aa0a607SDon Lewis],,)
6437aa0a607SDon LewisAC_ARG_WITH(stlport,
6447aa0a607SDon Lewis[  --with-stlport         Only building --without-stlport is supported.
6457aa0a607SDon Lewis], WITH_STLPORT=$withval , WITH_STLPORT=no)
6467aa0a607SDon LewisAC_ARG_WITH(jdk-home,
6477aa0a607SDon Lewis[  --with-jdk-home         if you have installed JDK 1.3 or later on your system
6487aa0a607SDon Lewis                          please supply the path here.
6497aa0a607SDon Lewis                          Note that this is not the location of the Java binary
6507aa0a607SDon Lewis                          but the location of the entire distribution.
6517aa0a607SDon Lewis
6527aa0a607SDon Lewis                          Usage: --with-jdk-home=<absolute path to JDK home>
6537aa0a607SDon Lewis],,)
6547aa0a607SDon LewisAC_ARG_WITH(gxx_include_path,
6557aa0a607SDon Lewis[  --with-gxx-include-path if you want to override the autodetected g++ include
6567aa0a607SDon Lewis                          path.
6577aa0a607SDon Lewis
6587aa0a607SDon Lewis                          Usage: --with-gxx-include-path=<absolute path to g++ include dir>
6597aa0a607SDon Lewis],,)
6607aa0a607SDon LewisAC_ARG_WITH(java,
6617aa0a607SDon Lewis[  --with-java             Build with[[out]] Java support.  If you use
6627aa0a607SDon Lewis                          --without-java/--with-java=no then the build will have
6637aa0a607SDon Lewis                          no support for Java components, applets, accessibility
6647aa0a607SDon Lewis                          or XML filters.
6657aa0a607SDon Lewis], if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi, WITH_JAVA=java)
6667aa0a607SDon LewisAC_ARG_ENABLE(gcjaot,
6677aa0a607SDon Lewis[  --enable-gcjaot         Build with[[out]] using Ahead of Time java compilation
6687aa0a607SDon Lewis                          support to speed up buildsi by compiling the jars also
6697aa0a607SDon Lewis                          to native code..
6707aa0a607SDon Lewis                          --enable-gcjaot is only known to work with bytecode
6717aa0a607SDon Lewis                          created with gcj or ecj
6727aa0a607SDon Lewis],,)
6737aa0a607SDon LewisAC_ARG_WITH(ant-home,
6747aa0a607SDon Lewis[  --with-ant-home         If you have installed Jakarta Ant on your system,
6757aa0a607SDon Lewis                          please supply the path here.
6767aa0a607SDon Lewis                          Note that this is not the location of the Ant binary
6777aa0a607SDon Lewis                          but the location of the entire distribution.
6787aa0a607SDon Lewis
6797aa0a607SDon Lewis                          Usage: --with-ant-home=<absolute path to Ant home>
6807aa0a607SDon Lewis],,)
6817aa0a607SDon LewisAC_ARG_WITH(junit,
6827aa0a607SDon Lewis[  --with-junit            Specifies the JUnit 4 jar file to use for JUnit-based
6837aa0a607SDon Lewis                          tests.  --without-junit disables those tests.  Not
6847aa0a607SDon Lewis                          relevant in the --without-java case.
6857aa0a607SDon Lewis
6867aa0a607SDon Lewis                          Usage: --with-junit=<absolute path to JUnit 4 jar>
6877aa0a607SDon Lewis],,with_junit=yes)
6887aa0a607SDon LewisAC_ARG_WITH(perl-home,
6897aa0a607SDon Lewis[  --with-perl-home        If you have installed the Perl 5 Distribution, on your
6907aa0a607SDon Lewis                          system, please supply the path here.
6917aa0a607SDon Lewis                          Note that this is not the location of the Perl binary
6927aa0a607SDon Lewis                          but the location of the entire distribution.
6937aa0a607SDon Lewis
6947aa0a607SDon Lewis                          Usage: --with-perl-home=<absolute path to Perl 5 home>
6957aa0a607SDon Lewis],,)
6967aa0a607SDon LewisAC_ARG_WITH(cl-home,
6977aa0a607SDon Lewis[  --with-cl-home          For Windows NT users, please supply the path
6987aa0a607SDon Lewis                          for the Microsoft C/C++ compiler.
6997aa0a607SDon Lewis                          Note that this is not the location of the compiler
7007aa0a607SDon Lewis                          binary but the location of the entire distribution.
7017aa0a607SDon Lewis
7027aa0a607SDon Lewis                          Usage: --with-cl-home=<absolute path to Microsoft C/C++ compiler home>
7037aa0a607SDon Lewis],,)
7047aa0a607SDon LewisAC_ARG_WITH(mspdb-path,
7057aa0a607SDon Lewis[  --with-mspdb-path       For Microsoft C/C++ compiler users, please supply the
7067aa0a607SDon Lewis                          path pointing to the mspdb71.dll (.NET 2003).
7077aa0a607SDon Lewis
7087aa0a607SDon Lewis                          Usage: --with-mspdb-path=<absolute path to mspdb71.dll>
7097aa0a607SDon Lewis],,)
7107aa0a607SDon LewisAC_ARG_WITH(midl-path,
7117aa0a607SDon Lewis[  --with-midl-path        For Microsoft C/C++ .NET compiler users, please supply
7127aa0a607SDon Lewis                          the path pointing to the midl.exe.
7137aa0a607SDon Lewis
7147aa0a607SDon Lewis                          Usage: --with-midl-path=<absolute path to midl.exe>
7157aa0a607SDon Lewis],,)
7167aa0a607SDon LewisAC_ARG_WITH(csc-path,
7177aa0a607SDon Lewis[  --with-csc-path         For Microsoft C/C++ .NET compiler users, please supply
7187aa0a607SDon Lewis                          the path pointing to the csc.exe.
7197aa0a607SDon Lewis
7207aa0a607SDon Lewis                          Usage: --with-csc-path=<absolute path to csc.exe>
7217aa0a607SDon Lewis],,)
7227aa0a607SDon LewisAC_ARG_WITH(nsis-path,
7237aa0a607SDon Lewis[  --with-nsis-path        For Windows users, please supply the path to the
7247aa0a607SDon Lewis                          "Nullsoft Scriptable Install System" (NSIS). If NSIS
7257aa0a607SDon Lewis                          is found in the path or this option is supplied a self
7267aa0a607SDon Lewis                          contained executable installer for Apache OpenOffice
7277aa0a607SDon Lewis                          will be created.
7287aa0a607SDon Lewis
7297aa0a607SDon Lewis                          Usage: --with-nsis-path=<absolute path to nsis.exe>
7307aa0a607SDon Lewis],,)
7317aa0a607SDon LewisAC_ARG_WITH(frame-home,
7327aa0a607SDon Lewis[  --with-frame-home       For Microsoft C/C++ .NET compiler users, please supply
7337aa0a607SDon Lewis                          the path pointing to lib/mscoree.lib, usually
7347aa0a607SDon Lewis                          something like:
7357aa0a607SDon Lewis                          "/cygdrive/c/Program Files/Microsoft Visual Studio .NET/FrameworkSDK"
7367aa0a607SDon Lewis
7377aa0a607SDon Lewis                          MS Visual Toolkit compiler users, please supply the
7387aa0a607SDon Lewis                          path pointing to lib/msvcrt.lib, usually something
7397aa0a607SDon Lewis                          like:
7407aa0a607SDon Lewis                          "/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Vc7"
7417aa0a607SDon Lewis
7427aa0a607SDon Lewis                          Usage: --with-frame-home=<absolute path to Framework SDK [[home]]>
7437aa0a607SDon Lewis],,)
7447aa0a607SDon LewisAC_ARG_WITH(psdk-home,
7457aa0a607SDon Lewis[  --with-psdk-home        For Windows users, please supply the path to the
7467aa0a607SDon Lewis                          Microsoft Platform SDK.
7477aa0a607SDon Lewis
7487aa0a607SDon Lewis                          Usage: --with-psdk-home=<absolute path to Microsoft Platform SDK>
7497aa0a607SDon Lewis],,)
7507aa0a607SDon LewisAC_ARG_WITH(directx-home,
7517aa0a607SDon Lewis[  --with-directx-home     For Windows users, please supply the path to the
7527aa0a607SDon Lewis                          Microsoft DirectX SDK.
7537aa0a607SDon Lewis
7547aa0a607SDon Lewis                          Usage: --with-directx-home=<absolute path to Microsoft DirectX SDK>
7557aa0a607SDon Lewis],,)
7567aa0a607SDon LewisAC_ARG_WITH(mozilla-build,
7577aa0a607SDon Lewis[  --with-mozilla-build    For Windows users, please supply the path to the
7587aa0a607SDon Lewis                          mozilla build tools.
7597aa0a607SDon Lewis
7607aa0a607SDon Lewis                          Usage: --with-mozilla-build=<absolute path to mozilla build tools>
7617aa0a607SDon Lewis
7627aa0a607SDon Lewis						  At the moment of this writing, an installer for the mozilla build tools
7637aa0a607SDon Lewis						  can be obtained from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
7647aa0a607SDon Lewis],[MOZILLABUILD=$withval],)
7657aa0a607SDon LewisAC_ARG_WITH(local-solenv,
7667aa0a607SDon Lewis[  --with-local-solenv     If you have solenv in a location other than ./solenv,
7677aa0a607SDon Lewis                          please supply the path here.
7687aa0a607SDon Lewis
7697aa0a607SDon Lewis                          Usage: --with-local-solenv=<absolute path to solenv>
7707aa0a607SDon Lewis],,)
7717aa0a607SDon LewisAC_ARG_WITH(local-solver,
7727aa0a607SDon Lewis[  --with-local-solver     if you have solver in a location other than ./solver,
7737aa0a607SDon Lewis                          please supply the path here.
7747aa0a607SDon Lewis
7757aa0a607SDon Lewis                          Usage: --with-local-solver=<absolute path to solver>
7767aa0a607SDon Lewis],,)
7777aa0a607SDon LewisAC_ARG_ENABLE(javascript,
7787aa0a607SDon Lewis[  --disable-javascript    Disables support for JavaScript macros.
7797aa0a607SDon Lewis],,)
7807aa0a607SDon LewisAC_ARG_WITH(system-apr,
7817aa0a607SDon Lewis[  --with-system-apr       Use apr library already installed on the system
7827aa0a607SDon Lewis],,)
7837aa0a607SDon LewisAC_ARG_WITH(system-apr-util,
7847aa0a607SDon Lewis[  --with-system-apr-util  Use apr-util library already installed on the system
7857aa0a607SDon Lewis],,)
7867aa0a607SDon LewisAC_ARG_WITH(system-serf,
7877aa0a607SDon Lewis[  --with-system-serf      Use serf library already installed on the system
7887aa0a607SDon Lewis],,)
7897aa0a607SDon LewisAC_ARG_WITH(system-coinmp,
7907aa0a607SDon Lewis[  --with-system-coinmp    Use CoinMP library already installed on the system
7917aa0a607SDon Lewis],,)
7927aa0a607SDon LewisAC_ARG_ENABLE(coinmp,
7937aa0a607SDon Lewis[  --disable-coinmp        Do not use CoinMP as the Calc solver.
7947aa0a607SDon Lewis],,)
7957aa0a607SDon LewisAC_ARG_ENABLE(check-only,
7967aa0a607SDon Lewis[  --enable-check-only     Use this option option if you just want to check your
7977aa0a607SDon Lewis                          environment.  This option stops the generation of an
7987aa0a607SDon Lewis                          ????env.set
7997aa0a607SDon Lewis
8007aa0a607SDon Lewis                          Usage: --enable-check-only=yes
8017aa0a607SDon Lewis],,)
8027aa0a607SDon LewisAC_ARG_ENABLE(ccache-skip,
8037aa0a607SDon Lewis[[  --enable-ccache-skip    [default=auto] allow the use of --ccache-skip to
8047aa0a607SDon Lewis                          escape compiler flags that would otherwise prevent
8057aa0a607SDon Lewis                          caching of the result (currently used on Mac only)
8067aa0a607SDon Lewis                          NOTE: requires patched version because of a bug in
8077aa0a607SDon Lewis                          ccache (see issue 104567 for details and patch)
8087aa0a607SDon Lewis                          explicitly enable if your version of ccache does not
8097aa0a607SDon Lewis                          identify as version 2.4_OOo
8107aa0a607SDon Lewis]],,enable_ccache_skip=auto)
8117aa0a607SDon LewisAC_ARG_WITH(lang,
8127aa0a607SDon Lewis[  --with-lang             Use this option to build Apache OpenOffice with
8137aa0a607SDon Lewis                          additional language support. English (US) is always
8147aa0a607SDon Lewis                          included by default. Separate multiple languages with
8157aa0a607SDon Lewis                          space. For all languages, use --with-lang=ALL.
8167aa0a607SDon Lewis
8177aa0a607SDon Lewis                          Usage: --with-lang="es sw tu cs sk"
8187aa0a607SDon Lewis],,)
8197aa0a607SDon LewisAC_ARG_WITH(poor-help-localizations,
8207aa0a607SDon Lewis[  --with-poor-help-localizations
8217aa0a607SDon Lewis                           Use this option to specify which languages have
8227aa0a607SDon Lewis                          unusable help localizations. Separate multiple
8237aa0a607SDon Lewis                          languages with space.
8247aa0a607SDon Lewis
8257aa0a607SDon Lewis                          Usage: --with-poor-help-localizations="af ar be-BY ca"
8267aa0a607SDon Lewis],,)
8277aa0a607SDon LewisAC_ARG_WITH(dict,
8287aa0a607SDon Lewis[  --with-dict             Use this option to build Apache OpenOffice with
8297aa0a607SDon Lewis                          dictionary support. ALL dictionaries are always
8307aa0a607SDon Lewis                          included by default unless overridden with
8317aa0a607SDon Lewis                          this option. Separate multiple dictionaries with
8327aa0a607SDon Lewis                          commas. For all dictionaries, use --with-dict=ALL.
8337aa0a607SDon Lewis
8347aa0a607SDon Lewis                          Usage: --with-dict=ENGB,ENUS,ITIT
8357aa0a607SDon Lewis],,)
8367aa0a607SDon LewisAC_ARG_WITH(intro-bitmaps,
8377aa0a607SDon Lewis[  --with-intro-bitmaps    Prefer the specified intro bitmaps over the
8387aa0a607SDon Lewis                          the default one.  Can be more than one (separated by
8397aa0a607SDon Lewis                          commas), the order means priority of fallback if the
8407aa0a607SDon Lewis                          first does not exist (in the installed tree).
8417aa0a607SDon Lewis
8427aa0a607SDon Lewis                          Usage: --with-intro-bitmaps=/path/my_ooo_intro.png
8437aa0a607SDon Lewis],,)
8447aa0a607SDon LewisAC_ARG_WITH(about-bitmaps,
8457aa0a607SDon Lewis[  --with-about-bitmaps    Similarly to --with-intro-bitmaps, this allows
8467aa0a607SDon Lewis                          specification of bitmaps for the About box.
8477aa0a607SDon Lewis
8487aa0a607SDon Lewis                          Usage: --with-about-bitmaps=/path/my_ooo_about.png
8497aa0a607SDon Lewis],,)
8507aa0a607SDon LewisAC_ARG_WITH(vendor,
8517aa0a607SDon Lewis[  --with-vendor           Set vendor of the build.
8527aa0a607SDon Lewis
8537aa0a607SDon Lewis                          Usage: --with-vendor="John the Builder"
8547aa0a607SDon Lewis],,)
8557aa0a607SDon LewisAC_ARG_WITH(unix-wrapper,
8567aa0a607SDon Lewis[  --with-unix-wrapper    Redefines the name of the UNIX wrapper that will be used
8577aa0a607SDon Lewis                          in the desktop files and in the desktop-integration RPMs.
8587aa0a607SDon Lewis
8597aa0a607SDon Lewis                          Usage: --with-unix-wrapper=ooffice
8607aa0a607SDon Lewis],,)
8617aa0a607SDon LewisAC_ARG_WITH(asm-home,
8627aa0a607SDon Lewis[  --with-asm-home         For Windows users, please supply the path for the
8637aa0a607SDon Lewis                          ml.exe assembler.
8647aa0a607SDon Lewis
8657aa0a607SDon Lewis                          Usage: --with-asm-home=<path to ml.exe directory>
8667aa0a607SDon Lewis],,)
8677aa0a607SDon LewisAC_ARG_WITH(nasm-home,
8687aa0a607SDon Lewis[  --with-nasm-home        For Windows users, please supply the path for the
8697aa0a607SDon Lewis                          nasm.exe assembler.
8707aa0a607SDon Lewis
8717aa0a607SDon Lewis                          Usage: --with-nasm-home=<path to nasm.exe directory>
8727aa0a607SDon Lewis],,)
8737aa0a607SDon LewisAC_ARG_WITH(os-version,
8747aa0a607SDon Lewis[  --with-os-version       For FreeBSD users, use this option option to override
8757aa0a607SDon Lewis                          the detected OSVERSION.
8767aa0a607SDon Lewis
8777aa0a607SDon Lewis                          Usage: --with-os-version=<OSVERSION>
8787aa0a607SDon Lewis],,)
8797aa0a607SDon LewisAC_ARG_WITH(unzip-home,
8807aa0a607SDon Lewis[  --with-unzip-home       Deprecated: use --with-zip-home instead],,)
8817aa0a607SDon LewisAC_ARG_WITH(zip-home,
8827aa0a607SDon Lewis[  --with-zip-home         If you use a non standard zip, for example windows
8837aa0a607SDon Lewis                          please supply the path for zip
8847aa0a607SDon Lewis
8857aa0a607SDon Lewis                          Usage: --with-zip-home=<path to zip executable>
8867aa0a607SDon Lewis],,)
8877aa0a607SDon LewisAC_ARG_WITH(mingwin,
8887aa0a607SDon Lewis[  --with-mingwin          For Windows users, use the mingwin32 compiler within
8897aa0a607SDon Lewis                          cygwin environment
8907aa0a607SDon Lewis
8917aa0a607SDon Lewis                          Usage: --with-mingwin=yes
8927aa0a607SDon Lewis
8937aa0a607SDon Lewis                          For !Windows use, use the mingw32 C++ compiler to
8947aa0a607SDon Lewis                          (re-) build unowinreg.dll. Specify the MinGW C++
8957aa0a607SDon Lewis                          Compilers name.
8967aa0a607SDon Lewis
8977aa0a607SDon Lewis                          Usage: --with-mingwin=i586-mingw32msvc-g++
8987aa0a607SDon Lewis],WITH_MINGWIN=$withval,WITH_MINGWIN=0)
8997aa0a607SDon LewisAC_ARG_WITH(build-version,
9007aa0a607SDon Lewis[  --with-build-version    Allows the builder to add a custom version tag
9017aa0a607SDon Lewis                          that will appear in the Help/About box for QA
9027aa0a607SDon Lewis                          purposes.
9037aa0a607SDon Lewis
9047aa0a607SDon Lewis                          Usage: --with-build-version="Built by Jim"
9057aa0a607SDon Lewis],with_build_version=$withval)
9067aa0a607SDon LewisAC_ARG_WITH(alloc,
9077aa0a607SDon Lewis[  --with-alloc            Define which allocator to build with
9087aa0a607SDon Lewis                          (choices are oo, system, tcmalloc, jemalloc)
9097aa0a607SDon Lewis
9107aa0a607SDon Lewis                          Note that on FreeBSD/NetBSD system==jemalloc
9117aa0a607SDon Lewis],,)
9127aa0a607SDon LewisAC_ARG_ENABLE(verbose,
9137aa0a607SDon Lewis[  --enable-verbose        Increase build verbosity.
9147aa0a607SDon Lewis  --disable-verbose       Decrease build verbosity.
9157aa0a607SDon Lewis],,)
9167aa0a607SDon LewisAC_ARG_ENABLE(dependency-tracking,
9177aa0a607SDon Lewis[  --disable-dependency-tracking  Disables generation of dependency information.
9187aa0a607SDon Lewis],,)
9197aa0a607SDon LewisAC_ARG_ENABLE(category-b,
9207aa0a607SDon Lewis[  --enable-category-b     Activate components under a category B license
9217aa0a607SDon Lewis                          (see http://www.apache.org/legal/3party.html#category-b):
9227aa0a607SDon Lewis                          MPL (seamonkey, hunspell, hyphen, nss, saxon, rhino),
9237aa0a607SDon Lewis                          CPL (silgraphite), CPL/EPL (CoinMP), SPL (beanshell),
9247aa0a607SDon Lewis                          OFL (fonts).
9257aa0a607SDon Lewis                          Flags for individual libraries override this one.
9267aa0a607SDon Lewis],,)
9277aa0a607SDon LewisAC_ARG_WITH(arm-target,
9287aa0a607SDon Lewis[  --arm-target            The minimal targeted arm processor
9297aa0a607SDon Lewis                              used for the build environment.
9307aa0a607SDon Lewis                              Cases :
9317aa0a607SDon Lewis                                arm-target < 6 : armv4t compatibility
9327aa0a607SDon Lewis                                arm-target = 6 : exact armv6 compatibility
9337aa0a607SDon Lewis                                arm-target > 6 : armv7-a compatibility
9347aa0a607SDon Lewis
9357aa0a607SDon Lewis                              Usage: --with-arm-target=7
9367aa0a607SDon Lewis],with_arm_target=$withval,with_arm_target=4)
9377aa0a607SDon LewisAC_ARG_WITH(rat-scan,
9387aa0a607SDon Lewis[  --with-rat-scan         Scan source code for license headers.
9397aa0a607SDon Lewis                          Use as --with-rat-scan to automatically download pre-built Rat binaries.
9407aa0a607SDon Lewis                          Alternatively use as --with-rat-scan=<path-to-rat-direcetory> to use
9417aa0a607SDon Lewis                          a separately installed library.
9427aa0a607SDon Lewis],with_rat_scan=$withval,)
9437aa0a607SDon Lewis
9447aa0a607SDon LewisBUILD_TYPE="OOo"
9457aa0a607SDon LewisADDITIONAL_REPOSITORIES="../ext_libraries"
9467aa0a607SDon LewisSCPDEFS=""
9477aa0a607SDon Lewis
9487aa0a607SDon Lewisdnl ===================================================================
9497aa0a607SDon Lewisdnl Check configure script vs. configure.in
9507aa0a607SDon Lewisdnl ===================================================================
9517aa0a607SDon LewisAC_MSG_CHECKING([whether configure is up-to-date])
9527aa0a607SDon Lewisif test "configure" -ot "configure.in"; then
9537aa0a607SDon Lewis   AC_MSG_RESULT([no])
9547aa0a607SDon Lewis   AC_MSG_ERROR([configure is not up-to-date, run autoconf first!])
9557aa0a607SDon Lewiselse
9567aa0a607SDon Lewis   AC_MSG_RESULT([yes])
9577aa0a607SDon Lewisfi
9587aa0a607SDon Lewisdnl ===================================================================
9597aa0a607SDon Lewisdnl Message.
9607aa0a607SDon Lewisdnl ===================================================================
9617aa0a607SDon Lewisecho "********************************************************************"
9627aa0a607SDon Lewisecho "*                                                                  *"
9637aa0a607SDon Lewisecho "*   Apache OpenOffice build configuration.                         *"
9647aa0a607SDon Lewisecho "*                                                                  *"
9657aa0a607SDon Lewisecho "*   The configure process checks your platform to see whether      *"
9667aa0a607SDon Lewisecho "*   you can build Apache OpenOffice on it.                         *"
9677aa0a607SDon Lewisecho "*   This process checks all pre-requisites and generates a file    *"
9687aa0a607SDon Lewisecho "*   containing the necessary environment variables.                *"
9697aa0a607SDon Lewisecho "*   Source this file after configure has ended successfully.       *"
9707aa0a607SDon Lewisecho "*                                                                  *"
9717aa0a607SDon Lewisecho "*   Warnings that are generated during the configure process       *"
9727aa0a607SDon Lewisecho "*   must be taken into account since it can be a reason for        *"
9737aa0a607SDon Lewisecho "*   an unsuccessful build of Apache OpenOffice.                    *"
9747aa0a607SDon Lewisecho "*                                                                  *"
9757aa0a607SDon Lewisecho "********************************************************************"
9767aa0a607SDon Lewisecho ""
9777aa0a607SDon Lewisecho "********************************************************************"
9787aa0a607SDon Lewisecho "*                                                                  *"
9797aa0a607SDon Lewisecho "*   Checking the platform pre-requisites.                          *"
9807aa0a607SDon Lewisecho "*                                                                  *"
9817aa0a607SDon Lewisecho "********************************************************************"
9827aa0a607SDon Lewisecho ""
9837aa0a607SDon Lewisdnl ===================================================================
9847aa0a607SDon Lewisdnl Configure pre-requisites.
9857aa0a607SDon Lewisdnl ===================================================================
9867aa0a607SDon Lewiscat /dev/null > warn
9877aa0a607SDon Lewis
9887aa0a607SDon LewisAC_PROG_EGREP
9897aa0a607SDon LewisAC_PROG_AWK
9907aa0a607SDon LewisAC_PATH_PROG( AWK, $AWK)
9917aa0a607SDon Lewisif test -z "$AWK"; then
9927aa0a607SDon Lewis   AC_MSG_ERROR([install awk to run this script])
9937aa0a607SDon Lewisfi
9947aa0a607SDon Lewis
9957aa0a607SDon LewisAC_PATH_PROGS(SED, sed )
9967aa0a607SDon Lewisif test -z "$SED"; then
9977aa0a607SDon Lewis   AC_MSG_ERROR([install sed to run this script])
9987aa0a607SDon Lewisfi
9997aa0a607SDon Lewis
10007aa0a607SDon LewisAC_MSG_CHECKING([for solenv environment])
10017aa0a607SDon Lewisif test -z "$with_local_solenv"; then
10027aa0a607SDon Lewis   LOCAL_SOLENV="DEFAULT"
10037aa0a607SDon Lewis   AC_MSG_RESULT([default])
10047aa0a607SDon Lewiselse
10057aa0a607SDon Lewis   LOCAL_SOLENV=$with_local_solenv
10067aa0a607SDon Lewis   AC_MSG_RESULT([$with_local_solenv])
10077aa0a607SDon Lewisfi
10087aa0a607SDon LewisAC_SUBST(LOCAL_SOLENV)
10097aa0a607SDon Lewis
10107aa0a607SDon Lewisif test "$LOCAL_SOLENV" = "DEFAULT"; then
10117aa0a607SDon Lewis  _solenv="./solenv"
10127aa0a607SDon Lewiselse
10137aa0a607SDon Lewis  _solenv="$LOCAL_SOLENV"
10147aa0a607SDon Lewisfi
10157aa0a607SDon LewisAC_SUBST(_solenv)
10167aa0a607SDon Lewis
10177aa0a607SDon Lewisif test -e $_solenv/inc/minor.mk; then
10187aa0a607SDon Lewis   # Get UPD number from ./solenv/inc/minor.mk
10197aa0a607SDon Lewis   UPD="`grep RSCVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`"
10207aa0a607SDon Lewis   AC_SUBST(UPD)
10217aa0a607SDon Lewis   SOURCEVERSION="`grep SOURCEVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`"
10227aa0a607SDon Lewis   AC_SUBST(SOURCEVERSION)
10237aa0a607SDon Lewiselse
10247aa0a607SDon Lewis   AC_MSG_ERROR([$_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation...])
10257aa0a607SDon Lewisfi
10267aa0a607SDon Lewis
10277aa0a607SDon Lewis
10287aa0a607SDon Lewisdnl ==================================================================
10297aa0a607SDon Lewisdnl Checks for custom pack.lst
10307aa0a607SDon Lewisdnl ==================================================================
10317aa0a607SDon LewisAC_MSG_CHECKING([for custom pack.lst])
10327aa0a607SDon LewisCUSTOM_PACK_LIST=
10337aa0a607SDon LewisUSE_PACKAGER=
10347aa0a607SDon Lewisif test -n "$with_packager_list" ; then
10357aa0a607SDon Lewis    if test -e $with_packager_list; then
10367aa0a607SDon Lewis      CUSTOM_PACK_LIST=$with_packager_list
10377aa0a607SDon Lewis      USE_PACKAGER=YES
10387aa0a607SDon Lewis    fi
10397aa0a607SDon Lewisfi
10407aa0a607SDon Lewisif test -n "$CUSTOM_PACK_LIST"; then
10417aa0a607SDon Lewis   AC_MSG_RESULT([$CUSTOM_PACK_LIST])
10427aa0a607SDon Lewiselse
10437aa0a607SDon Lewis   AC_MSG_RESULT([no])
10447aa0a607SDon Lewisfi
10457aa0a607SDon LewisAC_SUBST(CUSTOM_PACK_LIST)
10467aa0a607SDon LewisAC_SUBST(USE_PACKAGER)
10477aa0a607SDon Lewis
10487aa0a607SDon Lewis
10497aa0a607SDon Lewisdnl ===================================================================
10507aa0a607SDon Lewisdnl Checks for the operating system and processor.
10517aa0a607SDon Lewisdnl ===================================================================
10527aa0a607SDon LewisAC_CANONICAL_SYSTEM
10537aa0a607SDon Lewisif test "$build" != "$host" -o "$build" != "$target" \
10547aa0a607SDon Lewis  -o "$host" != "$target"; then
10557aa0a607SDon Lewis	AC_MSG_WARN([cross-compiling by any means is not supported (yet)!])
10567aa0a607SDon Lewis	echo "cross-compiling by any means is not supported (yet)!" >> warn
10577aa0a607SDon Lewisfi
10587aa0a607SDon Lewis
10597aa0a607SDon Lewisif echo "$build_os" | grep cygwin; then
10607aa0a607SDon Lewis   AC_MSG_CHECKING([Cygwin version])
10617aa0a607SDon Lewis   CygwinVer=`uname -r`
10627aa0a607SDon Lewis   AC_MSG_RESULT([$CygwinVer])
10637aa0a607SDon Lewis   if test "`echo $CygwinVer | $AWK -F . '{ print $1$2 }'`" -lt "15"; then
10647aa0a607SDon Lewis      AC_MSG_ERROR([You need at least Cygwin V1.5.x])
10657aa0a607SDon Lewis   fi
10667aa0a607SDon Lewiselse
10677aa0a607SDon Lewis   CygwinVer="false"
10687aa0a607SDon Lewisfi
10697aa0a607SDon Lewis
10707aa0a607SDon Lewis# get info about the system provided release/version details
10717aa0a607SDon Lewishead /etc/*-release
10727aa0a607SDon Lewisuname -a
10737aa0a607SDon Lewis
10747aa0a607SDon Lewisdnl ===================================================================
10757aa0a607SDon Lewisdnl The following is a list of supported systems.
10767aa0a607SDon Lewisdnl Sequential to keep the logic very simple
10777aa0a607SDon Lewisdnl These values may be checked and reset later.
10787aa0a607SDon Lewisdnl ===================================================================
10797aa0a607SDon Lewiscase "$build_os" in
10807aa0a607SDon Lewis	solaris*)
10817aa0a607SDon Lewis		test_gtk=yes
10827aa0a607SDon Lewis		test_cairo=yes
10837aa0a607SDon Lewis		test_kde=yes
10847aa0a607SDon Lewis		test_cups=yes
10857aa0a607SDon Lewis        	test_randr=yes
10867aa0a607SDon Lewis		test_freetype=yes
10877aa0a607SDon Lewis        	test_gstreamer=yes
10887aa0a607SDon Lewis		_os=SunOS
10897aa0a607SDon Lewis		AC_PATH_PROG( GNUTAR, gtar,,$PATH:/usr/sfw/bin)
10907aa0a607SDon Lewis		if test -z "$GNUTAR"; then
10917aa0a607SDon Lewis			AC_MSG_ERROR([gtar (gnu tar) not found but needed. Install it (SUN Freeware package).])
10927aa0a607SDon Lewis		fi
10937aa0a607SDon Lewis		AC_SUBST(GNUTAR)
10947aa0a607SDon Lewis
10957aa0a607SDon Lewis		dnl ===========================================================
10967aa0a607SDon Lewis		dnl check whether we're using solaris 6,7,8 - sparc or intel.
10977aa0a607SDon Lewis		dnl ===========================================================
10987aa0a607SDon Lewis   		AC_MSG_CHECKING([the Solaris operating system release])
10997aa0a607SDon Lewis   		_os_release=`echo $build_os | $SED -e s/solaris2\.//`
11007aa0a607SDon Lewis		if test "$_os_release" -lt "6"; then
11017aa0a607SDon Lewis      			AC_MSG_ERROR([use solaris >= 6 to build Apache OpenOffice])
11027aa0a607SDon Lewis   		else
11037aa0a607SDon Lewis      			AC_MSG_RESULT([ok ($_os_release)])
11047aa0a607SDon Lewis   		fi
11057aa0a607SDon Lewis
11067aa0a607SDon Lewis   		dnl check whether we're using a sparc or i386 processor
11077aa0a607SDon Lewis   		AC_MSG_CHECKING([the processor type])
11087aa0a607SDon Lewis   		if test "$build_cpu" = "sparc" -o "$build_cpu" = "i386"; then
11097aa0a607SDon Lewis      			AC_MSG_RESULT([ok ($build_cpu)])
11107aa0a607SDon Lewis   		else
11117aa0a607SDon Lewis      			AC_MSG_ERROR([only sparc and i386 processors are supported])
11127aa0a607SDon Lewis   		fi
11137aa0a607SDon Lewis		;;
11147aa0a607SDon Lewis	linux-gnu*|k*bsd*-gnu*)
11157aa0a607SDon Lewis		test_gtk=yes
11167aa0a607SDon Lewis		test_cairo=yes
11177aa0a607SDon Lewis		test_kde=yes
11187aa0a607SDon Lewis		test_kde4=yes
11197aa0a607SDon Lewis		test_cups=yes
11207aa0a607SDon Lewis        	test_randr=yes
11217aa0a607SDon Lewis		test_freetype=yes
11227aa0a607SDon Lewis        	test_gstreamer=yes
11237aa0a607SDon Lewis        	_os=Linux
11247aa0a607SDon Lewis		;;
11257aa0a607SDon Lewis	gnu)
11267aa0a607SDon Lewis		test_cups=no
11277aa0a607SDon Lewis		_os=GNU
11287aa0a607SDon Lewis		;;
11297aa0a607SDon Lewis	cygwin*) # Windows
11307aa0a607SDon Lewis		test_cups=no
11317aa0a607SDon Lewis		test_cairo=yes
11327aa0a607SDon Lewis		test_freetype=no
11337aa0a607SDon Lewis        	test_gstreamer=no
11347aa0a607SDon Lewis		_os=WINNT
11357aa0a607SDon Lewis		;;
11367aa0a607SDon Lewis	darwin*) # Mac OS X
11377aa0a607SDon Lewis		test_cups=yes
11387aa0a607SDon Lewis		test_gtk=yes
11397aa0a607SDon Lewis		test_cairo=yes
11407aa0a607SDon Lewis        	test_randr=no
11417aa0a607SDon Lewis		test_freetype=no
11427aa0a607SDon Lewis        	test_gstreamer=no
11437aa0a607SDon Lewis		_os=Darwin
11447aa0a607SDon Lewis      		if test "$enable_systray" = "yes" && test "$enable_gtk" != "no"; then
11457aa0a607SDon Lewis         	   AC_MSG_WARN([Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray])
11467aa0a607SDon Lewis         	   echo "Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >>warn
11477aa0a607SDon Lewis         	   enable_systray=no
11487aa0a607SDon Lewis      		fi
11497aa0a607SDon Lewis		if test ! -n "$CC"; then
11507aa0a607SDon Lewis		   CC="`xcrun -f clang` -arch x86_64"
11517aa0a607SDon Lewis		fi
11527aa0a607SDon Lewis		if test ! -n "$CXX"; then
1153a46ef990SJim Jagielski		   CXX="`xcrun -f clang++` -arch x86_64"
11547aa0a607SDon Lewis		fi
11557aa0a607SDon Lewis		;;
11567aa0a607SDon Lewis	os2*)
11577aa0a607SDon Lewis		test_x=no
11587aa0a607SDon Lewis		test_cups=no
11597aa0a607SDon Lewis        	test_randr=no
11607aa0a607SDon Lewis		test_gtk=no
11617aa0a607SDon Lewis		test_freetype=no
11627aa0a607SDon Lewis        	test_gstreamer=no
11637aa0a607SDon Lewis		_os=OS2
11647aa0a607SDon Lewis		;;
11657aa0a607SDon Lewis	freebsd*)
11667aa0a607SDon Lewis		test_gtk=yes
11677aa0a607SDon Lewis		test_cairo=yes
11687aa0a607SDon Lewis		test_kde=yes
11697aa0a607SDon Lewis		test_kde4=yes
11707aa0a607SDon Lewis		test_cups=yes
11717aa0a607SDon Lewis        	test_randr=yes
11727aa0a607SDon Lewis		test_freetype=yes
11737aa0a607SDon Lewis        	test_gstreamer=yes
11747aa0a607SDon Lewis		AC_MSG_CHECKING([the FreeBSD operating system release])
11757aa0a607SDon Lewis		if test -n "$with_os_version"; then
11767aa0a607SDon Lewis			OSVERSION="$with_os_version"
11777aa0a607SDon Lewis		else
11787aa0a607SDon Lewis			OSVERSION=`/sbin/sysctl -n kern.osreldate`
11797aa0a607SDon Lewis		fi
11807aa0a607SDon Lewis		AC_MSG_RESULT([found OSVERSION=$OSVERSION])
11817aa0a607SDon Lewis		AC_MSG_CHECKING([which thread library to use])
11827aa0a607SDon Lewis		if test "$OSVERSION" -lt "500016"; then
11837aa0a607SDon Lewis			PTHREAD_CFLAGS="-D_THREAD_SAFE"
11847aa0a607SDon Lewis			PTHREAD_LIBS="-pthread"
11857aa0a607SDon Lewis		elif test "$OSVERSION" -lt "502102"; then
11867aa0a607SDon Lewis			PTHREAD_CFLAGS="-D_THREAD_SAFE"
11877aa0a607SDon Lewis			PTHREAD_LIBS="-lc_r"
11887aa0a607SDon Lewis		else
11897aa0a607SDon Lewis			PTHREAD_CFLAGS=""
11907aa0a607SDon Lewis			PTHREAD_LIBS="-pthread"
11917aa0a607SDon Lewis		fi
11927aa0a607SDon Lewis		AC_MSG_RESULT([$PTHREAD_LIBS])
11937aa0a607SDon Lewis		_os=FreeBSD
11947aa0a607SDon Lewis		;;
11957aa0a607SDon Lewis	osf)
11967aa0a607SDon Lewis		test_cups=no
11977aa0a607SDon Lewis        	test_randr=no
11987aa0a607SDon Lewis		_os=OSF1
11997aa0a607SDon Lewis		;;
12007aa0a607SDon Lewis	netbsd)
12017aa0a607SDon Lewis		test_gtk=yes
12027aa0a607SDon Lewis		test_cairo=yes
12037aa0a607SDon Lewis		test_kde=yes
12047aa0a607SDon Lewis		test_kde4=yes
12057aa0a607SDon Lewis		test_cups=no
12067aa0a607SDon Lewis        	test_randr=yes
12077aa0a607SDon Lewis		test_freetype=yes
12087aa0a607SDon Lewis        	test_gstreamer=yes
12097aa0a607SDon Lewis		PTHREAD_CFLAGS="-pthread"
12107aa0a607SDon Lewis		PTHREAD_LIBS="-pthread -lpthread"
12117aa0a607SDon Lewis		_os=NetBSD
12127aa0a607SDon Lewis		;;
12137aa0a607SDon Lewis	aix*)
12147aa0a607SDon Lewis		test_cups=no
12157aa0a607SDon Lewis        	test_randr=no
12167aa0a607SDon Lewis		test_freetype=yes
12177aa0a607SDon Lewis        	test_gstreamer=yes
12187aa0a607SDon Lewis	   	PTHREAD_LIBS=-pthread
12197aa0a607SDon Lewis		echo "AIX is an alpha port --- Use at own risk" >> warn
12207aa0a607SDon Lewis		_os=AIX
12217aa0a607SDon Lewis		;;
12227aa0a607SDon Lewis   *)
12237aa0a607SDon Lewis   AC_MSG_ERROR([$_os operating system is not suitable to build Apache OpenOffice!])
12247aa0a607SDon Lewis   ;;
12257aa0a607SDon Lewisesac
12267aa0a607SDon Lewis
12277aa0a607SDon LewisAC_SUBST(OSVERSION)
12287aa0a607SDon LewisAC_SUBST(PTHREAD_CFLAGS)
12297aa0a607SDon LewisAC_SUBST(PTHREAD_LIBS)
12307aa0a607SDon Lewis
12317aa0a607SDon Lewis
12327aa0a607SDon Lewisdnl Ensure pkg-config is initialized before any possible use
12337aa0a607SDon LewisPKG_PROG_PKG_CONFIG
12347aa0a607SDon Lewis
12357aa0a607SDon Lewis
12367aa0a607SDon Lewisdnl ===================================================================
12377aa0a607SDon Lewisdnl Set the ENABLE_CRASHDUMP variable.
12387aa0a607SDon Lewisdnl ===================================================================
12397aa0a607SDon LewisAC_MSG_CHECKING([whether to enable crashdump feature])
12407aa0a607SDon Lewisif test "$enable_crashdump" = "yes"; then
12417aa0a607SDon Lewis   ENABLE_CRASHDUMP="TRUE"
12427aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE CRASHREP"
12437aa0a607SDon Lewis   AC_MSG_RESULT([yes])
12447aa0a607SDon Lewiselse
12457aa0a607SDon Lewis   ENABLE_CRASHDUMP=""
12467aa0a607SDon Lewis   AC_MSG_RESULT([no])
12477aa0a607SDon Lewisfi
12487aa0a607SDon LewisAC_SUBST(ENABLE_CRASHDUMP)
12497aa0a607SDon Lewis
12507aa0a607SDon Lewisif test "$_os" = "WINNT"; then
12517aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE TWAIN"
12527aa0a607SDon Lewisfi
12537aa0a607SDon Lewis
12547aa0a607SDon Lewisif test "$_os" = "WINNT"; then
12557aa0a607SDon Lewis   dnl ===================================================================
12567aa0a607SDon Lewis   dnl Set the VC_STANDARD variable.
12577aa0a607SDon Lewis   dnl ===================================================================
12587aa0a607SDon Lewis   AC_MSG_CHECKING([whether to use the standard non-optimizing compiler])
12597aa0a607SDon Lewis   if test "$enable_cl_standard" = "" -o "$enable_cl_standard" = "no"; then
12607aa0a607SDon Lewis      VC_STANDARD=""
12617aa0a607SDon Lewis      AC_MSG_RESULT([no])
12627aa0a607SDon Lewis   else
12637aa0a607SDon Lewis      VC_STANDARD="TRUE"
12647aa0a607SDon Lewis      AC_MSG_RESULT([yes])
12657aa0a607SDon Lewis   fi
12667aa0a607SDon Lewis   AC_SUBST(VC_STANDARD)
12677aa0a607SDon Lewisfi
12687aa0a607SDon Lewis
12697aa0a607SDon Lewisif test "$_os" = "WINNT"; then
12707aa0a607SDon Lewis   dnl ===================================================================
12717aa0a607SDon Lewis   dnl Set the BUILD_X64 variable.
12727aa0a607SDon Lewis   dnl ===================================================================
12737aa0a607SDon Lewis   AC_MSG_CHECKING([whether to build/use the Windows 64bit shell extensions])
12747aa0a607SDon Lewis   if test "$enable_win_x64_shellext" = "" -o "$enable_win_x64_shellext" = "no"; then
12757aa0a607SDon Lewis      BUILD_X64=""
12767aa0a607SDon Lewis      AC_MSG_RESULT([no])
12777aa0a607SDon Lewis   else
12787aa0a607SDon Lewis      BUILD_X64="TRUE"
12797aa0a607SDon Lewis      AC_MSG_RESULT([yes])
12807aa0a607SDon Lewis   fi
12817aa0a607SDon Lewis   AC_SUBST(BUILD_X64)
12827aa0a607SDon Lewisfi
12837aa0a607SDon Lewis
12847aa0a607SDon Lewisdnl ===================================================================
12857aa0a607SDon Lewisdnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
12867aa0a607SDon Lewisdnl ===================================================================
12877aa0a607SDon LewisAC_MSG_CHECKING([whether to turn warnings to errors])
12887aa0a607SDon Lewisif test -n "$enable_werror" && test "$enable_werror" != "no"; then
12897aa0a607SDon Lewis   ENABLE_WERROR="TRUE"
12907aa0a607SDon Lewis   AC_MSG_RESULT([yes])
12917aa0a607SDon Lewis   AC_MSG_WARN([Turning warnings to errors has no effect in modules or])
12927aa0a607SDon Lewis   AC_MSG_WARN([on platforms where it has been disabled explicitely])
12937aa0a607SDon Lewis   echo "Turning warnings to errors has no effect in modules or on platforms where it has been disabled explicitely" >> warn
12947aa0a607SDon Lewiselse
12957aa0a607SDon Lewis   ENABLE_WERROR="FALSE"
12967aa0a607SDon Lewis   AC_MSG_RESULT([no])
12977aa0a607SDon Lewisfi
12987aa0a607SDon LewisAC_SUBST(ENABLE_WERROR)
12997aa0a607SDon Lewis
13007aa0a607SDon Lewisdnl ===================================================================
13017aa0a607SDon Lewisdnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
13027aa0a607SDon Lewisdnl ===================================================================
13037aa0a607SDon LewisAC_MSG_CHECKING([whether to do a debug build])
13047aa0a607SDon Lewisif test -n "$enable_debug" && test "$enable_debug" != "no"; then
13057aa0a607SDon Lewis   ENABLE_DEBUG="TRUE"
13067aa0a607SDon Lewis   if test -z "$enable_symbols"; then
13077aa0a607SDon Lewis      enable_symbols="yes"
13087aa0a607SDon Lewis   fi
13097aa0a607SDon Lewis   AC_MSG_RESULT([yes])
13107aa0a607SDon Lewiselse
13117aa0a607SDon Lewis   ENABLE_DEBUG="FALSE"
13127aa0a607SDon Lewis   AC_MSG_RESULT([no])
13137aa0a607SDon Lewisfi
13147aa0a607SDon LewisAC_SUBST(ENABLE_DEBUG)
13157aa0a607SDon Lewis
13167aa0a607SDon Lewisdnl ===================================================================
13177aa0a607SDon Lewisdnl Set the ENABLE_DBGUTIL variable
13187aa0a607SDon Lewisdnl ===================================================================
13197aa0a607SDon LewisAC_MSG_CHECKING([whether to build with additional debug utilities])
13207aa0a607SDon Lewisif test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
13217aa0a607SDon Lewis   PROEXT=""
13227aa0a607SDon Lewis   PRODUCT=""
13237aa0a607SDon Lewis   PROFULLSWITCH=""
13247aa0a607SDon Lewis   AC_MSG_RESULT([yes])
13257aa0a607SDon Lewiselse
13267aa0a607SDon Lewis   PRODUCT="full"
13277aa0a607SDon Lewis   PROFULLSWITCH="product=full"
13287aa0a607SDon Lewis   PROEXT=".pro"
13297aa0a607SDon Lewis   AC_MSG_RESULT([no, full product build])
13307aa0a607SDon Lewisfi
13317aa0a607SDon LewisAC_SUBST(PRODUCT)
13327aa0a607SDon LewisAC_SUBST(PROFULLSWITCH)
13337aa0a607SDon LewisAC_SUBST(PROEXT)
13347aa0a607SDon Lewis
13357aa0a607SDon Lewisdnl ===================================================================
13367aa0a607SDon Lewisdnl First setting is whether to include symbols into final build.
13377aa0a607SDon Lewisdnl ===================================================================
13387aa0a607SDon LewisAC_MSG_CHECKING([whether to include symbols into final build])
13397aa0a607SDon Lewisif test -n "$enable_symbols" && test "$enable_symbols" != "no"; then
13407aa0a607SDon Lewis	if test "$enable_symbols" = "yes" -o "$enable_symbols" = "TRUE"; then
13417aa0a607SDon Lewis		ENABLE_SYMBOLS="TRUE"
13427aa0a607SDon Lewis		AC_MSG_RESULT([yes])
13437aa0a607SDon Lewis	else
13447aa0a607SDon Lewis		if test "$enable_symbols" = "SMALL" -o "$enable_symbols" = "small"; then
13457aa0a607SDon Lewis			ENABLE_SYMBOLS="SMALL"
13467aa0a607SDon Lewis			AC_MSG_RESULT([yes, small ones])
13477aa0a607SDon Lewis		else if test "$enable_symbols" != "no" ; then
13487aa0a607SDon Lewis			     echo enable symbols is: $enable_symbols
13497aa0a607SDon Lewis			     AC_MSG_ERROR([--enable-symbols only accepts yes, TRUE or SMALL as parameter.])
13507aa0a607SDon Lewis           	     else
13517aa0a607SDon Lewis              		     ENABLE_SYMBOLS=
13527aa0a607SDon Lewis		     fi
13537aa0a607SDon Lewis		fi
13547aa0a607SDon Lewis	fi
13557aa0a607SDon Lewiselse
13567aa0a607SDon Lewis   ENABLE_SYMBOLS=
13577aa0a607SDon Lewis   AC_MSG_RESULT([no])
13587aa0a607SDon Lewisfi
13597aa0a607SDon LewisAC_SUBST(ENABLE_SYMBOLS)
13607aa0a607SDon Lewis
13617aa0a607SDon Lewisdnl ===================================================================
13627aa0a607SDon Lewisdnl Determine if the solver is to be stripped or not.
13637aa0a607SDon Lewisdnl ===================================================================
13647aa0a607SDon LewisAC_MSG_CHECKING([whether to strip the solver or not.])
13657aa0a607SDon Lewisif test -n "$enable_strip_solver"; then
13667aa0a607SDon Lewis   if test "$enable_strip_solver" = "yes"; then
13677aa0a607SDon Lewis      DISABLE_STRIP=
13687aa0a607SDon Lewis   else if test "$enable_strip_solver" = "no"; then
13697aa0a607SDon Lewis           DISABLE_STRIP="TRUE"
13707aa0a607SDon Lewis        else
13717aa0a607SDon Lewis           AC_MSG_ERROR([--disable-strip-solver only accepts yes or no as parameter.])
13727aa0a607SDon Lewis        fi
13737aa0a607SDon Lewis   fi
13747aa0a607SDon Lewiselse
13757aa0a607SDon Lewis   if test -n "$ENABLE_SYMBOLS"; then
13767aa0a607SDon Lewis      DISABLE_STRIP="TRUE"
13777aa0a607SDon Lewis   else
13787aa0a607SDon Lewis      DISABLE_STRIP=
13797aa0a607SDon Lewis   fi
13807aa0a607SDon Lewisfi
13817aa0a607SDon Lewisif test -z "$DISABLE_STRIP"; then
13827aa0a607SDon Lewis   AC_MSG_RESULT([yes])
13837aa0a607SDon Lewiselse
13847aa0a607SDon Lewis   AC_MSG_RESULT([no])
13857aa0a607SDon Lewisfi
13867aa0a607SDon LewisAC_SUBST(DISABLE_STRIP)
13877aa0a607SDon Lewis
13887aa0a607SDon Lewisdnl ===================================================================
13897aa0a607SDon Lewisdnl Build options
13907aa0a607SDon Lewisdnl ===================================================================
13917aa0a607SDon Lewis
13927aa0a607SDon Lewis# Disable or enable category-B librariets: nss, hunspell, hyphen, saxon,
13937aa0a607SDon Lewis# rhino, silgraphite, beanshell.
13947aa0a607SDon Lewis
13957aa0a607SDon Lewis# Note that further below they may be enabled or disabled again by
13967aa0a607SDon Lewis# more specific options.
13977aa0a607SDon Lewis
13987aa0a607SDon LewisENABLE_CATEGORY_B=
13997aa0a607SDon Lewis
14007aa0a607SDon LewisAC_MSG_CHECKING([whether to enable category B components])
14017aa0a607SDon Lewis# Category B modules (libraries):
14027aa0a607SDon Lewis#   nss (nss)
14037aa0a607SDon Lewis#   hunspell (hunspell)
14047aa0a607SDon Lewis#   hyphen (hyphen)
14057aa0a607SDon Lewis#   saxon (saxon)
14067aa0a607SDon Lewis#   rhino (rhino)
14077aa0a607SDon Lewis#   beanshell (beanshell)
14087aa0a607SDon Lewis#   graphite (silgraphite)
14097aa0a607SDon Lewisif test "$enable_category_b" = "yes"; then
14107aa0a607SDon Lewis   ENABLE_CATEGORY_B=YES
14117aa0a607SDon Lewis   enable_hunspell="yes"
14127aa0a607SDon Lewis   enable_hyphen="yes"
14137aa0a607SDon Lewis   enable_saxon="yes"
14147aa0a607SDon Lewis   enable_javascript="yes"
14157aa0a607SDon Lewis   enable_beanshell="yes"
14167aa0a607SDon Lewis   enable_graphite="yes"
14177aa0a607SDon Lewis   enable_coinmp="yes"
14187aa0a607SDon Lewis   enable_category_b_fonts="yes"
14197aa0a607SDon Lewis
14207aa0a607SDon Lewis   AC_MSG_RESULT([yes: allow modules nss, hunspell, hyphen, saxon, rhino, beanshell, graphite, coinmp to be built])
14217aa0a607SDon Lewiselse
14227aa0a607SDon Lewis   # Disable libaries.
14237aa0a607SDon Lewis   enable_nss_module="no"
14247aa0a607SDon Lewis   enable_hunspell="no"
14257aa0a607SDon Lewis   enable_hyphen="no"
14267aa0a607SDon Lewis   enable_saxon="no"
14277aa0a607SDon Lewis   enable_javascript="no"
14287aa0a607SDon Lewis   enable_beanshell="no"
14297aa0a607SDon Lewis   enable_graphite="no"
14307aa0a607SDon Lewis   enable_coinmp="no"
14317aa0a607SDon Lewis   enable_category_b_fonts="no"
14327aa0a607SDon Lewis
14337aa0a607SDon Lewis   AC_MSG_RESULT([no: disabled modules nss, hunspell, hyphen, saxon, rhino, beanshell, graphite, coinmp])
14347aa0a607SDon Lewisfi
14357aa0a607SDon LewisAC_SUBST(ENABLE_CATEGORY_B)
14367aa0a607SDon Lewis
14377aa0a607SDon Lewis# gstreamer is used only via pre-installed libraries: not a problem
14387aa0a607SDon Lewis
14397aa0a607SDon Lewisdnl ===================================================================
14407aa0a607SDon Lewisdnl Online Update
14417aa0a607SDon Lewisdnl ===================================================================
14427aa0a607SDon LewisAC_MSG_CHECKING([whether to enable the Online Update support])
14437aa0a607SDon Lewisif test "$enable_online_update" = "yes" -o "$enable_online_update" = "TRUE"; then
14447aa0a607SDon Lewis   ENABLE_ONLINE_UPDATE="YES"
14457aa0a607SDon Lewis   SCPDEFS="$SCPDEFS -DENABLE_ONLINE_UPDATE"
14467aa0a607SDon Lewis   AC_MSG_RESULT([yes])
14477aa0a607SDon Lewiselse
14487aa0a607SDon Lewis   ENABLE_ONLINE_UPDATE=""
14497aa0a607SDon Lewis   AC_MSG_RESULT([no])
14507aa0a607SDon Lewisfi
14517aa0a607SDon LewisAC_SUBST(ENABLE_ONLINE_UPDATE)
14527aa0a607SDon Lewis
14537aa0a607SDon Lewis
14547aa0a607SDon LewisAC_MSG_CHECKING([whether to enable native CUPS support])
14557aa0a607SDon Lewisif test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then
14567aa0a607SDon Lewis   ENABLE_CUPS="TRUE"
14577aa0a607SDon Lewis   AC_MSG_RESULT([yes])
14587aa0a607SDon Lewiselse
14597aa0a607SDon Lewis   ENABLE_CUPS=""
14607aa0a607SDon Lewis   AC_MSG_RESULT([no])
14617aa0a607SDon Lewisfi
14627aa0a607SDon LewisAC_SUBST(ENABLE_CUPS)
14637aa0a607SDon Lewis
14647aa0a607SDon LewisAC_MSG_CHECKING([whether to enable fontconfig support])
14657aa0a607SDon Lewisif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a \( "$enable_fontconfig" = "yes" -o "$enable_fontconfig" = "TRUE" \); then
14667aa0a607SDon Lewis   ENABLE_FONTCONFIG="TRUE"
14677aa0a607SDon Lewis   AC_MSG_RESULT([yes])
14687aa0a607SDon Lewiselse
14697aa0a607SDon Lewis   ENABLE_FONTCONFIG=""
14707aa0a607SDon Lewis   AC_MSG_RESULT([no])
14717aa0a607SDon Lewisfi
14727aa0a607SDon LewisAC_SUBST(ENABLE_FONTCONFIG)
14737aa0a607SDon Lewis
14747aa0a607SDon Lewisdnl ===================================================================
14757aa0a607SDon Lewisdnl find external tarballs.
14767aa0a607SDon Lewisdnl ===================================================================
14777aa0a607SDon Lewisif test -z $TARFILE_LOCATION; then
14787aa0a607SDon Lewis   TARFILE_LOCATION="DEFAULT"
14797aa0a607SDon Lewisfi
14807aa0a607SDon LewisAC_SUBST(TARFILE_LOCATION)
14817aa0a607SDon Lewis
14827aa0a607SDon Lewisif test -z "$enable_fetch_external" || test "$enable_fetch_external" = "yes" \
14837aa0a607SDon Lewis   && test -z "$with_system_libs" -a "$with_system_jars" != "no"; then
14847aa0a607SDon Lewis   DO_FETCH_TARBALLS="yes"
14857aa0a607SDon Lewisfi
14867aa0a607SDon LewisAC_SUBST(DO_FETCH_TARBALLS)
14877aa0a607SDon Lewis
14887aa0a607SDon Lewisif test "$_os" = "WINNT"; then
14897aa0a607SDon Lewis   AC_MSG_CHECKING([whether to use DirectX])
14907aa0a607SDon Lewis   ENABLE_DIRECT_DRAW=""
14917aa0a607SDon Lewis   if test "$enable_directx" = "yes" -o "$enable_directx" = "TRUE" -o "$enable_directx" = ""; then
14927aa0a607SDon Lewis      ENABLE_DIRECTX="TRUE"
14937aa0a607SDon Lewis      AC_MSG_RESULT([yes])
14947aa0a607SDon Lewis   else
14957aa0a607SDon Lewis      ENABLE_DIRECTX=""
14967aa0a607SDon Lewis      AC_MSG_RESULT([no])
14977aa0a607SDon Lewis   fi
14987aa0a607SDon Lewis   AC_SUBST(ENABLE_DIRECTX)
14997aa0a607SDon Lewis
15007aa0a607SDon Lewis   AC_MSG_CHECKING([whether to use ActiveX])
15017aa0a607SDon Lewis   if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
15027aa0a607SDon Lewis      DISABLE_ACTIVEX=""
15037aa0a607SDon Lewis      AC_MSG_RESULT([yes])
15047aa0a607SDon Lewis   else
15057aa0a607SDon Lewis      DISABLE_ACTIVEX="TRUE"
15067aa0a607SDon Lewis      AC_MSG_RESULT([no])
15077aa0a607SDon Lewis   fi
15087aa0a607SDon Lewis
15097aa0a607SDon Lewis   AC_MSG_CHECKING([whether to use ATL])
15107aa0a607SDon Lewis   if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
15117aa0a607SDon Lewis      DISABLE_ATL=""
15127aa0a607SDon Lewis      AC_MSG_RESULT([yes])
15137aa0a607SDon Lewis   else
15147aa0a607SDon Lewis      DISABLE_ATL="TRUE"
15157aa0a607SDon Lewis      dnl ActiveX depends on ATL, it should be disabled
15167aa0a607SDon Lewis      DISABLE_ACTIVEX="TRUE"
15177aa0a607SDon Lewis      AC_MSG_RESULT([no])
15187aa0a607SDon Lewis   fi
15197aa0a607SDon Lewis
15207aa0a607SDon Lewis   AC_SUBST(DISABLE_ATL)
15217aa0a607SDon Lewis   AC_SUBST(DISABLE_ACTIVEX)
15227aa0a607SDon Lewis
15237aa0a607SDon Lewisfi
15247aa0a607SDon Lewis
15257aa0a607SDon Lewisdnl ===================================================================
15267aa0a607SDon Lewisdnl Disable rpath in shared libraries?
15277aa0a607SDon Lewisdnl ===================================================================
15287aa0a607SDon LewisAC_MSG_CHECKING([whether to use RPATH in shared libraries])
15297aa0a607SDon Lewisif test "$enable_rpath" = "no"; then
15307aa0a607SDon Lewis   ENABLE_RPATH="no"
15317aa0a607SDon Lewiselse
15327aa0a607SDon Lewis   ENABLE_RPATH="yes"
15337aa0a607SDon Lewisfi
15347aa0a607SDon LewisAC_MSG_RESULT([$ENABLE_RPATH])
15357aa0a607SDon LewisAC_SUBST(ENABLE_RPATH)
15367aa0a607SDon Lewis
15377aa0a607SDon Lewisdnl ===================================================================
15387aa0a607SDon Lewisdnl Check extensions to be bundled as literal blobs
15397aa0a607SDon Lewisdnl ===================================================================
15407aa0a607SDon Lewisif test -n "$with_bundled_extension_blobs"; then
15417aa0a607SDon Lewis	BUNDLED_EXTENSION_BLOBS="$with_bundled_extension_blobs"
15427aa0a607SDon Lewiselse
15437aa0a607SDon Lewis	BUNDLED_EXTENSION_BLOBS=
15447aa0a607SDon Lewisfi
15457aa0a607SDon LewisAC_SUBST(BUNDLED_EXTENSION_BLOBS)
15467aa0a607SDon Lewis
15477aa0a607SDon Lewis#dnl ===================================================================
15487aa0a607SDon Lewis#dnl Check extensions that are to be bundled as pre-registerd
15497aa0a607SDon Lewis#dnl ===================================================================
15507aa0a607SDon Lewisif test -n "$with_bundled_prereg_extensions"; then
15517aa0a607SDon Lewis	BUNDLED_PREREG_EXTENSIONS="$with_bundled_prereg_extensions"
15527aa0a607SDon Lewiselse
15537aa0a607SDon Lewis	BUNDLED_PREREG_EXTENSIONS=
15547aa0a607SDon Lewisfi
15557aa0a607SDon LewisAC_SUBST(BUNDLED_PREREG_EXTENSIONS)
15567aa0a607SDon Lewis
15577aa0a607SDon Lewisdnl ===================================================================
15587aa0a607SDon Lewisdnl Configure system provided dictionary/hyphenation/thesaurus
15597aa0a607SDon Lewisdnl ===================================================================
15607aa0a607SDon Lewis  AC_MSG_CHECKING([whether to use dicts from external paths])
15617aa0a607SDon Lewis  if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
15627aa0a607SDon Lewis	AC_MSG_RESULT([yes])
15637aa0a607SDon Lewis	SYSTEM_DICTS=YES
15647aa0a607SDon Lewis	AC_MSG_CHECKING([for spelling dictionary directory])
15657aa0a607SDon Lewis	if test -n "$with_external_dict_dir"; then
15667aa0a607SDon Lewis		DICT_SYSTEM_DIR=file://$with_external_dict_dir
15677aa0a607SDon Lewis	else
15687aa0a607SDon Lewis		DICT_SYSTEM_DIR=file:///usr/share/hunspell
15697aa0a607SDon Lewis	fi
15707aa0a607SDon Lewis	AC_MSG_RESULT([$DICT_SYSTEM_DIR])
15717aa0a607SDon Lewis	AC_MSG_CHECKING([for hyphenation patterns directory])
15727aa0a607SDon Lewis	if test -n "$with_external_hyph_dir"; then
15737aa0a607SDon Lewis		HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
15747aa0a607SDon Lewis	else
15757aa0a607SDon Lewis		HYPH_SYSTEM_DIR=file:///usr/share/hyphen
15767aa0a607SDon Lewis	fi
15777aa0a607SDon Lewis	AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
15787aa0a607SDon Lewis	AC_MSG_CHECKING([for thesaurus directory])
15797aa0a607SDon Lewis	if test -n "$with_external_thes_dir"; then
15807aa0a607SDon Lewis		THES_SYSTEM_DIR=file://$with_external_thes_dir
15817aa0a607SDon Lewis	else
15827aa0a607SDon Lewis		THES_SYSTEM_DIR=file:///usr/share/mythes
15837aa0a607SDon Lewis	fi
15847aa0a607SDon Lewis	AC_MSG_RESULT([$THES_SYSTEM_DIR])
15857aa0a607SDon Lewis  else
15867aa0a607SDon Lewis  	AC_MSG_RESULT([no])
15877aa0a607SDon Lewis  	SYSTEM_DICTS=NO
15887aa0a607SDon Lewis  fi
15897aa0a607SDon LewisAC_SUBST(SYSTEM_DICTS)
15907aa0a607SDon LewisAC_SUBST(DICT_SYSTEM_DIR)
15917aa0a607SDon LewisAC_SUBST(HYPH_SYSTEM_DIR)
15927aa0a607SDon LewisAC_SUBST(THES_SYSTEM_DIR)
15937aa0a607SDon Lewis
15947aa0a607SDon Lewisif test $_os = "WINNT"; then
15957aa0a607SDon Lewis   AC_MSG_CHECKING([Windows build environment sanity])
15967aa0a607SDon Lewis   dnl ===================================================================
15977aa0a607SDon Lewis   dnl Sanity check! Native windows programs cannot use cygwin symlinks!
15987aa0a607SDon Lewis   dnl ===================================================================
15997aa0a607SDon Lewis   dnl As long as awk instead of $AWK is used somewhere in the sources,
16007aa0a607SDon Lewis   dnl check for $AWK and awk. $AWK is pointing to gawk in cygwin.
16017aa0a607SDon Lewis      if test -L $AWK -o -L `which awk` -o -L `which tar` -o -L `which gunzip` ; then
16027aa0a607SDon Lewis         AC_MSG_ERROR([$AWK, awk, tar or gunzip is a cygwin symlink!
16037aa0a607SDon LewisNative windows programs cannot use cygwin symlinks. Remove the symbolic
16047aa0a607SDon Lewislink, and copy the program to the name of the link.])
16057aa0a607SDon Lewis      fi
16067aa0a607SDon Lewis   dnl ===================================================================
16077aa0a607SDon Lewis   dnl Another sanity check! More a band-aid. winenv.* adds guw.exe to
16087aa0a607SDon Lewis   dnl CC and CXX but the configure checks here assume that guw.exe
16097aa0a607SDon Lewis   dnl (if needed at all) is not yet present.
16107aa0a607SDon Lewis   dnl ===================================================================
16117aa0a607SDon Lewis   CC=`echo $CC | $SED "s/^guw.exe //"`
16127aa0a607SDon Lewis   CXX=`echo $CXX | $SED "s/^guw.exe //"`
16137aa0a607SDon Lewis   dnl ===================================================================
16147aa0a607SDon Lewis   dnl If $CC is set to a MinGW compiler, e.g. "gcc -mno-cygwin" enable
16157aa0a607SDon Lewis   dnl $WITH_MINGWIN
16167aa0a607SDon Lewis   dnl ===================================================================
16177aa0a607SDon Lewis      if test -n "$CC";then
16187aa0a607SDon Lewis         if test "`$CC -dumpmachine 2>/dev/null | $SED -e 's/^.*-//'`" = "mingw32"; then
16197aa0a607SDon Lewis            WITH_MINGWIN="yes"
16207aa0a607SDon Lewis         fi
16217aa0a607SDon Lewis      fi
16227aa0a607SDon Lewis   dnl ===================================================================
16237aa0a607SDon Lewis   if test "$WITH_MINGWIN" = "yes" ; then
16247aa0a607SDon Lewis      if test -z "$CC"; then
16257aa0a607SDon Lewis         CC="gcc -mno-cygwin"
16267aa0a607SDon Lewis         CXX="g++ -mno-cygwin"
16277aa0a607SDon Lewis      fi
16287aa0a607SDon Lewis   fi
16297aa0a607SDon Lewis   AC_MSG_RESULT([ok])
16307aa0a607SDon Lewisfi
16317aa0a607SDon LewisAC_SUBST(WITH_MINGWIN)
16327aa0a607SDon Lewis
16337aa0a607SDon Lewisdnl ===================================================================
16347aa0a607SDon Lewisdnl Extra check for Windows. cygwin builds need gcc to build dmake
16357aa0a607SDon Lewisdnl and g++ to build guw.exe although MS cl (or MinGW) is used to
16367aa0a607SDon Lewisdnl build OOo.
16377aa0a607SDon Lewisdnl ===================================================================
16387aa0a607SDon Lewisif test "$_os" = "WINNT" ; then
16397aa0a607SDon Lewis   AC_MSG_CHECKING([for cygwin gcc/g++])
16407aa0a607SDon Lewis   if which gcc > /dev/null && which g++ > /dev/null ; then
16417aa0a607SDon Lewis      AC_MSG_RESULT([found])
16427aa0a607SDon Lewis   else
16437aa0a607SDon Lewis      AC_MSG_ERROR([cygwin gcc and g++ are needed, please install them.])
16447aa0a607SDon Lewis   fi
16457aa0a607SDon Lewisfi
16467aa0a607SDon Lewis
16477aa0a607SDon Lewis
16487aa0a607SDon Lewisdnl ===================================================================
16497aa0a607SDon Lewisdnl Check whether the bash shell can be used.
16507aa0a607SDon Lewisdnl ===================================================================
16517aa0a607SDon LewisAC_PATH_PROG(SHELLPATH, bash)
16527aa0a607SDon Lewisif test -z "$SHELLPATH"; then
16537aa0a607SDon Lewis   AC_MSG_ERROR([bash not found in \$PATH])
16547aa0a607SDon Lewiselse
16557aa0a607SDon Lewis   SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/bash$//p"`
16567aa0a607SDon Lewisfi
16577aa0a607SDon LewisAC_SUBST(SHELLPATH)
16587aa0a607SDon Lewis
16597aa0a607SDon Lewisdnl ===================================================================
16607aa0a607SDon Lewisdnl  Checks for c compiler,
16617aa0a607SDon Lewisdnl  The check for the c++ compiler is later on.
16627aa0a607SDon Lewisdnl ===================================================================
16637aa0a607SDon LewisAC_MSG_CHECKING([gcc home])
16647aa0a607SDon Lewisif test -z "$with_gcc_home"; then
16657aa0a607SDon Lewis	GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
16667aa0a607SDon Lewiselse
16677aa0a607SDon Lewis	GCC_HOME="$with_gcc_home"
16687aa0a607SDon Lewisfi
16697aa0a607SDon LewisAC_MSG_RESULT($GCC_HOME)
16707aa0a607SDon LewisAC_SUBST(GCC_HOME)
16717aa0a607SDon Lewis
16727aa0a607SDon Lewissave_CC=$CC
16737aa0a607SDon Lewissave_CXX=$CXX
16747aa0a607SDon Lewis
16757aa0a607SDon Lewisif test -n "$with_gcc_home"; then
16767aa0a607SDon Lewis   if test -z "$CC"; then
16777aa0a607SDon Lewis      CC="$with_gcc_home/bin/gcc"
16787aa0a607SDon Lewis   fi
16797aa0a607SDon Lewisfi
16807aa0a607SDon Lewis
16817aa0a607SDon Lewisdnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
16827aa0a607SDon Lewisif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
16837aa0a607SDon Lewis   AC_PROG_CC
16847aa0a607SDon Lewisfi
16857aa0a607SDon Lewis
16867aa0a607SDon Lewisif test "$_os" = "FreeBSD"; then
16877aa0a607SDon Lewis    FBSD_GCC_RPATH=
16887aa0a607SDon Lewis    if $CC --version 2>&1 | grep clang > /dev/null ; then
16897aa0a607SDon Lewis        COM_IS=CLANG
16907aa0a607SDon Lewis    else
16917aa0a607SDon Lewis        COM_IS=GCC
16927aa0a607SDon Lewis        rpath=`$CC --print-file-name libstdc++.so`
16937aa0a607SDon Lewis        rpath=`realpath $rpath`
16947aa0a607SDon Lewis        rpath=`dirname $rpath`
16957aa0a607SDon Lewis	if test "$rpath" != "/usr/lib" ; then
16967aa0a607SDon Lewis            FBSD_GCC_RPATH="-Wl,-rpath=$rpath"
16977aa0a607SDon Lewis	fi
16987aa0a607SDon Lewis    fi
16997aa0a607SDon Lewis    AC_SUBST(COM_IS)
17007aa0a607SDon Lewis    AC_SUBST(FBSD_GCC_RPATH)
17017aa0a607SDon Lewisfi
17027aa0a607SDon Lewis
17037aa0a607SDon LewisCOMPATH=`dirname "$CC"`
17047aa0a607SDon Lewisif test "$COMPATH" = "." ; then
17057aa0a607SDon Lewis    AC_PATH_PROGS(COMPATH, $CC)
17067aa0a607SDon Lewis    dnl double square bracket to get single because of M4 quote...
17077aa0a607SDon Lewis    COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
17087aa0a607SDon Lewisfi
17097aa0a607SDon LewisCC_PATH="$COMPATH/"
17107aa0a607SDon LewisCOMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
17117aa0a607SDon Lewis
17127aa0a607SDon Lewisdnl ===================================================================
17137aa0a607SDon Lewisdnl  Test the gcc version,  3 is OK
17147aa0a607SDon Lewisdnl ===================================================================
17157aa0a607SDon LewisGCCVER=20995
17167aa0a607SDon Lewisif test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then
17177aa0a607SDon Lewis    AC_MSG_CHECKING([the GNU gcc compiler version])
17187aa0a607SDon Lewis   _gcc_version=`$CC -dumpversion`
17197aa0a607SDon Lewis   _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
17207aa0a607SDon Lewis   GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
17217aa0a607SDon Lewis
17227aa0a607SDon Lewis   if test "$_gcc_major" -lt "3"; then
17237aa0a607SDon Lewis      AC_MSG_ERROR([found version "$_gcc_version", use version 3+ of the gcc compiler])
17247aa0a607SDon Lewis   else
17257aa0a607SDon Lewis      if test "$GCCVER" -eq "030203"; then
17267aa0a607SDon Lewis	    if test "$ENABLE_SYMBOLS" = "SMALL"; then
17277aa0a607SDon Lewis           AC_MSG_ERROR([version "$_gcc_version" gives internal error with small.])
17287aa0a607SDon Lewis	    fi
17297aa0a607SDon Lewis      fi
17307aa0a607SDon Lewis   fi
17317aa0a607SDon Lewis   if test "$_os" = "Darwin" ; then
17327aa0a607SDon Lewis         AC_MSG_RESULT([implicitly using CC=$CC])
17337aa0a607SDon Lewis   else
17347aa0a607SDon Lewis      AC_MSG_RESULT([checked (gcc $_gcc_version)])
17357aa0a607SDon Lewis   fi
17367aa0a607SDon Lewis   if test "$_os" = "SunOS"; then
17377aa0a607SDon Lewis      AC_MSG_CHECKING([gcc linker])
17387aa0a607SDon Lewis      if $CC -Wl,--version 2>&1 |head -n 1| grep -v GNU > /dev/null;then
17397aa0a607SDon Lewis          AC_MSG_ERROR([failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris])
17407aa0a607SDon Lewis      fi
17417aa0a607SDon Lewis      AC_MSG_RESULT([ok (GNU ld)])
17427aa0a607SDon Lewis   fi
17437aa0a607SDon Lewisfi
17447aa0a607SDon LewisAC_SUBST(GCCVER)
17457aa0a607SDon Lewis
17467aa0a607SDon LewisHAVE_LD_BSYMBOLIC_FUNCTIONS=
17477aa0a607SDon Lewisif test "$GCC" = "yes"; then
17487aa0a607SDon Lewis   AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
17497aa0a607SDon Lewis   bsymbolic_functions_ldflags_save=$LDFLAGS
17507aa0a607SDon Lewis   LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
17517aa0a607SDon Lewis   AC_LINK_IFELSE([AC_LANG_PROGRAM([
17527aa0a607SDon Lewis   #include <stdio.h>
17537aa0a607SDon Lewis   ],[
17547aa0a607SDon Lewis    printf ("hello world\n");
17557aa0a607SDon Lewis   ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
17567aa0a607SDon Lewis   if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
17577aa0a607SDon Lewis     AC_MSG_RESULT( found )
17587aa0a607SDon Lewis   else
17597aa0a607SDon Lewis     AC_MSG_RESULT( not found )
17607aa0a607SDon Lewis   fi
17617aa0a607SDon Lewis   LDFLAGS=$bsymbolic_functions_ldflags_save
17627aa0a607SDon Lewisfi
17637aa0a607SDon LewisAC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
17647aa0a607SDon Lewis
17657aa0a607SDon Lewisdnl ===================================================================
17667aa0a607SDon Lewisdnl Set the ENABLE_PCH variable. (Activate --enable-pch)
17677aa0a607SDon Lewisdnl ===================================================================
17687aa0a607SDon LewisAC_MSG_CHECKING([whether to enable pch feature])
17697aa0a607SDon Lewisif test -n "$enable_pch" && test "$enable_pch" != "no"; then
17707aa0a607SDon Lewis   if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
17717aa0a607SDon Lewis	   ENABLE_PCH="TRUE"
17727aa0a607SDon Lewis	   AC_MSG_RESULT([yes])
17737aa0a607SDon Lewisdnl There is no PCH support in GCC versions prior to this
17747aa0a607SDon Lewis   elif test "$GCC" = "yes" -a "$GCCVER" -gt "030400"; then
17757aa0a607SDon Lewis	   ENABLE_PCH="TRUE"
17767aa0a607SDon Lewis	   AC_MSG_RESULT([yes])
17777aa0a607SDon Lewis   else
17787aa0a607SDon Lewis	   ENABLE_PCH=""
17797aa0a607SDon Lewis	   AC_MSG_WARN([Precompiled header not yet supported for your platform/compiler])
17807aa0a607SDon Lewis   fi
17817aa0a607SDon Lewiselse
17827aa0a607SDon Lewis   ENABLE_PCH=""
17837aa0a607SDon Lewis   AC_MSG_RESULT([no])
17847aa0a607SDon Lewisfi
17857aa0a607SDon LewisAC_SUBST(ENABLE_PCH)
17867aa0a607SDon Lewis
17877aa0a607SDon Lewisdnl ===================================================================
17887aa0a607SDon Lewisdnl Search all the common names for GNU make
17897aa0a607SDon Lewisdnl ===================================================================
17907aa0a607SDon LewisAC_MSG_CHECKING([for GNU make])
17917aa0a607SDon Lewisfor a in "$MAKE" $GNUMAKE make gmake gnumake; do
17927aa0a607SDon Lewis      $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
17937aa0a607SDon Lewis      if test $? -eq 0;  then
17947aa0a607SDon Lewis           GNUMAKE=$a
17957aa0a607SDon Lewis           break
17967aa0a607SDon Lewis      fi
17977aa0a607SDon Lewisdone
17987aa0a607SDon LewisAC_MSG_RESULT($GNUMAKE)
17997aa0a607SDon Lewisif test -z "$GNUMAKE"; then
18007aa0a607SDon Lewis    AC_MSG_ERROR([not found. install GNU make.])
18017aa0a607SDon Lewisfi
18027aa0a607SDon Lewis
18037aa0a607SDon LewisAC_MSG_CHECKING([the GNU make version])
18047aa0a607SDon Lewis_make_version=`$GNUMAKE --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
18057aa0a607SDon Lewis_make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
18067aa0a607SDon Lewisif test "$_make_longver" -ge "038100" ; then
18077aa0a607SDon Lewis   AC_MSG_RESULT([$GNUMAKE $_make_version])
18087aa0a607SDon Lewiselse
18097aa0a607SDon Lewis   AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
18107aa0a607SDon Lewisfi
18117aa0a607SDon LewisAC_SUBST(GNUMAKE)
18127aa0a607SDon Lewis
18137aa0a607SDon Lewisdnl ===================================================================
18147aa0a607SDon Lewisdnl Search for a pre-installed dmake
18157aa0a607SDon Lewisdnl ===================================================================
18167aa0a607SDon LewisAC_MSG_CHECKING([for dmake])
18177aa0a607SDon LewisDMAKE="no"
18187aa0a607SDon Lewis# Override system dmake if --with-dmake-path or --with-dmake-url is used.
18197aa0a607SDon Lewisif test -z "$with_dmake_path" && test -z "$with_dmake_url"; then
18207aa0a607SDon Lewis   AC_PATH_PROG(DMAKE, dmake, no)
18217aa0a607SDon Lewis   IS_SYSTEM_DMAKE=NO
18227aa0a607SDon Lewis   if test "$DMAKE" != "no"; then
18237aa0a607SDon Lewis      AC_MSG_RESULT([using system dmake])
18247aa0a607SDon Lewis      DMAKE_PATH="$DMAKE"
18257aa0a607SDon Lewis      IS_SYSTEM_DMAKE=YES
18267aa0a607SDon Lewis   fi
18277aa0a607SDon Lewiselif test -n "$with_dmake_path" ; then
18287aa0a607SDon Lewis   # Did not find pre-installed dmake.
18297aa0a607SDon Lewis   # Is it at a nonstandard location provided by --with-dmake-path ?
18307aa0a607SDon Lewis   AC_MSG_NOTICE([looking for dmake at $DMAKE_PATH])
18317aa0a607SDon Lewis   if test -x "$with_dmake_path" ; then
18327aa0a607SDon Lewis      AC_MSG_RESULT([using user provided dmake])
18337aa0a607SDon Lewis      DMAKE=$with_dmake_path
18347aa0a607SDon Lewis   fi
18357aa0a607SDon Lewisfi
18367aa0a607SDon Lewis
18377aa0a607SDon LewisDMAKE_URL=
18387aa0a607SDon Lewisif test "$DMAKE" = "no"; then
18397aa0a607SDon Lewis    AC_MSG_NOTICE([no system or user-provided dmake found])
18407aa0a607SDon Lewis    # Check if a URL was supplied from which we can download the source and compile it.
18417aa0a607SDon Lewis    if test -n "$with_dmake_url" ; then
18427aa0a607SDon Lewis       # At this moment we can not verify the URL or the content that we want to download.
18437aa0a607SDon Lewis       # Neither can we apply the test below for ruling out that it is the SunStudio dmake.
18447aa0a607SDon Lewis       DMAKE_URL=$with_dmake_url
18457aa0a607SDon Lewis       AC_MSG_RESULT([dmake will be downloaded and compiled in bootstrap])
18467aa0a607SDon Lewis       DMAKE=
18477aa0a607SDon Lewis    else
18487aa0a607SDon Lewis       AC_MSG_ERROR([no URL for dmake source code specified, either. Use --with-dmake-url to supply an URL; run configure with the --help option for a list of possible URLs.])
18497aa0a607SDon Lewis       BUILD_DMAKE=YES
18507aa0a607SDon Lewis    fi
18517aa0a607SDon Lewiselse
18527aa0a607SDon Lewis    AC_MSG_CHECKING([whether the found dmake is the right dmake])
18537aa0a607SDon Lewis    # we need to find out whether that dmake we found is "our" dmake
18547aa0a607SDon Lewis    # or the dmake from Sun's SunStudio Compiler which is something
18557aa0a607SDon Lewis    # different
18567aa0a607SDon Lewis    # This test _should_ work because the one accepts -V (ours) and one
18577aa0a607SDon Lewis    # (the other) not...
18587aa0a607SDon Lewis    $DMAKE -V 2>/dev/null | grep -E 'dmake(.exe)? .* Version .*' >/dev/null
18597aa0a607SDon Lewis    if test $? -eq 0; then
18607aa0a607SDon Lewis       BUILD_DMAKE=NO
18617aa0a607SDon Lewis       AC_MSG_RESULT([yes])
18627aa0a607SDon Lewis       AC_MSG_CHECKING([the dmake version])
18637aa0a607SDon Lewis       DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
18647aa0a607SDon Lewis       if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
18657aa0a607SDon Lewis          AC_MSG_RESULT([OK, >= 4.11])
18667aa0a607SDon Lewis       elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
18677aa0a607SDon Lewis	        test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
18687aa0a607SDon Lewis          AC_MSG_RESULT([OK, >= 4.11])
18697aa0a607SDon Lewis       else
18707aa0a607SDon Lewis          AC_MSG_ERROR([too old. >= 4.11 is needed])
18717aa0a607SDon Lewis          DMAKE=no
18727aa0a607SDon Lewis       fi
18737aa0a607SDon Lewis    else
18747aa0a607SDon Lewis       AC_MSG_WARN([no])
18757aa0a607SDon Lewis       DMAKE=no
18767aa0a607SDon Lewis    fi
18777aa0a607SDon Lewisfi
18787aa0a607SDon Lewisif test "$DMAKE" = "no"; then
18797aa0a607SDon Lewis   AC_MSG_ERROR([please use --with-dmake-path or --with-dmake-url to specify dmake executable or source])
18807aa0a607SDon Lewisfi
18817aa0a607SDon LewisAC_SUBST(DMAKE_URL)
18827aa0a607SDon LewisAC_SUBST(DMAKE_PATH)
18837aa0a607SDon LewisAC_SUBST(IS_SYSTEM_DMAKE)
18847aa0a607SDon Lewis
18857aa0a607SDon Lewis
18867aa0a607SDon Lewisdnl ===================================================================
18877aa0a607SDon Lewisdnl Search all the common names for GNU or BSD tar
18887aa0a607SDon Lewisdnl ===================================================================
18897aa0a607SDon LewisAC_MSG_CHECKING([for GNU or compatible BSD tar])
18907aa0a607SDon Lewisfor a in $GNUTAR gtar gnutar bsdtar tar; do
18917aa0a607SDon Lewis      $a --version 2> /dev/null | egrep "GNU|libarchive"  2>&1 > /dev/null
18927aa0a607SDon Lewis      if test $? -eq 0;  then
18937aa0a607SDon Lewis           GNUTAR=$a
18947aa0a607SDon Lewis           break
18957aa0a607SDon Lewis      fi
18967aa0a607SDon Lewisdone
18977aa0a607SDon LewisAC_MSG_RESULT($GNUTAR)
18987aa0a607SDon Lewisif test -z "$GNUTAR"; then
18997aa0a607SDon Lewis    AC_MSG_ERROR([not found. install GNU tar.])
19007aa0a607SDon Lewisfi
19017aa0a607SDon Lewis
19027aa0a607SDon LewisAC_SUBST(GNUTAR)
19037aa0a607SDon Lewis
19047aa0a607SDon Lewisdnl ===================================================================
19057aa0a607SDon Lewisdnl  Test the solaris compiler version
19067aa0a607SDon Lewisdnl ===================================================================
19077aa0a607SDon Lewisif test "$_os" = "SunOS"; then
19087aa0a607SDon Lewis   if test "$CC" = "cc"; then
19097aa0a607SDon Lewis      AC_PATH_PROGS(_cc, cc)
19107aa0a607SDon Lewis      COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
19117aa0a607SDon Lewis      AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
19127aa0a607SDon Lewis      dnl cc -V outputs to standard error!!!!
19137aa0a607SDon Lewis      _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | sed -e 's/.* C //'`
19147aa0a607SDon Lewis      _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
19157aa0a607SDon Lewis      _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
19167aa0a607SDon Lewis      if test "$_sunstudio_major" != "5"; then
19177aa0a607SDon Lewis         AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
19187aa0a607SDon Lewis      else
19197aa0a607SDon Lewis         _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" }'`
19207aa0a607SDon Lewis         if test "$_sunstudio_minor" = "false"; then
19217aa0a607SDon Lewis            AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
19227aa0a607SDon Lewis         else
19237aa0a607SDon Lewis            dnl compiler will do
19247aa0a607SDon Lewis            AC_MSG_RESULT([checked])
19257aa0a607SDon Lewis         fi
19267aa0a607SDon Lewis      fi
19277aa0a607SDon Lewis   fi
19287aa0a607SDon Lewisfi
19297aa0a607SDon Lewis
19307aa0a607SDon Lewisif test "$GCC" = "yes"; then
19317aa0a607SDon Lewis   AC_MSG_CHECKING( for --hash-style=both linker support )
19327aa0a607SDon Lewis   hash_style_ldflags_save=$LDFLAGS
19337aa0a607SDon Lewis   LDFLAGS="$LDFLAGS -Wl,--hash-style=both"
19347aa0a607SDon Lewis   AC_LINK_IFELSE([AC_LANG_PROGRAM([
19357aa0a607SDon Lewis   #include <stdio.h>
19367aa0a607SDon Lewis   ],[
19377aa0a607SDon Lewis    printf ("hello world\n");
19387aa0a607SDon Lewis   ])], HAVE_LD_HASH_STYLE=TRUE, HAVE_LD_HASH_STYLE=FALSE)
19397aa0a607SDon Lewis   if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then
19407aa0a607SDon Lewis     AC_MSG_RESULT( found )
19417aa0a607SDon Lewis   else
19427aa0a607SDon Lewis     AC_MSG_RESULT( not found )
19437aa0a607SDon Lewis   fi
19447aa0a607SDon Lewis   LDFLAGS=$hash_style_ldflags_save
19457aa0a607SDon Lewisfi
19467aa0a607SDon LewisAC_SUBST(HAVE_LD_HASH_STYLE)
19477aa0a607SDon Lewis
19487aa0a607SDon Lewisdnl ===================================================================
19497aa0a607SDon Lewisdnl  Test the Compaq compiler for OSF1
19507aa0a607SDon Lewisdnl ===================================================================
19517aa0a607SDon Lewisif test "$_os" = "OSF1"; then
19527aa0a607SDon Lewis   if test "$CC" = "cc"; then
19537aa0a607SDon Lewis      AC_PATH_PROGS(_cc, cc)
19547aa0a607SDon Lewis      COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
19557aa0a607SDon Lewis      AC_MSG_WARN([******* $_cc , $COMPATH])
19567aa0a607SDon Lewis      AC_MSG_CHECKING([the Compaq C compiler version])
19577aa0a607SDon Lewis      dnl cc -V outputs to standard error!!!!
19587aa0a607SDon Lewis      _compaqc_version=`$CC -V 2>&1 | $AWK '{ print $3 }'`
19597aa0a607SDon Lewis      _compaqc_major=`echo $_compaqc_version | $AWK -F. '{ print $1 }'`
19607aa0a607SDon Lewis      if test "$_compaqc_major" != "T6"; then
19617aa0a607SDon Lewis         AC_MSG_ERROR([found version "$_compaqc_version", use version 6 of the Compaq C compiler])
19627aa0a607SDon Lewis      else
19637aa0a607SDon Lewis         dnl compiler will do
19647aa0a607SDon Lewis         AC_MSG_RESULT([checked])
19657aa0a607SDon Lewis      fi
19667aa0a607SDon Lewis   fi
19677aa0a607SDon Lewisfi
19687aa0a607SDon Lewis
19697aa0a607SDon Lewisdnl ===================================================================
19707aa0a607SDon Lewisdnl Check whether there's a Perl version available.
19717aa0a607SDon Lewisdnl ===================================================================
19727aa0a607SDon Lewisif test -z "$with_perl_home"; then
19737aa0a607SDon Lewis   AC_PATH_PROG(PERL, perl)
19747aa0a607SDon Lewiselse
19757aa0a607SDon Lewis   if test "$_os" = "WINNT"; then
19767aa0a607SDon Lewis      with_perl_home=`cygpath -u "$with_perl_home"`
19777aa0a607SDon Lewis   fi
19787aa0a607SDon Lewis   _perl_path="$with_perl_home/bin/perl"
19797aa0a607SDon Lewis   if test -x "$_perl_path"; then
19807aa0a607SDon Lewis      PERL=$_perl_path
19817aa0a607SDon Lewis   else
19827aa0a607SDon Lewis      AC_MSG_ERROR([$_perl_path not found])
19837aa0a607SDon Lewis   fi
19847aa0a607SDon Lewisfi
19857aa0a607SDon Lewis
19867aa0a607SDon Lewisdnl ===================================================================
19877aa0a607SDon Lewisdnl Testing for Perl version 5 or greater.
19887aa0a607SDon Lewisdnl $] is the perl version variable, it is returned as an integer
19897aa0a607SDon Lewisdnl ===================================================================
19907aa0a607SDon Lewisif test "$PERL"; then
19917aa0a607SDon Lewis   AC_MSG_CHECKING([the Perl version])
19927aa0a607SDon Lewis   ${PERL} -e "exit($]);"
19937aa0a607SDon Lewis   _perl_version=$?
19947aa0a607SDon Lewis   if test "$_perl_version" -lt 5; then
19957aa0a607SDon Lewis      AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
19967aa0a607SDon Lewis   fi
19977aa0a607SDon Lewis   AC_MSG_RESULT([checked (perl $_perl_version)])
19987aa0a607SDon Lewiselse
19997aa0a607SDon Lewis   AC_MSG_ERROR([Perl not found, install version 5 of Perl])
20007aa0a607SDon Lewisfi
20017aa0a607SDon LewisAC_SUBST(PERL)
20027aa0a607SDon Lewis
20037aa0a607SDon Lewisdnl ===================================================================
20047aa0a607SDon Lewisdnl Testing for required Perl modules
20057aa0a607SDon Lewisdnl The list of required Perl modules is documented here:
20067aa0a607SDon Lewisdnl     http://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO#General_Build_Requirements
20077aa0a607SDon Lewisdnl ===================================================================
20087aa0a607SDon LewisAC_MSG_CHECKING([for required Perl modules])
20097aa0a607SDon Lewisif `$PERL -e 'use Archive::Zip; use XML::Parser; use LWP::UserAgent; use Digest::SHA; use Digest::MD5; use LWP::Protocol::https;'>/dev/null 2>&1`; then
20107aa0a607SDon Lewis	AC_MSG_RESULT([all modules found])
20117aa0a607SDon Lewiselse
20127aa0a607SDon Lewis    # Find out which modules are missing.
20137aa0a607SDon Lewis    missing_perl_modules=
20147aa0a607SDon Lewis    if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
20157aa0a607SDon Lewis       missing_perl_modules=Archive::Zip
20167aa0a607SDon Lewis    fi
20177aa0a607SDon Lewis    if ! `$PERL -e 'use LWP::UserAgent;'>/dev/null 2>&1`; then
20187aa0a607SDon Lewis       missing_perl_modules="$missing_perl_modules LWP::UserAgent"
20197aa0a607SDon Lewis    fi
20207aa0a607SDon Lewis    if ! `$PERL -e 'use XML::Parser;'>/dev/null 2>&1`; then
20217aa0a607SDon Lewis       missing_perl_modules="$missing_perl_modules XML::Parser"
20227aa0a607SDon Lewis    fi
20237aa0a607SDon Lewis    if ! `$PERL -e 'use Digest::SHA;'>/dev/null 2>&1`; then
20247aa0a607SDon Lewis       missing_perl_modules="$missing_perl_modules Digest::SHA"
20257aa0a607SDon Lewis    fi
20267aa0a607SDon Lewis    if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
20277aa0a607SDon Lewis       missing_perl_modules="$missing_perl_modules Digest::MD5"
20287aa0a607SDon Lewis    fi
20297aa0a607SDon Lewis    if ! `$PERL -e 'use LWP::Protocol::https;'>/dev/null 2>&1`; then
20307aa0a607SDon Lewis       missing_perl_modules="$missing_perl_modules LWP::Protocol::https"
20317aa0a607SDon Lewis    fi
20327aa0a607SDon Lewis	AC_MSG_ERROR([
20337aa0a607SDon Lewis    The missing Perl modules are: $missing_perl_modules
20347aa0a607SDon Lewis    Install them with your package manager (the name of the package depends on your system);
20357aa0a607SDon Lewis    or, as last resort, run the following command as superuser/administrator: "cpan -i $missing_perl_modules"])
20367aa0a607SDon Lewisfi
20377aa0a607SDon Lewis
20387aa0a607SDon Lewisdnl ===================================================================
20397aa0a607SDon Lewisdnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
20407aa0a607SDon Lewisdnl ===================================================================
20417aa0a607SDon Lewisif test "$_os" = "WINNT"; then
20427aa0a607SDon Lewis	if test "$WITH_MINGWIN" != "yes"; then
20437aa0a607SDon Lewis		AC_MSG_CHECKING([for friendly registry keys])
20447aa0a607SDon Lewis		# VS.Net 2003, VS.Net 2005
20457aa0a607SDon Lewis		if test -z "$with_cl_home"; then
20467aa0a607SDon Lewis			vctest=`./oowintool --msvc-productdir`;
20477aa0a607SDon Lewis			if test -x "$vctest/bin/cl.exe"; then
20487aa0a607SDon Lewis				with_cl_home=$vctest;
20497aa0a607SDon Lewis			fi
20507aa0a607SDon Lewis		else
20517aa0a607SDon Lewis			with_cl_home=`cygpath -u "$with_cl_home"`
20527aa0a607SDon Lewis		fi
20537aa0a607SDon Lewis		AC_MSG_RESULT([done])
20547aa0a607SDon Lewis
20557aa0a607SDon Lewis		dnl ===========================================================
20567aa0a607SDon Lewis		dnl  Check for mspdb71.dll/mspdb80.dll
20577aa0a607SDon Lewis		dnl ===========================================================
20587aa0a607SDon Lewis		dnl  .NET 2003/5/8 Compiler
20597aa0a607SDon Lewis		if test -n "$with_mspdb_path";then
20607aa0a607SDon Lewis			with_mspdb_path=`cygpath -u "$with_mspdb_path"`
20617aa0a607SDon Lewis		fi
20627aa0a607SDon Lewis		if test -e "$with_mspdb_path/mspdb71.dll" -o -e "$with_mspdb_path/mspdb80.dll"; then
20637aa0a607SDon Lewis			MSPDB_PATH="$with_mspdb_path"
20647aa0a607SDon Lewis		fi
20657aa0a607SDon Lewis		dnl .NET 2003 case
20667aa0a607SDon Lewis		if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb71.dll"; then
20677aa0a607SDon Lewis			MSPDB_PATH="$with_cl_home/../Common7/IDE"
20687aa0a607SDon Lewis		fi
20697aa0a607SDon Lewis		dnl .NET 2005/2008 case
20707aa0a607SDon Lewis		if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
20717aa0a607SDon Lewis			MSPDB_PATH="$with_cl_home/../Common7/IDE"
20727aa0a607SDon Lewis		fi
20737aa0a607SDon Lewis		dnl Windows SDK 6.0 case
20747aa0a607SDon Lewis		if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
20757aa0a607SDon Lewis			MSPDB_PATH="$with_cl_home/bin"
20767aa0a607SDon Lewis		fi
20777aa0a607SDon Lewis
20787aa0a607SDon Lewis		if test -z "$MSPDB_PATH";then
20797aa0a607SDon Lewis			dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
20807aa0a607SDon Lewis			AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
20817aa0a607SDon Lewis			AC_PATH_PROG(MSPDB_PATH, mspdb71.dll)
20827aa0a607SDon Lewis			MSPDB_PATH=`dirname "$MSPDB_PATH"`
20837aa0a607SDon Lewis		fi
20847aa0a607SDon Lewis
20857aa0a607SDon Lewis		if test -z "$MSPDB_PATH"; then
20867aa0a607SDon Lewis			AC_MSG_ERROR([You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path])
20877aa0a607SDon Lewis		fi
20887aa0a607SDon Lewis		MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
20897aa0a607SDon Lewis		MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
20907aa0a607SDon Lewis		dnl The path needs to be added before cl is called
20917aa0a607SDon Lewis		PATH="$MSPDB_PATH:$PATH"
20927aa0a607SDon Lewis
20937aa0a607SDon Lewis		AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
20947aa0a607SDon Lewis   		if test -x "$with_cl_home/bin/cl.exe"; then
20957aa0a607SDon Lewis   			CC="$with_cl_home/bin/cl.exe"
20967aa0a607SDon Lewis   		else
20977aa0a607SDon Lewis   			AC_PATH_PROG(CC, cl.exe)
20987aa0a607SDon Lewis   		fi
20997aa0a607SDon Lewis  		if test -e "$CC"; then
21007aa0a607SDon Lewis			# This gives us a posix path with 8.3 filename restrictions
21017aa0a607SDon Lewis			CC=`cygpath -d "$CC"`
21027aa0a607SDon Lewis			CC=`cygpath -u "$CC"`
21037aa0a607SDon Lewis			# Remove /cl.exe from CC case insensitive
21047aa0a607SDon Lewis			AC_MSG_RESULT([found ($CC)])
21057aa0a607SDon Lewis			COMPATH=`echo $CC | $SED 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]]@@'`
21067aa0a607SDon Lewis			export INCLUDE=`cygpath -d "$COMPATH/Include"`
21077aa0a607SDon Lewis			dnl  Check which Microsoft C/C++ compiler is found
21087aa0a607SDon Lewis			AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
21097aa0a607SDon Lewisdnl      The following find microsoft, matches nn.nn.nnnn then pulls numbers out.
21107aa0a607SDon Lewis			CCTXTVER=`$CC 2>&1 | head -n1`
21117aa0a607SDon Lewis			CCNUMVER=`echo $CCTXTVER | $AWK "/Microsoft/ && /..\\...\\...../ {
21127aa0a607SDon Lewis							x = match( \\\$0, /..\\...\\...../ )
21137aa0a607SDon Lewis							CCversion = substr( \\\$0, RSTART, RLENGTH)
21147aa0a607SDon Lewis							tokencount = split (CCversion,vertoken,\".\")
21157aa0a607SDon Lewis							for ( i = 1 ; i <= tokencount ; i++ ) {
21167aa0a607SDon Lewis								printf (\"%04d\",vertoken[[i]] )
21177aa0a607SDon Lewis							}
21187aa0a607SDon Lewis							}"`
21197aa0a607SDon Lewis			AC_MSG_RESULT([found Compiler version $CCNUMVER in \"$CCTXTVER\"])
21207aa0a607SDon Lewis			if test "$CCNUMVER" -ge "001500000000"; then
21217aa0a607SDon Lewis				COMEX=12
21227aa0a607SDon Lewis				MSVSVER=2008
21237aa0a607SDon Lewis				AC_MSG_RESULT([found .NET 2008 / VS 9.0.])
21247aa0a607SDon Lewis			else
21257aa0a607SDon Lewis				AC_MSG_ERROR([Compiler too old. Use Microsoft C/C++ .NET 2008.])
21267aa0a607SDon Lewis			fi
21277aa0a607SDon Lewis		else
21287aa0a607SDon Lewis			AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
21297aa0a607SDon Lewis		fi
21307aa0a607SDon Lewis	else
21317aa0a607SDon Lewis		AC_MSG_CHECKING([the Mingwin32 C++ Compiler])
21327aa0a607SDon Lewis		if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then
21337aa0a607SDon Lewis			AC_MSG_RESULT([found.])
21347aa0a607SDon Lewis			if $CC -dumpspecs | grep -q "mno-cygwin"; then
21357aa0a607SDon Lewis				USE_MINGW="cygwin"
21367aa0a607SDon Lewis			else
21377aa0a607SDon Lewis				USE_MINGW="pure-mingw"
21387aa0a607SDon Lewis			fi
21397aa0a607SDon Lewis		else
21407aa0a607SDon Lewis			AC_MSG_ERROR([Mingwin32 C++ Compiler not found.])
21417aa0a607SDon Lewis		fi
21427aa0a607SDon Lewis	fi
21437aa0a607SDon Lewisfi
21447aa0a607SDon LewisAC_SUBST(COMEX)
21457aa0a607SDon LewisAC_SUBST(MSPDB_PATH)
21467aa0a607SDon LewisAC_SUBST(USE_MINGW)
21477aa0a607SDon Lewis
21487aa0a607SDon Lewisdnl ===================================================================
21497aa0a607SDon Lewisdnl  .NET needs special treatment
21507aa0a607SDon Lewisdnl ===================================================================
21517aa0a607SDon Lewisif test "$_os" = "WINNT"; then
21527aa0a607SDon Lewisif test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then
21537aa0a607SDon Lewis	dnl Check midl.exe
21547aa0a607SDon Lewis	AC_PATH_PROG(MIDL_PATH, midl.exe)
21557aa0a607SDon Lewis	if test -n "$MIDL_PATH";then
21567aa0a607SDon Lewis		MIDL_PATH=`dirname "$MIDL_PATH"`
21577aa0a607SDon Lewis	fi
21587aa0a607SDon Lewis	if test -n "$with_midl_path";then
21597aa0a607SDon Lewis		with_midl_path=`cygpath -u "$with_midl_path"`
21607aa0a607SDon Lewis	fi
21617aa0a607SDon Lewis	if test -x "$with_midl_path/midl.exe"; then
21627aa0a607SDon Lewis		MIDL_PATH="$with_midl_path"
21637aa0a607SDon Lewis	fi
21647aa0a607SDon Lewis	if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
21657aa0a607SDon Lewis		MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
21667aa0a607SDon Lewis	fi
21677aa0a607SDon Lewis	if test -z "$MIDL_PATH" ; then
21687aa0a607SDon Lewis      vstest=`./oowintool --msvs-productdir`;
21697aa0a607SDon Lewis      if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
21707aa0a607SDon Lewis		  MIDL_PATH="$vstest/Common7/Tools/Bin"
21717aa0a607SDon Lewis      fi
21727aa0a607SDon Lewis	fi
21737aa0a607SDon Lewis	if test -z "$MIDL_PATH" ; then
21747aa0a607SDon Lewis		psdktest=`./oowintool --psdk-home`
21757aa0a607SDon Lewis		if test -x "$psdktest/Bin/midl.exe" ; then
21767aa0a607SDon Lewis			MIDL_PATH="$psdktest/Bin"
21777aa0a607SDon Lewis		fi
21787aa0a607SDon Lewis	fi
21797aa0a607SDon Lewis	if test ! -x "$MIDL_PATH/midl.exe"; then
21807aa0a607SDon Lewis		AC_MSG_ERROR([midl.exe not found. Make sure it's in the path or use --with-midl-path])
21817aa0a607SDon Lewis	fi
21827aa0a607SDon Lewis	# Convert to posix path with 8.3 filename restrictions ( No spaces )
21837aa0a607SDon Lewis	MIDL_PATH=`cygpath -d "$MIDL_PATH"`
21847aa0a607SDon Lewis	MIDL_PATH=`cygpath -u "$MIDL_PATH"`
21857aa0a607SDon Lewis
21867aa0a607SDon Lewis	dnl Check csc.exe
21877aa0a607SDon Lewis	AC_PATH_PROG(CSC_PATH, csc.exe)
21887aa0a607SDon Lewis	if test -n "$CSC_PATH";then
21897aa0a607SDon Lewis		CSC_PATH=`dirname "$CSC_PATH"`
21907aa0a607SDon Lewis	fi
21917aa0a607SDon Lewis	if test -n "$with_csc_path";then
21927aa0a607SDon Lewis		with_csc_path=`cygpath -u "$with_csc_path"`
21937aa0a607SDon Lewis	fi
21947aa0a607SDon Lewis	if test -x "$with_csc_path/csc.exe"; then
21957aa0a607SDon Lewis		CSC_PATH="$with_csc_path"
21967aa0a607SDon Lewis	else
21977aa0a607SDon Lewis	   csctest=`./oowintool --csc-compilerdir`;
21987aa0a607SDon Lewis	   if test -x "$csctest/csc.exe"; then
21997aa0a607SDon Lewis	      CSC_PATH="$csctest"
22007aa0a607SDon Lewis	   fi
22017aa0a607SDon Lewis	fi
22027aa0a607SDon Lewis	if test ! -x "$CSC_PATH/csc.exe"; then
22037aa0a607SDon Lewis		AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
22047aa0a607SDon Lewis	fi
22057aa0a607SDon Lewis	# Convert to posix path with 8.3 filename restrictions ( No spaces )
22067aa0a607SDon Lewis	CSC_PATH=`cygpath -d "$CSC_PATH"`
22077aa0a607SDon Lewis	CSC_PATH=`cygpath -u "$CSC_PATH"`
22087aa0a607SDon Lewis
22097aa0a607SDon Lewis    dnl Check mscoree.lib / .NET Frameworks dir
22107aa0a607SDon Lewis    dnl For VS2003/2005 $with_frame_home has to point to the directory with lib/mscoree.lib.
22117aa0a607SDon Lewis       AC_MSG_CHECKING(.NET Framework)
22127aa0a607SDon Lewis	    if test -n "$with_frame_home"; then
22137aa0a607SDon Lewis		with_frame_home=`cygpath -u "$with_frame_home"`
22147aa0a607SDon Lewis	    fi
22157aa0a607SDon Lewis	    if test -f "$with_frame_home/lib/mscoree.lib"; then
22167aa0a607SDon Lewis		    FRAME_HOME="$with_frame_home"
22177aa0a607SDon Lewis	    fi
22187aa0a607SDon Lewis	    if test -z "$FRAME_HOME" -a -e "$with_cl_home/../SDK/v1.1/lib/mscoree.lib"; then
22197aa0a607SDon Lewis		    FRAME_HOME="$with_cl_home/../SDK/v1.1"
22207aa0a607SDon Lewis	    fi
22217aa0a607SDon Lewis	    if test -z "$FRAME_HOME" ; then
22227aa0a607SDon Lewis          frametest=`./oowintool --dotnetsdk-dir`
22237aa0a607SDon Lewis          if test -f "$frametest/lib/mscoree.lib"; then
22247aa0a607SDon Lewis             FRAME_HOME="$frametest"
22257aa0a607SDon Lewis          else
22267aa0a607SDon Lewis             frametest=`./oowintool --psdk-home`
22277aa0a607SDon Lewis             if test -f "$frametest/lib/mscoree.lib"; then
22287aa0a607SDon Lewis                FRAME_HOME="$frametest"
22297aa0a607SDon Lewis             fi
22307aa0a607SDon Lewis          fi
22317aa0a607SDon Lewis	    fi
22327aa0a607SDon Lewis	    if test ! -f "$FRAME_HOME/lib/mscoree.lib"; then
22337aa0a607SDon Lewis		AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home])
22347aa0a607SDon Lewis	    fi
22357aa0a607SDon Lewis	    AC_MSG_RESULT(found)
22367aa0a607SDon Lewis	# Convert to posix path with 8.3 filename restrictions ( No spaces )
22377aa0a607SDon Lewis	FRAME_HOME=`cygpath -d "$FRAME_HOME"`
22387aa0a607SDon Lewis	FRAME_HOME=`cygpath -u "$FRAME_HOME"`
22397aa0a607SDon Lewisfi
22407aa0a607SDon LewisAC_SUBST(MIDL_PATH)
22417aa0a607SDon LewisAC_SUBST(CSC_PATH)
22427aa0a607SDon LewisAC_SUBST(FRAME_HOME)
22437aa0a607SDon Lewisfi
22447aa0a607SDon Lewis
22457aa0a607SDon Lewisdnl ===================================================================
22467aa0a607SDon Lewisdnl Check if stdc headers are available excluding windows.
22477aa0a607SDon Lewisdnl ===================================================================
22487aa0a607SDon Lewisif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
22497aa0a607SDon Lewis   AC_HEADER_STDC
22507aa0a607SDon Lewisfi
22517aa0a607SDon Lewis
22527aa0a607SDon Lewisdnl ===================================================================
22537aa0a607SDon Lewisdnl Find pre-processors.
22547aa0a607SDon Lewisdnl ===================================================================
22557aa0a607SDon Lewisif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
22567aa0a607SDon Lewis   AC_PROG_CXXCPP
22577aa0a607SDon Lewis
22587aa0a607SDon Lewisdnl Check whether there's a C pre-processor.
22597aa0a607SDon Lewisdnl ===================================================================
22607aa0a607SDon Lewisdnl When using SunStudio compiler, there is a bug with the cc
22617aa0a607SDon Lewisdnl preprocessor, so use CC preprocessor as the cc preprocessor
22627aa0a607SDon Lewisdnl See Issuezilla #445.
22637aa0a607SDon Lewisdnl ===================================================================
22647aa0a607SDon Lewis   if test "$_os" = "SunOS"; then
22657aa0a607SDon Lewis      CPP=$CXXCPP
22667aa0a607SDon Lewis   else
22677aa0a607SDon Lewis      AC_PROG_CPP
22687aa0a607SDon Lewis   fi
22697aa0a607SDon Lewisfi
22707aa0a607SDon Lewis
22717aa0a607SDon LewisAC_CHECK_SIZEOF(long)
22727aa0a607SDon LewisSIZEOF_LONG=$ac_cv_sizeof_long
22737aa0a607SDon LewisAC_SUBST(SIZEOF_LONG)
22747aa0a607SDon LewisAC_C_BIGENDIAN
22757aa0a607SDon LewisWORDS_BIGENDIAN=$ac_cv_c_bigendian
22767aa0a607SDon LewisAC_SUBST(WORDS_BIGENDIAN)
22777aa0a607SDon Lewis
22787aa0a607SDon Lewisdnl Check for large file support
22797aa0a607SDon LewisAC_SYS_LARGEFILE
22807aa0a607SDon Lewisif test -n "$ac_cv_sys_file_offset_bits"; then
22817aa0a607SDon Lewis   LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
22827aa0a607SDon Lewisfi
22837aa0a607SDon Lewisif test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
22847aa0a607SDon Lewis   LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
22857aa0a607SDon Lewisfi
22867aa0a607SDon LewisAC_SUBST(LFS_CFLAGS)
22877aa0a607SDon Lewis
22887aa0a607SDon Lewisdnl ===================================================================
22897aa0a607SDon Lewisdnl Check if valgrind.h is available
22907aa0a607SDon Lewisdnl ===================================================================
22917aa0a607SDon Lewisif test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
22927aa0a607SDon Lewis   dnl Test $prefix (currently only testing for /usr and /usr/local)
22937aa0a607SDon Lewis   dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
22947aa0a607SDon Lewis   VALGRIND_CFLAGS=""
22957aa0a607SDon Lewis   prev_cppflags=$CPPFLAGS
22967aa0a607SDon Lewis   if test -z "$VALGRIND_CFLAGS"; then
22977aa0a607SDon Lewis      CPPFLAGS="-I/usr/include/valgrind"
22987aa0a607SDon Lewis      AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
22997aa0a607SDon Lewis   fi
23007aa0a607SDon Lewis   if test -z "$VALGRIND_CFLAGS"; then
23017aa0a607SDon Lewis      CPPFLAGS="-I/usr/local/include/valgrind"
23027aa0a607SDon Lewis      AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
23037aa0a607SDon Lewis   fi
23047aa0a607SDon Lewis   if test -n "$VALGRIND_CFLAGS"; then
23057aa0a607SDon Lewis      CPPFLAGS=$VALGRIND_CFLAGS
23067aa0a607SDon Lewis      AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
23077aa0a607SDon Lewis   fi
23087aa0a607SDon Lewis   CPPFLAGS=$prev_cppflags
23097aa0a607SDon Lewisfi
23107aa0a607SDon LewisAC_SUBST([VALGRIND_CFLAGS])
23117aa0a607SDon Lewis
23127aa0a607SDon Lewisdnl ===================================================================
23137aa0a607SDon Lewisdnl Check if cups/cups.h is available
23147aa0a607SDon Lewisdnl ===================================================================
23157aa0a607SDon Lewisif test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then
23167aa0a607SDon Lewis    AC_CHECK_HEADER(cups/cups.h, [],
23177aa0a607SDon Lewis                    [AC_MSG_ERROR([cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?])], [])
23187aa0a607SDon Lewisfi
23197aa0a607SDon Lewis
23207aa0a607SDon Lewisdnl ===================================================================
23217aa0a607SDon Lewisdnl Check if PAM/pam_appl.h is available on Linux or FreeBSD
23227aa0a607SDon Lewisdnl ===================================================================
23237aa0a607SDon Lewisif test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then
23247aa0a607SDon Lewis  AC_MSG_CHECKING([whether to enable pam support])
23257aa0a607SDon Lewis  if test -z "$enable_pam" || test "$enable_pam" != "no"; then
23267aa0a607SDon Lewis    AC_MSG_RESULT([yes])
23277aa0a607SDon Lewis    PAM=YES
23287aa0a607SDon Lewis    AC_CHECK_HEADER(security/pam_appl.h, [],
23297aa0a607SDon Lewis                    [AC_MSG_ERROR([pam_appl.h could not be found. libpam-dev or pam-devel missing?])], [])
23307aa0a607SDon Lewis    AC_MSG_CHECKING([whether to link to libpam])
23317aa0a607SDon Lewis    if test -n "$enable_pam_link" -a "$enable_pam_link" != "no"; then
23327aa0a607SDon Lewis      AC_MSG_RESULT([yes])
23337aa0a607SDon Lewis      PAM_LINK=YES
23347aa0a607SDon Lewis      AC_CHECK_LIB(pam, pam_start, [],
23357aa0a607SDon Lewis          [AC_MSG_ERROR(libpam not found or functional)], [])
23367aa0a607SDon Lewis    else
23377aa0a607SDon Lewis      AC_MSG_RESULT([no, dynamically open it])
23387aa0a607SDon Lewis      PAM_LINK=NO
23397aa0a607SDon Lewis    fi
23407aa0a607SDon Lewis  else
23417aa0a607SDon Lewis    AC_MSG_RESULT([no])
23427aa0a607SDon Lewis    PAM=NO
23437aa0a607SDon Lewis    PAM_LINK=NO
23447aa0a607SDon Lewis    dnl check getspnam_r for needed args (4 or 5)
23457aa0a607SDon Lewis    AX_FUNC_WHICH_GETSPNAM_R
23467aa0a607SDon Lewis  fi
23477aa0a607SDon Lewisfi
23487aa0a607SDon LewisAC_SUBST(PAM)
23497aa0a607SDon LewisAC_SUBST(NEW_SHADOW_API)
23507aa0a607SDon LewisAC_SUBST(PAM_LINK)
23517aa0a607SDon Lewis
23527aa0a607SDon Lewisif test "$_os" = "Linux"; then
23537aa0a607SDon Lewis    AC_MSG_CHECKING([whether to link to libcrypt])
23547aa0a607SDon Lewis    if test -n "$enable_crypt_link" -a "$enable_crypt_link" != "no"; then
23557aa0a607SDon Lewis        AC_MSG_RESULT([yes])
23567aa0a607SDon Lewis        CRYPT_LINK=YES
23577aa0a607SDon Lewis        AC_CHECK_LIB(crypt, crypt, [],
23587aa0a607SDon Lewis            [AC_MSG_ERROR(libcrypt not found or functional)], [])
23597aa0a607SDon Lewis    else
23607aa0a607SDon Lewis        AC_MSG_RESULT([no, dynamically open it])
23617aa0a607SDon Lewis        CRYPT_LINK=NO
23627aa0a607SDon Lewis    fi
23637aa0a607SDon Lewisfi
23647aa0a607SDon LewisAC_SUBST(CRYPT_LINK)
23657aa0a607SDon Lewis
23667aa0a607SDon Lewisdnl ===================================================================
23677aa0a607SDon Lewisdnl Testing for c++ compiler and version...
23687aa0a607SDon Lewisdnl ===================================================================
23697aa0a607SDon Lewisif test -n "$with_gcc_home"; then
23707aa0a607SDon Lewis   if test -z "$CXX"; then
23717aa0a607SDon Lewis      CXX="$with_gcc_home/bin/g++"
23727aa0a607SDon Lewis   fi
23737aa0a607SDon Lewisfi
23747aa0a607SDon Lewis
23757aa0a607SDon Lewisif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
23767aa0a607SDon Lewis   if test -e "$CC"; then
23777aa0a607SDon Lewis      CXX="$CC"
23787aa0a607SDon Lewis   fi
23797aa0a607SDon Lewisfi
23807aa0a607SDon Lewis
23817aa0a607SDon Lewisdnl Autoconf 2.53 can do this test for cl.exe, 2.13 can't!
23827aa0a607SDon Lewisif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
23837aa0a607SDon Lewis   AC_PROG_CXX
23847aa0a607SDon Lewisfi
23857aa0a607SDon Lewis
23867aa0a607SDon Lewisdnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
23877aa0a607SDon Lewisif test "$GXX" = "yes"; then
23887aa0a607SDon Lewis   AC_MSG_CHECKING([the GNU C++ compiler version])
23897aa0a607SDon Lewis
23907aa0a607SDon Lewis   _gpp_version=`$CXX -dumpversion`
23917aa0a607SDon Lewis   _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
23927aa0a607SDon Lewis
23937aa0a607SDon Lewis   AC_MSG_RESULT([checked (g++ $_gpp_version)])
23947aa0a607SDon Lewis
23957aa0a607SDon Lewis   if test "$_gpp_majmin" = "304"; then
23967aa0a607SDon Lewis      AC_MSG_CHECKING([whether $CXX has the enum bug])
23977aa0a607SDon LewisAC_TRY_RUN([
23987aa0a607SDon Lewisextern "C" void abort (void);
23997aa0a607SDon Lewisextern "C" void exit (int status);
24007aa0a607SDon Lewis
24017aa0a607SDon Lewisenum E { E0, E1, E2, E3, E4, E5 };
24027aa0a607SDon Lewis
24037aa0a607SDon Lewisvoid
24047aa0a607SDon Lewistest (enum E e)
24057aa0a607SDon Lewis{
24067aa0a607SDon Lewis  if (e == E2 || e == E3 || e == E1)
24077aa0a607SDon Lewis  exit (1);
24087aa0a607SDon Lewis}
24097aa0a607SDon Lewis
24107aa0a607SDon Lewisint
24117aa0a607SDon Lewismain (void)
24127aa0a607SDon Lewis{
24137aa0a607SDon Lewis  test (E4);
24147aa0a607SDon Lewis  test (E5);
24157aa0a607SDon Lewis  test (E0);
24167aa0a607SDon Lewis  return 0;
24177aa0a607SDon Lewis}
24187aa0a607SDon Lewis],[AC_MSG_ERROR([your version of the GNU C++ compile has a bug which prevents Apache OpenOffice from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details.])], [AC_MSG_RESULT([no])])
24197aa0a607SDon Lewis   fi
24207aa0a607SDon Lewisfi
24217aa0a607SDon Lewis
24227aa0a607SDon Lewisdnl ===================================================================
24237aa0a607SDon Lewisdnl Set the gcc/gxx include directories
24247aa0a607SDon Lewisdnl ===================================================================
24257aa0a607SDon Lewis# Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
24267aa0a607SDon Lewis# often contains an i386 which is expanded as a macro.
24277aa0a607SDon Lewisif test "$GXX" = "yes"; then
24287aa0a607SDon Lewis   AC_MSG_CHECKING([for g++ include path])
24297aa0a607SDon Lewis   if test -z "$with_gxx_include_path"; then
24307aa0a607SDon Lewis      with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
24317aa0a607SDon Lewis      if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
24327aa0a607SDon Lewis          with_gxx_include_path="/usr/include"
24337aa0a607SDon Lewis      fi
24347aa0a607SDon Lewis      if test "$WITH_MINGWIN" = "yes"; then
24357aa0a607SDon Lewis         with_gxx_include_path=`cygpath -d "$with_gxx_include_path"`
24367aa0a607SDon Lewis         with_gxx_include_path=`cygpath -u "$with_gxx_include_path"`
24377aa0a607SDon Lewis      fi
24387aa0a607SDon Lewis      if echo $with_gxx_include_path | grep -q linux; then
24397aa0a607SDon Lewis         # workaround for Mandriva - issue 100049
24407aa0a607SDon Lewis         with_gxx_include_path=`cd $with_gxx_include_path && pwd`
24417aa0a607SDon Lewis      fi
24427aa0a607SDon Lewis   fi
24437aa0a607SDon Lewisfi
24447aa0a607SDon Lewisdnl This is the original code...
24457aa0a607SDon Lewisdnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
24467aa0a607SDon Lewisif test -z "$with_gxx_include_path"; then
24477aa0a607SDon Lewis   with_gxx_include_path="NO_GXX_INCLUDE"
24487aa0a607SDon Lewis   AC_MSG_RESULT([no g++ includes])
24497aa0a607SDon Lewiselse
24507aa0a607SDon Lewis   AC_MSG_RESULT([$with_gxx_include_path])
24517aa0a607SDon Lewisfi
24527aa0a607SDon LewisGXX_INCLUDE_PATH="$with_gxx_include_path"
24537aa0a607SDon LewisAC_SUBST(GXX_INCLUDE_PATH)
24547aa0a607SDon Lewis
24557aa0a607SDon Lewisdnl ===================================================================
24567aa0a607SDon Lewisdnl Set the mingw runtime library include directories
24577aa0a607SDon Lewisdnl ===================================================================
24587aa0a607SDon Lewisif test "$WITH_MINGWIN" = "yes"; then
24597aa0a607SDon Lewis   AC_MSG_CHECKING([for mingwin runtime include path])
24607aa0a607SDon Lewis   cat >conftest.$ac_ext <<_ACEOF
24617aa0a607SDon Lewis#include <stddef.h>
24627aa0a607SDon Lewis#include <bits/c++config.h>
24637aa0a607SDon Lewis_ACEOF
24647aa0a607SDon Lewis   _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`
24657aa0a607SDon Lewis   rm conftest.$ac_ext
24667aa0a607SDon Lewis   if test -n "$_mingw_lib_include_path"; then
24677aa0a607SDon Lewis      _temp=""
24687aa0a607SDon Lewis      for a in $_mingw_lib_include_path
24697aa0a607SDon Lewis         do
24707aa0a607SDon Lewis            a=`cygpath -d "$a"`
24717aa0a607SDon Lewis            _temp="$_temp "`cygpath -u "$a"`
24727aa0a607SDon Lewis         done
24737aa0a607SDon Lewis      _mingw_lib_include_path=$_temp
24747aa0a607SDon Lewis   fi
24757aa0a607SDon Lewis   if test -z "$_mingw_lib_include_path"; then
24767aa0a607SDon Lewis      _mingw_lib_include_path="NO_LIB_INCLUDE"
24777aa0a607SDon Lewis      AC_MSG_RESULT([no mingwin runtime includes])
24787aa0a607SDon Lewis   else
24797aa0a607SDon Lewis      AC_MSG_RESULT([$_mingw_lib_include_path])
24807aa0a607SDon Lewis   fi
24817aa0a607SDon Lewis  MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
24827aa0a607SDon Lewis  AC_SUBST(MINGW_LIB_INCLUDE_PATH)
24837aa0a607SDon Lewisdnl mingw gcc 4.4.0 needs backward in include path to use hash_set/hash_map
24847aa0a607SDon Lewis   AC_MSG_CHECKING([for mingwin c++ backward include path])
24857aa0a607SDon Lewis   cat >conftest.$ac_ext <<_ACEOF
24867aa0a607SDon Lewis#include <hash_set>
24877aa0a607SDon Lewis_ACEOF
24887aa0a607SDon Lewis   _mingw_backward_include_path=`$CXX -E -xc++ -Wno-deprecated conftest.$ac_ext 2>&5| $SED -n -e '/.*1*"\(.*\)\/hash_set".*/s//\1/p' | sort -u | xargs echo`
24897aa0a607SDon Lewis   rm conftest.$ac_ext
24907aa0a607SDon Lewis   if test -n "$_mingw_backward_include_path"; then
24917aa0a607SDon Lewis      _mingw_backward_include_path=`cygpath -d $_mingw_backward_include_path`
24927aa0a607SDon Lewis      _mingw_backward_include_path=`cygpath -u $_mingw_backward_include_path`
24937aa0a607SDon Lewis      AC_MSG_RESULT([$_mingw_backward_include_path])
24947aa0a607SDon Lewis   else
24957aa0a607SDon Lewis      _mingw_backward_include_path="NO_BACKWARD_INCLUDE"
24967aa0a607SDon Lewis      AC_MSG_RESULT([no mingwin c++ backward includes])
24977aa0a607SDon Lewis   fi
24987aa0a607SDon Lewis  MINGW_BACKWARD_INCLUDE_PATH="$_mingw_backward_include_path"
24997aa0a607SDon Lewis  AC_SUBST(MINGW_BACKWARD_INCLUDE_PATH)
25007aa0a607SDon Lewis  mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
25017aa0a607SDon Lewis  MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
25027aa0a607SDon Lewis  AC_MSG_CHECKING([whether to use dynamic libgcc])
25037aa0a607SDon Lewis  if test -e "$MINGW_CLIB_DIR/libgcc_s.a"; then
25047aa0a607SDon Lewis    AC_MSG_CHECKING([dynamic libgcc name])
25057aa0a607SDon Lewis    MINGW_GCCDLL_pattern=`nm $MINGW_CLIB_DIR/libgcc_s.a | sed -ne 's@.* _libgcc\(.*\)_dll_iname@libgcc\1.dll@p' | uniq | sed -e 's@_@?@g'`
25067aa0a607SDon Lewis    MINGW_GCCDLL=`cd $COMPATH/bin && ls $MINGW_GCCDLL_pattern 2>/dev/null`
25077aa0a607SDon Lewis    if test -n "$MINGW_GCCDLL"; then
25087aa0a607SDon Lewis        MINGW_SHARED_GCCLIB=YES
25097aa0a607SDon Lewis        AC_MSG_RESULT([use $MINGW_GCCDLL])
25107aa0a607SDon Lewis    else
25117aa0a607SDon Lewis        AC_MSG_RESULT([no])
25127aa0a607SDon Lewis    fi
25137aa0a607SDon Lewis  else
25147aa0a607SDon Lewis    AC_MSG_RESULT([no])
25157aa0a607SDon Lewis  fi
25167aa0a607SDon Lewis  if test -e "$MINGW_CLIB_DIR/libgcc_eh.a"; then
25177aa0a607SDon Lewis      MINGW_GCCLIB_EH=YES
25187aa0a607SDon Lewis  fi
25197aa0a607SDon Lewis  AC_MSG_CHECKING([whether to use dynamic libstdc++])
25207aa0a607SDon Lewis  MINGW_SHARED_LIBSTDCPP=
25217aa0a607SDon Lewis  if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then
25227aa0a607SDon Lewis    MINGW_SHARED_LIBSTDCPP=stdc++_s
25237aa0a607SDon Lewis  fi
25247aa0a607SDon Lewis  if test -e "$MINGW_CLIB_DIR/libstdc++.dll.a" ; then
25257aa0a607SDon Lewis    MINGW_SHARED_LIBSTDCPP=stdc++.dll
25267aa0a607SDon Lewis  fi
25277aa0a607SDon Lewis  if test -n "$MINGW_SHARED_LIBSTDCPP" ; then
25287aa0a607SDon Lewis    AC_MSG_CHECKING([dynamic libstdc++ name])
25297aa0a607SDon Lewis    MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/lib$MINGW_SHARED_LIBSTDCPP.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'`
25307aa0a607SDon Lewis    MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null`
25317aa0a607SDon Lewis    if test -n "$MINGW_GXXDLL"; then
25327aa0a607SDon Lewis        MINGW_SHARED_LIBSTDCPP=-l$MINGW_SHARED_LIBSTDCPP
25337aa0a607SDon Lewis        MINGW_SHARED_GXXLIB=YES
25347aa0a607SDon Lewis        AC_MSG_RESULT([use $MINGW_GXXDLL])
25357aa0a607SDon Lewis    else
25367aa0a607SDon Lewis        MINGW_SHARED_LIBSTDCPP=
25377aa0a607SDon Lewis        AC_MSG_RESULT([no])
25387aa0a607SDon Lewis    fi
25397aa0a607SDon Lewis  else
25407aa0a607SDon Lewis    AC_MSG_RESULT([no])
25417aa0a607SDon Lewis  fi
25427aa0a607SDon Lewis  MINGW_CLIB_DIR=`cygpath $MINGW_CLIB_DIR`
25437aa0a607SDon Lewis  AC_SUBST(MINGW_CLIB_DIR)
25447aa0a607SDon Lewis  AC_SUBST(MINGW_SHARED_GCCLIB)
25457aa0a607SDon Lewis  AC_SUBST(MINGW_GCCLIB_EH)
25467aa0a607SDon Lewis  AC_SUBST(MINGW_SHARED_GXXLIB)
25477aa0a607SDon Lewis  AC_SUBST(MINGW_SHARED_LIBSTDCPP)
25487aa0a607SDon Lewis  AC_SUBST(MINGW_GCCDLL)
25497aa0a607SDon Lewis  AC_SUBST(MINGW_GXXDLL)
25507aa0a607SDon Lewisfi
25517aa0a607SDon Lewis
25527aa0a607SDon Lewisdnl ===================================================================
25537aa0a607SDon Lewisdnl Extra checking for the SUN OS compiler
25547aa0a607SDon Lewisdnl ===================================================================
25557aa0a607SDon Lewisif test "$_os" = "SunOS"; then
25567aa0a607SDon Lewis   dnl SunStudio C++ compiler packaged with SunStudio C compiler
25577aa0a607SDon Lewis   if test "$CC" = "cc"; then
25587aa0a607SDon Lewis   AC_MSG_CHECKING([SunStudio C++ Compiler])
25597aa0a607SDon Lewis      if test "$CXX" != "CC"; then
25607aa0a607SDon Lewis         AC_MSG_WARN([SunStudio C++ was not found])
25617aa0a607SDon Lewis         echo "SunStudio C++ was not found" >> warn
25627aa0a607SDon Lewis      else
25637aa0a607SDon Lewis         AC_MSG_RESULT([checked])
25647aa0a607SDon Lewis      fi
25657aa0a607SDon Lewis   fi
25667aa0a607SDon Lewisfi
25677aa0a607SDon Lewisdnl ===================================================================
25687aa0a607SDon Lewisdnl Extra checking for the OSF compiler
25697aa0a607SDon Lewisdnl ===================================================================
25707aa0a607SDon Lewisif test "$_os" = "OSF1"; then
25717aa0a607SDon Lewis   AC_MSG_CHECKING([Compaq C++ compiler version])
25727aa0a607SDon Lewis   dnl cxx -V outputs to standard error!!!!
25737aa0a607SDon Lewis   _compaqcxx_version=`$CXX -V 2>&1 | $AWK '{ print $3 }'`
25747aa0a607SDon Lewis   _compaqcxx_major=`echo $_compaqcxx_version | $AWK -F. '{ print $1 }'`
25757aa0a607SDon Lewis   if test "$_compaqcxx_major" != "V6"; then
25767aa0a607SDon Lewis      AC_MSG_WARN([found version "$_compaqc_version", use version 6 of the Compaq C++ compiler])
25777aa0a607SDon Lewis      echo "found version $_compaqc_version, use version 6 of the Compaq C++ compiler" >> warn
25787aa0a607SDon Lewis   else
25797aa0a607SDon Lewis      dnl compiler will do
25807aa0a607SDon Lewis      AC_MSG_RESULT([checked])
25817aa0a607SDon Lewis   fi
25827aa0a607SDon Lewisfi
25837aa0a607SDon Lewis
25847aa0a607SDon Lewisdnl *************************************************************
25857aa0a607SDon Lewisdnl Testing for exception handling - dwarf2 or sjlj exceptions...
25867aa0a607SDon Lewisdnl *************************************************************
25877aa0a607SDon LewisAC_MSG_CHECKING([exception type])
25887aa0a607SDon LewisAC_LANG_PUSH([C++])
25897aa0a607SDon Lewisif test "$WITH_MINGWIN" = "yes"; then
25907aa0a607SDon Lewis  AC_TRY_LINK(
25917aa0a607SDon Lewis	[#include <iostream>
25927aa0a607SDon Lewis
25937aa0a607SDon Lewisextern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
25947aa0a607SDon Lewis
25957aa0a607SDon Lewis	],
25967aa0a607SDon Lewis	[_Unwind_SjLj_RaiseException() ],
25977aa0a607SDon Lewis	[exceptions_type="sjlj"],
25987aa0a607SDon Lewis	[exceptions_type="dwarf2"]
25997aa0a607SDon Lewis  )
26007aa0a607SDon Lewisfi
26017aa0a607SDon Lewis
26027aa0a607SDon LewisAC_MSG_RESULT($exceptions_type)
26037aa0a607SDon LewisAC_LANG_POP([C++])
26047aa0a607SDon LewisEXCEPTIONS="$exceptions_type"
26057aa0a607SDon LewisAC_SUBST(EXCEPTIONS)
26067aa0a607SDon Lewis
26077aa0a607SDon Lewisdnl **************************************************************
26087aa0a607SDon Lewisdnl Testing for required  Solaris and SunStudio compiler patches...
26097aa0a607SDon Lewisdnl **************************************************************
26107aa0a607SDon Lewisdnl Check whether the OS is SunOS.
26117aa0a607SDon Lewisif test "$_os" = "SunOS"; then
26127aa0a607SDon Lewis   _temp=`showrev -p | $AWK -F" " '{ print $2 }'`
26137aa0a607SDon Lewis   if test "$_os_release" = "7"; then
26147aa0a607SDon Lewis      dnl ***************
26157aa0a607SDon Lewis      dnl patch 106327-06
26167aa0a607SDon Lewis      dnl ***************
26177aa0a607SDon Lewis      AC_MSG_CHECKING([for patch 106327-06 or greater])
26187aa0a607SDon Lewis      _patch=`echo $_temp | $AWK '/106327-06/ { print "found" }'`
26197aa0a607SDon Lewis      _patch="false"
26207aa0a607SDon Lewis      for i in $_temp
26217aa0a607SDon Lewis      do
26227aa0a607SDon Lewis         _patch_major=`echo $i | $AWK -F"-" '{ print $1 }'`
26237aa0a607SDon Lewis         if test "$_patch_major" = "106327"; then
26247aa0a607SDon Lewis            _patch_rev=`echo $i | $AWK -F"-" '{ print $2 }'`
26257aa0a607SDon Lewis            if test "$_patch_rev" -ge "6"; then
26267aa0a607SDon Lewis               _patch="found"
26277aa0a607SDon Lewis            fi
26287aa0a607SDon Lewis        fi
26297aa0a607SDon Lewis      done
26307aa0a607SDon Lewis      if test "$_patch" = "found"; then
26317aa0a607SDon Lewis         AC_MSG_RESULT([found])
26327aa0a607SDon Lewis      else
26337aa0a607SDon Lewis         AC_MSG_WARN([patch 106327-06 not found, please install compiler patch 106327-06 or greater])
26347aa0a607SDon Lewis         echo "patch 106327-06 not found, please install compiler patch 106327-06 or greater" >> warn
26357aa0a607SDon Lewis      fi
26367aa0a607SDon Lewis      dnl ***************
26377aa0a607SDon Lewis      dnl patch 106950-11
26387aa0a607SDon Lewis      dnl ***************
26397aa0a607SDon Lewis      AC_MSG_CHECKING([for patch 106950-11 or greater])
26407aa0a607SDon Lewis      _patch=`echo $_temp | $AWK '/106950-11/ { print "found" }'`
26417aa0a607SDon Lewis      _patch="false"
26427aa0a607SDon Lewis      for i in $_temp
26437aa0a607SDon Lewis      do
26447aa0a607SDon Lewis         _patch_major=`echo $i | $AWK -F"-" '{ print $1 }'`
26457aa0a607SDon Lewis         if test "$_patch_major" = "106950"; then
26467aa0a607SDon Lewis            _patch_rev=`echo $i | $AWK -F"-" '{ print $2 }'`
26477aa0a607SDon Lewis            if test "$_patch_rev" -ge "11"; then
26487aa0a607SDon Lewis               _patch="found"
26497aa0a607SDon Lewis            fi
26507aa0a607SDon Lewis         fi
26517aa0a607SDon Lewis      done
26527aa0a607SDon Lewis      if test "$_patch" = "found"; then
26537aa0a607SDon Lewis         AC_MSG_RESULT([found])
26547aa0a607SDon Lewis      else
26557aa0a607SDon Lewis         AC_MSG_WARN([patch 106950-11 not found, please install linker patch 106950-11 or greater])
26567aa0a607SDon Lewis         echo "patch 106950-11 not found, please install linker patch 106950-11 or greater" >> warn
26577aa0a607SDon Lewis      fi
26587aa0a607SDon Lewis   else
26597aa0a607SDon Lewis      if test "$_os_release" = "6"; then
26607aa0a607SDon Lewis         dnl ***************
26617aa0a607SDon Lewis         dnl patch 105591-09
26627aa0a607SDon Lewis         dnl ***************
26637aa0a607SDon Lewis         AC_MSG_CHECKING([for patch 105591-09 or greater])
26647aa0a607SDon Lewis         _patch=`echo $_temp | $AWK '/105591-09/ { print "found" }'`
26657aa0a607SDon Lewis         _patch="false"
26667aa0a607SDon Lewis         for i in $_temp
26677aa0a607SDon Lewis         do
26687aa0a607SDon Lewis            _patch_major=`echo $i | $AWK -F"-" '{ print $1 }'`
26697aa0a607SDon Lewis            if test "$_patch_major" = "105591"; then
26707aa0a607SDon Lewis               _patch_rev=`echo $i | $AWK -F"-" '{ print $2 }'`
26717aa0a607SDon Lewis               if test "$_patch_rev" -ge "9"; then
26727aa0a607SDon Lewis                  _patch="found"
26737aa0a607SDon Lewis               fi
26747aa0a607SDon Lewis           fi
26757aa0a607SDon Lewis         done
26767aa0a607SDon Lewis         if test "$_patch" = "found"; then
26777aa0a607SDon Lewis            AC_MSG_RESULT([found])
26787aa0a607SDon Lewis         else
26797aa0a607SDon Lewis            AC_MSG_WARN([patch 105591-09 not found, please install compiler patch 105591-09 or greater])
26807aa0a607SDon Lewis            echo "patch 105591-09 not found, please install compiler patch 105591-09 or greater" >> warn
26817aa0a607SDon Lewis         fi
26827aa0a607SDon Lewis         dnl ***************
26837aa0a607SDon Lewis         dnl patch 107733-08
26847aa0a607SDon Lewis         dnl ***************
26857aa0a607SDon Lewis         AC_MSG_CHECKING([for patch 107733-08 or greater])
26867aa0a607SDon Lewis         _patch=`echo $_temp | $AWK '/107733-08/ { print "found" }'`
26877aa0a607SDon Lewis         _patch="false"
26887aa0a607SDon Lewis         for i in $_temp
26897aa0a607SDon Lewis         do
26907aa0a607SDon Lewis            _patch_major=`echo $i | $AWK -F"-" '{ print $1 }'`
26917aa0a607SDon Lewis            if test "$_patch_major" = "107733"; then
26927aa0a607SDon Lewis               _patch_rev=`echo $i | $AWK -F"-" '{ print $2 }'`
26937aa0a607SDon Lewis               if test "$_patch_rev" -ge "8"; then
26947aa0a607SDon Lewis                  _patch="found"
26957aa0a607SDon Lewis               fi
26967aa0a607SDon Lewis           fi
26977aa0a607SDon Lewis         done
26987aa0a607SDon Lewis         if test "$_patch" = "found"; then
26997aa0a607SDon Lewis            AC_MSG_RESULT([found])
27007aa0a607SDon Lewis         else
27017aa0a607SDon Lewis            AC_MSG_WARN([patch 107733-06 not found, please install linker patch 107733-08 or greater])
27027aa0a607SDon Lewis            echo "patch 107733-06 not found, please install linker patch 107733-08 or greater" >> warn
27037aa0a607SDon Lewis         fi
27047aa0a607SDon Lewis      fi
27057aa0a607SDon Lewis   fi
27067aa0a607SDon Lewisfi
27077aa0a607SDon Lewis
27087aa0a607SDon Lewisdnl ===================================================================
27097aa0a607SDon Lewisdnl Checks for what the default STL should be
27107aa0a607SDon Lewisdnl ===================================================================
27117aa0a607SDon Lewis   AC_MSG_CHECKING([what the default STL should be])
27127aa0a607SDon Lewis   DEFAULT_TO_STLPORT="no"
27137aa0a607SDon Lewisif test "$WITH_STLPORT" != "no"; then
27147aa0a607SDon Lewis   AC_MSG_ERROR([Option --with-stlport is no longer available.])
27157aa0a607SDon Lewiselse
27167aa0a607SDon Lewis   USE_SYSTEM_STL="YES"
27177aa0a607SDon Lewisfi
27187aa0a607SDon Lewis
27197aa0a607SDon LewisAC_SUBST(USE_SYSTEM_STL)
27207aa0a607SDon Lewis
27217aa0a607SDon Lewisdnl ===================================================================
27227aa0a607SDon Lewisdnl visibility feature
27237aa0a607SDon Lewisdnl ===================================================================
27247aa0a607SDon Lewisif test "$GCC" = "yes"; then
27257aa0a607SDon Lewis   AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
27267aa0a607SDon Lewis   save_CFLAGS=$CFLAGS
27277aa0a607SDon Lewis   CFLAGS="$CFLAGS -fvisibility=hidden"
27287aa0a607SDon Lewis   AC_TRY_LINK([], [ return 0; ], [ HAVE_GCC_VISIBILITY_FEATURE=TRUE ], [])
27297aa0a607SDon Lewis   CFLAGS=$save_CFLAGS
27307aa0a607SDon Lewis   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
27317aa0a607SDon Lewis      AC_MSG_RESULT([yes])
27327aa0a607SDon Lewis   else
27337aa0a607SDon Lewis      AC_MSG_RESULT([no])
27347aa0a607SDon Lewis   fi
27357aa0a607SDon Lewisfi
27367aa0a607SDon Lewis
27377aa0a607SDon Lewis# ===================================================================
27387aa0a607SDon Lewis# use --ccache-skip?
27397aa0a607SDon Lewis# ===================================================================
27407aa0a607SDon Lewisdnl used to escape compiler options for ccache that otherwise prevent
27417aa0a607SDon Lewisdnl caching of the results (like "-x objective-c++" for Mac)
27427aa0a607SDon LewisAC_MSG_CHECKING([whether we are allowed and able to use --ccache-skip])
27437aa0a607SDon Lewisif test "$_os" != "Darwin" ; then
27447aa0a607SDon Lewis   AC_MSG_RESULT([only used on Mac currently, skipping])
27457aa0a607SDon Lewiselif test "$enable_ccache_skip" = "no" ; then
27467aa0a607SDon Lewis   AC_MSG_RESULT([no - diabled explicitly])
27477aa0a607SDon Lewiselif test "$enable_ccache_skip" = "yes" ; then
27487aa0a607SDon Lewis   AC_MSG_RESULT([yes - enabled explicitly, skipping checks])
27497aa0a607SDon Lewis   AC_SUBST([USE_CCACHE], [YES])
27507aa0a607SDon Lewiselif test "$enable_ccache_skip" = "auto" ; then
27517aa0a607SDon Lewis   # checking for ccache presence/version
27527aa0a607SDon Lewis   AC_MSG_RESULT([probing...])
27537aa0a607SDon Lewis   AC_PATH_PROG([CCACHE],[ccache],[not_found])
27547aa0a607SDon Lewis   if test "$CCACHE" = "not_found" ; then
27557aa0a607SDon Lewis      AC_MSG_NOTICE([not enabling --ccache-skip (ccache not found)])
27567aa0a607SDon Lewis   else
27577aa0a607SDon Lewis      # check ccache version
27587aa0a607SDon Lewis      AC_MSG_CHECKING([whether version of ccache is suitable])
27597aa0a607SDon Lewis      CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
27607aa0a607SDon Lewis      if test "$CCACHE_VERSION" = "2.4_OOo"; then
27617aa0a607SDon Lewis         AC_MSG_RESULT([yes])
27627aa0a607SDon Lewis         AC_MSG_CHECKING([whether ccache is actually used for the build])
27637aa0a607SDon Lewis         AC_LANG_PUSH([C++])
27647aa0a607SDon Lewis         save_CXXFLAGS=$CXXFLAGS
27657aa0a607SDon Lewis         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
27667aa0a607SDon Lewis         dnl an empty program will do, we're checking the compiler flags
27677aa0a607SDon Lewis         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
27687aa0a607SDon Lewis            [use_ccache=yes], [use_ccache=no])
27697aa0a607SDon Lewis         if test $use_ccache = yes ; then
27707aa0a607SDon Lewis            AC_MSG_RESULT([yes, will enable --ccache-skip])
27717aa0a607SDon Lewis            AC_SUBST([USE_CCACHE], [YES])
27727aa0a607SDon Lewis         else
27737aa0a607SDon Lewis            AC_MSG_RESULT([no, will not enable --ccache-skip])
27747aa0a607SDon Lewis         fi
27757aa0a607SDon Lewis         CXXFLAGS=$save_CXXFLAGS
27767aa0a607SDon Lewis         AC_LANG_POP([C++])
27777aa0a607SDon Lewis      else
27787aa0a607SDon Lewis         AC_MSG_RESULT([no])
27797aa0a607SDon Lewis         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip])
27807aa0a607SDon Lewis      fi
27817aa0a607SDon Lewis   fi
27827aa0a607SDon Lewiselse
27837aa0a607SDon Lewis   AC_MSG_ERROR([invalid option to --enable-ccache-skip. Valid values are "auto", "yes" and "no"])
27847aa0a607SDon Lewisfi
27857aa0a607SDon Lewis
27867aa0a607SDon Lewisdnl ===================================================================
27877aa0a607SDon Lewisdnl system stl sanity tests
27887aa0a607SDon Lewisdnl ===================================================================
27897aa0a607SDon Lewisif false ; then # TODO: update TR1 compliant STLs
27907aa0a607SDon Lewisif test "$USE_SYSTEM_STL" = "YES"; then
27917aa0a607SDon Lewis   AC_MSG_CHECKING([system stl sanity])
27927aa0a607SDon Lewis   AC_LANG_PUSH([C++])
27937aa0a607SDon Lewis
27947aa0a607SDon Lewis   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
27957aa0a607SDon Lewis      AC_MSG_CHECKING([if STL headers are visibility safe])
27967aa0a607SDon Lewis      AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
27977aa0a607SDon Lewis      AC_MSG_RESULT([$stlvisok])
27987aa0a607SDon Lewis      if test "$stlvisok" = "no"; then
27997aa0a607SDon Lewis         AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
28007aa0a607SDon Lewis         echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
28017aa0a607SDon Lewis         unset HAVE_GCC_VISIBILITY_FEATURE
28027aa0a607SDon Lewis      fi
28037aa0a607SDon Lewis   fi
28047aa0a607SDon Lewis
28057aa0a607SDon Lewis   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
28067aa0a607SDon Lewis      sharedlink_ldflags_save=$LDFLAGS
28077aa0a607SDon Lewis      LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
28087aa0a607SDon Lewis
28097aa0a607SDon Lewis      AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
28107aa0a607SDon Lewis      AC_TRY_LINK([#include <sstream>
28117aa0a607SDon Lewisusing namespace std;
28127aa0a607SDon Lewis],[istringstream strm( "test" ); return 0;],
28137aa0a607SDon Lewis      $EGREP -q  unresolvable conftest.err;
28147aa0a607SDon Lewis      if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi,
28157aa0a607SDon Lewis      gccvisok=no)
28167aa0a607SDon Lewis      AC_MSG_RESULT([$gccvisok])
28177aa0a607SDon Lewis      if test "$gccvisok" = "no"; then
28187aa0a607SDon Lewis         AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility])
28197aa0a607SDon Lewis         echo "Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >> warn
28207aa0a607SDon Lewis         unset HAVE_GCC_VISIBILITY_FEATURE
28217aa0a607SDon Lewis      fi
28227aa0a607SDon Lewis
28237aa0a607SDon Lewis      LDFLAGS=$sharedlink_ldflags_save
28247aa0a607SDon Lewis   fi
28257aa0a607SDon Lewis
28267aa0a607SDon Lewis   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
28277aa0a607SDon Lewis      AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
28287aa0a607SDon Lewis      cat >visibility.cxx <<_ACEOF
28297aa0a607SDon Lewis#pragma GCC visibility push(hidden)
28307aa0a607SDon Lewisstruct __attribute__ ((visibility ("default"))) TestStruct {
28317aa0a607SDon Lewis  static void Init();
28327aa0a607SDon Lewis};
28337aa0a607SDon Lewis__attribute__ ((visibility ("default"))) void TestFunc() {
28347aa0a607SDon Lewis  TestStruct::Init();
28357aa0a607SDon Lewis}
28367aa0a607SDon Lewis_ACEOF
28377aa0a607SDon Lewis      if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
28387aa0a607SDon Lewis         gccvisbroken=yes
28397aa0a607SDon Lewis      else
28407aa0a607SDon Lewis         case "$build_cpu" in
28417aa0a607SDon Lewis            i?86|x86_64)
28427aa0a607SDon Lewis               if $EGREP -q '@PLT' visibility.s; then
28437aa0a607SDon Lewis                  gccvisbroken=no
28447aa0a607SDon Lewis               else
28457aa0a607SDon Lewis                  gccvisbroken=yes
28467aa0a607SDon Lewis               fi
28477aa0a607SDon Lewis               ;;
28487aa0a607SDon Lewis            *)
28497aa0a607SDon Lewis               gccvisbroken=no
28507aa0a607SDon Lewis               ;;
28517aa0a607SDon Lewis         esac
28527aa0a607SDon Lewis      fi
28537aa0a607SDon Lewis      rm -f visibility.s visibility.cxx
28547aa0a607SDon Lewis
28557aa0a607SDon Lewis      AC_MSG_RESULT([$gccvisbroken])
28567aa0a607SDon Lewis      if test "$gccvisbroken" = "yes"; then
28577aa0a607SDon Lewis         AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
28587aa0a607SDon Lewis         echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
28597aa0a607SDon Lewis         unset HAVE_GCC_VISIBILITY_FEATURE
28607aa0a607SDon Lewis      fi
28617aa0a607SDon Lewis   fi
28627aa0a607SDon Lewis
28637aa0a607SDon Lewis   AC_LANG_POP([C++])
28647aa0a607SDon Lewisfi
28657aa0a607SDon Lewisfi # endof TODO: update TR1 compliant STLs
28667aa0a607SDon Lewis
28677aa0a607SDon LewisAC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
28687aa0a607SDon Lewis
28697aa0a607SDon Lewisdnl ===================================================================
28707aa0a607SDon Lewisdnl allocator
28717aa0a607SDon Lewisdnl ===================================================================
28727aa0a607SDon LewisAC_MSG_CHECKING([which memory allocator to use])
28737aa0a607SDon Lewisif test "$with_alloc" = "system"; then
28747aa0a607SDon Lewis    AC_MSG_RESULT([system])
28757aa0a607SDon Lewis    ALLOC="SYS_ALLOC";
28767aa0a607SDon Lewis    AC_CHECK_FUNCS([malloc realloc calloc free])
28777aa0a607SDon Lewisfi
28787aa0a607SDon Lewisif test "$with_alloc" = "tcmalloc"; then
28797aa0a607SDon Lewis    AC_MSG_RESULT(tcmalloc)
28807aa0a607SDon Lewis    if ! echo $build_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
28817aa0a607SDon Lewis        AC_MSG_ERROR([tcmalloc only available/usable on ix86])
28827aa0a607SDon Lewis    fi
28837aa0a607SDon Lewis    AC_CHECK_LIB(tcmalloc, malloc, [],
28847aa0a607SDon Lewis        [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
28857aa0a607SDon Lewis    ALLOC="TCMALLOC";
28867aa0a607SDon Lewisfi
28877aa0a607SDon Lewisif test "$with_alloc" = "jemalloc"; then
28887aa0a607SDon Lewis  if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
28897aa0a607SDon Lewis    AC_MSG_RESULT(jemalloc)
28907aa0a607SDon Lewis    save_CFLAGS=$CFLAGS
28917aa0a607SDon Lewis    CFLAGS="$CFLAGS -pthread"
28927aa0a607SDon Lewis    AC_CHECK_LIB(jemalloc, malloc, [],
28937aa0a607SDon Lewis        [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
28947aa0a607SDon Lewis    ALLOC="JEMALLOC";
28957aa0a607SDon Lewis    CFLAGS=$save_CFLAGS
28967aa0a607SDon Lewis  else
28977aa0a607SDon Lewis    AC_MSG_RESULT([system])
28987aa0a607SDon Lewis    ALLOC="SYS_ALLOC";
28997aa0a607SDon Lewis    AC_CHECK_FUNCS([malloc realloc calloc free])
29007aa0a607SDon Lewis  fi
29017aa0a607SDon Lewisfi
29027aa0a607SDon Lewisif test "$with_alloc" = "internal" -o -z "$with_alloc"; then
29037aa0a607SDon Lewis   AC_MSG_RESULT([internal])
29047aa0a607SDon Lewisfi
29057aa0a607SDon LewisAC_SUBST(ALLOC)
29067aa0a607SDon Lewis
29077aa0a607SDon Lewisdnl ===================================================================
29087aa0a607SDon Lewisdnl Custom build version
29097aa0a607SDon Lewisdnl ===================================================================
29107aa0a607SDon Lewis
29117aa0a607SDon LewisAC_MSG_CHECKING([whether to add custom build version])
29127aa0a607SDon Lewisif test "z$with_build_version" != "z"; then
29137aa0a607SDon Lewis   BUILD_VER_STRING=$with_build_version
29147aa0a607SDon Lewis   AC_MSG_RESULT([yes, $BUILD_VER_STRING])
29157aa0a607SDon Lewiselse
291617435e9bSJuergen Schmidt   BUILD_VER_STRING=`date +"%Y-%m-%d %H:%M:%S (%a, %d %b %Y)"`
29177aa0a607SDon Lewis   AC_MSG_RESULT([no])
29187aa0a607SDon Lewisfi
29197aa0a607SDon LewisAC_SUBST(BUILD_VER_STRING)
29207aa0a607SDon Lewis
29217aa0a607SDon Lewisdnl ===================================================================
29227aa0a607SDon Lewisdnl Java support enable
29237aa0a607SDon Lewisdnl ===================================================================
29247aa0a607SDon LewisAC_MSG_CHECKING([whether to build with Java support])
29257aa0a607SDon Lewisif test "$WITH_JAVA" != "no"; then
29267aa0a607SDon Lewis   AC_MSG_RESULT([yes])
29277aa0a607SDon Lewis   SOLAR_JAVA="TRUE"
29287aa0a607SDon Lewiselse
29297aa0a607SDon Lewis   AC_MSG_RESULT([no])
29307aa0a607SDon Lewis   SOLAR_JAVA=""
29317aa0a607SDon Lewis
29327aa0a607SDon Lewis   AC_MSG_WARN([building without java will mean some features will not be available])
29337aa0a607SDon Lewis   echo "building without java will mean some features will not be available" >>warn
29347aa0a607SDon Lewisfi
29357aa0a607SDon LewisAC_SUBST(SOLAR_JAVA)
29367aa0a607SDon Lewis
29377aa0a607SDon Lewisif test "$_os" = "Linux" && test "$build_cpu" = "powerpc"; then
29387aa0a607SDon Lewis   # IBMs JDK needs this...
29397aa0a607SDon Lewis   JITC_PROCESSOR_TYPE=6
29407aa0a607SDon Lewis   export JITC_PROCESSOR_TYPE
29417aa0a607SDon Lewisfi
29427aa0a607SDon Lewis
29437aa0a607SDon Lewisif test "$_os" = "WINNT"; then
29447aa0a607SDon Lewis   if test -z "$with_jdk_home"; then
29457aa0a607SDon Lewis      _jdk_home=`./oowintool --jdk-home`
29467aa0a607SDon Lewis       if test -d "$_jdk_home"; then
29477aa0a607SDon Lewis          with_jdk_home="$_jdk_home"
29487aa0a607SDon Lewis       fi
29497aa0a607SDon Lewis   else
29507aa0a607SDon Lewis      with_jdk_home=`cygpath -u "$with_jdk_home"`
29517aa0a607SDon Lewis   fi
29527aa0a607SDon Lewisfi
29537aa0a607SDon Lewis
29547aa0a607SDon Lewisdnl ===================================================================
29557aa0a607SDon Lewisdnl Checks for java
29567aa0a607SDon Lewisdnl ===================================================================
29577aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
29587aa0a607SDon Lewis   JAVA_HOME=; export JAVA_HOME
29597aa0a607SDon Lewis   if test -z "$with_jdk_home"; then
29607aa0a607SDon Lewis      AC_PATH_PROG(JAVAINTERPRETER, $WITH_JAVA)
29617aa0a607SDon Lewis   else
29627aa0a607SDon Lewis      _java_path="$with_jdk_home/bin/$WITH_JAVA"
29637aa0a607SDon Lewis      dnl Check if there is a java interpreter at all.
29647aa0a607SDon Lewis      if test -x "$_java_path"; then
29657aa0a607SDon Lewis         JAVAINTERPRETER=$_java_path
29667aa0a607SDon Lewis      else
29677aa0a607SDon Lewis         AC_MSG_ERROR([$_java_path not found, please use --with-jdk-home])
29687aa0a607SDon Lewis      fi
29697aa0a607SDon Lewis   fi
29707aa0a607SDon Lewis   if test "$_os" = "WINNT"; then
29717aa0a607SDon Lewis      if test x`echo "$JAVAINTERPRETER" | grep -i '\.exe$'` = x; then
29727aa0a607SDon Lewis          JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
29737aa0a607SDon Lewis      fi
29747aa0a607SDon Lewis      JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
29757aa0a607SDon Lewis      JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
29767aa0a607SDon Lewis   elif test "$_os" = "Darwin"; then
29777aa0a607SDon Lewis         JAVAIFLAGS=""
29787aa0a607SDon Lewis   fi
29797aa0a607SDon Lewisfi
29807aa0a607SDon Lewis
29817aa0a607SDon Lewisdnl ===================================================================
29827aa0a607SDon Lewisdnl Checks for JDK.
29837aa0a607SDon Lewisdnl ===================================================================
29847aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
29857aa0a607SDon Lewis   _gij_longver=0
29867aa0a607SDon Lewis   AC_MSG_CHECKING([the installed JDK])
29877aa0a607SDon Lewis   if test -n "$JAVAINTERPRETER"; then
29887aa0a607SDon Lewis      dnl java -version sends output to stderr!
29897aa0a607SDon Lewis      if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
29907aa0a607SDon Lewis         AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
29917aa0a607SDon Lewis#        dnl Kaffe specific tests
29927aa0a607SDon Lewis#        KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP "  Version:" | $SED -r "s/.*  Version: ([[0-9\.]]*).*/\1/"`
29937aa0a607SDon Lewis#        if test -z "$KAFFE_VER"; then
29947aa0a607SDon Lewis#          AC_MSG_ERROR([looks like Kaffe but version detection failed])
29957aa0a607SDon Lewis#        fi
29967aa0a607SDon Lewis#        _kaffe_ver=`echo "$KAFFE_VER" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
29977aa0a607SDon Lewis#        if test "$_kaffe_ver" -lt 10100; then
29987aa0a607SDon Lewis#           AC_MSG_ERROR([Kaffe is too old ($KAFFE_VER - $_kaffe_ver), you need at least 1.1.0])
29997aa0a607SDon Lewis#        fi
30007aa0a607SDon Lewis#        JDK=kaffe
30017aa0a607SDon Lewis#
30027aa0a607SDon Lewis#        dnl TODO: define some project exclusion variables
30037aa0a607SDon Lewis#
30047aa0a607SDon Lewis#        AC_MSG_RESULT([checked (Kaffe $KAFFE_VER)])
30057aa0a607SDon Lewis#        AC_MSG_WARN([EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile])
30067aa0a607SDon Lewis#        echo "EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile" >>warn
30077aa0a607SDon Lewis#        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
30087aa0a607SDon Lewis      elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then
30097aa0a607SDon Lewis        JDK=gcj
30107aa0a607SDon Lewis        AC_MSG_RESULT([checked (gcj)])
30117aa0a607SDon Lewis        _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
30127aa0a607SDon Lewis        _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
30137aa0a607SDon Lewis
30147aa0a607SDon Lewis      elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | grep -c "BEA"` -gt 0; then
30157aa0a607SDon Lewis         AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
30167aa0a607SDon Lewis#        JDK=bea
30177aa0a607SDon Lewis#
30187aa0a607SDon Lewis#        dnl BEA JDK specific tests
30197aa0a607SDon Lewis#        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
30207aa0a607SDon Lewis#        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
30217aa0a607SDon Lewis#
30227aa0a607SDon Lewis#        if test "$_jdk_ver" -lt 10500; then
30237aa0a607SDon Lewis#          AC_MSG_ERROR([JDK is too old, you need at least BEA JDK 1.5.0])
30247aa0a607SDon Lewis#        fi
30257aa0a607SDon Lewis#
30267aa0a607SDon Lewis#        AC_MSG_RESULT([checked (BEA JDK $_jdk)])
30277aa0a607SDon Lewis#
30287aa0a607SDon Lewis#        if test "$with_jdk_home" = ""; then
30297aa0a607SDon Lewis#             AC_MSG_ERROR([In order to successfully build Apache OpenOffice using the BEA JDK,
30307aa0a607SDon Lewis#you must use the "--with-jdk-home" configure option explicitly])
30317aa0a607SDon Lewis#        fi
30327aa0a607SDon Lewis#
30337aa0a607SDon Lewis#        AC_MSG_WARN([A bug in certain BEA JREs can prevent you from successfully compiling some modules])
30347aa0a607SDon Lewis#        echo "A bug in certain BEA JREs can prevent you from successfully compiling some modules" >>warn
30357aa0a607SDon Lewis#
30367aa0a607SDon Lewis#        JAVA_HOME=$with_jdk_home
30377aa0a607SDon Lewis#
30387aa0a607SDon Lewis      elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | grep -c "IBM"` -gt 0; then
30397aa0a607SDon Lewis        JDK=ibm
30407aa0a607SDon Lewis
30417aa0a607SDon Lewis        dnl IBM JDK specific tests
30427aa0a607SDon Lewis        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
30437aa0a607SDon Lewis        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
30447aa0a607SDon Lewis
30457aa0a607SDon Lewis        if test "$_jdk_ver" -lt 10500; then
30467aa0a607SDon Lewis             AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
30477aa0a607SDon Lewis        fi
30487aa0a607SDon Lewis
30497aa0a607SDon Lewis        AC_MSG_RESULT([checked (IBM JDK $_jdk)])
30507aa0a607SDon Lewis
30517aa0a607SDon Lewis        if test "$with_jdk_home" = ""; then
30527aa0a607SDon Lewis             AC_MSG_ERROR([In order to successfully build Apache OpenOffice using the IBM JDK,
30537aa0a607SDon Lewisyou must use the "--with-jdk-home" configure option explicitly])
30547aa0a607SDon Lewis        fi
30557aa0a607SDon Lewis
30567aa0a607SDon Lewis        JAVA_HOME=$with_jdk_home
30577aa0a607SDon Lewis
30587aa0a607SDon Lewis      else
30597aa0a607SDon Lewis        JDK=sun
30607aa0a607SDon Lewis
30617aa0a607SDon Lewis        dnl SUN JDK specific tests
30627aa0a607SDon Lewis        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
30637aa0a607SDon Lewis        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
30647aa0a607SDon Lewis
30657aa0a607SDon Lewis        if test "$_jdk_ver" -lt 10500; then
30667aa0a607SDon Lewis             AC_MSG_ERROR([JDK is too old, you need at least 1.5])
30677aa0a607SDon Lewis        fi
30687aa0a607SDon Lewis        AC_MSG_RESULT([checked (JDK $_jdk)])
30697aa0a607SDon Lewis        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
30707aa0a607SDon Lewis        if test "$_os" = "WINNT"; then
30717aa0a607SDon Lewis          JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
30727aa0a607SDon Lewis        fi
30737aa0a607SDon Lewis        if test "$_os" = "OS2"; then
30747aa0a607SDon Lewis          JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
30757aa0a607SDon Lewis        fi
30767aa0a607SDon Lewis      fi
30777aa0a607SDon Lewis   else
30787aa0a607SDon Lewis      AC_MSG_ERROR([JAVA not found. You need at least jdk-1.5, or gcj-4])
30797aa0a607SDon Lewis   fi
30807aa0a607SDon Lewiselse
30817aa0a607SDon Lewis   dnl Java disabled
30827aa0a607SDon Lewis   JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
30837aa0a607SDon Lewisfi
30847aa0a607SDon Lewis
30857aa0a607SDon Lewisdnl ===================================================================
30867aa0a607SDon Lewisdnl Checks for javac
30877aa0a607SDon Lewisdnl ===================================================================
30887aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
30897aa0a607SDon Lewis    if test "$JDK" = "gcj"; then
30907aa0a607SDon Lewis        javacompiler=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
30917aa0a607SDon Lewis    else
30927aa0a607SDon Lewis        javacompiler="javac"
30937aa0a607SDon Lewis    fi
30947aa0a607SDon Lewis    if test "$_os" = "OS2"; then
30957aa0a607SDon Lewis      if test x`echo "$javacompiler" | grep -i '\.exe$'` = x; then
30967aa0a607SDon Lewis          javacompiler="${javacompiler}.exe"
30977aa0a607SDon Lewis      fi
30987aa0a607SDon Lewis    fi
30997aa0a607SDon Lewis    if test -z "$with_jdk_home"; then
31007aa0a607SDon Lewis        AC_PATH_PROG(JAVACOMPILER, $javacompiler)
31017aa0a607SDon Lewis    else
31027aa0a607SDon Lewis        _javac_path="$with_jdk_home/bin/$javacompiler"
31037aa0a607SDon Lewis        dnl Check if there is a java compiler at all.
31047aa0a607SDon Lewis        if test -x "$_javac_path"; then
31057aa0a607SDon Lewis            JAVACOMPILER=$_javac_path
31067aa0a607SDon Lewis        fi
31077aa0a607SDon Lewis    fi
31087aa0a607SDon Lewis    if test -z "$JAVACOMPILER"; then
31097aa0a607SDon Lewis      AC_MSG_ERROR([$javacompiler not found, please use --with-jdk-home])
31107aa0a607SDon Lewis    fi
31117aa0a607SDon Lewis    if test "$_os" = "WINNT"; then
31127aa0a607SDon Lewis       if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then
31137aa0a607SDon Lewis          JAVACOMPILER="${JAVACOMPILER}.exe"
31147aa0a607SDon Lewis       fi
31157aa0a607SDon Lewis       JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
31167aa0a607SDon Lewis       JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
31177aa0a607SDon Lewis    fi
31187aa0a607SDon Lewis    if test "$_os" = "OS2"; then
31197aa0a607SDon Lewis       if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then
31207aa0a607SDon Lewis          JAVACOMPILER="${JAVACOMPILER}.exe"
31217aa0a607SDon Lewis       fi
31227aa0a607SDon Lewis    fi
31237aa0a607SDon Lewis
31247aa0a607SDon Lewis    if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then
31257aa0a607SDon Lewis        AC_MSG_CHECKING([re-checking JDK])
31267aa0a607SDon Lewis        JDK=gcj
31277aa0a607SDon Lewis        AC_MSG_RESULT([checked (ecj)])
31287aa0a607SDon Lewis        #TODO: what's to do here? some switch to do 1.5 compiling?
31297aa0a607SDon Lewis        JAVAFLAGS="-source 1.5 -target 1.5"
31307aa0a607SDon Lewis        _gij_longver="40200"
31317aa0a607SDon Lewis    fi
31327aa0a607SDon Lewisfi
31337aa0a607SDon Lewis
31347aa0a607SDon LewisJAVACISGCJ=""
31357aa0a607SDon Lewisdnl ===================================================================
31367aa0a607SDon Lewisdnl Checks that javac is gcj
31377aa0a607SDon Lewisdnl ===================================================================
31387aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
31397aa0a607SDon Lewis    if test `$JAVACOMPILER --version 2>&1 | grep -c "GCC"` -gt 0; then
31407aa0a607SDon Lewis        JAVACISGCJ="yes"
31417aa0a607SDon Lewis    fi
31427aa0a607SDon Lewisfi
31437aa0a607SDon LewisAC_SUBST(JAVACISGCJ)
31447aa0a607SDon Lewis
31457aa0a607SDon Lewisdnl ===================================================================
31467aa0a607SDon Lewisdnl Checks for javadoc
31477aa0a607SDon Lewisdnl ===================================================================
31487aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
31497aa0a607SDon Lewis    if test -z "$with_jdk_home"; then
31507aa0a607SDon Lewis        AC_PATH_PROG(JAVADOC, javadoc)
31517aa0a607SDon Lewis    else
31527aa0a607SDon Lewis        _javadoc_path="$with_jdk_home/bin/javadoc"
31537aa0a607SDon Lewis        if test "$_os" = "OS2"; then
31547aa0a607SDon Lewis          if test x`echo "$_javadoc_path" | grep -i '\.exe$'` = x; then
31557aa0a607SDon Lewis              _javadoc_path="${_javadoc_path}.exe"
31567aa0a607SDon Lewis          fi
31577aa0a607SDon Lewis        fi
31587aa0a607SDon Lewis        dnl Check if there is a javadoc at all.
31597aa0a607SDon Lewis        if test -x "$_javadoc_path"; then
31607aa0a607SDon Lewis            JAVADOC=$_javadoc_path
31617aa0a607SDon Lewis        else
31627aa0a607SDon Lewis            AC_PATH_PROG(JAVADOC, javadoc)
31637aa0a607SDon Lewis        fi
31647aa0a607SDon Lewis    fi
31657aa0a607SDon Lewis    if test -z "$JAVADOC"; then
31667aa0a607SDon Lewis      AC_MSG_ERROR([$_javadoc_path not found, please use --with-jdk-home])
31677aa0a607SDon Lewis    fi
31687aa0a607SDon Lewis    if test "$_os" = "WINNT"; then
31697aa0a607SDon Lewis        if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then
31707aa0a607SDon Lewis            JAVADOC="${JAVADOC}.exe"
31717aa0a607SDon Lewis        fi
31727aa0a607SDon Lewis        JAVADOC=`cygpath -d "$JAVADOC"`
31737aa0a607SDon Lewis        JAVADOC=`cygpath -u "$JAVADOC"`
31747aa0a607SDon Lewis    fi
31757aa0a607SDon Lewis    if test "$_os" = "OS2"; then
31767aa0a607SDon Lewis        if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then
31777aa0a607SDon Lewis            JAVADOC="${JAVADOC}.exe"
31787aa0a607SDon Lewis        fi
31797aa0a607SDon Lewis    fi
31807aa0a607SDon Lewisfi
31817aa0a607SDon Lewis
31827aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
31837aa0a607SDon Lewis    dnl first check if we have been asked to autodetect JAVA_HOME with a recent gij
31847aa0a607SDon Lewis    if test "$JDK" = "gcj" -a -z "$JAVA_HOME"; then
31857aa0a607SDon Lewis      if test "x$with_jdk_home" = "x" -a "$_gij_longver" -ge "40200"; then
31867aa0a607SDon Lewis        cat > findhome.java <<_ACEOF
31877aa0a607SDon Lewis[import java.io.File;
31887aa0a607SDon Lewis
31897aa0a607SDon Lewisclass findhome
31907aa0a607SDon Lewis{
31917aa0a607SDon Lewis    public static void main(String args[])
31927aa0a607SDon Lewis    {
31937aa0a607SDon Lewis        String jrelocation = System.getProperty("java.home");
31947aa0a607SDon Lewis        File jre = new File(jrelocation);
31957aa0a607SDon Lewis        System.out.println(jre.getParent());
31967aa0a607SDon Lewis    }
31977aa0a607SDon Lewis}]
31987aa0a607SDon Lewis_ACEOF
31997aa0a607SDon Lewis        AC_MSG_CHECKING([if javac works])
32007aa0a607SDon Lewis        javac_cmd="$JAVACOMPILER findhome.java 1>&2"
32017aa0a607SDon Lewis        AC_TRY_EVAL(javac_cmd)
32027aa0a607SDon Lewis        if test $? = 0 && test -f ./findhome.class ; then
32037aa0a607SDon Lewis          AC_MSG_RESULT([javac works])
32047aa0a607SDon Lewis        else
32057aa0a607SDon Lewis          echo "configure: javac test failed" >&5
32067aa0a607SDon Lewis          cat findhome.java >&5
32077aa0a607SDon Lewis          AC_MSG_ERROR([javac does not work - java projects will not build!])
32087aa0a607SDon Lewis        fi
32097aa0a607SDon Lewis
32107aa0a607SDon Lewis        AC_MSG_CHECKING([if gij knows its java.home])
32117aa0a607SDon Lewis        JAVA_HOME=`$JAVAINTERPRETER findhome`
32127aa0a607SDon Lewis        if test $? = 0 && test "$JAVA_HOME" != "" ; then
32137aa0a607SDon Lewis          AC_MSG_RESULT([$JAVA_HOME])
32147aa0a607SDon Lewis        else
32157aa0a607SDon Lewis          echo "configure: java test failed" >&5
32167aa0a607SDon Lewis          cat findhome.java >&5
32177aa0a607SDon Lewis          AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
32187aa0a607SDon Lewis        fi
32197aa0a607SDon Lewis      else
32207aa0a607SDon Lewis        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$WITH_JAVA,,p"`
32217aa0a607SDon Lewis      fi
32227aa0a607SDon Lewis    fi
32237aa0a607SDon Lewis
32247aa0a607SDon Lewis    dnl second sanity check JAVA_HOME if possible
32257aa0a607SDon Lewis    if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
32267aa0a607SDon Lewis      # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
32277aa0a607SDon Lewis      if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
32287aa0a607SDon Lewis         javac_link_f=`readlink -f "$JAVACOMPILER" 2>/dev/null`
32297aa0a607SDon Lewis         if test $? == 0 && test "$JAVACOMPILER" != "$javac_link_f"; then
32307aa0a607SDon Lewis          # try to recover first by looking whether we have a alternatives
32317aa0a607SDon Lewis          # system as in Debian or newer SuSEs where following /usr/bin/javac
32327aa0a607SDon Lewis          # over /etc/alternatives/javac leads to the right bindir where we
32337aa0a607SDon Lewis          # just need to strip a bit away to get a valid JAVA_HOME
32347aa0a607SDon Lewis          # Solaris 11 is even worse, because target is relative, so use -f
32357aa0a607SDon Lewis            JAVA_HOME="$javac_link_f"
32367aa0a607SDon Lewis         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
32377aa0a607SDon Lewis          # Darwin readlink(1) is so primitive it doesn't even support -f
32387aa0a607SDon Lewis          # maybe only one level of symlink (e.g. on Mac)
32397aa0a607SDon Lewis            JAVA_HOME=`readlink $JAVACOMPILER`
32407aa0a607SDon Lewis         else
32417aa0a607SDon Lewis          # else warn
32427aa0a607SDon Lewis          AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
32437aa0a607SDon Lewis          AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
32447aa0a607SDon Lewis          echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
32457aa0a607SDon Lewis          echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
32467aa0a607SDon Lewis          fi
32477aa0a607SDon Lewis         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
32487aa0a607SDon Lewis         if test "$JAVA_HOME" != "/usr"; then
32497aa0a607SDon Lewis            if test "$_os" = "Darwin"; then
32507aa0a607SDon Lewis               dnl Leopard returns a non-suitable path with readlink - points to "Current" only
32517aa0a607SDon Lewis               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
32527aa0a607SDon Lewis               dnl Tiger already returns a JDK path..
32537aa0a607SDon Lewis               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
32547aa0a607SDon Lewis            else
32557aa0a607SDon Lewis               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
32567aa0a607SDon Lewis            fi
32577aa0a607SDon Lewis         fi
32587aa0a607SDon Lewis      fi
32597aa0a607SDon Lewis      # now check if $JAVA_HOME is really valid
32607aa0a607SDon Lewis      if test "$_os" = "Darwin"; then
32617aa0a607SDon Lewis         if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
32627aa0a607SDon Lewis            JAVA_HOME_OK="NO"
32637aa0a607SDon Lewis         fi
32647aa0a607SDon Lewis      elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
32657aa0a607SDon Lewis         JAVA_HOME_OK="NO"
32667aa0a607SDon Lewis      fi
32677aa0a607SDon Lewis      if test "$JAVA_HOME_OK" = "NO"; then
32687aa0a607SDon Lewis         AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
32697aa0a607SDon Lewis         AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
32707aa0a607SDon Lewis         AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
32717aa0a607SDon Lewis         echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
32727aa0a607SDon Lewis         echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
32737aa0a607SDon Lewis         echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
32747aa0a607SDon Lewis#         if test "$JDK" = "gcj"; then
32757aa0a607SDon Lewis#             echo "e.g. install java-1.4.2-gcj-compat-devel and use --with-jdk-home=/usr/lib/jvm/java-1.4.2-gcj" >> warn
32767aa0a607SDon Lewis#         fi
32777aa0a607SDon Lewis      fi
32787aa0a607SDon Lewis    fi
32797aa0a607SDon Lewisfi
32807aa0a607SDon Lewis
32817aa0a607SDon LewisAWTLIB=
32827aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
32837aa0a607SDon Lewis   AC_MSG_CHECKING([for jawt lib name])
32847aa0a607SDon Lewis   if test "$JDK" = "gcj"; then
32857aa0a607SDon Lewis      save_CFLAGS=$CFLAGS
32867aa0a607SDon Lewis      save_LDFLAGS=$LDFLAGS
32877aa0a607SDon Lewis      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
32887aa0a607SDon Lewis      LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
32897aa0a607SDon Lewis      exec 6>/dev/null # no output
32907aa0a607SDon Lewis      AC_CHECK_HEADER(jni.h, [],
32917aa0a607SDon Lewis                    [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
32927aa0a607SDon Lewis      AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
32937aa0a607SDon Lewis      exec 6>&1 # output on again
32947aa0a607SDon Lewis      CFLAGS=$save_CFLAGS
32957aa0a607SDon Lewis      LDFLAGS=$save_LDFLAGS
32967aa0a607SDon Lewis   fi
32977aa0a607SDon Lewis   # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
32987aa0a607SDon Lewis   # A workaround is to link also against libpmawt.so
32997aa0a607SDon Lewis   if test "$JDK" = "ibm" ; then
33007aa0a607SDon Lewis      save_CFLAGS=$CFLAGS
33017aa0a607SDon Lewis      save_LDFLAGS=$LDFLAGS
33027aa0a607SDon Lewis      save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
33037aa0a607SDon Lewis      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
33047aa0a607SDon Lewis      LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
33057aa0a607SDon Lewis      LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
33067aa0a607SDon Lewis      export LD_LIBRARY_PATH
33077aa0a607SDon Lewis      exec 6>/dev/null # no output
33087aa0a607SDon Lewis      AC_CHECK_HEADER(jni.h, [],
33097aa0a607SDon Lewis                    [AC_MSG_ERROR([jni.h could not be found.])], [])
33107aa0a607SDon Lewis      AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
33117aa0a607SDon Lewis      if test -z "$AWTLIB"; then
33127aa0a607SDon Lewis         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
33137aa0a607SDon Lewis         AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
33147aa0a607SDon Lewis      fi
33157aa0a607SDon Lewis      exec 6>&1 # output on again
33167aa0a607SDon Lewis      CFLAGS=$save_CFLAGS
33177aa0a607SDon Lewis      LDFLAGS=$save_LDFLAGS
33187aa0a607SDon Lewis      LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
33197aa0a607SDon Lewis   fi
33207aa0a607SDon Lewis   if test -z "$AWTLIB"; then
33217aa0a607SDon Lewis      AWTLIB=-ljawt
33227aa0a607SDon Lewis   fi
33237aa0a607SDon Lewis   AC_MSG_RESULT([$AWTLIB])
33247aa0a607SDon Lewis   AC_SUBST(AWTLIB)
33257aa0a607SDon Lewisfi
33267aa0a607SDon Lewis
33277aa0a607SDon Lewisdnl ===================================================================
33287aa0a607SDon Lewisdnl Check for optional gcj for AOT
33297aa0a607SDon Lewisdnl ===================================================================
33307aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
33317aa0a607SDon Lewis  AC_MSG_CHECKING([whether to enable gcj aot compilation])
33327aa0a607SDon Lewis  if test -n "$enable_gcjaot" && test "$enable_gcjaot" != "no"; then
33337aa0a607SDon Lewis     AC_MSG_RESULT([yes])
33347aa0a607SDon Lewis     if test `echo $WITH_JAVA | grep -c "gij"` -eq 0; then
33357aa0a607SDon Lewis        gcjaot="gcj"
33367aa0a607SDon Lewis     else
33377aa0a607SDon Lewis        gcjaot=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g"`
33387aa0a607SDon Lewis     fi
33397aa0a607SDon Lewis     AC_MSG_RESULT([$gcjaot])
33407aa0a607SDon Lewis     if test -n "$with_jdk_home"; then
33417aa0a607SDon Lewis        _javac_path="$with_jdk_home/bin/$gcjaot"
33427aa0a607SDon Lewis        dnl Check if there is a gcj at all.
33437aa0a607SDon Lewis        if test -x "$_javac_path"; then
33447aa0a607SDon Lewis           JAVAAOTCOMPILER=$_javac_path
33457aa0a607SDon Lewis        fi
33467aa0a607SDon Lewis     fi
33477aa0a607SDon Lewis     if test -z "$JAVAAOTCOMPILER"; then
33487aa0a607SDon Lewis        AC_PATH_PROG(JAVAAOTCOMPILER, $gcjaot)
33497aa0a607SDon Lewis     fi
33507aa0a607SDon Lewis     if test -z "$JAVAAOTCOMPILER"; then
33517aa0a607SDon Lewis        AC_MSG_WARN([$gcjaot not found, please use --with-jdk-home])
33527aa0a607SDon Lewis     fi
33537aa0a607SDon Lewis  else
33547aa0a607SDon Lewis     AC_MSG_RESULT([no])
33557aa0a607SDon Lewis  fi
33567aa0a607SDon Lewisfi
33577aa0a607SDon Lewis
33587aa0a607SDon LewisAC_SUBST(JAVA_HOME)
33597aa0a607SDon LewisAC_SUBST(JDK)
33607aa0a607SDon LewisAC_SUBST(JAVAFLAGS)
33617aa0a607SDon LewisAC_SUBST(JAVAINTERPRETER)
33627aa0a607SDon LewisAC_SUBST(JAVAIFLAGS)
33637aa0a607SDon LewisAC_SUBST(JAVACOMPILER)
33647aa0a607SDon LewisAC_SUBST(JAVAAOTCOMPILER)
33657aa0a607SDon LewisAC_SUBST(JAVADOC)
33667aa0a607SDon Lewis
33677aa0a607SDon Lewisdnl ===================================================================
33687aa0a607SDon Lewisdnl Checks for specific files.
33697aa0a607SDon Lewisdnl ===================================================================
33707aa0a607SDon Lewis
33717aa0a607SDon Lewisdnl ===================================================================
33727aa0a607SDon Lewisdnl Checks for programs.
33737aa0a607SDon Lewisdnl ===================================================================
33747aa0a607SDon Lewis
33757aa0a607SDon LewisAC_MSG_CHECKING([whether to enable EPM for packing])
33767aa0a607SDon Lewisif test "$enable_epm" = "yes"; then
33777aa0a607SDon Lewis   AC_MSG_RESULT([yes])
33787aa0a607SDon Lewis   dnl ===================================================================
33797aa0a607SDon Lewis   dnl Check for epm - not needed for windows
33807aa0a607SDon Lewis   dnl ===================================================================
33817aa0a607SDon Lewis   if test "$_os" != "WINNT"; then
33827aa0a607SDon Lewis      if test -n "$with_epm"; then
33837aa0a607SDon Lewis	      EPM=$with_epm
33847aa0a607SDon Lewis      else
33857aa0a607SDon Lewis         AC_PATH_PROG(EPM, epm, no)
33867aa0a607SDon Lewis      fi
33877aa0a607SDon Lewis
33887aa0a607SDon Lewis      # Override system epm and --with-epm if --with-epm-url is used.
33897aa0a607SDon Lewis      if test -n "$with_epm_url" ; then
33907aa0a607SDon Lewis         # At this moment we can not verify the URL or the content that we want to download.
33917aa0a607SDon Lewis       	 EPM_URL=$with_epm_url
33927aa0a607SDon Lewis       	 AC_MSG_RESULT([epm will be downloaded and compiled in bootstrap])
33937aa0a607SDon Lewis       	 EPM=
33947aa0a607SDon Lewis         echo "EPM will be built."
33957aa0a607SDon Lewis         BUILD_EPM=YES
33967aa0a607SDon Lewis         BUILD_TYPE="$BUILD_TYPE EPM"
33977aa0a607SDon Lewis      else
33987aa0a607SDon Lewis         if test "$EPM" = "no" ; then
33997aa0a607SDon Lewis	    AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm (--with-epm). Or specify an URL to an epm-3.7 source package (--with-epm-url); run configure with the --help option for a list of possible URLs.])
34007aa0a607SDon Lewis	 else
34017aa0a607SDon Lewis	    # Gentoo has some epm which is something different...
34027aa0a607SDon Lewis            AC_MSG_CHECKING([whether the found epm is the right epm])
34037aa0a607SDon Lewis            if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
34047aa0a607SDon Lewis               AC_MSG_RESULT([yes])
34057aa0a607SDon Lewis            else
34067aa0a607SDon Lewis	       AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm (--with-epm). Or specify an URL to an epm-3.7 source package (--with-epm-url); run configure with the --help option for a list of possible URLs.])
34077aa0a607SDon Lewis            fi
34087aa0a607SDon Lewis            AC_MSG_CHECKING([epm version])
34097aa0a607SDon Lewis            EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
34107aa0a607SDon Lewis	    if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
34117aa0a607SDon Lewis	       	    test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
34127aa0a607SDon Lewis               AC_MSG_RESULT([OK, >= 3.7])
34137aa0a607SDon Lewis               BUILD_EPM=NO
34147aa0a607SDon Lewis	    else
34157aa0a607SDon Lewis               AC_MSG_ERROR([too old. epm >= 3.7 is required.])
34167aa0a607SDon Lewis	    fi
34177aa0a607SDon Lewis      	 fi
34187aa0a607SDon Lewis      fi
34197aa0a607SDon Lewis   fi
34207aa0a607SDon Lewis
34217aa0a607SDon Lewis   # test which package format to use
34227aa0a607SDon Lewis   AC_MSG_CHECKING([which package format to use])
34237aa0a607SDon Lewis
34247aa0a607SDon Lewis   # defaults
34257aa0a607SDon Lewis   case "$_os" in
34267aa0a607SDon Lewis	OS2)
34277aa0a607SDon Lewis		PKGFORMAT=native
34287aa0a607SDon Lewis		;;
34297aa0a607SDon Lewis	Darwin)
34307aa0a607SDon Lewis		PKGFORMAT=dmg
34317aa0a607SDon Lewis		;;
34327aa0a607SDon Lewis	SunOS)
34337aa0a607SDon Lewis		PKGFORMAT=pkg
34347aa0a607SDon Lewis		;;
34357aa0a607SDon Lewis	Linux)
34367aa0a607SDon Lewis      # if building on Debian, default should be deb...
34377aa0a607SDon Lewis      if test -e /etc/debian_version; then
34387aa0a607SDon Lewis         PKGFORMAT=deb
34397aa0a607SDon Lewis      else
34407aa0a607SDon Lewis         PKGFORMAT=rpm
34417aa0a607SDon Lewis      fi
34427aa0a607SDon Lewis		;;
34437aa0a607SDon Lewis	AIX)
34447aa0a607SDon Lewis		PKGFORMAT=aix
34457aa0a607SDon Lewis		;;
34467aa0a607SDon Lewis	*BSD)
34477aa0a607SDon Lewis		PKGFORMAT=bsd
34487aa0a607SDon Lewis		;;
34497aa0a607SDon Lewis	OSF1)
34507aa0a607SDon Lewis		PKGFORMAT=setld
34517aa0a607SDon Lewis		;;
34527aa0a607SDon Lewis    WINNT)
34537aa0a607SDon Lewis        PKGFORMAT=msi
34547aa0a607SDon Lewis        ;;
34557aa0a607SDon Lewis	# we never should get here since we check the arciecture/os at the beginning,
34567aa0a607SDon Lewis	# but go sure...
34577aa0a607SDon Lewis	*)
34587aa0a607SDon Lewis		AC_MSG_ERROR([unknown system])
34597aa0a607SDon Lewis   esac
34607aa0a607SDon Lewis   if test -n "$with_package_format"; then
34617aa0a607SDon Lewis	for i in $with_package_format; do
34627aa0a607SDon Lewis		case "$i" in
34637aa0a607SDon Lewis			aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
34647aa0a607SDon Lewis			;;
34657aa0a607SDon Lewis		*)
34667aa0a607SDon Lewis			AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
34677aa0a607SDon Lewisaix - AIX software distribution
34687aa0a607SDon Lewisbsd - FreeBSD, NetBSD, or OpenBSD software distribution
34697aa0a607SDon Lewisdepot or swinstall - HP-UX software distribution
34707aa0a607SDon Lewisdeb - Debian software distribution
34717aa0a607SDon Lewisinst or tardist - IRIX software distribution
34727aa0a607SDon Lewisosx - MacOS X software distribution
34737aa0a607SDon Lewispkg - Solaris software distribution
34747aa0a607SDon Lewisrpm - RedHat software distribution
34757aa0a607SDon Lewissetld - Tru64 (setld) software distribution
34767aa0a607SDon Lewisnative - "Native" software distribution for the platform
34777aa0a607SDon Lewisportable - Portable software distribution
34787aa0a607SDon LewisOOo additionally supports:
34797aa0a607SDon Lewisarchive - .tar.gz or .zip
34807aa0a607SDon Lewisdmg - Mac OS X .dmg
34817aa0a607SDon Lewisinstalled - installation tree
34827aa0a607SDon Lewismsi - Windows .msi
34837aa0a607SDon Lewis			])
34847aa0a607SDon Lewis			;;
34857aa0a607SDon Lewis		esac
34867aa0a607SDon Lewis	done
34877aa0a607SDon Lewis	PKGFORMAT="$with_package_format"
34887aa0a607SDon Lewis   fi
34897aa0a607SDon Lewis   AC_MSG_RESULT([$PKGFORMAT])
34907aa0a607SDon Lewis   if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
34917aa0a607SDon Lewis      AC_MSG_CHECKING([for rpm])
34927aa0a607SDon Lewis      for a in "$RPM" rpmbuild rpm; do
34937aa0a607SDon Lewis         $a --usage >/dev/null 2> /dev/null
34947aa0a607SDon Lewis         if test $? -eq 0; then
34957aa0a607SDon Lewis            RPM=$a
34967aa0a607SDon Lewis            break
34977aa0a607SDon Lewis         else
34987aa0a607SDon Lewis            $a --version >/dev/null 2> /dev/null
34997aa0a607SDon Lewis            if test $? -eq 0; then
35007aa0a607SDon Lewis               RPM=$a
35017aa0a607SDon Lewis               break
35027aa0a607SDon Lewis            fi
35037aa0a607SDon Lewis         fi
35047aa0a607SDon Lewis       done
35057aa0a607SDon Lewis       if test -z "$RPM" ; then
35067aa0a607SDon Lewis          AC_MSG_ERROR([not found])
35077aa0a607SDon Lewis       elif "$RPM" --usage 2>&1 | $EGREP -- -bb >/dev/null; then
35087aa0a607SDon Lewis          RPM_PATH=`which $RPM`
35097aa0a607SDon Lewis          AC_MSG_RESULT([$RPM_PATH])
35107aa0a607SDon Lewis       else
35117aa0a607SDon Lewis          AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
35127aa0a607SDon Lewis       fi
35137aa0a607SDon Lewis   fi
35147aa0a607SDon Lewis   if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
35157aa0a607SDon Lewis      AC_PATH_PROG(DPKG, dpkg, no)
35167aa0a607SDon Lewis      if test "$DPKG" = "no"; then
35177aa0a607SDon Lewis         AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
35187aa0a607SDon Lewis      fi
35197aa0a607SDon Lewis   fi
35207aa0a607SDon Lewis   if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
35217aa0a607SDon Lewis      echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
35227aa0a607SDon Lewis      	if test "$EPM" != "no" && test "$EPM" != "internal"; then
35237aa0a607SDon Lewis           if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
35247aa0a607SDon Lewis               AC_MSG_CHECKING([whether epm is patched for OOos needs])
35257aa0a607SDon Lewis               if grep "Patched for Apache OpenOffice" $EPM >/dev/null 2>/dev/null; then
35267aa0a607SDon Lewis                  AC_MSG_RESULT([yes])
35277aa0a607SDon Lewis               else
35287aa0a607SDon Lewis                  AC_MSG_RESULT([no])
35297aa0a607SDon Lewis                  if echo "$PKGFORMAT" | grep -q rpm; then
35307aa0a607SDon Lewis                      _pt="rpm"
35317aa0a607SDon Lewis                      AC_MSG_WARN([the rpms will need to be installed with --nodeps])
35327aa0a607SDon Lewis                      echo "the rpms will need to be installed with --nodeps" >> warn
35337aa0a607SDon Lewis                  else
35347aa0a607SDon Lewis                      _pt="pkg"
35357aa0a607SDon Lewis                  fi
35367aa0a607SDon Lewis                  AC_MSG_WARN([the ${_pt}s will not be relocateable])
35377aa0a607SDon Lewis                  echo "the ${_pt}s will not be relocateable" >> warn
35387aa0a607SDon Lewis                  AC_MSG_WARN([if you want to make sure installation without --nodeps and
35397aa0a607SDon Lewis                  relocation will work, you need to patch your epm with the
35407aa0a607SDon Lewis                  patch in epm/epm-3.7.patch or build with
35417aa0a607SDon Lewis                  --with-epm=internal which will build a suitable epm])
35427aa0a607SDon Lewis               fi
35437aa0a607SDon Lewis           fi
35447aa0a607SDon Lewis        fi
35457aa0a607SDon Lewis   fi
35467aa0a607SDon Lewis   if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
35477aa0a607SDon Lewis      AC_PATH_PROG(PKGMK, pkgmk, no)
35487aa0a607SDon Lewis      if test "$PKGMK" = "no"; then
35497aa0a607SDon Lewis         AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
35507aa0a607SDon Lewis      fi
35517aa0a607SDon Lewis      AC_PATH_PROG(FAKEROOT, fakeroot, no)
35527aa0a607SDon Lewis      if test "$FAKEROOT" = "no"; then
35537aa0a607SDon Lewis         AC_MSG_WARN([fakeroot recommended for deb creation. Will try with getuid.so hack.])
35547aa0a607SDon Lewis      fi
35557aa0a607SDon Lewis   fi
35567aa0a607SDon Lewis   AC_SUBST(RPM)
35577aa0a607SDon Lewis   AC_SUBST(DPKG)
35587aa0a607SDon Lewis   AC_SUBST(FAKEROOT)
35597aa0a607SDon Lewis   AC_SUBST(PKGMK)
35607aa0a607SDon Lewiselse
35617aa0a607SDon Lewis   AC_MSG_RESULT([no])
35627aa0a607SDon Lewis   BUILD_EPM=NO
35637aa0a607SDon Lewis   EPM=NO
35647aa0a607SDon Lewis   PKGFORMAT=native
35657aa0a607SDon Lewisfi
35667aa0a607SDon LewisAC_SUBST(BUILD_EPM)
35677aa0a607SDon LewisAC_SUBST(EPM_URL)
35687aa0a607SDon LewisAC_SUBST(EPM)
35697aa0a607SDon LewisAC_SUBST(PKGFORMAT)
35707aa0a607SDon Lewis
35717aa0a607SDon Lewisdnl ===================================================================
35727aa0a607SDon Lewisdnl Check for gperf
35737aa0a607SDon Lewisdnl ===================================================================
35747aa0a607SDon LewisAC_PATH_PROG(GPERF, gperf)
35757aa0a607SDon Lewisif test -z "$with_gperf"; then
35767aa0a607SDon Lewis    AC_PATH_PROG(GPERF, gperf)
35777aa0a607SDon Lewis    if test -z "$GPERF"; then
35787aa0a607SDon Lewis       AC_MSG_ERROR([gperf not found but needed. Install it and/or specify --with-gperf=/path/to/it.])
35797aa0a607SDon Lewis    fi
35807aa0a607SDon Lewiselse
35817aa0a607SDon Lewis  if test -x "$with_gperf"; then
35827aa0a607SDon Lewis    GPERF=$with_gperf
35837aa0a607SDon Lewis  else
35847aa0a607SDon Lewis    AC_MSG_ERROR([--with-gperf did not point to an executable])
35857aa0a607SDon Lewis  fi
35867aa0a607SDon Lewisfi
35877aa0a607SDon LewisAC_MSG_CHECKING([gperf version])
35887aa0a607SDon Lewisif test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
35897aa0a607SDon Lewis	AC_MSG_RESULT([OK])
35907aa0a607SDon Lewis   GPERF=$GPERF
35917aa0a607SDon Lewiselse
35927aa0a607SDon Lewis	AC_MSG_ERROR([too old, you need at least 3.0.0])
35937aa0a607SDon Lewisfi
35947aa0a607SDon LewisAC_SUBST(GPERF)
35957aa0a607SDon Lewis
35967aa0a607SDon Lewisdnl ===================================================================
35977aa0a607SDon Lewisdnl Check for building stax
35987aa0a607SDon Lewisdnl ===================================================================
35997aa0a607SDon LewisAC_MSG_CHECKING([whether to build the stax])
36007aa0a607SDon Lewisif test -f "./stax/download/stax-1.2.0.jar"; then
36017aa0a607SDon Lewis   BUILD_STAX=NO
36027aa0a607SDon Lewis   AC_MSG_RESULT([no, will use the prebuilt stax/download/stax-1.2.0.jar])
36037aa0a607SDon Lewiselse
36047aa0a607SDon Lewis   BUILD_STAX=YES
36057aa0a607SDon Lewis   AC_MSG_RESULT([yes])
36067aa0a607SDon Lewisfi
36077aa0a607SDon LewisAC_SUBST(BUILD_STAX)
36087aa0a607SDon Lewis
36097aa0a607SDon Lewisdnl ===================================================================
36107aa0a607SDon Lewisdnl Check for building ODK
36117aa0a607SDon Lewisdnl ===================================================================
36127aa0a607SDon LewisAC_MSG_CHECKING([whether to build the ODK])
36137aa0a607SDon Lewisif test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
36147aa0a607SDon Lewis   AC_MSG_RESULT([yes])
36157aa0a607SDon Lewis   if test "$WITH_JAVA" != "no"; then
36167aa0a607SDon Lewis   AC_MSG_CHECKING([for external/unowinreg/unowinreg.dll])
36177aa0a607SDon Lewis   if ! test -f "./external/unowinreg/unowinreg.dll"; then
36187aa0a607SDon Lewis      HAVE_UNOWINREG_DLL=no
36197aa0a607SDon Lewis   else
36207aa0a607SDon Lewis      HAVE_UNOWINREG_DLL=yes
36217aa0a607SDon Lewis   fi
36227aa0a607SDon Lewis   if test "$HAVE_UNOWINREG_DLL" = "yes"; then
36237aa0a607SDon Lewis      AC_MSG_RESULT([found])
36247aa0a607SDon Lewis      BUILD_UNOWINREG=NO
36257aa0a607SDon Lewis   else
36267aa0a607SDon Lewis      if test "$_os" = "WINNT"; then
36277aa0a607SDon Lewis         AC_MSG_RESULT([not found, will be built])
36287aa0a607SDon Lewis      else
36297aa0a607SDon Lewis         AC_MSG_WARN([not found, will be cross-built using mingw32])
36307aa0a607SDon Lewis      fi
36317aa0a607SDon Lewis      BUILD_UNOWINREG=YES
36327aa0a607SDon Lewis   fi
36337aa0a607SDon Lewis   if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then
36347aa0a607SDon Lewis      if test -z "$WITH_MINGWIN" || test "$WITH_MINGWIN" = "0"; then
36357aa0a607SDon Lewis         AC_MSG_ERROR([for rebuilding unowinreg.dll you need the mingw32 C++ compiler.
36367aa0a607SDon Lewis         Specify mingw32 g++ executable name with --with-mingwin.
36377aa0a607SDon Lewis         Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and
36387aa0a607SDon Lewis         put it into external/unowinreg using your browser or a command equivalent to:
36397aa0a607SDon Lewis         wget -O external/unowinreg/unowinreg.dll http://www.openoffice.org/tools/unowinreg_prebuild/680/unowinreg.dll])
36407aa0a607SDon Lewis      fi
36417aa0a607SDon Lewis      if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
36427aa0a607SDon Lewis         if ! test -x "$WITH_MINGWIN"; then MINGWCXX=false; else MINGWCXX=`basename $WITH_MINGWIN`; fi
36437aa0a607SDon Lewis      else
36447aa0a607SDon Lewis         AC_CHECK_TOOL(MINGWCXX, $WITH_MINGWIN, false)
36457aa0a607SDon Lewis      fi
36467aa0a607SDon Lewis      if test "$MINGWCXX" = "false"; then
36477aa0a607SDon Lewis         AC_MSG_ERROR(specified MinGW32 C++ cross-compiler not found. Install it or correct name.)
36487aa0a607SDon Lewis      fi
36497aa0a607SDon Lewis      AC_MSG_CHECKING(whether we are using the MinGW32 cross C++ compiler)
36507aa0a607SDon Lewis      if ! echo "`$MINGWCXX -dumpmachine`" | grep -q mingw32; then
36517aa0a607SDon Lewis         AC_MSG_ERROR(no)
36527aa0a607SDon Lewis      else
36537aa0a607SDon Lewis         AC_MSG_RESULT(yes)
36547aa0a607SDon Lewis      fi
36557aa0a607SDon Lewis      if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
36567aa0a607SDon Lewis         if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/)); fi
36577aa0a607SDon Lewis      else
36587aa0a607SDon Lewis         AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`, false)
36597aa0a607SDon Lewis      fi
36607aa0a607SDon Lewis      if test "$MINGWSTRIP" = "false"; then
36617aa0a607SDon Lewis         AC_MSG_ERROR(MinGW32 binutils needed. Install them.)
36627aa0a607SDon Lewis      fi
36637aa0a607SDon Lewis      AC_LANG_PUSH([C++])
36647aa0a607SDon Lewis      save_CXX=$CXX
36657aa0a607SDon Lewis      save_CXXCPP=$CXXCPP
36667aa0a607SDon Lewis      CXX=$MINGWCXX
36677aa0a607SDon Lewis      CXXCPP="$MINGWCXX -E"
36687aa0a607SDon Lewis      save_CXXFLAGS=$CXXFLAGS
36697aa0a607SDon Lewis      save_CPPFLAGS=$CPPFLAGS
36707aa0a607SDon Lewis      CXXFLAGS="$CXXFLAGS -I$JAVA_HOME/include"
36717aa0a607SDon Lewis      CPPFLAGS="$CPPFLAGS -I$JAVA_HOME/include"
36727aa0a607SDon Lewis      # LIBS contains -lcrypt etc due to teh AC_CHECK_LIBS which obviously
36737aa0a607SDon Lewis      # do not make sense here (and 'd make the check fail)
36747aa0a607SDon Lewis      save_LIBS=$LIBS
36757aa0a607SDon Lewis      LIBS=""
36767aa0a607SDon Lewis      AC_HAVE_LIBRARY(kernel32)
36777aa0a607SDon Lewis      AC_HAVE_LIBRARY(advapi32)
36787aa0a607SDon Lewis      AC_CHECK_HEADER(windows.h, [], [AC_MSG_ERROR([windows.h missing])])
36797aa0a607SDon Lewis      CXXFLAGS=$save_CXXFLAGS
36807aa0a607SDon Lewis      CPPFLAGS=$save_CPPFLAGS
36817aa0a607SDon Lewis      CXX=$save_CXX
36827aa0a607SDon Lewis      CXXCPP=$save_CXXCPP
36837aa0a607SDon Lewis      LIBS=$save_LIBS
36847aa0a607SDon Lewis      AC_LANG_POP([C++])
36857aa0a607SDon Lewis      fi
36867aa0a607SDon Lewis   fi
36877aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE ODK"
36887aa0a607SDon Lewiselse
36897aa0a607SDon Lewis   AC_MSG_RESULT([no])
36907aa0a607SDon Lewis   BUILD_UNOWINREG=NO
36917aa0a607SDon Lewisfi
36927aa0a607SDon LewisAC_SUBST(BUILD_UNOWINREG)
36937aa0a607SDon LewisAC_SUBST(MINGWCXX)
36947aa0a607SDon LewisAC_SUBST(MINGWSTRIP)
36957aa0a607SDon Lewis
36967aa0a607SDon Lewisdnl ===================================================================
36977aa0a607SDon Lewisdnl Check for system stdlibs
36987aa0a607SDon Lewisdnl ===================================================================
36997aa0a607SDon LewisAC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
37007aa0a607SDon Lewisif test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \
37017aa0a607SDon Lewis   test "$with_system_stdlibs" != "no"; then
37027aa0a607SDon Lewis   AC_MSG_RESULT([no])
37037aa0a607SDon Lewis   SYSTEM_STDLIBS=YES
37047aa0a607SDon Lewiselse
37057aa0a607SDon Lewis   AC_MSG_RESULT([yes])
37067aa0a607SDon Lewis   SYSTEM_STDLIBS=NO
37077aa0a607SDon Lewisfi
37087aa0a607SDon LewisAC_SUBST(SYSTEM_STDLIBS)
37097aa0a607SDon Lewis
37107aa0a607SDon Lewisdnl ===================================================================
37117aa0a607SDon Lewisdnl Check for system zlib
37127aa0a607SDon Lewisdnl ===================================================================
37137aa0a607SDon Lewisif test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then
37147aa0a607SDon Lewis   with_system_zlib=yes
37157aa0a607SDon Lewisfi
37167aa0a607SDon LewisAC_MSG_CHECKING([which zlib to use])
37177aa0a607SDon Lewisif test -n "$with_system_zlib" -o -n "$with_system_libs" && \
37187aa0a607SDon Lewis	test "$with_system_zlib" != "no"; then
37197aa0a607SDon Lewis    AC_MSG_RESULT([external])
37207aa0a607SDon Lewis    SYSTEM_ZLIB=YES
37217aa0a607SDon Lewis    AC_CHECK_HEADER(zlib.h, [],
37227aa0a607SDon Lewis        [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
37237aa0a607SDon Lewis    AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
37247aa0a607SDon Lewis        [AC_MSG_ERROR(zlib not found or functional)], [])
37257aa0a607SDon Lewiselse
37267aa0a607SDon Lewis    AC_MSG_RESULT([internal])
37277aa0a607SDon Lewis    SYSTEM_ZLIB=NO
37287aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE ZLIB"
37297aa0a607SDon Lewisfi
37307aa0a607SDon LewisAC_SUBST(SYSTEM_ZLIB)
37317aa0a607SDon Lewis
37327aa0a607SDon Lewisdnl ===================================================================
37337aa0a607SDon Lewisdnl Check for system jpeg
37347aa0a607SDon Lewisdnl ===================================================================
37357aa0a607SDon LewisAC_MSG_CHECKING([which jpeg to use])
37367aa0a607SDon Lewisif test -n "$with_system_jpeg" -o -n "$with_system_libs" && \
37377aa0a607SDon Lewis	test "$with_system_jpeg" != "no"; then
37387aa0a607SDon Lewis    AC_MSG_RESULT([external])
37397aa0a607SDon Lewis    SYSTEM_JPEG=YES
37407aa0a607SDon Lewis    AC_CHECK_HEADER(jpeglib.h, [],
37417aa0a607SDon Lewis        [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
37427aa0a607SDon Lewis    AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
37437aa0a607SDon Lewis	[AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
37447aa0a607SDon Lewiselse
37457aa0a607SDon Lewis    AC_MSG_RESULT([internal])
37467aa0a607SDon Lewis    SYSTEM_JPEG=NO
37477aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE JPEG"
37487aa0a607SDon Lewisfi
37497aa0a607SDon LewisAC_SUBST(SYSTEM_JPEG)
37507aa0a607SDon Lewis
37517aa0a607SDon Lewisdnl ===================================================================
37527aa0a607SDon Lewisdnl Check for system expat
37537aa0a607SDon Lewisdnl ===================================================================
37547aa0a607SDon LewisAC_MSG_CHECKING([which expat to use])
37557aa0a607SDon Lewisif test -n "$with_system_expat" -o -n "$with_system_libs" && \
37567aa0a607SDon Lewis	test "$with_system_expat" != "no"; then
37577aa0a607SDon Lewis    AC_MSG_RESULT([external])
37587aa0a607SDon Lewis    SYSTEM_EXPAT=YES
37597aa0a607SDon Lewis    AC_CHECK_HEADER(expat.h, [],
37607aa0a607SDon Lewis        [AC_MSG_ERROR(expat.h not found. install expat)], [])
37617aa0a607SDon Lewis    AC_CHECK_LIB(expat, XML_ParserCreate, [],
37627aa0a607SDon Lewis	[AC_MSG_RESULT(expat library not found or functional.)], [])
37637aa0a607SDon Lewiselse
37647aa0a607SDon Lewis    AC_MSG_RESULT([internal])
37657aa0a607SDon Lewis    SYSTEM_EXPAT=NO
37667aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE EXPAT"
37677aa0a607SDon Lewisfi
37687aa0a607SDon LewisAC_SUBST(SYSTEM_EXPAT)
37697aa0a607SDon Lewis
37707aa0a607SDon Lewisdnl ===================================================================
37717aa0a607SDon Lewisdnl Check for system libwpd
37727aa0a607SDon Lewisdnl ===================================================================
37737aa0a607SDon LewisAC_MSG_CHECKING([which libwpd to use])
37747aa0a607SDon Lewisif test -n "$with_system_libwpd" -o -n "$with_system_libs" && \
37757aa0a607SDon Lewis        test "$with_system_libwpd" != "no"; then
37767aa0a607SDon Lewis    AC_MSG_RESULT([external])
37777aa0a607SDon Lewis    SYSTEM_LIBWPD=YES
37787aa0a607SDon Lewis    PKG_CHECK_MODULES( LIBWPD, libwpd-0.8 )
37797aa0a607SDon Lewiselse
37807aa0a607SDon Lewis    AC_MSG_RESULT([no])
37817aa0a607SDon Lewis    SYSTEM_LIBWPD=
37827aa0a607SDon Lewisfi
37837aa0a607SDon LewisAC_SUBST(SYSTEM_LIBWPD)
37847aa0a607SDon LewisAC_SUBST(LIBWPD_CFLAGS)
37857aa0a607SDon LewisAC_SUBST(LIBWPD_LIBS)
37867aa0a607SDon Lewis
37877aa0a607SDon Lewisdnl ===================================================================
37887aa0a607SDon Lewisdnl Check for system cppunit
37897aa0a607SDon Lewisdnl ===================================================================
37907aa0a607SDon LewisWITH_CPPUNIT=
37917aa0a607SDon LewisAC_MSG_CHECKING([which cppunit to use])
37927aa0a607SDon Lewisif test -n "$with_system_cppunit" -o -n "$with_system_libs" && \
37937aa0a607SDon Lewis        test "$with_system_cppunit" != "no"; then
37947aa0a607SDon Lewis    SYSTEM_CPPUNIT=YES
37957aa0a607SDon Lewis    # might work for earlier, too but go sure:
37967aa0a607SDon Lewis    PKG_CHECK_MODULES( CPPUNIT,
37977aa0a607SDon Lewis                       cppunit >= 1.12.0,
37987aa0a607SDon Lewis                       WITH_CPPUNIT="YES",
37997aa0a607SDon Lewis                       WITH_CPPUNIT="")
38007aa0a607SDon Lewis    if test -n "$WITH_CPPUNIT"; then
38017aa0a607SDon Lewis       AC_MSG_RESULT([found system cppunit $CPPUNIT])
38027aa0a607SDon Lewis    else
38037aa0a607SDon Lewis       AC_MSG_WARN([dit not find system cppunit version 1.12.0 or later])
38047aa0a607SDon Lewis    fi
38057aa0a607SDon Lewis
38067aa0a607SDon Lewiselse
38077aa0a607SDon Lewis    AC_MSG_WARN([not using cppunit])
38087aa0a607SDon Lewis    SYSTEM_CPPUNIT=NO
38097aa0a607SDon Lewisfi
38107aa0a607SDon LewisAC_SUBST(SYSTEM_CPPUNIT)
38117aa0a607SDon LewisAC_SUBST(CPPUNIT_CFLAGS)
38127aa0a607SDon LewisAC_SUBST(CPPUNIT_LIBS)
38137aa0a607SDon LewisAC_SUBST(WITH_CPPUNIT)
38147aa0a607SDon Lewis
38157aa0a607SDon Lewisdnl ===================================================================
38167aa0a607SDon Lewisdnl Check whether freetype is available
38177aa0a607SDon Lewisdnl ===================================================================
38187aa0a607SDon Lewisif test  "$test_freetype" = "yes"; then
38197aa0a607SDon Lewis   AC_MSG_CHECKING([whether freetype is available])
38207aa0a607SDon Lewis	PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
38217aa0a607SDon Lewisfi
38227aa0a607SDon LewisAC_SUBST(FREETYPE_CFLAGS)
38237aa0a607SDon LewisAC_SUBST(FREETYPE_LIBS)
38247aa0a607SDon Lewis
38257aa0a607SDon Lewisdnl ===================================================================
38267aa0a607SDon Lewisdnl Check whether freetype2 supports emboldening
38277aa0a607SDon Lewisdnl ===================================================================
38287aa0a607SDon Lewisif test  "$test_freetype" = "yes"; then
38297aa0a607SDon Lewis    save_CPPFLAGS="$CPPFLAGS"
38307aa0a607SDon Lewis    save_LDFLAGS="$LDFLAGS"
38317aa0a607SDon Lewis    save_LIBS="$LIBS"
38327aa0a607SDon Lewis    CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
38337aa0a607SDon Lewis    LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
38347aa0a607SDon Lewis    AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
38357aa0a607SDon Lewis                 [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
38367aa0a607SDon Lewis    LDFLAGS="$save_LDFLAGS"
38377aa0a607SDon Lewis    CPPFLAGS="$save_CPPFLAGS"
38387aa0a607SDon Lewis    LIBS="$save_LIBS"
38397aa0a607SDon Lewisfi
38407aa0a607SDon LewisAC_SUBST(USE_FT_EMBOLDEN)
38417aa0a607SDon Lewis
38427aa0a607SDon Lewisif test -n "$with_system_libxslt" -o -n "$with_system_libs" && \
38437aa0a607SDon Lewis   test "$with_system_libxslt" != "no"; then
38447aa0a607SDon Lewis    if test -z "$with_system_libxml" -a -z "$with_system_libs" || \
38457aa0a607SDon Lewis      test "$with_system_libxml" = "no"; then
38467aa0a607SDon Lewis      # somehow AC_MSG_WARN won't work...
38477aa0a607SDon Lewis       echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml"
38487aa0a607SDon Lewis       echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml" >> warn
38497aa0a607SDon Lewis       with_system_libxml=yes
38507aa0a607SDon Lewis    fi
38517aa0a607SDon Lewisfi
38527aa0a607SDon Lewisif test -n "$with_system_libxml" -o -n "$with_system_libs" && \
38537aa0a607SDon Lewis   test "$with_system_libxml" != "no"; then
38547aa0a607SDon Lewis    if test -z "$with_system_libxslt" -a -z "$with_system_libs" || \
38557aa0a607SDon Lewis      test "$with_system_libxslt" = "no"; then
38567aa0a607SDon Lewis      # somehow AC_MSG_WARN won't work...
38577aa0a607SDon Lewis       echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt"
38587aa0a607SDon Lewis       echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt" >> warn
38597aa0a607SDon Lewis       with_system_libxslt=yes
38607aa0a607SDon Lewis    fi
38617aa0a607SDon Lewisfi
38627aa0a607SDon Lewis
38637aa0a607SDon Lewisdnl ===================================================================
38647aa0a607SDon Lewisdnl Check for system libxslt
38657aa0a607SDon Lewisdnl ===================================================================
38667aa0a607SDon LewisAC_MSG_CHECKING([which libxslt to use])
38677aa0a607SDon Lewisif test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \
38687aa0a607SDon Lewis       "$_os" = "Darwin" && \
38697aa0a607SDon Lewis   test "$with_system_libxslt" != "no"; then
38707aa0a607SDon Lewis   AC_MSG_RESULT([external])
38717aa0a607SDon Lewis   SYSTEM_LIBXSLT=YES
38727aa0a607SDon Lewis
38737aa0a607SDon Lewis	if test "$_os" != "Darwin"; then
38747aa0a607SDon Lewis		PKG_CHECK_MODULES(LIBXSLT, libxslt)
38757aa0a607SDon Lewis	else
38767aa0a607SDon Lewis		LIBXSLT_CFLAGS=`xslt-config --cflags`
38777aa0a607SDon Lewis		LIBXSLT_LIBS=`xslt-config --libs`
38787aa0a607SDon Lewis	fi
38797aa0a607SDon Lewis
38807aa0a607SDon Lewis   dnl Check for xsltproc
38817aa0a607SDon Lewis   AC_PATH_PROG(XSLTPROC, xsltproc, no)
38827aa0a607SDon Lewis   if test "$XSLTPROC" = "no"; then
38837aa0a607SDon Lewis      AC_MSG_ERROR([xsltproc is required])
38847aa0a607SDon Lewis   fi
38857aa0a607SDon Lewiselse
38867aa0a607SDon Lewis   AC_MSG_RESULT([internal])
38877aa0a607SDon Lewis   SYSTEM_LIBXSLT=NO
38887aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE LIBXSLT"
38897aa0a607SDon Lewisfi
38907aa0a607SDon LewisAC_SUBST(SYSTEM_LIBXSLT)
38917aa0a607SDon LewisAC_SUBST(LIBXSLT_CFLAGS)
38927aa0a607SDon LewisAC_SUBST(LIBXSLT_LIBS)
38937aa0a607SDon Lewis
38947aa0a607SDon Lewis
38957aa0a607SDon Lewisdnl ===================================================================
38967aa0a607SDon Lewisdnl Check for system libxml
38977aa0a607SDon Lewisdnl ===================================================================
38987aa0a607SDon LewisAC_MSG_CHECKING([which libxml to use])
38997aa0a607SDon Lewisif test -n "$with_system_libxml" -o -n "$with_system_libs" -o \
39007aa0a607SDon Lewis            "$_os" = "Darwin" && \
39017aa0a607SDon Lewis	test "$with_system_libxml" != "no"; then
39027aa0a607SDon Lewis    AC_MSG_RESULT([external])
39037aa0a607SDon Lewis    SYSTEM_LIBXML=YES
39047aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
39057aa0a607SDon Lewis
39067aa0a607SDon Lewis	if test "$_os" != "Darwin"; then
39077aa0a607SDon Lewis		PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
39087aa0a607SDon Lewis	else
39097aa0a607SDon Lewis		LIBXML_CFLAGS=`xml2-config --cflags`
39107aa0a607SDon Lewis		LIBXML_LIBS=`xml2-config --libs`
39117aa0a607SDon Lewis	fi
39127aa0a607SDon Lewiselse
39137aa0a607SDon Lewis    AC_MSG_RESULT([internal])
39147aa0a607SDon Lewis    SYSTEM_LIBXML=NO
39157aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC"
39167aa0a607SDon Lewisfi
39177aa0a607SDon LewisAC_SUBST(SYSTEM_LIBXML)
39187aa0a607SDon LewisAC_SUBST(LIBXML_CFLAGS)
39197aa0a607SDon LewisAC_SUBST(LIBXML_LIBS)
39207aa0a607SDon Lewis
39217aa0a607SDon Lewis
39227aa0a607SDon Lewisdnl ===================================================================
39237aa0a607SDon Lewisdnl Checks for a MacOS platform SDK compatible with an OSX 10.7 deployment target
39247aa0a607SDon Lewisdnl ===================================================================
39257aa0a607SDon Lewisif test  "$_os" = "Darwin"; then
3926a46ef990SJim Jagielski   sdk_target=10.9
3927a46ef990SJim Jagielski   AC_MSG_CHECKING([checking SDK compatibility with OSX $sdk_target])
39287aa0a607SDon Lewis
39297aa0a607SDon Lewis   sdk_minor=`echo $sdk_target | cut -d"." -f2`
39307aa0a607SDon Lewis
3931a46ef990SJim Jagielski   if test "$sdk_minor" -lt "9"; then
39327aa0a607SDon Lewis      AC_MSG_ERROR([SDK version < 10.7 is not longer supported])
39337aa0a607SDon Lewis   else
39347aa0a607SDon Lewis      MACOSX_DEPLOYMENT_TARGET=$sdk_target
39357aa0a607SDon Lewis
3936a46ef990SJim Jagielski      sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx10.(9|10|11|12)" | sed -e "s/.*sdk //" | tail -n1`
39377aa0a607SDon Lewis      if test -z "$sdk_found"; then
39387aa0a607SDon Lewis         AC_MSG_ERROR([No SDK with OSX $sdk_target compatibility found])
39397aa0a607SDon Lewis      else
39407aa0a607SDon Lewis         AC_MSG_RESULT([yes, by using SDK $sdk_found])
39417aa0a607SDon Lewis      fi
39427aa0a607SDon Lewis
39437aa0a607SDon Lewis      sdk_path=`xcodebuild -version -sdk ${sdk_found} Path`
39447aa0a607SDon Lewis      AC_MSG_CHECKING([for $sdk_path])
39457aa0a607SDon Lewis      if test -d "$sdk_path"; then
39467aa0a607SDon Lewis         AC_MSG_RESULT([yes])
39477aa0a607SDon Lewis      else
39487aa0a607SDon Lewis         AC_MSG_ERROR([not found!])
39497aa0a607SDon Lewis      fi
39507aa0a607SDon Lewis
39517aa0a607SDon Lewis      MACOSX_SDK_PATH=$sdk_path
39527aa0a607SDon Lewis   fi
39537aa0a607SDon Lewis
39547aa0a607SDon Lewisfi
39557aa0a607SDon LewisAC_SUBST(MACOSX_DEPLOYMENT_TARGET)
39567aa0a607SDon LewisAC_SUBST(MACOSX_SDK_PATH)
39577aa0a607SDon Lewis
39587aa0a607SDon Lewis
39597aa0a607SDon Lewisdnl ===================================================================
39607aa0a607SDon Lewisdnl Check for system python
39617aa0a607SDon Lewisdnl ===================================================================
39627aa0a607SDon LewisAC_MSG_CHECKING([which python to use])
39637aa0a607SDon Lewisif test "$_os" = "Darwin" && test "$with_system_python" != "no"; then
39647aa0a607SDon Lewis   with_system_python=yes
39657aa0a607SDon Lewis
39667aa0a607SDon Lewis   _python="/Library/Frameworks/Python.framework/Versions/Current/bin/python"
39677aa0a607SDon Lewis   if test ! -f $_python; then
39687aa0a607SDon Lewis   	  _python="/usr/bin/python"
39697aa0a607SDon Lewis   fi
39707aa0a607SDon Lewis   AC_MSG_RESULT([compiling against system python ($_python)])
39717aa0a607SDon Lewis
39727aa0a607SDon Lewis   _python_hexversion=`$_python -c "import sys; print(sys.hexversion);"`
39737aa0a607SDon Lewis
39747aa0a607SDon Lewis   dnl hex version of Python 2.7.1 = 34013680
39757aa0a607SDon Lewis   if test $_python_hexversion -ge 34013680 ; then
39767aa0a607SDon Lewis   	  _python_version=`$_python -c "import sys; print sys.version;" | head -c 3`
39777aa0a607SDon Lewis      AC_MSG_RESULT([compiling against system python (version $_python_version)])
39787aa0a607SDon Lewis
39797aa0a607SDon Lewis	  _python_ver=`$_python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
39807aa0a607SDon Lewis
39817aa0a607SDon Lewis	  if test -d "/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"; then
39827aa0a607SDon Lewis	  	 PYTHON_CFLAGS="-I/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"
39837aa0a607SDon Lewis         elif test -d "$MACOSX_SDK_PATH/usr/include/python$_python_ver"; then
39847aa0a607SDon Lewis             PYTHON_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/python$_python_ver"
39857aa0a607SDon Lewis	  else
39867aa0a607SDon Lewis             PYTHON_CFLAGS="-I$MACOSX_SDK_PATH/System/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"
39877aa0a607SDon Lewis	  fi
39887aa0a607SDon Lewis   else
39897aa0a607SDon Lewis		AC_MSG_ERROR([Python 2.7.1 or higher is required])
39907aa0a607SDon Lewis   fi
39917aa0a607SDon Lewis
39927aa0a607SDon Lewis   PYTHON_LIBS="-framework Python"
39937aa0a607SDon Lewiselif test -n "$with_system_python" -o -n "$with_system_libs" && \
39947aa0a607SDon Lewis	test "$with_system_python" != "no"; then
39957aa0a607SDon Lewis   with_system_python=yes
39967aa0a607SDon Lewis   AC_MSG_RESULT([external])
39977aa0a607SDon Lewis   AM_PATH_PYTHON([2.7])
39987aa0a607SDon Lewis
39997aa0a607SDon Lewis   python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
40007aa0a607SDon Lewis   python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
40017aa0a607SDon Lewis   PYTHON_CFLAGS="-I$python_include"
40027aa0a607SDon Lewis   PYTHON_LIBS="-lpython$python_version"
40037aa0a607SDon Lewisfi
40047aa0a607SDon Lewisif test "$with_system_python" = "yes" ; then
40057aa0a607SDon Lewis   SYSTEM_PYTHON=YES
40067aa0a607SDon Lewis   dnl check if the headers really work:
40077aa0a607SDon Lewis   save_CPPFLAGS="$CPPFLAGS"
40087aa0a607SDon Lewis   CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
40097aa0a607SDon Lewis   AC_CHECK_HEADER(Python.h, [],
40107aa0a607SDon Lewis       [AC_MSG_ERROR(Python headers not found)], [])
40117aa0a607SDon Lewis   CPPFLAGS="$save_CPPFLAGS"
40127aa0a607SDon Lewiselse
40137aa0a607SDon Lewis   SYSTEM_PYTHON=NO
40147aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE PYTHON"
40157aa0a607SDon Lewis   AC_MSG_RESULT([internal])
40167aa0a607SDon Lewis   # Embedded python dies without Home set
40177aa0a607SDon Lewis   if test "z$HOME" = "z"; then
40187aa0a607SDon Lewis      export HOME="";
40197aa0a607SDon Lewis   fi
40207aa0a607SDon Lewis   # bz2 tarball and bzip2 is not standard
40217aa0a607SDon Lewis   if test -z "$BZIP2"; then
40227aa0a607SDon Lewis	AC_PATH_PROG( BZIP2, bzip2)
40237aa0a607SDon Lewis	if test -z "$BZIP2"; then
40247aa0a607SDon Lewis   		AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
40257aa0a607SDon Lewis   	fi
40267aa0a607SDon Lewis   fi
40277aa0a607SDon Lewisfi
40287aa0a607SDon LewisAC_SUBST(SYSTEM_PYTHON)
40297aa0a607SDon LewisAC_SUBST(PYTHON_CFLAGS)
40307aa0a607SDon LewisAC_SUBST(PYTHON_LIBS)
40317aa0a607SDon LewisHOME=`echo $HOME | sed 's:\\\\:/:g'`
40327aa0a607SDon LewisAC_SUBST(HOME)
40337aa0a607SDon Lewis
40347aa0a607SDon Lewisdnl ===================================================================
40357aa0a607SDon Lewisdnl Check for system lucene
40367aa0a607SDon Lewisdnl ===================================================================
40377aa0a607SDon LewisAC_MSG_CHECKING([which lucene to use])
40387aa0a607SDon Lewisif test -n "$with_system_lucene" -o -n "$with_system_libs" && \
40397aa0a607SDon Lewis       test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then
40407aa0a607SDon Lewis        AC_MSG_RESULT([external])
40417aa0a607SDon Lewis        SYSTEM_LUCENE=YES
40427aa0a607SDon Lewis        if test -z $LUCENE_CORE_JAR; then
40437aa0a607SDon Lewis          AC_CHECK_FILE(/usr/share/java/lucene-core-2.9.4.jar,
40447aa0a607SDon Lewis            [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.9.4.jar ],
40457aa0a607SDon Lewis            [
40467aa0a607SDon Lewis              AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
40477aa0a607SDon Lewis                [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
40487aa0a607SDon Lewis                [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
40497aa0a607SDon Lewis                   [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
40507aa0a607SDon Lewis                   [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
40517aa0a607SDon Lewis                  )
40527aa0a607SDon Lewis                ]
40537aa0a607SDon Lewis              )
40547aa0a607SDon Lewis            ]
40557aa0a607SDon Lewis          )
40567aa0a607SDon Lewis        else
40577aa0a607SDon Lewis          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
40587aa0a607SDon Lewis               [AC_MSG_ERROR(lucene-core.jar not found.)], [])
40597aa0a607SDon Lewis        fi
40607aa0a607SDon Lewis
40617aa0a607SDon Lewis        if test -z $LUCENE_ANALYZERS_JAR; then
40627aa0a607SDon Lewis          AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
40637aa0a607SDon Lewis            [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
40647aa0a607SDon Lewis            [
40657aa0a607SDon Lewis              AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
40667aa0a607SDon Lewis                [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
40677aa0a607SDon Lewis                [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
40687aa0a607SDon Lewis              )
40697aa0a607SDon Lewis            ]
40707aa0a607SDon Lewis          )
40717aa0a607SDon Lewis        else
40727aa0a607SDon Lewis          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
40737aa0a607SDon Lewis               [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
40747aa0a607SDon Lewis        fi
40757aa0a607SDon Lewis        AC_MSG_CHECKING([whether lucene is version 2.x])
40767aa0a607SDon Lewis        export LUCENE_CORE_JAR
40777aa0a607SDon Lewis        if $PERL -e 'use Archive::Zip;
40787aa0a607SDon Lewis            my $file = "$ENV{'LUCENE_CORE_JAR'}";
40797aa0a607SDon Lewis            my $zip = Archive::Zip->new( $file );
40807aa0a607SDon Lewis            my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
40817aa0a607SDon Lewis            if ( $mf =~ m/Specification-Version: 2.*/ ) {
40827aa0a607SDon Lewis                exit 0;
40837aa0a607SDon Lewis            } else {
40847aa0a607SDon Lewis                exit 1;
40857aa0a607SDon Lewis            }'; then
40867aa0a607SDon Lewis            AC_MSG_RESULT([yes])
40877aa0a607SDon Lewis         else
40887aa0a607SDon Lewis            AC_MSG_RESULT([no])
40897aa0a607SDon Lewis            AC_MSG_CHECKING([whether lucene is version 3.x])
40907aa0a607SDon Lewis
40917aa0a607SDon Lewis            if $PERL -e 'use Archive::Zip;
40927aa0a607SDon Lewis                my $file = "$ENV{'LUCENE_CORE_JAR'}";
40937aa0a607SDon Lewis                my $zip = Archive::Zip->new( $file );
40947aa0a607SDon Lewis                my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
40957aa0a607SDon Lewis                if ( $mf =~ m/Specification-Version: 3.*/ ) {
40967aa0a607SDon Lewis                    exit 0;
40977aa0a607SDon Lewis                } else {
40987aa0a607SDon Lewis                    exit 1;
40997aa0a607SDon Lewis                }'; then
41007aa0a607SDon Lewis                AC_MSG_RESULT([yes])
41017aa0a607SDon Lewis             else
41027aa0a607SDon Lewis                AC_MSG_ERROR([no, you need lucene 2 or 3])
41037aa0a607SDon Lewis             fi
41047aa0a607SDon Lewis         fi
41057aa0a607SDon Lewis
41067aa0a607SDon Lewiselse
41077aa0a607SDon Lewis    AC_MSG_RESULT([internal])
41087aa0a607SDon Lewis    SYSTEM_LUCENE=NO
41097aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE LUCENE"
41107aa0a607SDon Lewisfi
41117aa0a607SDon LewisAC_SUBST(SYSTEM_LUCENE)
41127aa0a607SDon LewisAC_SUBST(LUCENE_CORE_JAR)
41137aa0a607SDon LewisAC_SUBST(LUCENE_ANALYZERS_JAR)
41147aa0a607SDon Lewis
41157aa0a607SDon LewisAC_MSG_CHECKING([whether to build the MySQL Connector extension])
41167aa0a607SDon Lewisif test -n "$enable_mysql_connector" -a "$enable_mysql_connector" != "no"; then
41177aa0a607SDon Lewis  AC_MSG_RESULT([yes])
41187aa0a607SDon Lewis  ENABLE_MYSQLC=YES
41197aa0a607SDon Lewis  AC_MSG_CHECKING([for mysqlc module])
41207aa0a607SDon Lewis  if test -d mysqlc; then
41217aa0a607SDon Lewis   AC_MSG_RESULT([OK])
41227aa0a607SDon Lewis  else
41237aa0a607SDon Lewis   AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
41247aa0a607SDon Lewis  fi
41257aa0a607SDon Lewis  BUILD_TYPE="$BUILD_TYPE MYSQLC"
41267aa0a607SDon Lewiselse
41277aa0a607SDon Lewis  AC_MSG_RESULT([no])
41287aa0a607SDon Lewis  ENABLE_MYSQLC=NO
41297aa0a607SDon Lewisfi
41307aa0a607SDon LewisAC_SUBST(ENABLE_MYSQLC)
41317aa0a607SDon Lewis
41327aa0a607SDon Lewisif test "$ENABLE_MYSQLC" = "YES"; then
41337aa0a607SDon Lewisdnl ===================================================================
41347aa0a607SDon Lewisdnl Check for system MySQL
41357aa0a607SDon Lewisdnl ===================================================================
41367aa0a607SDon LewisAC_MSG_CHECKING([for mysql pre-requisites])
41377aa0a607SDon Lewisif test -n "$with_system_mysql" -o -n "$with_system_libs" && \
41387aa0a607SDon Lewis       test "$with_system_mysql" != "no" && test "$with_system_libs" != "no"; then
41397aa0a607SDon Lewis	AC_MSG_RESULT([external MySQL])
41407aa0a607SDon Lewis	SYSTEM_MYSQL=YES
41417aa0a607SDon Lewis	AC_PATH_PROG( MYSQLCONFIG, mysql_config)
41427aa0a607SDon Lewis	AC_MSG_CHECKING([MySQL version])
41437aa0a607SDon Lewis	if test -z "$MYSQLCONFIG" -o ! -x "$MYSQLCONFIG" ; then
41447aa0a607SDon Lewis		AC_MSG_ERROR([can not find/execute mysql_config]);
41457aa0a607SDon Lewis	fi
41467aa0a607SDon Lewis	MYSQL_VERSION=`$MYSQLCONFIG --version`
41477aa0a607SDon Lewis	MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
41487aa0a607SDon Lewis	if test "$MYSQL_MAJOR" -ge "5"; then
41497aa0a607SDon Lewis		AC_MSG_RESULT([OK])
41507aa0a607SDon Lewis	else
41517aa0a607SDon Lewis		AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
41527aa0a607SDon Lewis	fi
41537aa0a607SDon Lewis	AC_MSG_CHECKING([for MySQL Client library])
41547aa0a607SDon Lewis	MYSQL_INC=`$MYSQLCONFIG --include`
41557aa0a607SDon Lewis	MYSQL_LIB=`$MYSQLCONFIG --libs`
41567aa0a607SDon Lewis	MYSQL_DEFINES=`$MYSQLCONFIG --cflags | sed -e s,$MYSQL_INC,,`
41577aa0a607SDon Lewis	AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
41587aa0a607SDon Lewiselse
41597aa0a607SDon Lewis    SYSTEM_MYSQL=NO
41607aa0a607SDon Lewis    if test -n "$with_libmysql_path"; then
41617aa0a607SDon Lewis        AC_MSG_RESULT([external Connector/C (libmysql)])
41627aa0a607SDon Lewis        LIBMYSQL=libmysql.so
41637aa0a607SDon Lewis        if test "$_os" = "Darwin"; then
41647aa0a607SDon Lewis            LIBMYSQL=libmysql.dylib
41657aa0a607SDon Lewis        elif test "$_os" = "WINNT"; then
41667aa0a607SDon Lewis            LIBMYSQL=libmysql.dll
41677aa0a607SDon Lewis        fi
41687aa0a607SDon Lewis        AC_MSG_CHECKING([for $LIBMYSQL])
41697aa0a607SDon Lewis        if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
41707aa0a607SDon Lewis            AC_MSG_RESULT([found.])
41717aa0a607SDon Lewis            LIBMYSQL_PATH=$with_libmysql_path
41727aa0a607SDon Lewis        else
41737aa0a607SDon Lewis            AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
41747aa0a607SDon Lewis        fi
41757aa0a607SDon Lewis    else
41767aa0a607SDon Lewis        AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
41777aa0a607SDon Lewis    fi
41787aa0a607SDon Lewisfi
41797aa0a607SDon LewisAC_SUBST(SYSTEM_MYSQL)
41807aa0a607SDon LewisAC_SUBST(MYSQL_INC)
41817aa0a607SDon LewisAC_SUBST(MYSQL_LIB)
41827aa0a607SDon LewisAC_SUBST(MYSQL_DEFINES)
41837aa0a607SDon LewisAC_SUBST(LIBMYSQL_PATH)
41847aa0a607SDon Lewis
41857aa0a607SDon LewisAC_LANG_PUSH([C++])
41867aa0a607SDon Lewisdnl ===================================================================
41877aa0a607SDon Lewisdnl Check for system MySQL C++ Connector
41887aa0a607SDon Lewisdnl ===================================================================
41897aa0a607SDon Lewis# FIXME!
41907aa0a607SDon Lewis# who thought this too-generic cppconn dir was a good idea?
41917aa0a607SDon LewisAC_MSG_CHECKING([MySQL Connector/C++])
41927aa0a607SDon Lewisif test -n "$with_system_mysql_cppconn" -o -n "$with_system_libs" && \
41937aa0a607SDon Lewis		test "$with_system_mysql_cppconn" != "no" && test "$with_system_libs" != "no"; then
41947aa0a607SDon Lewis	AC_MSG_RESULT([external])
41957aa0a607SDon Lewis	SYSTEM_MYSQL_CPPCONN=YES
41967aa0a607SDon Lewis        AC_LANG_PUSH([C++])
41977aa0a607SDon Lewis	AC_CHECK_HEADER(mysql_driver.h, [],
41987aa0a607SDon Lewis					[AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
41997aa0a607SDon Lewis	AC_CHECK_LIB(mysqlcppconn, main, [],
42007aa0a607SDon Lewis					[AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
42017aa0a607SDon Lewis   AC_MSG_CHECKING([version])
42027aa0a607SDon Lewis      AC_TRY_RUN([
42037aa0a607SDon Lewis#include <mysql_driver.h>
42047aa0a607SDon Lewis
42057aa0a607SDon Lewisint main(int argc, char **argv) {
42067aa0a607SDon Lewis	sql::Driver *driver;
42077aa0a607SDon Lewis	driver = get_driver_instance();
42087aa0a607SDon Lewis	if (driver->getMajorVersion() > 1 || \
42097aa0a607SDon Lewis	   (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
42107aa0a607SDon Lewis	   (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
42117aa0a607SDon Lewis        return 0;
42127aa0a607SDon Lewis      else
42137aa0a607SDon Lewis        return 1;
42147aa0a607SDon Lewis}
42157aa0a607SDon Lewis      ], [AC_MSG_RESULT(OK)], [AC_MSG_ERROR([not suitable, we need >= 1.0.6])])
42167aa0a607SDon Lewis        AC_LANG_POP([C++])
42177aa0a607SDon Lewis
42187aa0a607SDon Lewiselse
42197aa0a607SDon Lewis	AC_MSG_RESULT([no])
42207aa0a607SDon Lewis	SYSTEM_MYSQL_CPPCONN=
42217aa0a607SDon Lewisfi
42227aa0a607SDon LewisAC_LANG_POP([C++])
42237aa0a607SDon LewisAC_SUBST(SYSTEM_MYSQL_CPPCONN)
42247aa0a607SDon Lewisfi
42257aa0a607SDon Lewis
42267aa0a607SDon Lewisdnl ===================================================================
42277aa0a607SDon Lewisdnl Check for system hsqldb
42287aa0a607SDon Lewisdnl ===================================================================
42297aa0a607SDon LewisAC_MSG_CHECKING([which hsqldb to use])
42307aa0a607SDon Lewisif test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \
42317aa0a607SDon Lewis       test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then
42327aa0a607SDon Lewis        AC_MSG_RESULT([external])
42337aa0a607SDon Lewis        SYSTEM_HSQLDB=YES
42347aa0a607SDon Lewis        if test -z $HSQLDB_JAR; then
42357aa0a607SDon Lewis               HSQLDB_JAR=/usr/share/java/hsqldb.jar
42367aa0a607SDon Lewis        fi
42377aa0a607SDon Lewis        AC_CHECK_FILE($HSQLDB_JAR, [],
42387aa0a607SDon Lewis               [AC_MSG_ERROR(hsqldb.jar not found.)], [])
42397aa0a607SDon Lewis        AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
42407aa0a607SDon Lewis        export HSQLDB_JAR
42417aa0a607SDon Lewis        if $PERL -e 'use Archive::Zip;
42427aa0a607SDon Lewis            my $file = "$ENV{'HSQLDB_JAR'}";
42437aa0a607SDon Lewis            my $zip = Archive::Zip->new( $file );
42447aa0a607SDon Lewis            my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
42457aa0a607SDon Lewis            if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
42467aa0a607SDon Lewis               push @l, split(/\n/, $mf);
42477aa0a607SDon Lewis               foreach my $line (@l) {
42487aa0a607SDon Lewis                  if ($line =~ m/Specification-Version:/) {
42497aa0a607SDon Lewis                      ($t, $version) = split (/:/,$line);
42507aa0a607SDon Lewis                      $version =~ s/^\s//;
42517aa0a607SDon Lewis                      ($a, $b, $c, $d) = split (/\./,$version);
42527aa0a607SDon Lewis                      if ($c == "0" && $d > "8")  {
42537aa0a607SDon Lewis                          exit 0;
42547aa0a607SDon Lewis                      } else {
42557aa0a607SDon Lewis                          exit 1;
42567aa0a607SDon Lewis                      }
42577aa0a607SDon Lewis                  }
42587aa0a607SDon Lewis               }
42597aa0a607SDon Lewis            } else {
42607aa0a607SDon Lewis                exit 1;
42617aa0a607SDon Lewis            }'; then
42627aa0a607SDon Lewis            AC_MSG_RESULT([yes])
42637aa0a607SDon Lewis         else
42647aa0a607SDon Lewis            AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
42657aa0a607SDon Lewis         fi
42667aa0a607SDon Lewiselse
42677aa0a607SDon Lewis    AC_MSG_RESULT([internal])
42687aa0a607SDon Lewis    SYSTEM_HSQLDB=NO
42697aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE HSQLDB"
42707aa0a607SDon Lewisfi
42717aa0a607SDon LewisAC_SUBST(SYSTEM_HSQLDB)
42727aa0a607SDon LewisAC_SUBST(HSQLDB_JAR)
42737aa0a607SDon Lewis
42747aa0a607SDon Lewisdnl ===================================================================
42757aa0a607SDon Lewisdnl Check for system beanshell
42767aa0a607SDon Lewisdnl ===================================================================
42777aa0a607SDon LewisENABLE_BEANSHELL=YES
42787aa0a607SDon LewisAC_MSG_CHECKING([which beanshell to use])
42797aa0a607SDon Lewisif test -n "$with_system_beanshell" -o -n "$with_system_libs" && \
42807aa0a607SDon Lewis       test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then
42817aa0a607SDon Lewis        AC_MSG_RESULT([external])
42827aa0a607SDon Lewis        SYSTEM_BSH=YES
42837aa0a607SDon Lewis        if test -z $BSH_JAR; then
42847aa0a607SDon Lewis               BSH_JAR=/usr/share/java/bsh.jar
42857aa0a607SDon Lewis        fi
42867aa0a607SDon Lewis        AC_CHECK_FILE($BSH_JAR, [],
42877aa0a607SDon Lewis               [AC_MSG_ERROR(bsh.jar not found.)], [])
42887aa0a607SDon Lewiselif test "x$enable_beanshell" = "xyes"; then
42897aa0a607SDon Lewis    AC_MSG_RESULT([internal])
42907aa0a607SDon Lewis    SYSTEM_BSH=NO
42917aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE BSH"
42927aa0a607SDon Lewiselse
42937aa0a607SDon Lewis    AC_MSG_RESULT([none (disabled)])
42947aa0a607SDon Lewis    SYSTEM_BSH=NO
42957aa0a607SDon Lewis    ENABLE_BEANSHELL=NO
42967aa0a607SDon Lewisfi
42977aa0a607SDon LewisAC_SUBST(SYSTEM_BSH)
42987aa0a607SDon LewisAC_SUBST(BSH_JAR)
42997aa0a607SDon LewisAC_SUBST(ENABLE_BEANSHELL)
43007aa0a607SDon Lewis
43017aa0a607SDon Lewis
43027aa0a607SDon Lewisdnl ===================================================================
43037aa0a607SDon Lewisdnl Check for saxon.  It can come from two different places:
43047aa0a607SDon Lewisdnl - pre-installed on the system.  This is checked when the --with-system-saxon
43057aa0a607SDon Lewisdnl   option is given to configure.
43067aa0a607SDon Lewisdnl   The exact place can be specified with the --with-saxon-jar=<path> option.
43077aa0a607SDon Lewisdnl - From the saxon tar ball in ext_sources/.  This is used when --enable-saxon
43087aa0a607SDon Lewisdnl   is given to configure but not any of --with-system-saxon or --with-saxon-jar.
43097aa0a607SDon Lewisdnl ===================================================================
43107aa0a607SDon LewisDISABLE_SAXON=
43117aa0a607SDon LewisAC_MSG_CHECKING([which saxon to use])
43127aa0a607SDon Lewisif test -n "$with_system_saxon" -o -n "$with_system_libs" && \
43137aa0a607SDon Lewis       test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then
43147aa0a607SDon Lewis        AC_MSG_RESULT([external])
43157aa0a607SDon Lewis        SYSTEM_SAXON=YES
43167aa0a607SDon Lewis        if test -z $SAXON_JAR; then
43177aa0a607SDon Lewis          AC_CHECK_FILE(/usr/share/java/saxon9.jar,
43187aa0a607SDon Lewis            [ SAXON_JAR=/usr/share/java/saxon9.jar ],
43197aa0a607SDon Lewis            [
43207aa0a607SDon Lewis              AC_CHECK_FILE(/usr/share/java/saxon.jar,
43217aa0a607SDon Lewis                [ SAXON_JAR=/usr/share/java/saxon.jar ],
43227aa0a607SDon Lewis                [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
43237aa0a607SDon Lewis                    [ SAXON_JAR=/usr/share/java/saxon9.jar ],
43247aa0a607SDon Lewis                    [ AC_MSG_ERROR(saxon.jar replacement not found)]
43257aa0a607SDon Lewis                  )
43267aa0a607SDon Lewis                ]
43277aa0a607SDon Lewis              )
43287aa0a607SDon Lewis            ]
43297aa0a607SDon Lewis          )
43307aa0a607SDon Lewis        else
43317aa0a607SDon Lewis          AC_CHECK_FILE($SAXON_JAR, [],
43327aa0a607SDon Lewis               [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
43337aa0a607SDon Lewis        fi
43347aa0a607SDon Lewis        if test -n "$SERIALIZER_JAR"; then
43357aa0a607SDon Lewis          AC_CHECK_FILE($SERIALIZER_JAR, [],
43367aa0a607SDon Lewis               [AC_MSG_ERROR(serializer.jar not found.)], [])
43377aa0a607SDon Lewis          AC_SUBST(SERIALIZER_JAR)
43387aa0a607SDon Lewis        fi
43397aa0a607SDon Lewis
43407aa0a607SDon Lewisdnl Saxon comes in two practically available versions, the out-of-date saxonb which
43417aa0a607SDon Lewisdnl supports the java extensions that OOo uses, and the up-to-date saxon he
43427aa0a607SDon Lewisdnl "home edition" version, which is crippled to not support those java extensions.
43437aa0a607SDon Lewisdnl And as an aside the he one also needs to be tweaked to include
43447aa0a607SDon Lewisdnl a META-INF/services to broadcast that it supports the jaxp transform factory
43457aa0a607SDon Lewis
43467aa0a607SDon Lewis        AC_MSG_CHECKING([if saxon works])
43477aa0a607SDon Lewis        cat > saxontest.java <<_ACEOF
43487aa0a607SDon Lewis[import javax.xml.transform.TransformerFactory;
43497aa0a607SDon Lewisimport javax.xml.transform.Transformer;
43507aa0a607SDon Lewisimport javax.xml.transform.stream.StreamSource;
43517aa0a607SDon Lewisimport java.io.*;
43527aa0a607SDon Lewis
43537aa0a607SDon Lewisimport net.sf.saxon.FeatureKeys;
43547aa0a607SDon Lewis
43557aa0a607SDon Lewisclass saxontest {
43567aa0a607SDon Lewis    public static void main(String[] args) {
43577aa0a607SDon Lewis      System.setProperty("javax.xml.transform.TransformerFactory",
43587aa0a607SDon Lewis        "net.sf.saxon.TransformerFactoryImpl");
43597aa0a607SDon Lewis      try {
43607aa0a607SDon Lewis        TransformerFactory tfactory = TransformerFactory.newInstance();
43617aa0a607SDon Lewis	// some external saxons (Debian, Ubuntu, ...) have this disabled
43627aa0a607SDon Lewis	// per default
43637aa0a607SDon Lewis	tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
43647aa0a607SDon Lewis        System.out.println("TransformerFactory is" +
43657aa0a607SDon Lewis          tfactory.getClass().getName());
43667aa0a607SDon Lewis        Transformer transformer = tfactory.newTransformer(
43677aa0a607SDon Lewis          new StreamSource(new File(args[0])));
43687aa0a607SDon Lewis      } catch(Exception e){
43697aa0a607SDon Lewis        e.printStackTrace(System.err);
43707aa0a607SDon Lewis        System.exit(-1);
43717aa0a607SDon Lewis      }
43727aa0a607SDon Lewis      System.exit(0);
43737aa0a607SDon Lewis    }
43747aa0a607SDon Lewis}
43757aa0a607SDon Lewis]
43767aa0a607SDon Lewis_ACEOF
43777aa0a607SDon Lewis        cat > saxontest.xsl<<_ACEOF
43787aa0a607SDon Lewis[<?xml version="1.0" encoding="UTF-8"?>
43797aa0a607SDon Lewis<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
43807aa0a607SDon Lewis <xsl:template match="/">
43817aa0a607SDon Lewis  <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
43827aa0a607SDon Lewis </xsl:template>
43837aa0a607SDon Lewis</xsl:stylesheet>
43847aa0a607SDon Lewis]
43857aa0a607SDon Lewis_ACEOF
43867aa0a607SDon Lewis        javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
43877aa0a607SDon Lewis        AC_TRY_EVAL(javac_cmd)
43887aa0a607SDon Lewis        if test $? = 0 && test -f ./saxontest.class ; then
43897aa0a607SDon Lewis            java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
43907aa0a607SDon Lewis            AC_TRY_EVAL(java_cmd)
43917aa0a607SDon Lewis            if test $? = 0; then
43927aa0a607SDon Lewis              AC_MSG_RESULT([yes])
43937aa0a607SDon Lewis            else
43947aa0a607SDon Lewis              cat saxontest.java >&5
43957aa0a607SDon Lewis              AC_MSG_RESULT([no])
43967aa0a607SDon Lewis              AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
43977aa0a607SDon Lewis            fi
43987aa0a607SDon Lewis        else
43997aa0a607SDon Lewis          AC_MSG_RESULT([no])
44007aa0a607SDon Lewis          cat saxontest.java >&5
44017aa0a607SDon Lewis          AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
44027aa0a607SDon Lewis        fi
44037aa0a607SDon Lewiselif test "x$enable_saxon" = "xyes"; then
44047aa0a607SDon Lewis    AC_MSG_RESULT([internal])
44057aa0a607SDon Lewis    SYSTEM_SAXON=NO
44067aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE SAXON"
44077aa0a607SDon Lewiselse
44087aa0a607SDon Lewis    AC_MSG_RESULT([none (disabled)])
44097aa0a607SDon Lewis    SYSTEM_SAXON=NO
44107aa0a607SDon Lewis    DISABLE_SAXON=YES
44117aa0a607SDon Lewisfi
44127aa0a607SDon LewisAC_SUBST(SYSTEM_SAXON)
44137aa0a607SDon LewisAC_SUBST(SAXON_JAR)
44147aa0a607SDon LewisAC_SUBST(DISABLE_SAXON)
44157aa0a607SDon Lewis
44167aa0a607SDon Lewis
44177aa0a607SDon Lewisdnl ===================================================================
44187aa0a607SDon Lewisdnl Check for rhino
44197aa0a607SDon Lewisdnl ===================================================================
44207aa0a607SDon LewisENABLE_JAVASCRIPT=
44217aa0a607SDon LewisAC_MSG_CHECKING([whether to enable support for JavaScript])
44227aa0a607SDon Lewisif test "x$enable_javascript" = "xyes"; then
44237aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE RHINO"
44247aa0a607SDon Lewis   AC_MSG_RESULT([yes])
44257aa0a607SDon Lewis   ENABLE_JAVASCRIPT=YES
44267aa0a607SDon Lewiselse
44277aa0a607SDon Lewis   AC_MSG_RESULT([no])
44287aa0a607SDon Lewis   ENABLE_JAVASCRIPT=NO
44297aa0a607SDon Lewisfi
44307aa0a607SDon LewisAC_SUBST(ENABLE_JAVASCRIPT)
44317aa0a607SDon Lewis
44327aa0a607SDon Lewis
44337aa0a607SDon Lewisdnl ===================================================================
44347aa0a607SDon Lewisdnl Check for system apr
44357aa0a607SDon Lewisdnl ===================================================================
44367aa0a607SDon LewisSYSTEM_APR=NO
44377aa0a607SDon LewisAPR_CFLAGS=
44387aa0a607SDon LewisAPR_LIBS=
44397aa0a607SDon LewisAC_MSG_CHECKING([which libapr to use])
44407aa0a607SDon Lewisif test "x$with_system_apr" = "xyes" -o -n "$with_system_libs"; then
44417aa0a607SDon Lewis    AC_MSG_RESULT([system])
44427aa0a607SDon Lewis    PKG_CHECK_MODULES([APR], [apr-1 >= 1.0])
44437aa0a607SDon Lewis    SYSTEM_APR=YES
44447aa0a607SDon Lewiselse
44457aa0a607SDon Lewis    AC_MSG_RESULT([internal])
44467aa0a607SDon Lewis    SYSTEM_APR=NO
44477aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE APR"
44487aa0a607SDon Lewisfi
44497aa0a607SDon LewisAC_SUBST(SYSTEM_APR)
44507aa0a607SDon LewisAC_SUBST(APR_CFLAGS)
44517aa0a607SDon LewisAC_SUBST(APR_LIBS)
44527aa0a607SDon Lewis
44537aa0a607SDon Lewis
44547aa0a607SDon Lewisdnl ===================================================================
44557aa0a607SDon Lewisdnl Check for system apr-util
44567aa0a607SDon Lewisdnl ===================================================================
44577aa0a607SDon LewisSYSTEM_APR_UTIL=NO
44587aa0a607SDon LewisAPR_UTIL_CFLAGS=
44597aa0a607SDon LewisAPR_UTIL_LIBS=
44607aa0a607SDon LewisAC_MSG_CHECKING([which libapr-util to use])
44617aa0a607SDon Lewisif test "x$with_system_apr_util" = "xyes" -o -n "$with_system_libs"; then
44627aa0a607SDon Lewis    AC_MSG_RESULT([system])
44637aa0a607SDon Lewis    PKG_CHECK_MODULES([APR_UTIL], [apr-util-1 >= 1.0])
44647aa0a607SDon Lewis    SYSTEM_APR_UTIL=YES
44657aa0a607SDon Lewiselse
44667aa0a607SDon Lewis    AC_MSG_RESULT([internal])
44677aa0a607SDon Lewis    SYSTEM_APR_UTIL=NO
44687aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE APR_UTIL"
44697aa0a607SDon Lewisfi
44707aa0a607SDon LewisAC_SUBST(SYSTEM_APR_UTIL)
44717aa0a607SDon LewisAC_SUBST(APR_UTIL_CFLAGS)
44727aa0a607SDon LewisAC_SUBST(APR_UTIL_LIBS)
44737aa0a607SDon Lewis
44747aa0a607SDon Lewis
44757aa0a607SDon Lewisdnl ===================================================================
44767aa0a607SDon Lewisdnl Check for system serf
44777aa0a607SDon Lewisdnl ===================================================================
44787aa0a607SDon LewisSYSTEM_SERF=NO
44797aa0a607SDon LewisSERF_CFLAGS=
44807aa0a607SDon LewisSERF_LIBS=
44817aa0a607SDon LewisAC_MSG_CHECKING([which libserf to use])
44827aa0a607SDon Lewisif test -n "$with_system_serf" -o -n "$with_system_libs" && \
44837aa0a607SDon Lewis  test "$with_system_serf" != "no"; then
44847aa0a607SDon Lewis    AC_MSG_RESULT([system])
44857aa0a607SDon Lewis    PKG_CHECK_MODULES([SERF], [serf-1 >= 1.1])
44867aa0a607SDon Lewis    SYSTEM_SERF=YES
44877aa0a607SDon Lewiselse
44887aa0a607SDon Lewis    AC_MSG_RESULT([internal])
44897aa0a607SDon Lewis    SYSTEM_SERF=NO
44907aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE SERF"
44917aa0a607SDon Lewisfi
44927aa0a607SDon LewisAC_SUBST(SYSTEM_SERF)
44937aa0a607SDon LewisAC_SUBST(SERF_CFLAGS)
44947aa0a607SDon LewisAC_SUBST(SERF_LIBS)
44957aa0a607SDon Lewis
44967aa0a607SDon Lewis
44977aa0a607SDon Lewisdnl ===================================================================
44987aa0a607SDon Lewisdnl Check for CoinMP
44997aa0a607SDon Lewisdnl ===================================================================
45007aa0a607SDon LewisENABLE_COINMP=
45017aa0a607SDon LewisSYSTEM_COINMP=NO
45027aa0a607SDon LewisCOINMP_CFLAGS=
45037aa0a607SDon LewisCOINMP_LIBS=
45047aa0a607SDon LewisAC_MSG_CHECKING([whether to enable support for CoinMP])
45057aa0a607SDon Lewisif test "x$enable_coinmp" = "xyes"; then
45067aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE COINMP"
45077aa0a607SDon Lewis    AC_MSG_RESULT([yes])
45087aa0a607SDon Lewis    ENABLE_COINMP=YES
45097aa0a607SDon Lewis
45107aa0a607SDon Lewis    dnl Check wether to use system or internal CoinMP
45117aa0a607SDon Lewis    AC_MSG_CHECKING([which coinmp to use])
45127aa0a607SDon Lewis    if test "x$with_system_coinmp" = "xyes" -o -n "$with_system_libs"; then
45137aa0a607SDon Lewis        AC_MSG_RESULT([system])
45147aa0a607SDon Lewis	PKG_CHECK_MODULES([COINMP], [coinmp])
45157aa0a607SDon Lewis        SYSTEM_COINMP=YES
45167aa0a607SDon Lewis        # some systems need this. Like Ubuntu....
45177aa0a607SDon Lewis        AC_CHECK_LIB(m, floor)
45187aa0a607SDon Lewis        AC_CHECK_LIB(dl, dlopen)
45197aa0a607SDon Lewis    else
45207aa0a607SDon Lewis        AC_MSG_RESULT([internal])
45217aa0a607SDon Lewis        SYSTEM_COINMP=NO
45227aa0a607SDon Lewis        BUILD_TYPE="$BUILD_TYPE COINMP"
45237aa0a607SDon Lewis    fi
45247aa0a607SDon Lewiselse
45257aa0a607SDon Lewis    AC_MSG_RESULT([no])
45267aa0a607SDon Lewis    ENABLE_COINMP=NO
45277aa0a607SDon Lewisfi
45287aa0a607SDon LewisAC_SUBST(ENABLE_COINMP)
45297aa0a607SDon LewisAC_SUBST(SYSTEM_COINMP)
45307aa0a607SDon LewisAC_SUBST(COINMP_CFLAGS)
45317aa0a607SDon LewisAC_SUBST(COINMP_LIBS)
45327aa0a607SDon Lewis
45337aa0a607SDon Lewis
45347aa0a607SDon Lewisdnl ===================================================================
45357aa0a607SDon Lewisdnl Check for system curl
45367aa0a607SDon Lewisdnl ===================================================================
45377aa0a607SDon Lewisif test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then
45387aa0a607SDon Lewis   with_system_curl=yes
45397aa0a607SDon Lewisfi
45407aa0a607SDon LewisAC_MSG_CHECKING([which curl to use])
45417aa0a607SDon Lewisif test -n "$with_system_curl" -o -n "$with_system_libs" && \
45427aa0a607SDon Lewis	test "$with_system_curl" != "no"; then
45437aa0a607SDon Lewis   AC_MSG_RESULT([external])
45447aa0a607SDon Lewis   SYSTEM_CURL=YES
45457aa0a607SDon Lewis
45467aa0a607SDon Lewis   AC_PATH_PROG( CURLCONFIG, curl-config)
45477aa0a607SDon Lewis   if test -z "$CURLCONFIG"; then
45487aa0a607SDon Lewis      AC_MSG_ERROR([install curl to run this script])
45497aa0a607SDon Lewis   fi
45507aa0a607SDon Lewis
45517aa0a607SDon Lewis   # check curl version
45527aa0a607SDon Lewis   AC_MSG_CHECKING([whether curl is >= 7.13.1])
45537aa0a607SDon Lewis   if test "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $1 }'`" -gt "7" -a \
45547aa0a607SDon Lewis	"`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $2 }'`" -gt "13" -a \
45557aa0a607SDon Lewis	"`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $3 }'`" -gt "1"; then
45567aa0a607SDon Lewis      AC_MSG_ERROR([no, you need at least curl 7.13,1])
45577aa0a607SDon Lewis   else
45587aa0a607SDon Lewis      AC_MSG_RESULT([yes])
45597aa0a607SDon Lewis   fi
45607aa0a607SDon Lewis   CURL_LIBS=`$CURLCONFIG --libs`
45617aa0a607SDon Lewis   CURL_CFLAGS=`$CURLCONFIG --cflags`
45627aa0a607SDon Lewiselse
45637aa0a607SDon Lewis   AC_MSG_RESULT([internal])
45647aa0a607SDon Lewis   SYSTEM_CURL=NO
45657aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE CURL"
45667aa0a607SDon Lewisfi
45677aa0a607SDon LewisAC_SUBST(SYSTEM_CURL)
45687aa0a607SDon LewisAC_SUBST(CURL_CFLAGS)
45697aa0a607SDon LewisAC_SUBST(CURL_LIBS)
45707aa0a607SDon Lewis
45717aa0a607SDon Lewisdnl ===================================================================
45727aa0a607SDon Lewisdnl Check for system mdds
45737aa0a607SDon Lewisdnl ===================================================================
45747aa0a607SDon LewisAC_MSG_CHECKING([which mdds to use])
45757aa0a607SDon Lewisif test -n "$with_system_mdds" -o -n "$with_system_headers" && \
45767aa0a607SDon Lewis	test "$with_system_mdds" != "no"; then
45777aa0a607SDon Lewis    AC_MSG_RESULT([external])
45787aa0a607SDon Lewis    SYSTEM_MDDS=YES
45797aa0a607SDon Lewis    AC_LANG_PUSH([C++])
45807aa0a607SDon Lewis    AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
45817aa0a607SDon Lewis        [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
45827aa0a607SDon Lewis    AC_LANG_POP([C++])
45837aa0a607SDon Lewiselse
45847aa0a607SDon Lewis   AC_MSG_RESULT([internal])
45857aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE MDDS"
45867aa0a607SDon Lewis   SYSTEM_MDDS=NO
45877aa0a607SDon Lewisfi
45887aa0a607SDon LewisAC_SUBST(SYSTEM_MDDS)
45897aa0a607SDon Lewis
45907aa0a607SDon Lewisdnl ===================================================================
45917aa0a607SDon Lewisdnl Check for system boost
45927aa0a607SDon Lewisdnl ===================================================================
45937aa0a607SDon LewisAC_MSG_CHECKING([which boost to use])
45947aa0a607SDon Lewisif test -n "$with_system_boost" -o -n "$with_system_headers" && \
45957aa0a607SDon Lewis	test "$with_system_boost" != "no"; then
45967aa0a607SDon Lewis   AC_MSG_RESULT([external])
45977aa0a607SDon Lewis   SYSTEM_BOOST=YES
45987aa0a607SDon Lewis   AC_LANG_PUSH([C++])
45997aa0a607SDon Lewis   AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
46007aa0a607SDon Lewis       [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
46017aa0a607SDon Lewis   AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
46027aa0a607SDon Lewis       [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
46037aa0a607SDon Lewis   AC_CHECK_HEADER(boost/function.hpp, [],
46047aa0a607SDon Lewis       [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
46057aa0a607SDon Lewis
46067aa0a607SDon Lewis   save_CXXFLAGS=$CXXFLAGS
46077aa0a607SDon Lewis   CXXFLAGS="$CXXFLAGS -fno-exceptions"
46087aa0a607SDon Lewis   AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
46097aa0a607SDon Lewis   AC_TRY_COMPILE([#include <boost/function.hpp>
46107aa0a607SDon Lewis], [],
46117aa0a607SDon Lewis   ac_cv_cxx_boost_no_exceptons_broken=no, ac_cv_cxx_boost_no_exceptons_broken=yes)
46127aa0a607SDon Lewis
46137aa0a607SDon Lewis   if test "$ac_cv_cxx_boost_no_exceptons_broken" = "yes"; then
46147aa0a607SDon Lewis	AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
46157aa0a607SDon Lewis   else
46167aa0a607SDon Lewis  	AC_MSG_RESULT([yes])
46177aa0a607SDon Lewis   fi
46187aa0a607SDon Lewis   CXXFLAGS=$save_CXXFLAGS
46197aa0a607SDon Lewis   AC_LANG_POP([C++])
46207aa0a607SDon Lewiselse
46217aa0a607SDon Lewis   AC_MSG_RESULT([internal])
46227aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE BOOST"
46237aa0a607SDon Lewis   SYSTEM_BOOST=NO
46247aa0a607SDon Lewisfi
46257aa0a607SDon LewisAC_SUBST(SYSTEM_BOOST)
46267aa0a607SDon Lewis
46277aa0a607SDon Lewisdnl ===================================================================
46287aa0a607SDon Lewisdnl Check for system vigra
46297aa0a607SDon Lewisdnl ===================================================================
46307aa0a607SDon LewisAC_MSG_CHECKING([which vigra to use])
46317aa0a607SDon Lewisif test -n "$with_system_vigra" -o -n "$with_system_headers" && \
46327aa0a607SDon Lewis	test "$with_system_vigra" != "no"; then
46337aa0a607SDon Lewis   AC_MSG_RESULT([external])
46347aa0a607SDon Lewis   SYSTEM_VIGRA=YES
46357aa0a607SDon Lewis   AC_LANG_PUSH([C++])
46367aa0a607SDon Lewis   AC_CHECK_HEADER(vigra/copyimage.hxx, [],
46377aa0a607SDon Lewis       [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
46387aa0a607SDon Lewis   AC_LANG_POP([C++])
46397aa0a607SDon Lewiselse
46407aa0a607SDon Lewis   AC_MSG_RESULT([internal])
46417aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE VIGRA"
46427aa0a607SDon Lewis   SYSTEM_VIGRA=NO
46437aa0a607SDon Lewisfi
46447aa0a607SDon LewisAC_SUBST(SYSTEM_VIGRA)
46457aa0a607SDon Lewis
46467aa0a607SDon Lewisdnl ===================================================================
46477aa0a607SDon Lewisdnl Check for system odbc
46487aa0a607SDon Lewisdnl ===================================================================
46497aa0a607SDon LewisAC_MSG_CHECKING([which odbc headers to use])
46507aa0a607SDon Lewisif test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \
46517aa0a607SDon Lewis	test "$with_system_odbc_headers" != "no"; then
46527aa0a607SDon Lewis   AC_MSG_RESULT([external])
46537aa0a607SDon Lewis   SYSTEM_ODBC_HEADERS=YES
46547aa0a607SDon Lewis
46557aa0a607SDon Lewis   AC_CHECK_HEADER(sqlext.h, [],
46567aa0a607SDon Lewis      [AC_MSG_ERROR(odbc not found. install odbc)], [])
46577aa0a607SDon Lewiselse
46587aa0a607SDon Lewis   AC_MSG_RESULT([internal])
46597aa0a607SDon Lewis   SYSTEM_ODBC_HEADERS=NO
46607aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE UNIXODBC"
46617aa0a607SDon Lewisfi
46627aa0a607SDon LewisAC_SUBST(SYSTEM_ODBC_HEADERS)
46637aa0a607SDon Lewis
46647aa0a607SDon LewisAC_MSG_CHECKING([whether to build XML Security support])
46657aa0a607SDon Lewisif test "$enable_nss_module" = "no"; then
46667aa0a607SDon Lewis   AC_MSG_RESULT([no, since NSS disabled but needed])
46677aa0a607SDon Lewiselse
46687aa0a607SDon Lewis   AC_MSG_RESULT([yes])
46697aa0a607SDon Lewisfi
46707aa0a607SDon Lewis
46717aa0a607SDon LewisAC_MSG_CHECKING([whether to build LDAP configuration backend])
46727aa0a607SDon Lewisif test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then
46737aa0a607SDon Lewis   if test "$with_openldap" = "yes"; then
46747aa0a607SDon Lewis      AC_MSG_RESULT([yes])
46757aa0a607SDon Lewis      WITH_LDAP=YES
46767aa0a607SDon Lewis   else
46777aa0a607SDon Lewis      WITH_LDAP=NO
46787aa0a607SDon Lewis   fi
46797aa0a607SDon Lewiselse
46807aa0a607SDon Lewis   AC_MSG_RESULT([no])
46817aa0a607SDon Lewis   WITH_LDAP=NO
46827aa0a607SDon Lewisfi
46837aa0a607SDon Lewis
46847aa0a607SDon Lewisif test "$WITH_LDAP" = "YES"; then
46857aa0a607SDon Lewis   dnl ===================================================================
46867aa0a607SDon Lewis   dnl Test whether we want to use the OpenLDAP LDAP SDK
46877aa0a607SDon Lewis   dnl ===================================================================
46887aa0a607SDon Lewis   AC_MSG_CHECKING([which LDAP SDK to use])
46897aa0a607SDon Lewis   if test -n "$with_openldap" && test "$with_openldap" != "no"; then
46907aa0a607SDon Lewis  	   AC_MSG_RESULT([OpenLDAP])
46917aa0a607SDon Lewis	   WITH_OPENLDAP=YES
46927aa0a607SDon Lewis	   AC_CHECK_HEADERS(ldap.h, [],
46937aa0a607SDon Lewis		   [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
46947aa0a607SDon Lewis	   AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
46957aa0a607SDon Lewis		   [AC_MSG_ERROR(openldap lib not found or functional)], [])
46967aa0a607SDon Lewis	   # rumours say that OpenLDAP doesn't have that function. I looked and
46977aa0a607SDon Lewis	   # it has it. Test for it to be sure
46987aa0a607SDon Lewis         AC_CHECK_LIB(ldap, ldap_set_option, [],
46997aa0a607SDon Lewis                [AC_MSG_ERROR(openldap lib not found or functional)], [])
47007aa0a607SDon Lewis   fi
47017aa0a607SDon Lewisfi
47027aa0a607SDon LewisAC_SUBST(WITH_LDAP)
47037aa0a607SDon LewisAC_SUBST(WITH_OPENLDAP)
47047aa0a607SDon Lewis
47057aa0a607SDon LewisAC_MSG_CHECKING([whether to build the internal NSS module])
47067aa0a607SDon Lewisif test "$enable_nss_module" != "no"; then
47077aa0a607SDon Lewis   ENABLE_NSS_MODULE="YES"
47087aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE NSS"
47097aa0a607SDon Lewis   AC_MSG_RESULT([yes])
47107aa0a607SDon Lewis   if test "$_os" = "WINNT"; then
47117aa0a607SDon Lewis      AC_MSG_CHECKING([for Mozilla build tooling])
47127aa0a607SDon Lewis      if test -z "$MOZILLABUILD" ; then
47137aa0a607SDon LewisAC_MSG_ERROR([
47147aa0a607SDon LewisMozilla build tooling not found!
47157aa0a607SDon Lewis  It is required for NSS that is needed for AOO's security facilities.
47167aa0a607SDon Lewis  Either disable NSS using the option --disable-nss-module
47177aa0a607SDon Lewis  or use the --with-mozilla-build option after installing the tool obtained
47187aa0a607SDon Lewis  from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
47197aa0a607SDon Lewis      else
47207aa0a607SDon Lewis         if test \( "$WITH_MINGWIN" = "yes" \) ; then
47217aa0a607SDon Lewis            if test ! -d "$MOZILLABUILD" ; then
47227aa0a607SDon LewisAC_MSG_ERROR([Mozilla build tooling incomplete!])
47237aa0a607SDon Lewis            else
47247aa0a607SDon Lewis               AC_MSG_RESULT([ok])
47257aa0a607SDon Lewis            fi
47267aa0a607SDon Lewis         else
4727*18079e30SMatthias Seidel            if test ! -d "$MOZILLABUILD/msys" ; then
47287aa0a607SDon LewisAC_MSG_ERROR([Mozilla build tooling incomplete!])
47297aa0a607SDon Lewis            else
47307aa0a607SDon Lewis               AC_MSG_RESULT([ok])
47317aa0a607SDon Lewis            fi
47327aa0a607SDon Lewis         fi
47337aa0a607SDon Lewis      fi
47347aa0a607SDon Lewis   fi
47357aa0a607SDon Lewiselse
47367aa0a607SDon Lewis   ENABLE_NSS_MODULE="NO"
47377aa0a607SDon Lewis   AC_MSG_RESULT([no])
47387aa0a607SDon Lewisfi
47397aa0a607SDon Lewis
47407aa0a607SDon LewisAC_SUBST(ENABLE_NSS_MODULE)
47417aa0a607SDon LewisAC_SUBST(MOZILLABUILD)
47427aa0a607SDon LewisAC_SUBST(MOZ_INC)
47437aa0a607SDon Lewis
47447aa0a607SDon Lewisdnl ===================================================================
47457aa0a607SDon Lewisdnl Check for system sane
47467aa0a607SDon Lewisdnl ===================================================================
47477aa0a607SDon LewisAC_MSG_CHECKING([which sane header to use])
47487aa0a607SDon Lewisif test -n "$with_system_sane_header" -o -n "$with_system_headers" && \
47497aa0a607SDon Lewis	test "$with_system_sane_header" != "no"; then
47507aa0a607SDon Lewis   AC_MSG_RESULT([external])
47517aa0a607SDon Lewis   SYSTEM_SANE_HEADER=YES
47527aa0a607SDon Lewis   AC_CHECK_HEADER(sane/sane.h, [],
47537aa0a607SDon Lewis      [AC_MSG_ERROR(sane not found. install sane)], [])
47547aa0a607SDon Lewiselse
47557aa0a607SDon Lewis   AC_MSG_RESULT([internal])
47567aa0a607SDon Lewis   SYSTEM_SANE_HEADER=NO
47577aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE SANE"
47587aa0a607SDon Lewisfi
47597aa0a607SDon LewisAC_SUBST(SYSTEM_SANE_HEADER)
47607aa0a607SDon Lewis
47617aa0a607SDon Lewisdnl ===================================================================
47627aa0a607SDon Lewisdnl Check for system icu
47637aa0a607SDon Lewisdnl ===================================================================
47647aa0a607SDon LewisAC_MSG_CHECKING([which icu to use])
47657aa0a607SDon Lewisif test -n "$with_system_icu" -o -n "$with_system_libs" && \
47667aa0a607SDon Lewis	test "$with_system_icu" != "no"; then
47677aa0a607SDon Lewis   AC_MSG_RESULT([external])
47687aa0a607SDon Lewis   SYSTEM_ICU=YES
47697aa0a607SDon Lewis   AC_LANG_PUSH([C++])
47707aa0a607SDon Lewis   AC_MSG_CHECKING([for unicode/rbbi.h])
47717aa0a607SDon Lewis   AC_TRY_CPP(unicode/rbbi.h, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([icu headers not found.]))
47727aa0a607SDon Lewis   AC_LANG_POP([C++])
47737aa0a607SDon Lewis   AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
47747aa0a607SDon Lewis   if test -z "$SYSTEM_GENBRK"; then
47757aa0a607SDon Lewis      AC_MSG_ERROR([\"genbrk\" not found in \$PATH, install the icu development tool \"genbrk"\])
47767aa0a607SDon Lewis   fi
47777aa0a607SDon Lewis   AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin])
47787aa0a607SDon Lewis   if test -z "$SYSTEM_GENCCODE"; then
47797aa0a607SDon Lewis      AC_MSG_ERROR([\"genccode\" not found in \$PATH, install the icu development tool \"genccode"\])
47807aa0a607SDon Lewis   fi
47817aa0a607SDon Lewis   AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin])
47827aa0a607SDon Lewis   if test -z "$SYSTEM_GENCMN"; then
47837aa0a607SDon Lewis      AC_MSG_ERROR([\"gencmn\" not found in \$PATH, install the icu development tool \"gencmn"\])
47847aa0a607SDon Lewis   fi
47857aa0a607SDon Lewis
47867aa0a607SDon Lewis   AC_PATH_PROG( ICUCONFIG, icu-config)
47877aa0a607SDon Lewis   AC_MSG_CHECKING([ICU version])
47887aa0a607SDon Lewis   if test "$_os" = "OS2"; then
47897aa0a607SDon Lewis      ICU_MAJOR=4
47907aa0a607SDon Lewis   else
47917aa0a607SDon Lewis      ICU_VERSION=`$ICUCONFIG --version`
47927aa0a607SDon Lewis      ICU_MAJOR=`$ICUCONFIG --version | cut -d"." -f1`
47937aa0a607SDon Lewis      ICU_MINOR=`$ICUCONFIG --version | cut -d"." -f2`
47947aa0a607SDon Lewis      ICU_MICRO=`$ICUCONFIG --version | cut -d"." -f3`
47957aa0a607SDon Lewis   fi
47967aa0a607SDon Lewis
47977aa0a607SDon Lewis   if test "$ICU_MAJOR" -ge "4"; then
47987aa0a607SDon Lewis      AC_MSG_RESULT([OK])
47997aa0a607SDon Lewis   else
48007aa0a607SDon Lewis      AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
48017aa0a607SDon Lewis   fi
48027aa0a607SDon Lewis
48037aa0a607SDon Lewiselse
48047aa0a607SDon Lewis    AC_MSG_RESULT([internal])
48057aa0a607SDon Lewis    SYSTEM_ICU=NO
48067aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE ICU"
48077aa0a607SDon Lewisfi
48087aa0a607SDon LewisAC_SUBST(SYSTEM_ICU)
48097aa0a607SDon LewisAC_SUBST(SYSTEM_GENBRK)
48107aa0a607SDon LewisAC_SUBST(SYSTEM_GENCCODE)
48117aa0a607SDon LewisAC_SUBST(SYSTEM_GENCMN)
48127aa0a607SDon LewisAC_SUBST(ICU_MAJOR)
48137aa0a607SDon LewisAC_SUBST(ICU_MINOR)
48147aa0a607SDon LewisAC_SUBST(ICU_MICRO)
48157aa0a607SDon Lewis
48167aa0a607SDon Lewisdnl ===================================================================
48177aa0a607SDon Lewisdnl Graphite
48187aa0a607SDon Lewisdnl ===================================================================
48197aa0a607SDon Lewis
48207aa0a607SDon LewisENABLE_GRAPHITE="FALSE"
48217aa0a607SDon LewisAC_MSG_CHECKING([whether to enable graphite support])
48227aa0a607SDon Lewisif test "x$enable_graphite" = "xyes" -a \( "$_os" = "WINNT" -o "$_os" = "Linux" -o "$_os" = "FreeBSD" \) ; then
48237aa0a607SDon Lewis    AC_MSG_RESULT([yes])
48247aa0a607SDon Lewis    ENABLE_GRAPHITE="TRUE"
48257aa0a607SDon Lewis    AC_MSG_CHECKING([which graphite to use])
48267aa0a607SDon Lewis    if test -n "$with_system_graphite" -o -n "$with_system_libs" && \
48277aa0a607SDon Lewis        test "$with_system_graphite" != "no"; then
48287aa0a607SDon Lewis        AC_MSG_RESULT([external])
48297aa0a607SDon Lewis        SYSTEM_GRAPHITE=YES
48307aa0a607SDon Lewis        PKG_CHECK_MODULES( GRAPHITE, silgraphite )
48317aa0a607SDon Lewis    else
48327aa0a607SDon Lewis        AC_MSG_RESULT([internal])
48337aa0a607SDon Lewis        SYSTEM_GRAPHITE=NO
48347aa0a607SDon Lewis        BUILD_TYPE="$BUILD_TYPE GRAPHITE"
48357aa0a607SDon Lewis    fi
48367aa0a607SDon Lewiselse
48377aa0a607SDon Lewis   AC_MSG_RESULT([no])
48387aa0a607SDon Lewis   ENABLE_GRAPHITE="FALSE"
48397aa0a607SDon Lewisfi
48407aa0a607SDon LewisAC_SUBST(ENABLE_GRAPHITE)
48417aa0a607SDon LewisAC_SUBST(SYSTEM_GRAPHITE)
48427aa0a607SDon LewisAC_SUBST(GRAPHITE_LIBS)
48437aa0a607SDon LewisAC_SUBST(GRAPHITE_CFLAGS)
48447aa0a607SDon Lewis
48457aa0a607SDon Lewis
48467aa0a607SDon Lewisdnl ===================================================================
48477aa0a607SDon Lewisdnl Checks for libraries.
48487aa0a607SDon Lewisdnl ===================================================================
48497aa0a607SDon Lewisdnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
48507aa0a607SDon Lewisdnl See if we have the AppKit framework for building with Quartz graphics.
48517aa0a607SDon Lewis
48527aa0a607SDon Lewisif test  "$_os" = "Darwin"; then
48537aa0a607SDon Lewis   if test "x$with_x" = "xyes"; then
48547aa0a607SDon Lewis      AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
48557aa0a607SDon Lewis   else
48567aa0a607SDon Lewis      AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
48577aa0a607SDon Lewis      if test -d "/System/Library/Frameworks/AppKit.framework/"; then
48587aa0a607SDon Lewis         AC_MSG_RESULT([yes])
48597aa0a607SDon Lewis         x_includes="no_x_includes"
48607aa0a607SDon Lewis         x_libraries="no_x_libraries"
48617aa0a607SDon Lewis         dnl disable some things used on other Unix versions but not on the aqua build
48627aa0a607SDon Lewis         enable_gtk=no
48637aa0a607SDon Lewis         enable_cups=no
48647aa0a607SDon Lewis         ENABLE_CUPS=""
48657aa0a607SDon Lewis         AC_SUBST(ENABLE_CUPS)
48667aa0a607SDon Lewis      else
48677aa0a607SDon Lewis         AC_MSG_ERROR([No AppKit.framewrok found])
48687aa0a607SDon Lewis      fi
48697aa0a607SDon Lewis   fi
48707aa0a607SDon Lewisfi
48717aa0a607SDon Lewis
48727aa0a607SDon Lewisdnl ***************************************
48737aa0a607SDon Lewisdnl testing for X libraries and includes...
48747aa0a607SDon Lewisdnl ***************************************
48757aa0a607SDon Lewisif test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
48767aa0a607SDon Lewis   echo "Do Nothing for _os = Darwin"
48777aa0a607SDon Lewis   dnl Mac OS X using Aqua graphics. Don't check for X11.
48787aa0a607SDon Lewis   :
48797aa0a607SDon Lewiselif test "$_os" = "OS2" ; then
48807aa0a607SDon Lewis   echo "Do Nothing for _os = OS2. Don't check for X11."
48817aa0a607SDon Lewis   dnl OS/2 uses native graphics. Don't check for X11.
48827aa0a607SDon Lewis   :
48837aa0a607SDon Lewiselif test "$_os" != "WINNT" ; then
48847aa0a607SDon Lewis   AC_PATH_X
48857aa0a607SDon Lewis   AC_PATH_XTRA
48867aa0a607SDon Lewis   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
48877aa0a607SDon Lewis
48887aa0a607SDon Lewis   if test "x$x_includes" = "x"; then
48897aa0a607SDon Lewis     x_includes="default_x_includes"
48907aa0a607SDon Lewis   fi
48917aa0a607SDon Lewis   if test "x$x_libraries" = "x"; then
48927aa0a607SDon Lewis     x_libraries="default_x_libraries"
48937aa0a607SDon Lewis   fi
48947aa0a607SDon Lewis   dnl The variables $x_libraries and $x_includes are set.
48957aa0a607SDon Lewis   if test -z "$x_libraries"; then
48967aa0a607SDon Lewis      AC_MSG_ERROR([No X libraries found]) # Exit
48977aa0a607SDon Lewis   fi
48987aa0a607SDon Lewis   if test -z "$x_includes"; then
48997aa0a607SDon Lewis      AC_MSG_ERROR([No X includes found]) # Exit
49007aa0a607SDon Lewis   fi
49017aa0a607SDon Lewis   CFLAGS=$X_CFLAGS
49027aa0a607SDon Lewis   LDFLAGS="$X_LDFLAGS $X_LIBS"
49037aa0a607SDon Lewis   AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
49047aa0a607SDon Lewis   dnl Check if the XauDisposeAuth symbol is provided by libXau.
49057aa0a607SDon Lewis   AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
49067aa0a607SDon Lewiselse
49077aa0a607SDon Lewis   x_includes="no_x_includes"
49087aa0a607SDon Lewis   x_libraries="no_x_libraries"
49097aa0a607SDon Lewisfi
49107aa0a607SDon Lewisif test -z "$x_includes"; then
49117aa0a607SDon Lewis   x_includes="no_x_includes"
49127aa0a607SDon Lewisfi
49137aa0a607SDon Lewisif test -z "$x_libraries"; then
49147aa0a607SDon Lewis   x_libraries="no_x_libraries"
49157aa0a607SDon Lewisfi
49167aa0a607SDon Lewisif test "$x_includes" = "default_x_includes"; then
49177aa0a607SDon Lewis   XINC="/usr/include"
49187aa0a607SDon Lewiselse
49197aa0a607SDon Lewis   XINC="$x_includes"
49207aa0a607SDon Lewisfi
49217aa0a607SDon LewisAC_SUBST(XINC)
49227aa0a607SDon Lewisif test "$x_libraries" = "default_x_libraries"; then
49237aa0a607SDon Lewis   XLIB=`$PKG_CONFIG --variable=libdir x11`
49247aa0a607SDon Lewis   if test "x$XLIB" = x; then
49257aa0a607SDon Lewis         XLIB="/usr/lib"
49267aa0a607SDon Lewis   fi
49277aa0a607SDon Lewiselse
49287aa0a607SDon Lewis   XLIB="$x_libraries"
49297aa0a607SDon Lewisfi
49307aa0a607SDon LewisAC_SUBST(XLIB)
49317aa0a607SDon LewisAC_SUBST(XAU_LIBS)
49327aa0a607SDon Lewis
49337aa0a607SDon Lewisdnl ===================================================================
49347aa0a607SDon Lewisdnl Check if fontconfig/fontconfig.h is available
49357aa0a607SDon Lewisdnl ===================================================================
49367aa0a607SDon Lewisif test "$ENABLE_FONTCONFIG" = "TRUE" ; then
49377aa0a607SDon Lewis    AC_CHECK_HEADER(fontconfig/fontconfig.h, [],
49387aa0a607SDon Lewis                    [AC_MSG_ERROR([fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?])], [])
49397aa0a607SDon Lewis    AC_MSG_CHECKING([whether fontconfig is >= 2.2.0])
49407aa0a607SDon Lewis    AC_TRY_RUN([
49417aa0a607SDon Lewis#include <fontconfig/fontconfig.h>
49427aa0a607SDon Lewis
49437aa0a607SDon Lewisint main(int argc, char **argv) {
49447aa0a607SDon Lewis	if(FC_MAJOR > 2 || (FC_MAJOR == 2 && FC_MINOR >= 2)) return 0;
49457aa0a607SDon Lewis	else return 1;
49467aa0a607SDon Lewis}
49477aa0a607SDon Lewis], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, fontconfig >= 2.2.0 needed])])
49487aa0a607SDon Lewisfi
49497aa0a607SDon Lewis
49507aa0a607SDon Lewisdnl ===================================================================
49517aa0a607SDon Lewisdnl Check for system Xrender
49527aa0a607SDon Lewisdnl ===================================================================
49537aa0a607SDon LewisAC_MSG_CHECKING([whether to link to Xrender])
49547aa0a607SDon Lewisif test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then
49557aa0a607SDon Lewis   AC_MSG_RESULT([yes])
49567aa0a607SDon Lewis   XRENDER_LINK=YES
49577aa0a607SDon Lewis   with_system_xrender_headers=yes
49587aa0a607SDon Lewiselse
49597aa0a607SDon Lewis   AC_MSG_RESULT([no, dynamically open it])
49607aa0a607SDon Lewis   XRENDER_LINK=NO
49617aa0a607SDon Lewisfi
49627aa0a607SDon LewisAC_MSG_CHECKING([which Xrender headers to use])
49637aa0a607SDon Lewisif test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \
49647aa0a607SDon Lewis	test "$with_system_xrender_headers" != "no"; then
49657aa0a607SDon Lewis   AC_MSG_RESULT([external])
49667aa0a607SDon Lewis   SYSTEM_XRENDER_HEADERS=YES
49677aa0a607SDon Lewis   AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
49687aa0a607SDon Lewis      [AC_MSG_ERROR(Xrender not found. install X)], [])
49697aa0a607SDon Lewiselse
49707aa0a607SDon Lewis   AC_MSG_RESULT([internal])
49717aa0a607SDon Lewis   SYSTEM_XRENDER_HEADERS=NO
49727aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
49737aa0a607SDon Lewisfi
49747aa0a607SDon Lewisif test "$XRENDER_LINK" = "YES"; then
49757aa0a607SDon Lewis   AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
49767aa0a607SDon Lewis      [AC_MSG_ERROR(libXrender not found or functional)], [])
49777aa0a607SDon Lewisfi
49787aa0a607SDon LewisAC_SUBST(SYSTEM_XRENDER_HEADERS)
49797aa0a607SDon LewisAC_SUBST(XRENDER_LINK)
49807aa0a607SDon Lewis
49817aa0a607SDon Lewisdnl ===================================================================
49827aa0a607SDon Lewisdnl Check for XRandr
49837aa0a607SDon Lewisdnl ===================================================================
49847aa0a607SDon LewisAC_MSG_CHECKING([whether to enable RandR support])
49857aa0a607SDon Lewisif test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
49867aa0a607SDon Lewis   if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
49877aa0a607SDon Lewis	  XRANDR_DLOPEN="TRUE"
49887aa0a607SDon Lewis	  AC_MSG_RESULT([resorting to dlopen libXrandr at runtime])
49897aa0a607SDon Lewis   else
49907aa0a607SDon Lewis	  XRANDR_DLOPEN="FALSE"
49917aa0a607SDon Lewis      PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
49927aa0a607SDon Lewis      if test "$ENABLE_RANDR" != "TRUE"; then
49937aa0a607SDon Lewis         AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
49947aa0a607SDon Lewis                        [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
49957aa0a607SDon Lewis         XRANDR_CFLAGS=" "
49967aa0a607SDon Lewis         AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
49977aa0a607SDon Lewis              [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
49987aa0a607SDon Lewis         XRANDR_LIBS="-lXrandr "
49997aa0a607SDon Lewis         ENABLE_RANDR="TRUE"
50007aa0a607SDon Lewis	     AC_MSG_RESULT([enabling RandR support])
50017aa0a607SDon Lewis      fi
50027aa0a607SDon Lewis   fi
50037aa0a607SDon Lewiselse
50047aa0a607SDon Lewis   ENABLE_RANDR=""
50057aa0a607SDon Lewis   AC_MSG_RESULT([no])
50067aa0a607SDon Lewisfi
50077aa0a607SDon LewisAC_SUBST(XRANDR_DLOPEN)
50087aa0a607SDon LewisAC_SUBST(XRANDR_CFLAGS)
50097aa0a607SDon LewisAC_SUBST(XRANDR_LIBS)
50107aa0a607SDon LewisAC_SUBST(ENABLE_RANDR)
50117aa0a607SDon Lewis
50127aa0a607SDon Lewisdnl ===================================================================
50137aa0a607SDon Lewisdnl Check for system nss
50147aa0a607SDon Lewisdnl ===================================================================
50157aa0a607SDon LewisAC_MSG_CHECKING([which libnss to use])
50167aa0a607SDon Lewisif test -n "$with_system_nss" -o -n "$with_system_libs" && test "$with_system_nss" != "no"; then
50177aa0a607SDon Lewis    AC_MSG_RESULT([external])
50187aa0a607SDon Lewis    PKG_CHECK_MODULES( NSS, nss )
50197aa0a607SDon Lewis    SYSTEM_NSS=YES
50207aa0a607SDon Lewiselse
50217aa0a607SDon Lewis    AC_MSG_RESULT([internal])
50227aa0a607SDon Lewis    SYSTEM_NSS=NO
50237aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE NSS"
50247aa0a607SDon Lewisfi
50257aa0a607SDon LewisAC_SUBST(SYSTEM_NSS)
50267aa0a607SDon LewisAC_SUBST(NSS_CFLAGS)
50277aa0a607SDon LewisAC_SUBST(NSS_LIBS)
50287aa0a607SDon Lewis
50297aa0a607SDon Lewisdnl ===================================================================
50307aa0a607SDon Lewisdnl Check for system openssl
50317aa0a607SDon Lewisdnl ===================================================================
50327aa0a607SDon Lewisif test "$_os" = "Darwin" && test "$with_system_openssl" != "no"; then
50337aa0a607SDon Lewis   with_system_openssl=yes
50347aa0a607SDon Lewisfi
50357aa0a607SDon LewisAC_MSG_CHECKING([which libssl to use])
50367aa0a607SDon Lewisif test -n "$with_system_openssl" -o -n "$with_system_libs" && \
50377aa0a607SDon Lewis        test "$with_system_openssl" != "no"; then
50387aa0a607SDon Lewis    AC_MSG_RESULT([external])
50397aa0a607SDon Lewis    # Mac OS builds should get out without extra stuff is the Mac porters'
50407aa0a607SDon Lewis    # wish. And pkg-config is although Xcode ships a .pc for openssl
50417aa0a607SDon Lewis    if test "$_os" = "Darwin" -o "$_os" = "FreeBSD"; then
50427aa0a607SDon Lewis        OPENSSL_CFLAGS=
50437aa0a607SDon Lewis        OPENSSL_LIBS="-lssl -lcrypto"
50447aa0a607SDon Lewis    else
50457aa0a607SDon Lewis    	PKG_CHECK_MODULES( OPENSSL, openssl )
50467aa0a607SDon Lewis    fi
50477aa0a607SDon Lewis    SYSTEM_OPENSSL=YES
50487aa0a607SDon Lewiselse
50497aa0a607SDon Lewis    AC_MSG_RESULT([internal])
50507aa0a607SDon Lewis    SYSTEM_OPENSSL=NO
50517aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE OPENSSL"
50527aa0a607SDon Lewisfi
50537aa0a607SDon LewisAC_SUBST(SYSTEM_OPENSSL)
50547aa0a607SDon LewisAC_SUBST(OPENSSL_CFLAGS)
50557aa0a607SDon LewisAC_SUBST(OPENSSL_LIBS)
50567aa0a607SDon Lewis
50577aa0a607SDon Lewisdnl ===================================================================
50587aa0a607SDon Lewisdnl Check for system redland
50597aa0a607SDon Lewisdnl ===================================================================
50607aa0a607SDon LewisAC_MSG_CHECKING([which redland library to use])
50617aa0a607SDon Lewisif test -n "$with_system_redland" -o -n "$with_system_libs" && \
50627aa0a607SDon Lewis	test "$with_system_redland" != "no"; then
50637aa0a607SDon Lewis	AC_MSG_RESULT([external])
50647aa0a607SDon Lewis	SYSTEM_REDLAND=YES
50657aa0a607SDon Lewis   dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
50667aa0a607SDon Lewis   PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
50677aa0a607SDon Lewiselse
50687aa0a607SDon Lewis	AC_MSG_RESULT([internal])
50697aa0a607SDon Lewis	BUILD_TYPE="$BUILD_TYPE REDLAND"
50707aa0a607SDon Lewis	SYSTEM_REDLAND=NO
50717aa0a607SDon Lewisfi
50727aa0a607SDon LewisAC_SUBST(SYSTEM_REDLAND)
50737aa0a607SDon LewisAC_SUBST(REDLAND_CFLAGS)
50747aa0a607SDon LewisAC_SUBST(REDLAND_LIBS)
50757aa0a607SDon Lewis
50767aa0a607SDon Lewisdnl ===================================================================
50777aa0a607SDon Lewisdnl Check for hunspell
50787aa0a607SDon Lewisdnl ===================================================================
50797aa0a607SDon LewisAC_MSG_CHECKING([whether to build the Spell Checking component])
50807aa0a607SDon LewisENABLE_HUNSPELL=
50817aa0a607SDon Lewis
50827aa0a607SDon Lewisif test "x$enable_hunspell" != "xno" ; then
50837aa0a607SDon Lewis    AC_MSG_CHECKING([which libhunspell to use])
50847aa0a607SDon Lewis    if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \
50857aa0a607SDon Lewis        test "$with_system_hunspell" != "no"; then
50867aa0a607SDon Lewis        AC_MSG_RESULT([external])
50877aa0a607SDon Lewis        SYSTEM_HUNSPELL=YES
50887aa0a607SDon Lewis        AC_LANG_PUSH([C++])
50897aa0a607SDon Lewis        PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
50907aa0a607SDon Lewis        if test "$HUNSPELL_PC" != "TRUE"; then
50917aa0a607SDon Lewis            AC_CHECK_HEADER(hunspell.hxx, [],
50927aa0a607SDon Lewis            [AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
50937aa0a607SDon Lewis                [AC_MSG_ERROR(hunspell headers not found.)], [])
50947aa0a607SDon Lewis             ], [])
50957aa0a607SDon Lewis            AC_CHECK_LIB(hunspell, main, [],
50967aa0a607SDon Lewis            [ AC_MSG_ERROR(hunspell library not found.) ], [])
50977aa0a607SDon Lewis            HUNSPELL_LIBS=-lhunspell
50987aa0a607SDon Lewis        fi
50997aa0a607SDon Lewis        AC_LANG_POP([C++])
51007aa0a607SDon Lewis    else
51017aa0a607SDon Lewis        AC_MSG_RESULT([internal])
51027aa0a607SDon Lewis        SYSTEM_HUNSPELL=NO
51037aa0a607SDon Lewis        BUILD_TYPE="$BUILD_TYPE HUNSPELL"
51047aa0a607SDon Lewis    fi
51057aa0a607SDon Lewis    ENABLE_HUNSPELL=YES
51067aa0a607SDon Lewis    AC_SUBST(SYSTEM_HUNSPELL)
51077aa0a607SDon Lewis    AC_SUBST(HUNSPELL_CFLAGS)
51087aa0a607SDon Lewis    AC_SUBST(HUNSPELL_LIBS)
51097aa0a607SDon Lewiselse
51107aa0a607SDon Lewis    AC_MSG_RESULT([no])
51117aa0a607SDon Lewisfi
51127aa0a607SDon LewisAC_SUBST(ENABLE_HUNSPELL)
51137aa0a607SDon Lewis
51147aa0a607SDon Lewisdnl ===================================================================
51157aa0a607SDon Lewisdnl Checking for libhyphen
51167aa0a607SDon Lewisdnl ===================================================================
51177aa0a607SDon LewisAC_MSG_CHECKING([whether to build the Hyphenator component])
51187aa0a607SDon LewisENABLE_HYPHEN=
51197aa0a607SDon Lewis
51207aa0a607SDon Lewisif test "x$enable_hyphen" != "xno" ; then
51217aa0a607SDon Lewis    AC_MSG_CHECKING([which libhyphen to use])
51227aa0a607SDon Lewis    if test -n "$with_system_hyphen" -o -n "$with_system_libs" && \
51237aa0a607SDon Lewis        test "$with_system_hyphen" != "no"; then
51247aa0a607SDon Lewis        AC_MSG_RESULT([external])
51257aa0a607SDon Lewis        SYSTEM_HYPH=YES
51267aa0a607SDon Lewis        AC_CHECK_HEADER(hyphen.h, [],
51277aa0a607SDon Lewis        [ AC_MSG_ERROR(libhyphen headers not found.)], [])
51287aa0a607SDon Lewis        AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
51297aa0a607SDon Lewis        [ AC_MSG_ERROR(no. You are sure you have libhyphen headers?)],
51307aa0a607SDon Lewis        [#include <hyphen.h>])
51317aa0a607SDon Lewis        AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
51327aa0a607SDon Lewis            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
51337aa0a607SDon Lewis        if test -z "$HYPHEN_LIB"; then
51347aa0a607SDon Lewis        AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
51357aa0a607SDon Lewis            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
51367aa0a607SDon Lewis        fi
51377aa0a607SDon Lewis        if test -z "$HYPHEN_LIB"; then
51387aa0a607SDon Lewis        AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
51397aa0a607SDon Lewis            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
51407aa0a607SDon Lewis        fi
51417aa0a607SDon Lewis    else
51427aa0a607SDon Lewis        AC_MSG_RESULT([internal])
51437aa0a607SDon Lewis        SYSTEM_HYPH=NO
51447aa0a607SDon Lewis        BUILD_TYPE="$BUILD_TYPE HYPHEN"
51457aa0a607SDon Lewis    fi
51467aa0a607SDon Lewis    ENABLE_HYPHEN=YES
51477aa0a607SDon Lewis    AC_SUBST(SYSTEM_HYPH)
51487aa0a607SDon Lewis    AC_SUBST(HYPHEN_LIB)
51497aa0a607SDon Lewiselse
51507aa0a607SDon Lewis    AC_MSG_RESULT([no])
51517aa0a607SDon Lewisfi
51527aa0a607SDon LewisAC_SUBST(ENABLE_HYPHEN)
51537aa0a607SDon Lewis
51547aa0a607SDon Lewis
51557aa0a607SDon Lewis#dnl ===================================================================
51567aa0a607SDon Lewis#dnl Check whether we are allowed to bundle dictionaries and whether
51577aa0a607SDon Lewis#dnl hunspell is available.
51587aa0a607SDon Lewis#dnl ===================================================================
51597aa0a607SDon LewisENABLE_BUNDLED_DICTIONARIES=
51607aa0a607SDon Lewisif test "x$enable_bundled_dictionaries" != "xno" -a "x$ENABLE_HUNSPELL" = "xYES"; then
51617aa0a607SDon Lewis   ENABLE_BUNDLED_DICTIONARIES=YES
51627aa0a607SDon Lewisfi
51637aa0a607SDon LewisAC_SUBST(ENABLE_BUNDLED_DICTIONARIES)
51647aa0a607SDon Lewis
51657aa0a607SDon Lewis
51667aa0a607SDon Lewis
51677aa0a607SDon Lewisdnl ===================================================================
51687aa0a607SDon Lewisdnl Checking for mythes
51697aa0a607SDon Lewisdnl ===================================================================
51707aa0a607SDon LewisAC_MSG_CHECKING([which mythes to use])
51717aa0a607SDon Lewisif test -n "$with_system_mythes" -o -n "$with_system_libs" && \
51727aa0a607SDon Lewis   test "$with_system_mythes" != "no"; then
51737aa0a607SDon Lewis    AC_MSG_RESULT([external])
51747aa0a607SDon Lewis    SYSTEM_MYTHES=YES
51757aa0a607SDon Lewis    AC_LANG_PUSH([C++])
51767aa0a607SDon Lewis    PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
51777aa0a607SDon Lewis    if test "$MYTHES_PKGCONFIG" = "no"; then
51787aa0a607SDon Lewis        AC_CHECK_HEADER(mythes.hxx, [],
51797aa0a607SDon Lewis            [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
51807aa0a607SDon Lewis        AC_CHECK_LIB(mythes-1.2, main, [],
51817aa0a607SDon Lewis            [ MYTHES_FOUND=no], [])
51827aa0a607SDon Lewis 	if test "$MYTHES_FOUND" = "no"; then
51837aa0a607SDon Lewis            AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
51847aa0a607SDon Lewis                [ MYTHES_FOUND=no], [])
51857aa0a607SDon Lewis	fi
51867aa0a607SDon Lewis	if test "$MYTHES_FOUND" = "no"; then
51877aa0a607SDon Lewis		AC_MSG_ERROR([mythes library not found!.])
51887aa0a607SDon Lewis	fi
51897aa0a607SDon Lewis    fi
51907aa0a607SDon Lewis    AC_LANG_POP([C++])
51917aa0a607SDon Lewiselse
51927aa0a607SDon Lewis    AC_MSG_RESULT([internal])
51937aa0a607SDon Lewis    SYSTEM_MYTHES=NO
51947aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE MYTHES"
51957aa0a607SDon Lewisfi
51967aa0a607SDon LewisAC_SUBST(SYSTEM_MYTHES)
51977aa0a607SDon LewisAC_SUBST(MYTHES_CFLAGS)
51987aa0a607SDon LewisAC_SUBST(MYTHES_LIBS)
51997aa0a607SDon Lewis
52007aa0a607SDon Lewis
52017aa0a607SDon Lewisdnl ===================================================================
52027aa0a607SDon Lewisdnl Checking for libtextcat
52037aa0a607SDon Lewisdnl ===================================================================
52047aa0a607SDon LewisAC_MSG_CHECKING([which libtextcat to use])
52057aa0a607SDon Lewisif test -n "$with_system_libtextcat" && test "$with_system_libtextcat" != "no"; then
52067aa0a607SDon Lewis    AC_MSG_RESULT([external])
52077aa0a607SDon Lewis    SYSTEM_LIBTEXTCAT=YES
52087aa0a607SDon Lewis    AC_CHECK_HEADER(libtextcat/textcat.h, [],
52097aa0a607SDon Lewis       [ AC_MSG_ERROR(libtextcat headers not found.)], [])
52107aa0a607SDon Lewis    AC_CHECK_LIB(textcat, special_textcat_Init, ,
52117aa0a607SDon Lewis        [ AC_MSG_ERROR(libtextcat library not found or not suitable. libtextcat typically needs to be patched)], [])
52127aa0a607SDon Lewiselse
52137aa0a607SDon Lewis    AC_MSG_RESULT([internal])
52147aa0a607SDon Lewis    SYSTEM_LIBTEXTCAT=NO
52157aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE LIBTEXTCAT"
52167aa0a607SDon Lewisfi
52177aa0a607SDon LewisAC_SUBST(SYSTEM_LIBTEXTCAT)
52187aa0a607SDon Lewis
52197aa0a607SDon LewisAC_MSG_CHECKING([which libtextcat data directory to use])
52207aa0a607SDon Lewisif test -n "$with_system_libtextcat_data" && test "$with_system_libtextcat_data" != "no"; then
52217aa0a607SDon Lewis    if test "$with_system_libtextcat_data" = "yes"; then
52227aa0a607SDon Lewis        SYSTEM_LIBTEXTCAT_DATA=file:///usr/share/libtextcat
52237aa0a607SDon Lewis    else
52247aa0a607SDon Lewis        SYSTEM_LIBTEXTCAT_DATA=file://$with_system_libtextcat_data
52257aa0a607SDon Lewis    fi
52267aa0a607SDon Lewis    AC_MSG_RESULT([$SYSTEM_LIBTEXTCAT_DATA])
52277aa0a607SDon Lewiselse
52287aa0a607SDon Lewis    AC_MSG_RESULT([internal])
52297aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE LIBTEXTCATDATA"
52307aa0a607SDon Lewisfi
52317aa0a607SDon LewisAC_SUBST(SYSTEM_LIBTEXTCAT_DATA)
52327aa0a607SDon Lewis
52337aa0a607SDon Lewisdnl ***************************************
52347aa0a607SDon Lewisdnl testing libc version for Linux...
52357aa0a607SDon Lewisdnl ***************************************
52367aa0a607SDon Lewisif test "$_os" = "Linux"; then
52377aa0a607SDon Lewis   AC_MSG_CHECKING([whether libc is >= 2.1.1])
52387aa0a607SDon Lewis   exec 6>/dev/null # no output
52397aa0a607SDon Lewis   AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
52407aa0a607SDon Lewis   exec 6>&1 # output on again
52417aa0a607SDon Lewis   if test "$HAVE_LIBC"; then
52427aa0a607SDon Lewis      AC_MSG_RESULT([yes])
52437aa0a607SDon Lewis   else
52447aa0a607SDon Lewis      AC_MSG_ERROR([no, upgrade libc])
52457aa0a607SDon Lewis   fi
52467aa0a607SDon Lewisfi
52477aa0a607SDon Lewis
52487aa0a607SDon Lewisif test "$_os" != "WNT"; then
52497aa0a607SDon Lewis  AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
52507aa0a607SDon Lewis  AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
52517aa0a607SDon Lewis  if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
52527aa0a607SDon Lewis	SYSTEM_LIBC=YES
52537aa0a607SDon Lewis  fi
52547aa0a607SDon Lewiselse
52557aa0a607SDon Lewis  HAVE_GETOPT=NO
52567aa0a607SDon Lewis  HAVE_READDIR_R=NO
52577aa0a607SDon Lewis  SYSTEM_LIBC=YES
52587aa0a607SDon Lewisfi
52597aa0a607SDon LewisAC_SUBST(HAVE_GETOPT)
52607aa0a607SDon LewisAC_SUBST(HAVE_READDIR_R)
52617aa0a607SDon LewisAC_SUBST(SYSTEM_LIBC)
52627aa0a607SDon Lewis
52637aa0a607SDon Lewisdnl =========================================
52647aa0a607SDon Lewisdnl Check for the Microsoft Platform SDK.
52657aa0a607SDon Lewisdnl =========================================
52667aa0a607SDon Lewisdnl FIXME: I don't know yet if PSDK works with MinGW, keep it until I know better,
52677aa0a607SDon Lewisdnl and add "-a \( "$WITH_MINGWIN" != "yes" \)" then
52687aa0a607SDon Lewisif test \( "$_os" = "WINNT" \) ; then
52697aa0a607SDon Lewis	AC_MSG_CHECKING([for PSDK files])
52707aa0a607SDon Lewis	if test -z "$with_psdk_home"; then
52717aa0a607SDon Lewis		# This first line will detect a February 2003 Microsoft Platform SDK
52727aa0a607SDon Lewis		PSDK_HOME=`./oowintool --psdk-home`
52737aa0a607SDon Lewis        # But there might be also an April 2005 PSDK, unfortunately MS changed
52747aa0a607SDon Lewis        # the registry entry. (we prefer the old version!?)
52757aa0a607SDon Lewis        if test -z "$PSDK_HOME"; then
52767aa0a607SDon Lewis          PSDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
52777aa0a607SDon Lewis        fi
52787aa0a607SDon Lewis            # normalize if found
52797aa0a607SDon Lewis            if test -n "$PSDK_HOME"; then
52807aa0a607SDon Lewis              PSDK_HOME=`cygpath -d "$PSDK_HOME"`
52817aa0a607SDon Lewis              PSDK_HOME=`cygpath -u "$PSDK_HOME"`
52827aa0a607SDon Lewis           fi
52837aa0a607SDon Lewis	else
52847aa0a607SDon Lewis           PSDK_HOME=`cygpath -u "$with_psdk_home"`
52857aa0a607SDon Lewis	fi
52867aa0a607SDon Lewis        # Remove a possible trailing backslash
52877aa0a607SDon Lewis        PSDK_HOME=`echo $PSDK_HOME | $SED 's/\/$//'`
52887aa0a607SDon Lewis    # Problem with current PSDK (iz 49865)
52897aa0a607SDon Lewis    if test -f "$PSDK_HOME/Lib/libcp.lib"; then
52907aa0a607SDon Lewis        AC_MSG_ERROR([
52917aa0a607SDon Lewis
52927aa0a607SDon LewisSome modules do not build correctly with MS Platform SDK - April 2005
52937aa0a607SDon LewisEdition if the library ($PSDK_HOME/Lib/libcp.lib) is found.
52947aa0a607SDon LewisRemove/rename/backup that file and restart configure. Details about this
52957aa0a607SDon Lewisproblem can be found in issue 49856.])
52967aa0a607SDon Lewis    fi
52977aa0a607SDon Lewis# WIndows SDK has different headers
52987aa0a607SDon Lewis	if test \( -f "$PSDK_HOME/Include/adoint.h" \) \
52997aa0a607SDon Lewis		 -a \( -f "$PSDK_HOME/Include/SqlUcode.h" \) \
53007aa0a607SDon Lewis		 -a \( -f "$PSDK_HOME/Include/usp10.h" \); then
53017aa0a607SDon Lewis		HAVE_PSDK_H="yes"
53027aa0a607SDon Lewis	else
53037aa0a607SDon Lewis		HAVE_PSDK_H="no"
53047aa0a607SDon Lewis	fi
53057aa0a607SDon Lewis	if test -f "$PSDK_HOME/lib/unicows.lib"; then
53067aa0a607SDon Lewis		HAVE_PSDK_LIB="yes"
53077aa0a607SDon Lewis	else
53087aa0a607SDon Lewis		HAVE_PSDK_LIB="no"
53097aa0a607SDon Lewis	fi
53107aa0a607SDon Lewis    if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
53117aa0a607SDon Lewis        AC_MSG_ERROR([Some (all?) PSDK files not found, please check if all needed Platform SDKs
53127aa0a607SDon Lewisare installed or use --with-psdk-home .])
53137aa0a607SDon Lewis    fi
53147aa0a607SDon Lewis    if test ! -x "$PSDK_HOME/bin/msiinfo.exe" \
53157aa0a607SDon Lewis         -o ! -x "$PSDK_HOME/bin/msidb.exe" \
53167aa0a607SDon Lewis         -o ! -x "$PSDK_HOME/bin/uuidgen.exe" \
53177aa0a607SDon Lewis         -o ! -x "$PSDK_HOME/bin/msitran.exe" ; then
53187aa0a607SDon Lewis        AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
53197aa0a607SDon Lewis    fi
53207aa0a607SDon Lewis    AC_MSG_RESULT([SDK files found ...)])
53217aa0a607SDon Lewisdnl Check if this is the right SDK.
53227aa0a607SDon Lewis    if echo $PSDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
53237aa0a607SDon Lewis        AC_MSG_RESULT([Found Windows SDK 6.1 ($PSDK_HOME)])
53247aa0a607SDon Lewis        WINDOWS_VISTA_PSDK=TRUE
53257aa0a607SDon Lewis    elif echo $PSDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
53267aa0a607SDon Lewis        AC_MSG_RESULT([Found Windows SDK 6.0 ($PSDK_HOME)])
53277aa0a607SDon Lewis        WINDOWS_VISTA_PSDK=TRUE
53287aa0a607SDon Lewis    elif echo $PSDK_HOME | grep "v7.0" >/dev/null 2>/dev/null; then
53297aa0a607SDon Lewis        AC_MSG_RESULT([Found Windows SDK 7.0 ($PSDK_HOME)])
53307aa0a607SDon Lewis        WINDOWS_VISTA_PSDK=TRUE
53317aa0a607SDon Lewis    else
53327aa0a607SDon Lewis        AC_MSG_RESULT([Found Legacy Windows Platform SDK ($PSDK_HOME)])
53337aa0a607SDon Lewis    fi
53347aa0a607SDon Lewisfi
53357aa0a607SDon LewisAC_SUBST(PSDK_HOME)
53367aa0a607SDon LewisAC_SUBST(WINDOWS_VISTA_PSDK)
53377aa0a607SDon Lewis
53387aa0a607SDon Lewisdnl =========================================
53397aa0a607SDon Lewisdnl Check for the Microsoft DirectX SDK.
53407aa0a607SDon Lewisdnl =========================================
53417aa0a607SDon Lewisif test \( "$_os" = "WINNT" \) ; then
53427aa0a607SDon Lewis    AC_MSG_CHECKING([for DirectX SDK files])
53437aa0a607SDon Lewis    if test -z "$with_directx_home"; then
53447aa0a607SDon Lewis        dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
53457aa0a607SDon Lewis        if test -n "$DXSDK_DIR"; then
53467aa0a607SDon Lewis            DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
53477aa0a607SDon Lewis            DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
53487aa0a607SDon Lewis        fi
53497aa0a607SDon Lewis        # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
53507aa0a607SDon Lewis        # the "DirectX SDK files not found" error later
53517aa0a607SDon Lewis    else
53527aa0a607SDon Lewis	DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
53537aa0a607SDon Lewis    fi
53547aa0a607SDon Lewis    # Remove a possible trailing backslash
53557aa0a607SDon Lewis    DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
53567aa0a607SDon Lewis
53577aa0a607SDon Lewis    if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" ; then
53587aa0a607SDon Lewis        HAVE_DIRECTDRAW_H="yes"
53597aa0a607SDon Lewis    else
53607aa0a607SDon Lewis        HAVE_DIRECTDRAW_H="no"
53617aa0a607SDon Lewis    fi
53627aa0a607SDon Lewis    if test -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
53637aa0a607SDon Lewis        HAVE_DIRECTXSDK_H="yes"
53647aa0a607SDon Lewis    else
53657aa0a607SDon Lewis        HAVE_DIRECTXSDK_H="no"
53667aa0a607SDon Lewis    fi
53677aa0a607SDon Lewis
53687aa0a607SDon Lewis    # MS changed the location of the libraries with dec 2004 directx sdk
53697aa0a607SDon Lewis    if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
53707aa0a607SDon Lewis        DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
53717aa0a607SDon Lewis    else
53727aa0a607SDon Lewis        DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
53737aa0a607SDon Lewis    fi
53747aa0a607SDon Lewis    if test -f "$DIRECTXSDK_LIB/ddraw.lib" ; then
53757aa0a607SDon Lewis        HAVE_DIRECTDRAW_LIB="yes"
53767aa0a607SDon Lewis    else
53777aa0a607SDon Lewis        HAVE_DIRECTDRAW_LIB="no"
53787aa0a607SDon Lewis    fi
53797aa0a607SDon Lewis    if test -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
53807aa0a607SDon Lewis        HAVE_DIRECTXSDK_LIB="yes"
53817aa0a607SDon Lewis    else
53827aa0a607SDon Lewis        HAVE_DIRECTXSDK_LIB="no"
53837aa0a607SDon Lewis    fi
53847aa0a607SDon Lewis
53857aa0a607SDon Lewis    if test "$HAVE_DIRECTDRAW_H" = "yes" -a "$HAVE_DIRECTDRAW_LIB" = "yes" ; then
53867aa0a607SDon Lewis       ENABLE_DIRECT_DRAW="TRUE"
53877aa0a607SDon Lewis    fi
53887aa0a607SDon Lewis    if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes" ; then
53897aa0a607SDon Lewis       HAVE_DIRECTXSDK="yes"
53907aa0a607SDon Lewis    else
53917aa0a607SDon Lewis       HAVE_DIRECTXSDK="no"
53927aa0a607SDon Lewis    fi
53937aa0a607SDon Lewis
53947aa0a607SDon Lewis    if test -n "$ENABLE_DIRECTX"; then
53957aa0a607SDon Lewis	    if test "$HAVE_DIRECTDRAW" = "yes" -o "$HAVE_DIRECTXSDK" = "yes" ; then
53967aa0a607SDon Lewis		    AC_MSG_RESULT([found])
53977aa0a607SDon Lewis	    else
53987aa0a607SDon Lewis		    AC_MSG_ERROR([DirectX SDK files not found, please use --with-directx-home or --disable-directx.])
53997aa0a607SDon Lewis	    fi
54007aa0a607SDon Lewis    else
54017aa0a607SDon Lewis		DIRECTXSDK_HOME=""
54027aa0a607SDon Lewis		AC_MSG_RESULT([disabled])
54037aa0a607SDon Lewis    fi
54047aa0a607SDon Lewisfi
54057aa0a607SDon LewisAC_SUBST(ENABLE_DIRECT_DRAW)
54067aa0a607SDon LewisAC_SUBST(DIRECTXSDK_HOME)
54077aa0a607SDon LewisAC_SUBST(DIRECTXSDK_LIB)
54087aa0a607SDon Lewis
54097aa0a607SDon Lewis
54107aa0a607SDon Lewisdnl ============================================
54117aa0a607SDon Lewisdnl Check for ATL and MFC
54127aa0a607SDon Lewisdnl ============================================
54137aa0a607SDon Lewisif test \( "$_os" = "WINNT" \) ; then
54147aa0a607SDon Lewis    AC_MSG_CHECKING([for ATL and MFC])
54157aa0a607SDon Lewis    if test "$DISABLE_ATL" = "TRUE"; then
54167aa0a607SDon Lewis        AC_MSG_RESULT([ATL is disabled, nothing to check])
54177aa0a607SDon Lewis    else
54187aa0a607SDon Lewis        AC_MSG_NOTICE([testing ATL/MFC libs and includes])
54197aa0a607SDon Lewis        if test -z "$with_atl_include_dir"; then
54207aa0a607SDon Lewis            ATL_INCLUDE=$COMPATH/atlmfc/include
54217aa0a607SDon Lewis        else
54227aa0a607SDon Lewis            ATL_INCLUDE=`cygpath -u "$with_atl_include_dir"`
54237aa0a607SDon Lewis        fi
54247aa0a607SDon Lewis        if test -z "$with_atl_lib_dir"; then
54257aa0a607SDon Lewis            ATL_LIB=$COMPATH/atlmfc/lib
54267aa0a607SDon Lewis	    ATL_LIB_X64=$COMPATH/atlmfc/lib/amd64
54277aa0a607SDon Lewis        else
54287aa0a607SDon Lewis            ATL_LIB=`cygpath -u "$with_atl_lib_dir"`
54297aa0a607SDon Lewis            ATL_LIB_X64=$ATL_LIB/../amd64
54307aa0a607SDon Lewis        fi
54317aa0a607SDon Lewis        if test -z "$with_mfc_include_dir"; then
54327aa0a607SDon Lewis            MFC_INCLUDE=$COMPATH/atlmfc/include
54337aa0a607SDon Lewis        else
54347aa0a607SDon Lewis            MFC_INCLUDE=`cygpath -u "$with_mfc_include_dir"`
54357aa0a607SDon Lewis        fi
54367aa0a607SDon Lewis        if test -z "$with_mfc_lib_dir"; then
54377aa0a607SDon Lewis            MFC_LIB=$COMPATH/atlmfc/lib
54387aa0a607SDon Lewis        else
54397aa0a607SDon Lewis            MFC_LIB=`cygpath -u "$with_mfc_lib_dir"`
54407aa0a607SDon Lewis        fi
54417aa0a607SDon Lewis
54427aa0a607SDon Lewis        ATL_INCLUDE=`echo $ATL_INCLUDE | $SED 's/\/$//'`
54437aa0a607SDon Lewis        ATL_LIB=`echo $ATL_LIB | $SED 's/\/$//'`
54447aa0a607SDon Lewis        ATL_LIB_X64=`echo $ATL_LIB_X64 | $SED 's/\/$//'`
54457aa0a607SDon Lewis        MFC_INCLUDE=`echo $MFC_INCLUDE | $SED 's/\/$//'`
54467aa0a607SDon Lewis        MFC_LIB=`echo $MFC_LIB | $SED 's/\/$//'`
54477aa0a607SDon Lewis
54487aa0a607SDon Lewis        AC_MSG_NOTICE([looking for atlbase.h in "$ATL_INCLUDE"])
54497aa0a607SDon Lewis        if test -f "$ATL_INCLUDE/atlbase.h"; then
54507aa0a607SDon Lewis            HAVE_ATL_H="yes"
54517aa0a607SDon Lewis        else
54527aa0a607SDon Lewis            HAVE_ATL_H="no"
54537aa0a607SDon Lewis        fi
54547aa0a607SDon Lewis        AC_MSG_NOTICE([found atlbase.h in "$ATL_INCLUDE"? "$HAVE_ATL_H"])
54557aa0a607SDon Lewis
54567aa0a607SDon Lewis        AC_MSG_NOTICE([looking for afx.h in "$MFC_INCLUDE"])
54577aa0a607SDon Lewis        if test -f "$MFC_INCLUDE/afx.h"; then
54587aa0a607SDon Lewis            HAVE_MFC_H="yes"
54597aa0a607SDon Lewis        else
54607aa0a607SDon Lewis            HAVE_MFC_H="no"
54617aa0a607SDon Lewis        fi
54627aa0a607SDon Lewis        AC_MSG_NOTICE([found afx.h in "$MFC_INCLUDE"? "$HAVE_MFC_H"])
54637aa0a607SDon Lewis
54647aa0a607SDon Lewis        AC_MSG_NOTICE([looking for atls.lib in "$ATL_LIB"])
54657aa0a607SDon Lewis        if test -f "$ATL_LIB/atls.lib"; then
54667aa0a607SDon Lewis            HAVE_ATL_LIB="yes"
54677aa0a607SDon Lewis            AC_MSG_NOTICE([looking for atlthunk.lib in "$ATL_LIB"])
54687aa0a607SDon Lewis            if test -f "$ATL_LIB/atlthunk.lib"; then
54697aa0a607SDon Lewis                HAVE_ATLTHUNK="YES"
54707aa0a607SDon Lewis            else
54717aa0a607SDon Lewis                HAVE_ATLTHUNK="NO"
54727aa0a607SDon Lewis            fi
54737aa0a607SDon Lewis            AC_MSG_NOTICE([found atlthunk.lib in "$ATL_LIB"? "$HAVE_ATLTHUNK"])
54747aa0a607SDon Lewis        else
54757aa0a607SDon Lewis            HAVE_ATL_LIB="no"
54767aa0a607SDon Lewis        fi
54777aa0a607SDon Lewis        AC_MSG_NOTICE([found atls.lib in "$ATL_LIB"? "$HAVE_ATL_LIB"])
54787aa0a607SDon Lewis
54797aa0a607SDon Lewis        dnl TODO check also MFC libraries, they seem to have diferent names
54807aa0a607SDon Lewis        dnl mfc42.lib mfc90.lib
54817aa0a607SDon Lewis        if test -d "$MFC_LIB"; then
54827aa0a607SDon Lewis            HAVE_MFC_LIB="yes"
54837aa0a607SDon Lewis        else
54847aa0a607SDon Lewis            HAVE_MFC_LIB="no"
54857aa0a607SDon Lewis        fi
54867aa0a607SDon Lewis
54877aa0a607SDon Lewis        if test "$HAVE_ATL_H" = "no" -o "$HAVE_MFC_H" = "no" -o "$HAVE_ATL_LIB" = "no" -o "$HAVE_MFC_LIB" = "no"; then
54887aa0a607SDon Lewis            ATL_INCLUDE=
54897aa0a607SDon Lewis            ATL_LIB=
54907aa0a607SDon Lewis            ATL_LIB_X64=
54917aa0a607SDon Lewis            MFC_INCLUDE=
54927aa0a607SDon Lewis            MFC_LIB=
54937aa0a607SDon Lewis            HAVE_ATL_LIB=
54947aa0a607SDon Lewis            dnl TODO shouldn't this be an error?
54957aa0a607SDon Lewis            DISABLE_ACTIVEX="TRUE"
54967aa0a607SDon Lewis            DISABLE_ATL="TRUE"
54977aa0a607SDon Lewis            AC_MSG_RESULT([ATL/MFC disabled])
54987aa0a607SDon Lewis        else
54997aa0a607SDon Lewis            ATL_INCLUDE=`cygpath -dm "$ATL_INCLUDE"`
55007aa0a607SDon Lewis            ATL_LIB=`cygpath -dm "$ATL_LIB"`
55017aa0a607SDon Lewis            ATL_LIB_X64=`cygpath -dm "$ATL_LIB_X64"`
55027aa0a607SDon Lewis            MFC_INCLUDE=`cygpath -dm "$MFC_INCLUDE"`
55037aa0a607SDon Lewis            MFC_LIB=`cygpath -dm "$MFC_LIB"`
55047aa0a607SDon Lewis            AC_MSG_RESULT([ATL/MFC enabled])
55057aa0a607SDon Lewis        fi
55067aa0a607SDon Lewis    fi
55077aa0a607SDon Lewisfi
55087aa0a607SDon LewisAC_SUBST(ATL_INCLUDE)
55097aa0a607SDon LewisAC_SUBST(ATL_LIB)
55107aa0a607SDon LewisAC_SUBST(ATL_LIB_X64)
55117aa0a607SDon LewisAC_SUBST(HAVE_ATLTHUNK)
55127aa0a607SDon LewisAC_SUBST(MFC_INCLUDE)
55137aa0a607SDon LewisAC_SUBST(MFC_LIB)
55147aa0a607SDon Lewis
55157aa0a607SDon Lewis
55167aa0a607SDon Lewisdnl ============================================
55177aa0a607SDon Lewisdnl Check for Nullsoft Scriptable Install System
55187aa0a607SDon Lewisdnl ============================================
55197aa0a607SDon LewisNSIS_PATH=""
55207aa0a607SDon Lewisif test "$_os" = "WINNT" ; then
55217aa0a607SDon Lewis    AC_MSG_CHECKING([for NSIS])
55227aa0a607SDon Lewis    AC_PATH_PROG(NSIS_PATH, nsis.exe)
55237aa0a607SDon Lewis    if test -n "$NSIS_PATH"; then
55247aa0a607SDon Lewis        NSIS_PATH=`dirname "$NSIS_PATH"`
55257aa0a607SDon Lewis    fi
55267aa0a607SDon Lewis    if test -n "$with_nsis_path"; then
55277aa0a607SDon Lewis        with_nsis_path=`cygpath -u "$with_nsis_path"`
55287aa0a607SDon Lewis    fi
55297aa0a607SDon Lewis    if test -e "$with_nsis_path/nsis.exe"; then
55307aa0a607SDon Lewis        NSIS_PATH="$with_nsis_path"
55317aa0a607SDon Lewis    fi
55327aa0a607SDon Lewis    nsistest=`./oowintool --nsis-dir`;
55337aa0a607SDon Lewis    if test -x "$nsistest/nsis.exe"; then
55347aa0a607SDon Lewis        NSIS_PATH="$nsistest"
55357aa0a607SDon Lewis    fi
55367aa0a607SDon Lewis    if test -z "$NSIS_PATH"; then
55377aa0a607SDon Lewis        AC_MSG_WARN([NSIS not found, no self contained installer will be build.])
55387aa0a607SDon Lewis        echo "NSIS not found, no self contained installer will be build." >> warn
55397aa0a607SDon Lewis    else
55407aa0a607SDon Lewis        NSIS_PATH=`cygpath -d "$NSIS_PATH"`
55417aa0a607SDon Lewis        NSIS_PATH=`cygpath -u "$NSIS_PATH"`
55427aa0a607SDon Lewis        AC_MSG_RESULT([found ($NSIS_PATH)])
55437aa0a607SDon Lewis		AC_MSG_CHECKING([whether NSIS version is >= 3.*])
55447aa0a607SDon Lewis		nsis_version_string=`"$NSIS_PATH/makensis.exe" /VERSION | $SED -e s/^v//i`
55457aa0a607SDon Lewis        nsis_version_major=`echo $nsis_version_string | cut -d. -f1`
55467aa0a607SDon Lewis		nsis_version_minor=`echo $nsis_version_string | cut -d. -f2`
55477aa0a607SDon Lewis		if test "$nsis_version_major" -ge "3"; then
55487aa0a607SDon Lewis			AC_MSG_RESULT([found NSIS $nsis_version_major.$nsis_version_minor >= 3.*])
55497aa0a607SDon Lewis			AC_MSG_CHECKING([whether NSIS was compiled with Unicode support])
55507aa0a607SDon Lewis			if echo `"$NSIS_PATH/makensis.exe" /HDRINFO` | $EGREP  "\bNSIS_UNICODE_MAKENSIS\b" 2>&1 >/dev/null; then
55517aa0a607SDon Lewis				AC_MSG_RESULT([NSIS version compiled with Unicode support.])
55527aa0a607SDon Lewis			else
55537aa0a607SDon Lewis				NSIS_PATH=""
55547aa0a607SDon Lewis				AC_MSG_WARN([NSIS version compiled without Unicode support, no self contained installer will be build.])
55557aa0a607SDon Lewis			fi
55567aa0a607SDon Lewis		else
55577aa0a607SDon Lewis			NSIS_PATH=""
55587aa0a607SDon Lewis			AC_MSG_WARN([NSIS version found is < 3.*, no self contained installer will be build.])
55597aa0a607SDon Lewis		fi
55607aa0a607SDon Lewis    fi
55617aa0a607SDon Lewisfi
55627aa0a607SDon LewisAC_SUBST(NSIS_PATH)
55637aa0a607SDon Lewis
55647aa0a607SDon Lewisdnl ***************************************
55657aa0a607SDon Lewisdnl testing bison and flex exist
55667aa0a607SDon Lewisdnl ***************************************
55677aa0a607SDon LewisAC_PATH_PROG(BISON, bison)
55687aa0a607SDon Lewisif test -z "$BISON"; then
55697aa0a607SDon Lewis   AC_MSG_ERROR([no bison found in \$PATH, install bison])
55707aa0a607SDon Lewiselse
55717aa0a607SDon Lewis   AC_MSG_CHECKING([the bison version])
55727aa0a607SDon Lewis   _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
55737aa0a607SDon Lewis    _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
55747aa0a607SDon Lewis    # Accept newer than 1.875 or older(equal) than 1.75
55757aa0a607SDon Lewis    if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
55767aa0a607SDon Lewis       if test "$_bison_version" = "1.875" ; then
55777aa0a607SDon Lewis          AC_MSG_WARN([suspect ($BISON $_bison_version)])
55787aa0a607SDon Lewis          echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
55797aa0a607SDon Lewis       else
55807aa0a607SDon Lewis          AC_MSG_RESULT([checked ($BISON $_bison_version)])
55817aa0a607SDon Lewis       fi
55827aa0a607SDon Lewis    else
55837aa0a607SDon Lewis       AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
55847aa0a607SDon Lewis    fi
55857aa0a607SDon Lewisfi
55867aa0a607SDon LewisAC_PATH_PROG(FLEX, flex)
55877aa0a607SDon Lewisif test -z "$FLEX"; then
55887aa0a607SDon Lewis   AC_MSG_ERROR([no flex found in \$PATH, install flex])
55897aa0a607SDon Lewisfi
55907aa0a607SDon Lewisdnl ***************************************
55917aa0a607SDon Lewisdnl testing that patch exists
55927aa0a607SDon Lewisdnl ***************************************
55937aa0a607SDon LewisAC_PATH_PROG(PATCH, patch)
55947aa0a607SDon Lewisif test -z "$PATCH"; then
55957aa0a607SDon Lewis   AC_MSG_ERROR([\"patch\" not found in \$PATH, install the development tool named\"patch"\])
55967aa0a607SDon Lewisfi
55977aa0a607SDon Lewis
55987aa0a607SDon Lewisdnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
55997aa0a607SDon Lewisif test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
56007aa0a607SDon Lewis   if test -z "$with_gnu_patch"; then
56017aa0a607SDon Lewis      GNUPATCH=$PATCH
56027aa0a607SDon Lewis   else
56037aa0a607SDon Lewis      if test -x "$with_gnu_patch"; then
56047aa0a607SDon Lewis	      GNUPATCH=$with_gnu_patch
56057aa0a607SDon Lewis      else
56067aa0a607SDon Lewis         AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
56077aa0a607SDon Lewis      fi
56087aa0a607SDon Lewis   fi
56097aa0a607SDon Lewis
56107aa0a607SDon Lewis   AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
56117aa0a607SDon Lewis   if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
56127aa0a607SDon Lewis	   AC_MSG_RESULT([yes])
56137aa0a607SDon Lewis   else
56147aa0a607SDon Lewis      AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
56157aa0a607SDon Lewis   fi
56167aa0a607SDon Lewisfi
56177aa0a607SDon Lewis
56187aa0a607SDon Lewisdnl We also need to check for --with-gnu-cp
56197aa0a607SDon Lewis
56207aa0a607SDon Lewisif test -z "$with_gnu_cp"; then
56217aa0a607SDon Lewis   # check the place where the GNU stuff is hidden on Solaris...
56227aa0a607SDon Lewis   if test -x /usr/gnu/bin/cp; then
56237aa0a607SDon Lewis      GNUCP=/usr/gnu/bin/cp
56247aa0a607SDon Lewis   else
56257aa0a607SDon Lewis      AC_PATH_PROGS(GNUCP, gnucp cp)
56267aa0a607SDon Lewis   fi
56277aa0a607SDon Lewis   if test -z $GNUCP; then
56287aa0a607SDon Lewis      AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
56297aa0a607SDon Lewis   fi
56307aa0a607SDon Lewiselse
56317aa0a607SDon Lewis   if test -x "$with_gnu_cp"; then
56327aa0a607SDon Lewis      GNUCP=$with_gnu_cp
56337aa0a607SDon Lewis   else
56347aa0a607SDon Lewis      AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
56357aa0a607SDon Lewis   fi
56367aa0a607SDon Lewisfi
56377aa0a607SDon Lewis
56387aa0a607SDon LewisAC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
56397aa0a607SDon Lewisif $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
56407aa0a607SDon Lewis   AC_MSG_RESULT([yes])
56417aa0a607SDon Lewiselse
56427aa0a607SDon Lewis   AC_MSG_RESULT([no])
56437aa0a607SDon Lewis   GNUCP=''
56447aa0a607SDon Lewisfi
56457aa0a607SDon Lewis
56467aa0a607SDon Lewisif test -z "$GNUCP"; then
56477aa0a607SDon Lewis   if test "$_os" = "SunOS"; then
56487aa0a607SDon Lewis      AC_MSG_ERROR([no, GNU cp from coreutils is needed. install or specify with --with-gnu-cp=/path/to/it])
56497aa0a607SDon Lewis   else
56507aa0a607SDon Lewis      AC_MSG_RESULT([no GNU cp from coreutils found - using the system's cp command])
56517aa0a607SDon Lewis   fi
56527aa0a607SDon Lewisfi
56537aa0a607SDon Lewis
56547aa0a607SDon LewisAC_SUBST(GNUPATCH)
56557aa0a607SDon LewisAC_SUBST(GNUCP)
56567aa0a607SDon Lewis
56577aa0a607SDon Lewisdnl ***************************************
56587aa0a607SDon Lewisdnl testing bash tools path on Windows
56597aa0a607SDon Lewisdnl ***************************************
56607aa0a607SDon Lewisif test "$_os" = "WINNT"; then
56617aa0a607SDon Lewis    CYGWIN_PATH=""
56627aa0a607SDon Lewis    AC_PATH_PROG(CYGWIN_PATH, bash)
56637aa0a607SDon Lewis    CYGWIN_PATH=`dirname "$CYGWIN_PATH"`
56647aa0a607SDon Lewisfi
56657aa0a607SDon Lewisif test -z "$CYGWIN_PATH"; then
56667aa0a607SDon Lewis   CYGWIN_PATH="NO_CYGWIN"
56677aa0a607SDon Lewisfi
56687aa0a607SDon LewisAC_SUBST(CYGWIN_PATH)
56697aa0a607SDon Lewis
56707aa0a607SDon Lewisdnl ***************************************
56717aa0a607SDon Lewisdnl testing ml.exe assembler path
56727aa0a607SDon Lewisdnl ***************************************
56737aa0a607SDon Lewisif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
56747aa0a607SDon Lewis  AC_MSG_CHECKING([ml.exe assembler path])
56757aa0a607SDon Lewis  if test -n "$with_asm_home"; then
56767aa0a607SDon Lewis    with_asm_home=`cygpath -u "$with_asm_home"`
56777aa0a607SDon Lewis  fi
56787aa0a607SDon Lewis  if test ! -x "$with_asm_home/ml.exe"; then
56797aa0a607SDon Lewis    AC_PATH_PROG(ML_EXE, ml.exe)
56807aa0a607SDon Lewis    if test -z "$ML_EXE"; then
56817aa0a607SDon Lewis      if test -x "$with_cl_home/bin/ml.exe"; then
56827aa0a607SDon Lewis        with_asm_home=$with_cl_home/bin
56837aa0a607SDon Lewis        AC_MSG_RESULT([found ($with_asm_home)])
56847aa0a607SDon Lewis      else
56857aa0a607SDon Lewis        AC_MSG_ERROR([Configure did not find ml.exe assembler.])
56867aa0a607SDon Lewis      fi
56877aa0a607SDon Lewis    else
56887aa0a607SDon Lewis       with_asm_home="ASM_IN_PATH"
56897aa0a607SDon Lewis    fi
56907aa0a607SDon Lewis  fi
56917aa0a607SDon Lewis  AC_MSG_RESULT([$ASM_HOME])
56927aa0a607SDon Lewiselse
56937aa0a607SDon Lewis  with_asm_home="NO_ASM_HOME"
56947aa0a607SDon Lewisfi
56957aa0a607SDon LewisASM_HOME="$with_asm_home"
56967aa0a607SDon LewisAC_SUBST(ASM_HOME)
56977aa0a607SDon Lewis
56987aa0a607SDon Lewisdnl ***************************************
56997aa0a607SDon Lewisdnl testing nasm.exe assembler path
57007aa0a607SDon Lewisdnl ***************************************
57017aa0a607SDon Lewisif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes" -a "$SYSTEM_OPENSSL" = "NO"; then
57027aa0a607SDon Lewis  AC_MSG_CHECKING([nasm.exe assembler path])
57037aa0a607SDon Lewis  if test -n "$with_nasm_home"; then
57047aa0a607SDon Lewis    with_nasm_home=`cygpath -u "$with_nasm_home"`
57057aa0a607SDon Lewis  fi
57067aa0a607SDon Lewis  if test ! -x "$with_nasm_home/nasm.exe"; then
57077aa0a607SDon Lewis    AC_PATH_PROG(NASM_EXE, nasm.exe)
57087aa0a607SDon Lewis    if test -z "$NASM_EXE"; then
57097aa0a607SDon Lewis      with_nasm_home="NO_NASM_HOME"
57107aa0a607SDon Lewis      AC_MSG_ERROR([NASM is required to build on Windows, please install or use --with-nasm-home],,)
57117aa0a607SDon Lewis    else
57127aa0a607SDon Lewis      with_nasm_home="NASM_IN_PATH"
57137aa0a607SDon Lewis    fi
57147aa0a607SDon Lewis  fi
57157aa0a607SDon Lewis  AC_MSG_RESULT([$NASM_HOME])
57167aa0a607SDon Lewiselse
57177aa0a607SDon Lewis  with_nasm_home="NO_NASM_HOME"
57187aa0a607SDon Lewisfi
57197aa0a607SDon LewisNASM_HOME="$with_nasm_home"
57207aa0a607SDon LewisAC_SUBST(NASM_HOME)
57217aa0a607SDon Lewis
57227aa0a607SDon Lewisdnl ===================================================================
57237aa0a607SDon Lewisdnl testing handle deprecated unzip switch
57247aa0a607SDon Lewisdnl ===================================================================
57257aa0a607SDon Lewisif test -z "$with_zip_home"; then
57267aa0a607SDon Lewis	with_zip_home="$with_unzip_home"
57277aa0a607SDon Lewisfi
57287aa0a607SDon Lewisdnl ===================================================================
57297aa0a607SDon Lewisdnl Zip will be found where you tell me to find it
57307aa0a607SDon Lewisdnl ===================================================================
57317aa0a607SDon Lewisif test -n "$with_zip_home" ; then
57327aa0a607SDon Lewis    if test "$_os" = "WINNT"; then
57337aa0a607SDon Lewis        with_zip_home=`cygpath -u "$with_zip_home"`
57347aa0a607SDon Lewis    fi
57357aa0a607SDon Lewis    ZIP="$with_zip_home/zip"
57367aa0a607SDon Lewis    UNZIP="$with_zip_home/unzip"
57377aa0a607SDon Lewis    ZIP_HOME="$with_zip_home"
57387aa0a607SDon Lewiselse
57397aa0a607SDon Lewis    AC_PATH_PROG(ZIP, zip)
57407aa0a607SDon Lewis    AC_PATH_PROG(UNZIP, unzip)
57417aa0a607SDon Lewis    ZIP_HOME=`dirname "$ZIP"`
57427aa0a607SDon Lewisfi
57437aa0a607SDon Lewisdnl ===================================================================
57447aa0a607SDon Lewisdnl Zip must be available or else it is an error, all platforms
57457aa0a607SDon Lewisdnl ===================================================================
57467aa0a607SDon Lewisif test -z "$ZIP" -o -z "$UNZIP"; then
57477aa0a607SDon Lewis    AC_MSG_ERROR([Zip/Unzip are required to build, please install or use --with-zip-home],,)
57487aa0a607SDon Lewisfi
57497aa0a607SDon Lewis
57507aa0a607SDon Lewisdnl ===================================================================
57517aa0a607SDon Lewisdnl Zip must be a specific type for different build types.
57527aa0a607SDon Lewisdnl ===================================================================
57537aa0a607SDon Lewisif test "$_os" = "WINNT"; then
57547aa0a607SDon Lewis    if test -n "`$ZIP -h | grep -i WinNT`" ; then
57557aa0a607SDon LewisAC_MSG_ERROR([$ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe.])
57567aa0a607SDon Lewis    fi
57577aa0a607SDon Lewisfi
57587aa0a607SDon LewisAC_SUBST(ZIP_HOME)
57597aa0a607SDon Lewis
57607aa0a607SDon Lewisdnl ===================================================================
57617aa0a607SDon Lewisdnl Windows builds need dbghelp.dll in external/dbghelp/
57627aa0a607SDon Lewisdnl ===================================================================
57637aa0a607SDon Lewisif test "$_os" = "WINNT"; then
57647aa0a607SDon Lewis   AC_MSG_CHECKING([for dbghelp.dll])
57657aa0a607SDon Lewis   if test -x ./external/dbghelp/dbghelp.dll; then
57667aa0a607SDon Lewis      AC_MSG_RESULT([found and executable])
57677aa0a607SDon Lewis   else
57687aa0a607SDon Lewis      AC_MSG_ERROR([dbghelp.dll is missing in external/dbghelp/.
57697aa0a607SDon LewisGet it from the Microsoft site and put it into external/dbghelp.
57707aa0a607SDon Lewis(Note: Microsoft seems to enjoy changing the exact location of this file. You
57717aa0a607SDon Lewismay have to search Microsoft's website.) Last time it was seen at:
57727aa0a607SDon Lewis<http://www.microsoft.com/downloads/release.asp?releaseid=30682>.])
57737aa0a607SDon Lewis   fi
57747aa0a607SDon Lewisfi
57757aa0a607SDon Lewis
57767aa0a607SDon Lewisdnl ===================================================================
57777aa0a607SDon Lewisdnl Windows builds need vcredist_x*.exe in external/vcredist/
57787aa0a607SDon Lewisdnl ===================================================================
57797aa0a607SDon LewisWITH_VC_REDIST=""
57807aa0a607SDon Lewis
57817aa0a607SDon Lewisif test "$_os" = "WINNT"; then
57827aa0a607SDon Lewis   AC_MSG_CHECKING([for vcredist_x86.exe])
57837aa0a607SDon Lewis   if test -x ./external/vcredist/vcredist_x86.exe; then
57847aa0a607SDon Lewis      AC_MSG_RESULT([found and executable])
57857aa0a607SDon Lewis   else
57867aa0a607SDon Lewis      AC_MSG_ERROR([ vcredist_x86.exe is missing in external/vcredist/.
57877aa0a607SDon LewisGet it from the Microsoft site and put it into external/vcredist. You can try
57887aa0a607SDon Lewisto download it from http://www.microsoft.com/download/en/search.aspx?q=redistributable%20package.])
57897aa0a607SDon Lewis   fi
57907aa0a607SDon Lewis   AC_MSG_CHECKING([for vcredist_x64.exe])
57917aa0a607SDon Lewis   if test -x ./external/vcredist/vcredist_x64.exe; then
57927aa0a607SDon Lewis      AC_MSG_RESULT([found and executable])
57937aa0a607SDon Lewis   else
57947aa0a607SDon Lewis      AC_MSG_ERROR([ vcredist_x64.exe is missing in external/vcredist/.
57957aa0a607SDon LewisGet it from the Microsoft site and put it into external/vcredist. You can try
57967aa0a607SDon Lewisto download it from http://www.microsoft.com/download/en/search.aspx?q=redistributable%20package.])
57977aa0a607SDon Lewis   fi
57987aa0a607SDon Lewis   WITH_VC_REDIST=YES
57997aa0a607SDon Lewis   AC_SUBST(WITH_VC_REDIST)
58007aa0a607SDon Lewisfi
58017aa0a607SDon Lewis
58027aa0a607SDon Lewisdnl ===================================================================
58037aa0a607SDon Lewisdnl Windows builds - use oowintool to copy CRT dlls and manifest
58047aa0a607SDon Lewisdnl ===================================================================
58057aa0a607SDon Lewisif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
58067aa0a607SDon Lewis       if ./oowintool --msvc-copy-dlls ./external/msvcp ; then
58077aa0a607SDon Lewis          :
58087aa0a607SDon Lewis       else
58097aa0a607SDon Lewis          AC_MSG_ERROR([oowintool failed to copy CRT])
58107aa0a607SDon Lewis       fi
58117aa0a607SDon Lewisfi
58127aa0a607SDon Lewis
58137aa0a607SDon Lewisdnl ===================================================================
58147aa0a607SDon Lewisdnl Windows builds need gdiplus.dll in external/gdiplus/
58157aa0a607SDon Lewisdnl ===================================================================
58167aa0a607SDon Lewisif test "$_os" = "WINNT"; then
58177aa0a607SDon Lewis   AC_MSG_CHECKING([for gdiplus.dll])
58187aa0a607SDon Lewis   if test -x ./external/gdiplus/gdiplus.dll; then
58197aa0a607SDon Lewis      AC_MSG_RESULT([found and executable])
58207aa0a607SDon Lewis   else
58217aa0a607SDon Lewis      AC_MSG_ERROR([gdiplus.dll is missing in external/gdiplus/.
58227aa0a607SDon LewisGet it from the Microsoft site and put it into external/gdiplus.
58237aa0a607SDon LewisYou may have to search Microsoft's website. Last time it was seen at:
58247aa0a607SDon Lewis<http://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en>.])
58257aa0a607SDon Lewis   fi
58267aa0a607SDon Lewisfi
58277aa0a607SDon Lewis
58287aa0a607SDon Lewisdnl ===================================================================
58297aa0a607SDon Lewisdnl Windows builds need msvcr100.dll in external/msvcp100/
58307aa0a607SDon Lewisdnl ===================================================================
58317aa0a607SDon Lewisif test "$_os" = "WINNT"; then
58327aa0a607SDon Lewis   AC_MSG_CHECKING([for msvcr100.dll])
58337aa0a607SDon Lewis   if test -x ./external/msvcp100/msvcr100.dll; then
58347aa0a607SDon Lewis      AC_MSG_RESULT([found and executable])
58357aa0a607SDon Lewis   else
58367aa0a607SDon Lewis      AC_MSG_ERROR([msvcr100.dll is missing in external/msvcp100/.
58377aa0a607SDon LewisGet it from the Microsoft Visual C++ 2010 Redistributable Package (x86),
58387aa0a607SDon Lewisfrom the Microsoft site and put it into external/msvcp100.
58397aa0a607SDon LewisYou may have to search Microsoft's website. Last time it was seen at:
58407aa0a607SDon Lewis<http://www.microsoft.com/en-us/download/search.aspx?q=Microsoft+Visual+C%2b%2b+2010+Redistributable>.])
58417aa0a607SDon Lewis   fi
58427aa0a607SDon Lewisfi
58437aa0a607SDon Lewis
58447aa0a607SDon Lewisdnl ===================================================================
58457aa0a607SDon Lewisdnl Test which vclplugs have to be built.
58467aa0a607SDon Lewisdnl ===================================================================
58477aa0a607SDon LewisAC_MSG_CHECKING([which VCLplugs shall be built])
58487aa0a607SDon LewisENABLE_GTK=""
58497aa0a607SDon Lewisif test "x$enable_gtk" = "xyes"; then
58507aa0a607SDon Lewis    ENABLE_GTK="TRUE"
58517aa0a607SDon Lewis    R="gtk"
58527aa0a607SDon Lewisfi
58537aa0a607SDon LewisAC_SUBST(ENABLE_GTK)
58547aa0a607SDon Lewis
58557aa0a607SDon LewisENABLE_KDE=""
58567aa0a607SDon Lewisif test "x$enable_kde" = "xyes"; then
58577aa0a607SDon Lewis    ENABLE_KDE="TRUE"
58587aa0a607SDon Lewis    R="$R kde"
58597aa0a607SDon Lewisfi
58607aa0a607SDon LewisAC_SUBST(ENABLE_KDE)
58617aa0a607SDon Lewis
58627aa0a607SDon LewisENABLE_KDE4=""
58637aa0a607SDon Lewisif test "x$enable_kde4" = "xyes"; then
58647aa0a607SDon Lewis    ENABLE_KDE4="TRUE"
58657aa0a607SDon Lewis    R="$R kde4"
58667aa0a607SDon Lewisfi
58677aa0a607SDon LewisAC_SUBST(ENABLE_KDE4)
58687aa0a607SDon Lewis
58697aa0a607SDon Lewisif test -z "$R"; then
58707aa0a607SDon Lewis	AC_MSG_RESULT([none])
58717aa0a607SDon Lewiselse
58727aa0a607SDon Lewis	AC_MSG_RESULT([$R])
58737aa0a607SDon Lewisfi
58747aa0a607SDon Lewis
58757aa0a607SDon Lewisdnl ===================================================================
58767aa0a607SDon Lewisdnl GCONF check
58777aa0a607SDon Lewisdnl ===================================================================
58787aa0a607SDon Lewis
58797aa0a607SDon LewisENABLE_GCONF=""
58807aa0a607SDon LewisAC_MSG_CHECKING([whether to enable GConf support])
58817aa0a607SDon Lewisif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then
58827aa0a607SDon Lewis    ENABLE_GCONF="TRUE"
58837aa0a607SDon Lewis    AC_MSG_RESULT([yes])
58847aa0a607SDon Lewis    PKG_CHECK_MODULES( GCONF, gconf-2.0 )
58857aa0a607SDon Lewiselse
58867aa0a607SDon Lewis    AC_MSG_RESULT([no])
58877aa0a607SDon Lewisfi
58887aa0a607SDon LewisAC_SUBST(ENABLE_GCONF)
58897aa0a607SDon Lewis
58907aa0a607SDon Lewisdnl ===================================================================
58917aa0a607SDon Lewisdnl Gnome VFS check
58927aa0a607SDon Lewisdnl ===================================================================
58937aa0a607SDon Lewis
58947aa0a607SDon LewisENABLE_GNOMEVFS=""
58957aa0a607SDon LewisAC_MSG_CHECKING([whether to enable GNOME VFS support])
58967aa0a607SDon Lewisif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then
58977aa0a607SDon Lewis    ENABLE_GNOMEVFS="TRUE"
58987aa0a607SDon Lewis    AC_MSG_RESULT([yes])
58997aa0a607SDon Lewis    PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
59007aa0a607SDon Lewis    if test "$ENABLE_GCONF" != "TRUE"; then
59017aa0a607SDon Lewis        PKG_CHECK_MODULES( GCONF, gconf-2.0 )
59027aa0a607SDon Lewis    fi
59037aa0a607SDon Lewiselse
59047aa0a607SDon Lewis    AC_MSG_RESULT([no])
59057aa0a607SDon Lewisfi
59067aa0a607SDon LewisAC_SUBST(ENABLE_GNOMEVFS)
59077aa0a607SDon Lewis
59087aa0a607SDon Lewisdnl ===================================================================
59097aa0a607SDon Lewisdnl Check whether the gtk 2.0 libraries are available.
59107aa0a607SDon Lewisdnl ===================================================================
59117aa0a607SDon Lewis
59127aa0a607SDon LewisGTK_CFLAGS=""
59137aa0a607SDon LewisGTK_LIBS=""
59147aa0a607SDon LewisENABLE_SYSTRAY_GTK=""
59157aa0a607SDon LewisENABLE_DBUS=""
59167aa0a607SDon Lewisif test  "$test_gtk" = "yes"; then
59177aa0a607SDon Lewis
59187aa0a607SDon Lewis   if test "$ENABLE_GTK" = "TRUE" ; then
59197aa0a607SDon Lewis      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]))
59207aa0a607SDon Lewis      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]))
59217aa0a607SDon Lewis      BUILD_TYPE="$BUILD_TYPE GTK"
59227aa0a607SDon Lewis
59237aa0a607SDon Lewis      if test "x$enable_systray" = "xyes"; then
59247aa0a607SDon Lewis         PKG_CHECK_MODULES(GTK_2_10,gtk+-2.0 >= 2.10.0,
59257aa0a607SDon Lewis                           [ENABLE_SYSTRAY_GTK="TRUE"
59267aa0a607SDon Lewis                            BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"],
59277aa0a607SDon Lewis                           [ENABLE_SYSTRAY_GTK=""])
59287aa0a607SDon Lewis      fi
59297aa0a607SDon Lewis
59307aa0a607SDon Lewis      AC_MSG_CHECKING([whether to enable DBUS support])
59317aa0a607SDon Lewis      if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
59327aa0a607SDon Lewis          ENABLE_DBUS="TRUE"
59337aa0a607SDon Lewis          AC_MSG_RESULT([yes])
59347aa0a607SDon Lewis          PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
59357aa0a607SDon Lewis      else
59367aa0a607SDon Lewis          AC_MSG_RESULT([no])
59377aa0a607SDon Lewis      fi
59387aa0a607SDon Lewis
59397aa0a607SDon Lewis      AC_MSG_CHECKING([whether to enable GIO support])
59407aa0a607SDon Lewis      if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
59417aa0a607SDon Lewis          if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
59427aa0a607SDon Lewis             AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
59437aa0a607SDon Lewis          fi
59447aa0a607SDon Lewis          ENABLE_GIO="TRUE"
59457aa0a607SDon Lewis          AC_MSG_RESULT([yes])
59467aa0a607SDon Lewis          PKG_CHECK_MODULES( GIO, gio-2.0 )
59477aa0a607SDon Lewis      else
59487aa0a607SDon Lewis          AC_MSG_RESULT([no])
59497aa0a607SDon Lewis      fi
59507aa0a607SDon Lewis
59517aa0a607SDon Lewis   fi
59527aa0a607SDon Lewis
59537aa0a607SDon Lewisfi
59547aa0a607SDon LewisAC_SUBST(ENABLE_GIO)
59557aa0a607SDon LewisAC_SUBST(ENABLE_DBUS)
59567aa0a607SDon LewisAC_SUBST(ENABLE_SYSTRAY_GTK)
59577aa0a607SDon LewisAC_SUBST(GTK_CFLAGS)
59587aa0a607SDon LewisAC_SUBST(GTK_LIBS)
59597aa0a607SDon LewisAC_SUBST(GTHREAD_CFLAGS)
59607aa0a607SDon LewisAC_SUBST(GTHREAD_LIBS)
59617aa0a607SDon Lewis
59627aa0a607SDon Lewisdnl ===================================================================
59637aa0a607SDon Lewisdnl Check whether the GStreamer libraries are available.
59647aa0a607SDon Lewisdnl ===================================================================
59657aa0a607SDon Lewis
59667aa0a607SDon LewisGSTREAMER_CFLAGS=""
59677aa0a607SDon LewisGSTREAMER_LIBS=""
59687aa0a607SDon LewisENABLE_GSTREAMER=""
59697aa0a607SDon Lewis
59707aa0a607SDon Lewisif test "$test_gstreamer" = "yes"; then
59717aa0a607SDon Lewis    AC_MSG_CHECKING([whether to build the GStreamer media backend])
59727aa0a607SDon Lewis    if test "x$enable_gstreamer" != "xno" ; then
59737aa0a607SDon Lewis        PKG_CHECK_MODULES( GSTREAMER, gtk+-2.0 >= 2.4 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 ,,AC_MSG_ERROR([requirements to build the GStreamer media backend not met. Do not use --enable-gstreamer or install the missing packages]))
59747aa0a607SDon Lewis        ENABLE_GSTREAMER="TRUE"
59757aa0a607SDon Lewis        AC_MSG_RESULT([yes])
59767aa0a607SDon Lewis    else
59777aa0a607SDon Lewis        AC_MSG_RESULT([no])
59787aa0a607SDon Lewis    fi
59797aa0a607SDon Lewisfi
59807aa0a607SDon LewisAC_SUBST(ENABLE_GSTREAMER)
59817aa0a607SDon LewisAC_SUBST(GSTREAMER_CFLAGS)
59827aa0a607SDon LewisAC_SUBST(GSTREAMER_LIBS)
59837aa0a607SDon Lewis
59847aa0a607SDon Lewisdnl ===================================================================
59857aa0a607SDon Lewisdnl Check the ARM target
59867aa0a607SDon Lewisdnl ===================================================================
59877aa0a607SDon Lewis
59887aa0a607SDon Lewisif test "$_os" = "Linux" && echo "$build_cpu" | $GREP -q arm; then
59897aa0a607SDon Lewis    # default value
59907aa0a607SDon Lewis    ARM_TARGET=ARMV4T
59917aa0a607SDon Lewis    AC_MSG_CHECKING([which ARM processor optimization to use])
59927aa0a607SDon Lewis    if test "$with_arm_target" -lt "6"; then
59937aa0a607SDon Lewis	ARM_TARGET=ARMV4T
59947aa0a607SDon Lewis    elif test "$with_arm_target" = "6"; then
59957aa0a607SDon Lewis	ARM_TARGET=ARMV6
59967aa0a607SDon Lewis    elif test "$with_arm_target" -gt "6"; then
59977aa0a607SDon Lewis	ARM_TARGET=ARMV7
59987aa0a607SDon Lewis    fi
59997aa0a607SDon Lewis    AC_MSG_RESULT([$ARM_TARGET])
60007aa0a607SDon Lewis    AC_SUBST(ARM_TARGET)
60017aa0a607SDon Lewisfi
60027aa0a607SDon Lewis
60037aa0a607SDon Lewisdnl ===================================================================
60047aa0a607SDon Lewisdnl Check whether the Cairo libraries are available.
60057aa0a607SDon Lewisdnl ===================================================================
60067aa0a607SDon Lewis
60077aa0a607SDon LewisENABLE_CAIRO=""
60087aa0a607SDon LewisBUILD_PIXMAN=""
60097aa0a607SDon LewisSYSTEM_CAIRO=""
60107aa0a607SDon Lewis
60117aa0a607SDon Lewisif test  "$test_cairo" = "yes"; then
60127aa0a607SDon Lewis
60137aa0a607SDon Lewis    AC_MSG_CHECKING([whether to use cairo])
60147aa0a607SDon Lewis    if test "x$enable_cairo" != "xno" ; then
60157aa0a607SDon Lewis        ENABLE_CAIRO="TRUE"
60167aa0a607SDon Lewis	AC_MSG_RESULT([yes])
60177aa0a607SDon Lewis        AC_MSG_CHECKING([which cairo to use])
60187aa0a607SDon Lewis        if test -n "$with_system_cairo" -o -n "$with_system_libs" && \
60197aa0a607SDon Lewis           test "$with_system_cairo" != "no"; then
60207aa0a607SDon Lewis           AC_MSG_RESULT([external])
60217aa0a607SDon Lewis           SYSTEM_CAIRO=YES
60227aa0a607SDon Lewis
60237aa0a607SDon Lewis           PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
60247aa0a607SDon Lewis	   if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$ENABLE_FONTCONFIG" != "TRUE" ; then
60257aa0a607SDon Lewis	      AC_MSG_ERROR([Cairo library requires fontconfig.])
60267aa0a607SDon Lewis	   fi
60277aa0a607SDon Lewis           if test "$with_system_xrender_headers" = "yes"; then
60287aa0a607SDon Lewis              AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
60297aa0a607SDon Lewis              AC_TRY_RUN([
60307aa0a607SDon Lewis#include <X11/extensions/Xrender.h>
60317aa0a607SDon Lewis
60327aa0a607SDon Lewisint main(int argc, char **argv) {
60337aa0a607SDon Lewis#ifdef PictStandardA8
60347aa0a607SDon Lewis      return 0;
60357aa0a607SDon Lewis#else
60367aa0a607SDon Lewis      return 1;
60377aa0a607SDon Lewis#endif
60387aa0a607SDon Lewis}
60397aa0a607SDon Lewis               ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, X headers too old.])])
60407aa0a607SDon Lewis           fi
60417aa0a607SDon Lewis        else
60427aa0a607SDon Lewis           BUILD_TYPE="$BUILD_TYPE CAIRO"
60437aa0a607SDon Lewis	   dnl === compiler fails on pixman with 64bit architectures...===
60447aa0a607SDon Lewis	   if test "$build_cpu" != "x86_64"; then
60457aa0a607SDon Lewis	      BUILD_PIXMAN=YES
60467aa0a607SDon Lewis	   fi
60477aa0a607SDon Lewis           AC_MSG_RESULT([internal])
60487aa0a607SDon Lewis        fi
60497aa0a607SDon Lewis    else
60507aa0a607SDon Lewis	   AC_MSG_RESULT([no])
60517aa0a607SDon Lewis    fi
60527aa0a607SDon Lewisfi
60537aa0a607SDon Lewis
60547aa0a607SDon LewisAC_SUBST(ENABLE_CAIRO)
60557aa0a607SDon LewisAC_SUBST(BUILD_PIXMAN)
60567aa0a607SDon LewisAC_SUBST(SYSTEM_CAIRO)
60577aa0a607SDon LewisAC_SUBST(CAIRO_CFLAGS)
60587aa0a607SDon LewisAC_SUBST(CAIRO_LIBS)
60597aa0a607SDon Lewis
60607aa0a607SDon LewisENABLE_CAIRO_CANVAS="FALSE"
60617aa0a607SDon Lewisif test "$enable_cairo_canvas" = "yes" -a "$ENABLE_CAIRO" = "TRUE" ; then
60627aa0a607SDon Lewis   ENABLE_CAIRO_CANVAS="TRUE"
60637aa0a607SDon Lewisfi
60647aa0a607SDon LewisAC_SUBST(ENABLE_CAIRO_CANVAS)
60657aa0a607SDon Lewis
60667aa0a607SDon Lewisdnl ===================================================================
60677aa0a607SDon Lewisdnl Check whether the OpenGL libraries are available
60687aa0a607SDon Lewisdnl ===================================================================
60697aa0a607SDon Lewis
60707aa0a607SDon LewisAC_MSG_CHECKING([whether to build the OpenGL Transitions component])
60717aa0a607SDon LewisENABLE_OPENGL=
60727aa0a607SDon Lewis
60737aa0a607SDon Lewisif test "x$enable_opengl" != "xno" ; then
60747aa0a607SDon Lewis   AC_MSG_RESULT([yes])
60757aa0a607SDon Lewis   AC_CHECK_HEADER(GL/gl.h, [],
60767aa0a607SDon Lewis                   [AC_MSG_ERROR([OpenGL headers not found])], [])
60777aa0a607SDon Lewis   AC_CHECK_LIB(GL, main, [],
60787aa0a607SDon Lewis     [AC_MSG_ERROR(libGL not installed or functional)], [])
60797aa0a607SDon Lewis   AC_CHECK_LIB(GLU, main, [],
60807aa0a607SDon Lewis     [AC_MSG_ERROR(libGLU not installed or functional)], [])
60817aa0a607SDon Lewis   ENABLE_OPENGL=TRUE
60827aa0a607SDon Lewiselse
60837aa0a607SDon Lewis   AC_MSG_RESULT([no])
60847aa0a607SDon Lewisfi
60857aa0a607SDon Lewis
60867aa0a607SDon LewisAC_SUBST(ENABLE_OPENGL)
60877aa0a607SDon Lewis
60887aa0a607SDon Lewis
60897aa0a607SDon LewisAC_MSG_CHECKING([whether to build the PDF Import extension])
60907aa0a607SDon Lewisif test -n "$enable_pdfimport" -a "$enable_pdfimport" != "no"; then
60917aa0a607SDon Lewis  AC_MSG_RESULT([yes])
60927aa0a607SDon Lewis  ENABLE_PDFIMPORT=YES
60937aa0a607SDon Lewis
60947aa0a607SDon Lewis  dnl ===================================================================
60957aa0a607SDon Lewis  dnl Check for system poppler
60967aa0a607SDon Lewis  dnl ===================================================================
60977aa0a607SDon Lewis  AC_MSG_CHECKING([whether to use system pdf backend])
60987aa0a607SDon Lewis  if test -n "$with_system_poppler" -o -n "$with_system_libs" && \
60997aa0a607SDon Lewis       test "$with_system_poppler" != "no"; then
61007aa0a607SDon Lewis      AC_MSG_RESULT([external])
61017aa0a607SDon Lewis      SYSTEM_POPPLER=YES
61027aa0a607SDon Lewis      PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
61037aa0a607SDon Lewis  else
61047aa0a607SDon Lewis      AC_MSG_RESULT([no])
61057aa0a607SDon Lewis      SYSTEM_POPPLER=NO
61067aa0a607SDon Lewis      ENABLE_PDFIMPORT=NO
61077aa0a607SDon Lewis  fi
61087aa0a607SDon Lewiselse
61097aa0a607SDon Lewis   AC_MSG_RESULT([no])
61107aa0a607SDon Lewis   ENABLE_PDFIMPORT=NO
61117aa0a607SDon Lewisfi
61127aa0a607SDon LewisAC_SUBST(ENABLE_PDFIMPORT)
61137aa0a607SDon LewisAC_SUBST(SYSTEM_POPPLER)
61147aa0a607SDon LewisAC_SUBST(POPPLER_CFLAGS)
61157aa0a607SDon LewisAC_SUBST(POPPLER_LIBS)
61167aa0a607SDon Lewis
61177aa0a607SDon LewisAC_MSG_CHECKING([whether to build the Wiki Publisher extension])
61187aa0a607SDon Lewisif test -n "$enable_wiki_publisher" -a "$enable_wiki_publisher" != "no" && test  "$WITH_JAVA" != "no"; then
61197aa0a607SDon Lewis  AC_MSG_RESULT([yes])
61207aa0a607SDon Lewis  AC_MSG_CHECKING([for swext module])
61217aa0a607SDon Lewis  if test -d ./swext; then
61227aa0a607SDon Lewis   AC_MSG_RESULT([OK])
61237aa0a607SDon Lewis  else
61247aa0a607SDon Lewis   AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
61257aa0a607SDon Lewis  fi
61267aa0a607SDon Lewis  ENABLE_MEDIAWIKI=YES
61277aa0a607SDon Lewis  BUILD_TYPE="$BUILD_TYPE SWEXT"
61287aa0a607SDon Lewiselse
61297aa0a607SDon Lewis  AC_MSG_RESULT([no])
61307aa0a607SDon Lewis  ENABLE_MEDIAWIKI=NO
61317aa0a607SDon Lewisfi
61327aa0a607SDon LewisAC_SUBST(ENABLE_MEDIAWIKI)
61337aa0a607SDon Lewis
61347aa0a607SDon Lewisif test "$ENABLE_MEDIAWIKI" = "YES"; then
61357aa0a607SDon Lewis  AC_MSG_CHECKING([which Servlet API Jar to use])
61367aa0a607SDon Lewis  if test -n "$with_system_servlet_api"; then
61377aa0a607SDon Lewis    AC_MSG_RESULT([external])
61387aa0a607SDon Lewis    SYSTEM_SERVLETAPI=YES
61397aa0a607SDon Lewis      if test -z "$SERVLETAPI_JAR"; then
61407aa0a607SDon Lewis	SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
61417aa0a607SDon Lewis      fi
61427aa0a607SDon Lewis      AC_CHECK_FILE($SERVLETAPI_JAR, [],
61437aa0a607SDon Lewis             [AC_MSG_ERROR(servlet-api.jar not found.)], [])
61447aa0a607SDon Lewis  else
61457aa0a607SDon Lewis    AC_MSG_RESULT([internal])
61467aa0a607SDon Lewis    SYSTEM_SERVLETAPI=NO
61477aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE TOMCAT"
61487aa0a607SDon Lewis  fi
61497aa0a607SDon Lewisfi
61507aa0a607SDon LewisAC_SUBST(SYSTEM_SERVLETAPI)
61517aa0a607SDon LewisAC_SUBST(SERVLETAPI_JAR)
61527aa0a607SDon Lewis
61537aa0a607SDon LewisAC_MSG_CHECKING([whether to build the Report Builder extension])
61547aa0a607SDon Lewisif test -n "$enable_report_builder" -a "$enable_report_builder" != "no" && test "$WITH_JAVA" != "no"; then
61557aa0a607SDon Lewis  AC_MSG_RESULT([yes])
61567aa0a607SDon Lewis  ENABLE_REPORTBUILDER=YES
61577aa0a607SDon Lewis  SYSTEM_JFREEREPORT=YES
61587aa0a607SDon Lewis  AC_MSG_CHECKING([for reportbuilder module])
61597aa0a607SDon Lewis  if test -d ./reportbuilder; then
61607aa0a607SDon Lewis    AC_MSG_RESULT([OK])
61617aa0a607SDon Lewis  else
61627aa0a607SDon Lewis    AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
61637aa0a607SDon Lewis  fi
61647aa0a607SDon Lewis  AC_MSG_CHECKING([which jfreereport libs to use (for Report Builder extension)])
61657aa0a607SDon Lewis  AC_MSG_RESULT([external])
61667aa0a607SDon Lewis  if test -z $SAC_JAR; then
61677aa0a607SDon Lewis         SAC_JAR=/usr/share/java/sac.jar
61687aa0a607SDon Lewis  fi
61697aa0a607SDon Lewis  AC_CHECK_FILE($SAC_JAR, [],
61707aa0a607SDon Lewis         [AC_MSG_ERROR(sac.jar not found.)], [])
61717aa0a607SDon Lewis
61727aa0a607SDon Lewis  if test -z $LIBXML_JAR; then
61737aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
61747aa0a607SDon Lewis      [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
61757aa0a607SDon Lewis      [
61767aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/libxml.jar,
61777aa0a607SDon Lewis          [ LIBXML_JAR=/usr/share/java/libxml.jar ],
61787aa0a607SDon Lewis          [AC_MSG_ERROR(libxml.jar replacement not found.)]
61797aa0a607SDon Lewis        )
61807aa0a607SDon Lewis      ]
61817aa0a607SDon Lewis    )
61827aa0a607SDon Lewis  else
61837aa0a607SDon Lewis    AC_CHECK_FILE($LIBXML_JAR, [],
61847aa0a607SDon Lewis         [AC_MSG_ERROR(libxml.jar not found.)], [])
61857aa0a607SDon Lewis  fi
61867aa0a607SDon Lewis
61877aa0a607SDon Lewis  if test -z $FLUTE_JAR; then
61887aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
61897aa0a607SDon Lewis      [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
61907aa0a607SDon Lewis      [
61917aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/flute.jar,
61927aa0a607SDon Lewis          [ FLUTE_JAR=/usr/share/java/flute.jar ],
61937aa0a607SDon Lewis          [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
61947aa0a607SDon Lewis        )
61957aa0a607SDon Lewis      ]
61967aa0a607SDon Lewis    )
61977aa0a607SDon Lewis  else
61987aa0a607SDon Lewis    AC_CHECK_FILE($FLUTE_JAR, [],
61997aa0a607SDon Lewis         [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
62007aa0a607SDon Lewis  fi
62017aa0a607SDon Lewis
62027aa0a607SDon Lewis  if test -z $JFREEREPORT_JAR; then
62037aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
62047aa0a607SDon Lewis      [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
62057aa0a607SDon Lewis      [
62067aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
62077aa0a607SDon Lewis          [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
62087aa0a607SDon Lewis          [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
62097aa0a607SDon Lewis        )
62107aa0a607SDon Lewis      ]
62117aa0a607SDon Lewis    )
62127aa0a607SDon Lewis  else
62137aa0a607SDon Lewis    AC_CHECK_FILE($JFREEREPORT_JAR, [],
62147aa0a607SDon Lewis         [AC_MSG_ERROR(jfreereport.jar not found.)], [])
62157aa0a607SDon Lewis  fi
62167aa0a607SDon Lewis
62177aa0a607SDon Lewis  if test -z $LIBLAYOUT_JAR; then
62187aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
62197aa0a607SDon Lewis      [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
62207aa0a607SDon Lewis      [
62217aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/liblayout.jar,
62227aa0a607SDon Lewis          [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
62237aa0a607SDon Lewis          [AC_MSG_ERROR(liblayout.jar replacement not found.)]
62247aa0a607SDon Lewis        )
62257aa0a607SDon Lewis      ]
62267aa0a607SDon Lewis    )
62277aa0a607SDon Lewis  else
62287aa0a607SDon Lewis    AC_CHECK_FILE($LIBLAYOUT_JAR, [],
62297aa0a607SDon Lewis         [AC_MSG_ERROR(liblayout.jar not found.)], [])
62307aa0a607SDon Lewis  fi
62317aa0a607SDon Lewis
62327aa0a607SDon Lewis  if test -z $LIBLOADER_JAR; then
62337aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
62347aa0a607SDon Lewis      [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
62357aa0a607SDon Lewis      [
62367aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/libloader.jar,
62377aa0a607SDon Lewis          [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
62387aa0a607SDon Lewis          [AC_MSG_ERROR(libloader.jar replacement not found.)]
62397aa0a607SDon Lewis        )
62407aa0a607SDon Lewis      ]
62417aa0a607SDon Lewis    )
62427aa0a607SDon Lewis  else
62437aa0a607SDon Lewis    AC_CHECK_FILE($LIBLOADER_JAR, [],
62447aa0a607SDon Lewis         [AC_MSG_ERROR(libloader.jar not found.)], [])
62457aa0a607SDon Lewis  fi
62467aa0a607SDon Lewis
62477aa0a607SDon Lewis  if test -z $LIBFORMULA_JAR; then
62487aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
62497aa0a607SDon Lewis      [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
62507aa0a607SDon Lewis      [
62517aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/libformula.jar,
62527aa0a607SDon Lewis          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
62537aa0a607SDon Lewis          [AC_MSG_ERROR(libformula.jar replacement not found.)]
62547aa0a607SDon Lewis        )
62557aa0a607SDon Lewis      ]
62567aa0a607SDon Lewis    )
62577aa0a607SDon Lewis  else
62587aa0a607SDon Lewis    AC_CHECK_FILE($LIBFORMULA_JAR, [],
62597aa0a607SDon Lewis         [AC_MSG_ERROR(libformula.jar not found.)], [])
62607aa0a607SDon Lewis  fi
62617aa0a607SDon Lewis
62627aa0a607SDon Lewis  if test -z $LIBREPOSITORY_JAR; then
62637aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
62647aa0a607SDon Lewis      [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
62657aa0a607SDon Lewis      [
62667aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/librepository.jar,
62677aa0a607SDon Lewis          [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
62687aa0a607SDon Lewis          [AC_MSG_ERROR(librepository.jar replacement not found.)]
62697aa0a607SDon Lewis        )
62707aa0a607SDon Lewis      ]
62717aa0a607SDon Lewis    )
62727aa0a607SDon Lewis  else
62737aa0a607SDon Lewis    AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
62747aa0a607SDon Lewis         [AC_MSG_ERROR(librepository.jar not found.)], [])
62757aa0a607SDon Lewis  fi
62767aa0a607SDon Lewis
62777aa0a607SDon Lewis  if test -z $LIBFONTS_JAR; then
62787aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
62797aa0a607SDon Lewis      [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
62807aa0a607SDon Lewis      [
62817aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/libfonts.jar,
62827aa0a607SDon Lewis          [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
62837aa0a607SDon Lewis          [AC_MSG_ERROR(libfonts.jar replacement not found.)]
62847aa0a607SDon Lewis        )
62857aa0a607SDon Lewis      ]
62867aa0a607SDon Lewis    )
62877aa0a607SDon Lewis  else
62887aa0a607SDon Lewis    AC_CHECK_FILE($LIBFONTS_JAR, [],
62897aa0a607SDon Lewis         [AC_MSG_ERROR(libfonts.jar not found.)], [])
62907aa0a607SDon Lewis  fi
62917aa0a607SDon Lewis
62927aa0a607SDon Lewis  if test -z $LIBSERIALIZER_JAR; then
62937aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
62947aa0a607SDon Lewis      [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
62957aa0a607SDon Lewis      [
62967aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/libserializer.jar,
62977aa0a607SDon Lewis          [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
62987aa0a607SDon Lewis          [AC_MSG_ERROR(libserializer.jar replacement not found.)]
62997aa0a607SDon Lewis        )
63007aa0a607SDon Lewis      ]
63017aa0a607SDon Lewis    )
63027aa0a607SDon Lewis  else
63037aa0a607SDon Lewis    AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
63047aa0a607SDon Lewis         [AC_MSG_ERROR(libserializer.jar not found.)], [])
63057aa0a607SDon Lewis  fi
63067aa0a607SDon Lewis
63077aa0a607SDon Lewis
63087aa0a607SDon Lewis  if test -z $LIBBASE_JAR; then
63097aa0a607SDon Lewis    AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
63107aa0a607SDon Lewis      [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
63117aa0a607SDon Lewis      [
63127aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/libbase.jar,
63137aa0a607SDon Lewis          [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
63147aa0a607SDon Lewis          [AC_MSG_ERROR(libbase.jar replacement not found.)]
63157aa0a607SDon Lewis        )
63167aa0a607SDon Lewis      ]
63177aa0a607SDon Lewis    )
63187aa0a607SDon Lewis  else
63197aa0a607SDon Lewis    AC_CHECK_FILE($LIBBASE_JAR, [],
63207aa0a607SDon Lewis         [AC_MSG_ERROR(libbase.jar not found.)], [])
63217aa0a607SDon Lewis  fi
63227aa0a607SDon Lewis  BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
63237aa0a607SDon Lewiselse
63247aa0a607SDon Lewis  AC_MSG_RESULT([no])
63257aa0a607SDon Lewis  ENABLE_REPORTBUILDER=NO
63267aa0a607SDon Lewisfi
63277aa0a607SDon LewisAC_SUBST(ENABLE_REPORTBUILDER)
63287aa0a607SDon LewisAC_SUBST(SYSTEM_JFREEREPORT)
63297aa0a607SDon LewisAC_SUBST(SAC_JAR)
63307aa0a607SDon LewisAC_SUBST(LIBXML_JAR)
63317aa0a607SDon LewisAC_SUBST(FLUTE_JAR)
63327aa0a607SDon LewisAC_SUBST(JFREEREPORT_JAR)
63337aa0a607SDon LewisAC_SUBST(LIBBASE_JAR)
63347aa0a607SDon LewisAC_SUBST(LIBLAYOUT_JAR)
63357aa0a607SDon LewisAC_SUBST(LIBLOADER_JAR)
63367aa0a607SDon LewisAC_SUBST(LIBFORMULA_JAR)
63377aa0a607SDon LewisAC_SUBST(LIBREPOSITORY_JAR)
63387aa0a607SDon LewisAC_SUBST(LIBFONTS_JAR)
63397aa0a607SDon LewisAC_SUBST(LIBSERIALIZER_JAR)
63407aa0a607SDon Lewis
63417aa0a607SDon Lewis# this has to be here because both the wiki publisher and the SRB use
63427aa0a607SDon Lewis# commons-logging
63437aa0a607SDon Lewisif test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
63447aa0a607SDon Lewis  AC_MSG_CHECKING([which Apache commons-* libs to use])
63457aa0a607SDon Lewis  if test "$with_system_apache_commons" = "yes"; then
63467aa0a607SDon Lewis    SYSTEM_APACHE_COMMONS=YES
63477aa0a607SDon Lewis    AC_MSG_RESULT([external])
63487aa0a607SDon Lewis    if test "$ENABLE_MEDIAWIKI" = "YES"; then
63497aa0a607SDon Lewis      if test -z $COMMONS_CODEC_JAR; then
635017435e9bSJuergen Schmidt        AC_CHECK_FILE(/usr/share/java/commons-codec-1.9.jar,
635117435e9bSJuergen Schmidt          [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.9.jar ],
63527aa0a607SDon Lewis          [
63537aa0a607SDon Lewis            AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
63547aa0a607SDon Lewis              [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
63557aa0a607SDon Lewis              [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
63567aa0a607SDon Lewis            )
63577aa0a607SDon Lewis          ]
63587aa0a607SDon Lewis        )
63597aa0a607SDon Lewis      else
63607aa0a607SDon Lewis        AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
63617aa0a607SDon Lewis             [AC_MSG_ERROR(commons-codec.jar not found.)], [])
63627aa0a607SDon Lewis      fi
63637aa0a607SDon Lewis
63647aa0a607SDon Lewis      if test -z $COMMONS_LANG_JAR; then
636517435e9bSJuergen Schmidt        AC_CHECK_FILE(/usr/share/java/commons-lang3-3.3.jar,
636617435e9bSJuergen Schmidt          [ COMMONS_LANG_JAR=/usr/share/java/commons-lang3-3.3.jar ],
63677aa0a607SDon Lewis          [
63687aa0a607SDon Lewis            AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
63697aa0a607SDon Lewis              [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
63707aa0a607SDon Lewis              [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
63717aa0a607SDon Lewis            )
63727aa0a607SDon Lewis          ]
63737aa0a607SDon Lewis        )
63747aa0a607SDon Lewis      else
63757aa0a607SDon Lewis        AC_CHECK_FILE($COMMONS_LANG_JAR, [],
63767aa0a607SDon Lewis             [AC_MSG_ERROR(commons-lang.jar not found.)], [])
63777aa0a607SDon Lewis      fi
63787aa0a607SDon Lewis
63797aa0a607SDon Lewis      if test -z $COMMONS_HTTPCLIENT_JAR; then
63807aa0a607SDon Lewis        AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
63817aa0a607SDon Lewis          [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
63827aa0a607SDon Lewis          [
63837aa0a607SDon Lewis            AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
63847aa0a607SDon Lewis              [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
63857aa0a607SDon Lewis              [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
63867aa0a607SDon Lewis            )
63877aa0a607SDon Lewis          ]
63887aa0a607SDon Lewis        )
63897aa0a607SDon Lewis      else
63907aa0a607SDon Lewis        AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
63917aa0a607SDon Lewis             [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
63927aa0a607SDon Lewis      fi
63937aa0a607SDon Lewis    fi
63947aa0a607SDon Lewis    if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
63957aa0a607SDon Lewis      if test -z $COMMONS_LOGGING_JAR; then
639617435e9bSJuergen Schmidt        AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.3.jar,
639717435e9bSJuergen Schmidt          [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.3.jar ],
63987aa0a607SDon Lewis          [
63997aa0a607SDon Lewis            AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
64007aa0a607SDon Lewis              [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
64017aa0a607SDon Lewis              [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
64027aa0a607SDon Lewis            )
64037aa0a607SDon Lewis          ]
64047aa0a607SDon Lewis        )
64057aa0a607SDon Lewis      else
64067aa0a607SDon Lewis        AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
64077aa0a607SDon Lewis             [AC_MSG_ERROR(commons-logging.jar not found.)], [])
64087aa0a607SDon Lewis      fi
64097aa0a607SDon Lewis    fi
64107aa0a607SDon Lewis  else
64117aa0a607SDon Lewis    AC_MSG_RESULT([internal])
64127aa0a607SDon Lewis    SYSTEM_APACHE_COMMONS=NO
64137aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
64147aa0a607SDon Lewis  fi
64157aa0a607SDon Lewisfi
64167aa0a607SDon LewisAC_SUBST(SYSTEM_APACHE_COMMONS)
64177aa0a607SDon LewisAC_SUBST(COMMONS_CODEC_JAR)
64187aa0a607SDon LewisAC_SUBST(COMMONS_LANG_JAR)
64197aa0a607SDon LewisAC_SUBST(COMMONS_HTTPCLIENT_JAR)
64207aa0a607SDon LewisAC_SUBST(COMMONS_LOGGING_JAR)
64217aa0a607SDon Lewis
64227aa0a607SDon Lewisdnl ===================================================================
64237aa0a607SDon Lewisdnl Check whether the Qt and KDE libraries are available.
64247aa0a607SDon Lewisdnl ===================================================================
64257aa0a607SDon Lewis
64267aa0a607SDon LewisKDE_CFLAGS=""
64277aa0a607SDon LewisKDE_LIBS=""
64287aa0a607SDon LewisMOC="moc"
64297aa0a607SDon Lewisif test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
64307aa0a607SDon Lewis    dnl Search paths for Qt and KDE
64317aa0a607SDon Lewis    if test "$build_cpu" != "x86_64" ; then
64327aa0a607SDon Lewis        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 $x_includes"
64337aa0a607SDon Lewis        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 $x_libraries"
64347aa0a607SDon Lewis    else
64357aa0a607SDon Lewis        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 $x_includes"
64367aa0a607SDon Lewis        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 $x_libraries"
64377aa0a607SDon Lewis    fi
64387aa0a607SDon Lewis    if test -n "$QTDIR" ; then
64397aa0a607SDon Lewis        qt_incdirs="$QTDIR/include $qt_incdirs"
64407aa0a607SDon Lewis        if test "$build_cpu" != "x86_64" ; then
64417aa0a607SDon Lewis            qt_libdirs="$QTDIR/lib $qt_libdirs"
64427aa0a607SDon Lewis        else
64437aa0a607SDon Lewis            qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
64447aa0a607SDon Lewis        fi
64457aa0a607SDon Lewis    fi
64467aa0a607SDon Lewis    if test "$build_cpu" != "x86_64" ; then
64477aa0a607SDon Lewis        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"
64487aa0a607SDon Lewis        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"
64497aa0a607SDon Lewis    else
64507aa0a607SDon Lewis        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"
64517aa0a607SDon Lewis        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"
64527aa0a607SDon Lewis    fi
64537aa0a607SDon Lewis    if test -n "$KDEDIR" ; then
64547aa0a607SDon Lewis        kde_incdirs="$KDEDIR/include $kde_incdirs"
64557aa0a607SDon Lewis        if test "$build_cpu" != "x86_64" ; then
64567aa0a607SDon Lewis            kde_libdirs="$KDEDIR/lib $kde_libdirs"
64577aa0a607SDon Lewis        else
64587aa0a607SDon Lewis            kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
64597aa0a607SDon Lewis        fi
64607aa0a607SDon Lewis    fi
64617aa0a607SDon Lewis
64627aa0a607SDon Lewis    dnl What to test
64637aa0a607SDon Lewis    qt_test_include="qstyle.h"
64647aa0a607SDon Lewis    qt_test_library="libqt-mt.so"
64657aa0a607SDon Lewis    kde_test_include="ksharedptr.h"
64667aa0a607SDon Lewis    kde_test_library="libkdeui.so"
64677aa0a607SDon Lewis
64687aa0a607SDon Lewis    dnl Check for Qt headers
64697aa0a607SDon Lewis    AC_MSG_CHECKING([for Qt headers])
64707aa0a607SDon Lewis    qt_incdir="no"
64717aa0a607SDon Lewis    for kde_check in $qt_incdirs ; do
64727aa0a607SDon Lewis        if test -r "$kde_check/$qt_test_include" ; then
64737aa0a607SDon Lewis            qt_incdir="$kde_check"
64747aa0a607SDon Lewis            break
64757aa0a607SDon Lewis        fi
64767aa0a607SDon Lewis    done
64777aa0a607SDon Lewis    AC_MSG_RESULT([$qt_incdir])
64787aa0a607SDon Lewis    if test "x$qt_incdir" = "xno" ; then
64797aa0a607SDon Lewis        AC_MSG_ERROR([Qt headers not found.  Please specify the root of
64807aa0a607SDon Lewisyour Qt installation by exporting QTDIR before running "configure".])
64817aa0a607SDon Lewis    fi
64827aa0a607SDon Lewis
64837aa0a607SDon Lewis    dnl Check for Qt libraries
64847aa0a607SDon Lewis    AC_MSG_CHECKING([for Qt libraries])
64857aa0a607SDon Lewis    qt_libdir="no"
64867aa0a607SDon Lewis    for qt_check in $qt_libdirs ; do
64877aa0a607SDon Lewis        if test -r "$qt_check/$qt_test_library" ; then
64887aa0a607SDon Lewis            qt_libdir="$qt_check"
64897aa0a607SDon Lewis            break
64907aa0a607SDon Lewis        fi
64917aa0a607SDon Lewis    done
64927aa0a607SDon Lewis    AC_MSG_RESULT([$qt_libdir])
64937aa0a607SDon Lewis    if test "x$qt_libdir" = "xno" ; then
64947aa0a607SDon Lewis        AC_MSG_ERROR([Qt libraries not found.  Please specify the root of
64957aa0a607SDon Lewisyour Qt installation by exporting QTDIR before running "configure".])
64967aa0a607SDon Lewis    fi
64977aa0a607SDon Lewis
64987aa0a607SDon Lewis    dnl Check for Meta Object Compiler
64997aa0a607SDon Lewis    AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
65007aa0a607SDon Lewis    if test "$MOC" = "no" ; then
65017aa0a607SDon Lewis        AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
65027aa0a607SDon Lewisthe root of your Qt installation by exporting QTDIR before running "configure".])
65037aa0a607SDon Lewis    fi
65047aa0a607SDon Lewis
65057aa0a607SDon Lewis    dnl Check for KDE headers
65067aa0a607SDon Lewis    AC_MSG_CHECKING([for KDE headers])
65077aa0a607SDon Lewis    kde_incdir="no"
65087aa0a607SDon Lewis    for kde_check in $kde_incdirs ; do
65097aa0a607SDon Lewis        if test -r "$kde_check/$kde_test_include" ; then
65107aa0a607SDon Lewis            kde_incdir="$kde_check"
65117aa0a607SDon Lewis            break
65127aa0a607SDon Lewis        fi
65137aa0a607SDon Lewis    done
65147aa0a607SDon Lewis    AC_MSG_RESULT([$kde_incdir])
65157aa0a607SDon Lewis    if test "x$kde_incdir" = "xno" ; then
65167aa0a607SDon Lewis        AC_MSG_ERROR([KDE headers not found.  Please specify the root of
65177aa0a607SDon Lewisyour KDE installation by exporting KDEDIR before running "configure".])
65187aa0a607SDon Lewis    fi
65197aa0a607SDon Lewis
65207aa0a607SDon Lewis    dnl Check for KDE libraries
65217aa0a607SDon Lewis    AC_MSG_CHECKING([for KDE libraries])
65227aa0a607SDon Lewis    kde_libdir="no"
65237aa0a607SDon Lewis    for kde_check in $kde_libdirs ; do
65247aa0a607SDon Lewis        if test -r "$kde_check/$kde_test_library" ; then
65257aa0a607SDon Lewis            kde_libdir="$kde_check"
65267aa0a607SDon Lewis            break
65277aa0a607SDon Lewis        fi
65287aa0a607SDon Lewis    done
65297aa0a607SDon Lewis    AC_MSG_RESULT([$kde_libdir])
65307aa0a607SDon Lewis    if test "x$kde_libdir" = "xno" ; then
65317aa0a607SDon Lewis        AC_MSG_ERROR([KDE libraries not found.  Please specify the root of
65327aa0a607SDon Lewisyour KDE installation by exporting KDEDIR before running "configure".])
65337aa0a607SDon Lewis    fi
65347aa0a607SDon Lewis
65357aa0a607SDon Lewis    dnl Set the variables
65367aa0a607SDon Lewis    KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
65377aa0a607SDon Lewis    KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
65387aa0a607SDon Lewisfi
65397aa0a607SDon LewisAC_SUBST(KDE_CFLAGS)
65407aa0a607SDon LewisAC_SUBST(KDE_LIBS)
65417aa0a607SDon LewisAC_SUBST(MOC)
65427aa0a607SDon Lewis
65437aa0a607SDon Lewisdnl ===================================================================
65447aa0a607SDon Lewisdnl KDE4 Integration
65457aa0a607SDon Lewisdnl ===================================================================
65467aa0a607SDon Lewis
65477aa0a607SDon LewisKDE4_CFLAGS=""
65487aa0a607SDon LewisKDE4_LIBS=""
65497aa0a607SDon LewisMOC4="moc"
65507aa0a607SDon Lewisif test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
65517aa0a607SDon Lewis   qt_incdirs="$QT4INC $QT4DIR /usr/include/qt4 /usr/include $x_includes"
65527aa0a607SDon Lewis   qt_libdirs="$QT4LIB /usr/lib $x_libraries"
65537aa0a607SDon Lewis
65547aa0a607SDon Lewis   kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
65557aa0a607SDon Lewis   kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
65567aa0a607SDon Lewis
65577aa0a607SDon Lewis   if test "$build_cpu" = "x86_64" ; then
65587aa0a607SDon Lewis      qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
65597aa0a607SDon Lewis      kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
65607aa0a607SDon Lewis   fi
65617aa0a607SDon Lewis
65627aa0a607SDon Lewis   if test -n "$KDE4DIR" ; then
65637aa0a607SDon Lewis      kde_incdirs="$KDE4DIR/include $kde_incdirs"
65647aa0a607SDon Lewis      if test "$build_cpu" != "x86_64" ; then
65657aa0a607SDon Lewis         kde_libdirs="$KDE4DIR/lib $kde_libdirs"
65667aa0a607SDon Lewis      else
65677aa0a607SDon Lewis         kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
65687aa0a607SDon Lewis      fi
65697aa0a607SDon Lewis   fi
65707aa0a607SDon Lewis
65717aa0a607SDon Lewis   qt_test_include="Qt/qobject.h"
65727aa0a607SDon Lewis   qt_test_library="libQtCore.so"
65737aa0a607SDon Lewis   kde_test_include="ksharedptr.h"
65747aa0a607SDon Lewis   kde_test_library="libkdeui.so"
65757aa0a607SDon Lewis
65767aa0a607SDon Lewis   AC_MSG_CHECKING([for Qt4 headers])
65777aa0a607SDon Lewis   qt_header_dir="no"
65787aa0a607SDon Lewis   for inc_dir in $qt_incdirs ; do
65797aa0a607SDon Lewis      if test -r "$inc_dir/$qt_test_include" ; then
65807aa0a607SDon Lewis         qt_header_dir="$inc_dir"
65817aa0a607SDon Lewis         break
65827aa0a607SDon Lewis      fi
65837aa0a607SDon Lewis   done
65847aa0a607SDon Lewis
65857aa0a607SDon Lewis   AC_MSG_RESULT([$qt_header_dir])
65867aa0a607SDon Lewis   if test "x$qt_header_dir" = "xno" ; then
65877aa0a607SDon Lewis      AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
65887aa0a607SDon Lewis   fi
65897aa0a607SDon Lewis
65907aa0a607SDon Lewis   AC_MSG_CHECKING([for Qt4 libraries])
65917aa0a607SDon Lewis   qt_lib_dir="no"
65927aa0a607SDon Lewis   for lib_dir in $qt_libdirs ; do
65937aa0a607SDon Lewis      if test -r "$lib_dir/$qt_test_library" ; then
65947aa0a607SDon Lewis         qt_lib_dir="$lib_dir"
65957aa0a607SDon Lewis         break
65967aa0a607SDon Lewis      fi
65977aa0a607SDon Lewis   done
65987aa0a607SDon Lewis
65997aa0a607SDon Lewis   AC_MSG_RESULT([$qt_lib_dir])
66007aa0a607SDon Lewis
66017aa0a607SDon Lewis   if test "x$qt_lib_dir" = "xno" ; then
66027aa0a607SDon Lewis      AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
66037aa0a607SDon Lewis   fi
66047aa0a607SDon Lewis
66057aa0a607SDon Lewis   dnl Check for Meta Object Compiler
66067aa0a607SDon Lewis   AC_PATH_PROG( MOCQT4, moc-qt4, no, [$QT4DIR/bin:$PATH] )
66077aa0a607SDon Lewis   MOC4="$MOCQT4"
66087aa0a607SDon Lewis   if test "$MOC4" = "no" ; then
66097aa0a607SDon Lewis      AC_PATH_PROG( MOC4, moc, no, [$PATH:$QT4DIR/bin] )
66107aa0a607SDon Lewis      if test "$MOC4" = "no" ; then
66117aa0a607SDon Lewis         AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
66127aa0a607SDon Lewis      fi
66137aa0a607SDon Lewis   fi
66147aa0a607SDon Lewis
66157aa0a607SDon Lewis   dnl Check for KDE4 headers
66167aa0a607SDon Lewis   AC_MSG_CHECKING([for KDE4 headers])
66177aa0a607SDon Lewis   kde_incdir="no"
66187aa0a607SDon Lewis   for kde_check in $kde_incdirs ; do
66197aa0a607SDon Lewis      if test -r "$kde_check/$kde_test_include" ; then
66207aa0a607SDon Lewis         kde_incdir="$kde_check"
66217aa0a607SDon Lewis         break
66227aa0a607SDon Lewis      fi
66237aa0a607SDon Lewis   done
66247aa0a607SDon Lewis   AC_MSG_RESULT([$kde_incdir])
66257aa0a607SDon Lewis   if test "x$kde_incdir" = "xno" ; then
66267aa0a607SDon Lewis      AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
66277aa0a607SDon Lewis   fi
66287aa0a607SDon Lewis
66297aa0a607SDon Lewis   dnl Check for KDE4 libraries
66307aa0a607SDon Lewis   AC_MSG_CHECKING([for KDE4 libraries])
66317aa0a607SDon Lewis   kde_libdir="no"
66327aa0a607SDon Lewis   for kde_check in $kde_libdirs ; do
66337aa0a607SDon Lewis      if test -r "$kde_check/$kde_test_library" ; then
66347aa0a607SDon Lewis         kde_libdir="$kde_check"
66357aa0a607SDon Lewis         break
66367aa0a607SDon Lewis      fi
66377aa0a607SDon Lewis   done
66387aa0a607SDon Lewis
66397aa0a607SDon Lewis   AC_MSG_RESULT([$kde_libdir])
66407aa0a607SDon Lewis   if test "x$kde_libdir" = "xno" ; then
66417aa0a607SDon Lewis      AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
66427aa0a607SDon Lewis   fi
66437aa0a607SDon Lewis
66447aa0a607SDon Lewis   KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
66457aa0a607SDon Lewis   KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
66467aa0a607SDon Lewisfi
66477aa0a607SDon LewisAC_SUBST(KDE4_CFLAGS)
66487aa0a607SDon LewisAC_SUBST(KDE4_LIBS)
66497aa0a607SDon LewisAC_SUBST(MOC4)
66507aa0a607SDon Lewis
66517aa0a607SDon Lewisdnl ===================================================================
66527aa0a607SDon Lewisdnl Test for the enabling the lockdown pieces
66537aa0a607SDon Lewisdnl ===================================================================
66547aa0a607SDon LewisAC_MSG_CHECKING([whether to enable the lockdown pieces])
66557aa0a607SDon LewisENABLE_LOCKDOWN=""
66567aa0a607SDon Lewisif test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
66577aa0a607SDon Lewis  ENABLE_LOCKDOWN=YES
66587aa0a607SDon Lewis  AC_MSG_RESULT([yes])
66597aa0a607SDon Lewiselse
66607aa0a607SDon Lewis  AC_MSG_RESULT([no])
66617aa0a607SDon Lewisfi
66627aa0a607SDon LewisAC_SUBST(ENABLE_LOCKDOWN)
66637aa0a607SDon Lewis
66647aa0a607SDon Lewisdnl ===================================================================
66657aa0a607SDon Lewisdnl Test whether to include Evolution 2 support
66667aa0a607SDon Lewisdnl ===================================================================
66677aa0a607SDon LewisAC_MSG_CHECKING([whether to enable evolution 2 support])
66687aa0a607SDon Lewisif test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
66697aa0a607SDon Lewis   AC_MSG_RESULT([yes])
66707aa0a607SDon Lewis   PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
66717aa0a607SDon Lewis   ENABLE_EVOAB2="TRUE"
66727aa0a607SDon Lewiselse
66737aa0a607SDon Lewis   ENABLE_EVOAB2=""
66747aa0a607SDon Lewis   AC_MSG_RESULT([no])
66757aa0a607SDon Lewisfi
66767aa0a607SDon LewisAC_SUBST(ENABLE_EVOAB2)
66777aa0a607SDon LewisAC_SUBST(GOBJECT_CFLAGS)
66787aa0a607SDon LewisAC_SUBST(GOBJECT_LIBS)
66797aa0a607SDon Lewis
66807aa0a607SDon Lewisdnl ===================================================================
66817aa0a607SDon Lewisdnl Test whether to include KDE AB support
66827aa0a607SDon Lewisdnl ===================================================================
66837aa0a607SDon LewisAC_MSG_CHECKING([whether to enable KDE address book support])
66847aa0a607SDon Lewisif test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then
66857aa0a607SDon Lewis   AC_MSG_RESULT([yes])
66867aa0a607SDon Lewis   AC_LANG_PUSH([C++])
66877aa0a607SDon Lewis   save_CXXFLAGS=$CXXFLAGS
66887aa0a607SDon Lewis   CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
66897aa0a607SDon Lewis   AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
66907aa0a607SDon Lewis       AC_TRY_RUN([
66917aa0a607SDon Lewis#include <kdeversion.h>
66927aa0a607SDon Lewis
66937aa0a607SDon Lewisint main(int argc, char **argv) {
66947aa0a607SDon Lewis       if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
66957aa0a607SDon Lewis       else return 1;
66967aa0a607SDon Lewis}
66977aa0a607SDon Lewis       ], [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])])
66987aa0a607SDon Lewis   CXXFLAGS=$save_CXXFLAGS
66997aa0a607SDon Lewis   AC_LANG_POP([C++])
67007aa0a607SDon Lewis   ENABLE_KAB=TRUE
67017aa0a607SDon Lewiselse
67027aa0a607SDon Lewis   AC_MSG_RESULT([no])
67037aa0a607SDon Lewis   ENABLE_KAB=
67047aa0a607SDon Lewisfi
67057aa0a607SDon LewisAC_SUBST(ENABLE_KAB)
67067aa0a607SDon Lewis
67077aa0a607SDon Lewisdnl ===================================================================
67087aa0a607SDon Lewisdnl Test whether to include MathMLDTD
67097aa0a607SDon Lewisdnl ===================================================================
67107aa0a607SDon LewisAC_MSG_CHECKING([whether to include MathMLDTD])
67117aa0a607SDon Lewisif test -n "$enable_mathmldtd"; then
67127aa0a607SDon Lewis  if test "$enable_mathmldtd" = "no"; then
67137aa0a607SDon Lewis    AC_MSG_RESULT([no])
67147aa0a607SDon Lewis    SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
67157aa0a607SDon Lewis  else
67167aa0a607SDon Lewis    AC_MSG_RESULT([yes])
67177aa0a607SDon Lewis    BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
67187aa0a607SDon Lewis  fi
67197aa0a607SDon Lewiselse
67207aa0a607SDon Lewis  AC_MSG_RESULT([no])
67217aa0a607SDon Lewis  SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
67227aa0a607SDon Lewisfi
67237aa0a607SDon Lewis
67247aa0a607SDon Lewisdnl ===================================================================
67257aa0a607SDon Lewisdnl Test whether to include category-B fonts
67267aa0a607SDon Lewisdnl ===================================================================
67277aa0a607SDon LewisWITH_CATB_FONTS=
67287aa0a607SDon LewisAC_MSG_CHECKING([whether to include category B fonts])
67297aa0a607SDon Lewisif test "x$enable_category_b_fonts" = "xyes" && test "x$with_fonts" != "xno"; then
67307aa0a607SDon Lewis   AC_MSG_RESULT([yes])
67317aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE CATB_FONTS"
67327aa0a607SDon Lewis   WITH_CATB_FONTS=YES
67337aa0a607SDon Lewis   SCPDEFS="$SCPDEFS -DWITH_CATB_FONTS"
67347aa0a607SDon Lewiselse
67357aa0a607SDon Lewis   AC_MSG_RESULT([no])
67367aa0a607SDon Lewis   WITH_CATB_FONTS=NO
67377aa0a607SDon Lewisfi
67387aa0a607SDon Lewis
67397aa0a607SDon Lewisdnl ===================================================================
67407aa0a607SDon Lewisdnl Test whether to include category-A fonts
67417aa0a607SDon Lewisdnl ===================================================================
67427aa0a607SDon LewisWITH_CATA_FONTS=
67437aa0a607SDon LewisAC_MSG_CHECKING([whether to include category A fonts])
67447aa0a607SDon Lewisif test "x$with_fonts" != "xno" ; then
67457aa0a607SDon Lewis  AC_MSG_RESULT([yes])
67467aa0a607SDon Lewis  WITH_CATA_FONTS=YES
67477aa0a607SDon Lewis  SCPDEFS="$SCPDEFS -DWITH_CATA_FONTS"
67487aa0a607SDon Lewiselse
67497aa0a607SDon Lewis  AC_MSG_RESULT([no])
67507aa0a607SDon Lewis  WITH_CATA_FONTS=NO
67517aa0a607SDon Lewis  WITH_CATB_FONTS=NO
67527aa0a607SDon Lewisfi
67537aa0a607SDon Lewis
67547aa0a607SDon LewisWITH_FONTS=NO
67557aa0a607SDon LewisAC_MSG_CHECKING([whether any fonts are included])
67567aa0a607SDon Lewisif test "x$WITH_CATA_FONTS" = "xYES" -o "x$WITH_CATB_FONTS" = "xYES"; then
67577aa0a607SDon Lewis  BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
67587aa0a607SDon Lewis  WITH_FONTS=YES
67597aa0a607SDon Lewis  AC_MSG_RESULT([yes])
67607aa0a607SDon Lewiselse
67617aa0a607SDon Lewis  AC_MSG_RESULT([no])
67627aa0a607SDon Lewisfi
67637aa0a607SDon Lewis
67647aa0a607SDon LewisAC_SUBST(WITH_CATA_FONTS)
67657aa0a607SDon LewisAC_SUBST(WITH_CATB_FONTS)
67667aa0a607SDon LewisAC_SUBST(WITH_FONTS)
67677aa0a607SDon Lewis
67687aa0a607SDon Lewisdnl ===================================================================
67697aa0a607SDon Lewisdnl Test whether to include ppds
67707aa0a607SDon Lewisdnl ===================================================================
67717aa0a607SDon LewisAC_MSG_CHECKING([whether to include PPDs])
67727aa0a607SDon Lewisif test "$with_ppds" != "no"; then
67737aa0a607SDon Lewis  AC_MSG_RESULT([yes])
67747aa0a607SDon Lewiselse
67757aa0a607SDon Lewis  AC_MSG_RESULT([no])
67767aa0a607SDon Lewis  WITHOUT_PPDS=YES
67777aa0a607SDon Lewis  SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
67787aa0a607SDon Lewisfi
67797aa0a607SDon LewisAC_SUBST(WITHOUT_PPDS)
67807aa0a607SDon Lewis
67817aa0a607SDon Lewisdnl ===================================================================
67827aa0a607SDon Lewisdnl Test whether to include afms
67837aa0a607SDon Lewisdnl ===================================================================
67847aa0a607SDon LewisAC_MSG_CHECKING([whether to include AFMs])
67857aa0a607SDon Lewisif test "$with_afms" != "no"; then
67867aa0a607SDon Lewis  AC_MSG_RESULT([yes])
67877aa0a607SDon Lewis  BUILD_TYPE="$BUILD_TYPE AFMS"
67887aa0a607SDon Lewiselse
67897aa0a607SDon Lewis  AC_MSG_RESULT([no])
67907aa0a607SDon Lewis  WITHOUT_AFMS=YES
67917aa0a607SDon Lewis  SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
67927aa0a607SDon Lewisfi
67937aa0a607SDon LewisAC_SUBST(WITHOUT_AFMS)
67947aa0a607SDon Lewis
67957aa0a607SDon LewisAC_SUBST(SCPDEFS)
67967aa0a607SDon Lewis
67977aa0a607SDon LewisAC_MSG_CHECKING([whether and how to use Xinerama])
67987aa0a607SDon Lewisif test "$_os" = "Darwin"; then
67997aa0a607SDon Lewis   USE_XINERAMA=YES
68007aa0a607SDon Lewis   XINERAMA_LINK=dynamic
68017aa0a607SDon Lewis   AC_MSG_RESULT([yes])
68027aa0a607SDon Lewiselif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
68037aa0a607SDon Lewis   if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then
68047aa0a607SDon Lewis      # we have both versions, let the user decide but use the dynamic one
68057aa0a607SDon Lewis      # per default
68067aa0a607SDon Lewis      USE_XINERAMA=YES
68077aa0a607SDon Lewis      if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
68087aa0a607SDon Lewis         XINERAMA_LINK=dynamic
68097aa0a607SDon Lewis      else
68107aa0a607SDon Lewis         XINERAMA_LINK=static
68117aa0a607SDon Lewis      fi
68127aa0a607SDon Lewis   elif test -e "$XLIB/libXinerama.so" -a ! -e "$XLIB/libXinerama.a"; then
68137aa0a607SDon Lewis      # we have only the dynamic version
68147aa0a607SDon Lewis      USE_XINERAMA=YES
68157aa0a607SDon Lewis      XINERAMA_LINK=dynamic
68167aa0a607SDon Lewis   elif test -e "$XLIB/libXinerama.a"; then
68177aa0a607SDon Lewis      # static version
68187aa0a607SDon Lewis      if echo $build_cpu | grep -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
68197aa0a607SDon Lewis         USE_XINERAMA=YES
68207aa0a607SDon Lewis         XINERAMA_LINK=static
68217aa0a607SDon Lewis      else
68227aa0a607SDon Lewis         USE_XINERAMA=NO
68237aa0a607SDon Lewis         XINERAMA_LINK=none
68247aa0a607SDon Lewis      fi
68257aa0a607SDon Lewis   else
68267aa0a607SDon Lewis      # no Xinerama
68277aa0a607SDon Lewis      USE_XINERAMA=NO
68287aa0a607SDon Lewis      XINERAMA_LINK=none
68297aa0a607SDon Lewis   fi
68307aa0a607SDon Lewis   if test "$USE_XINERAMA" = "YES"; then
68317aa0a607SDon Lewis      AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
68327aa0a607SDon Lewis      AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
68337aa0a607SDon Lewis          [AC_MSG_ERROR(Xinerama header not found.)], [])
68347aa0a607SDon Lewis      XINERAMA_EXTRA_LIBS="-L$XLIB -lXext"
68357aa0a607SDon Lewis      if test "$_os" = "FreeBSD"; then
68367aa0a607SDon Lewis          XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
68377aa0a607SDon Lewis      fi
68387aa0a607SDon Lewis      if test "$_os" = "Linux"; then
68397aa0a607SDon Lewis          XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
68407aa0a607SDon Lewis      fi
68417aa0a607SDon Lewis      AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
68427aa0a607SDon Lewis          [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
68437aa0a607SDon Lewis   else
68447aa0a607SDon Lewis      AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
68457aa0a607SDon Lewis   fi
68467aa0a607SDon Lewiselse
68477aa0a607SDon Lewis   AC_MSG_RESULT([no])
68487aa0a607SDon Lewisfi
68497aa0a607SDon LewisAC_SUBST(USE_XINERAMA)
68507aa0a607SDon LewisAC_SUBST(XINERAMA_LINK)
68517aa0a607SDon Lewis
68527aa0a607SDon Lewisdnl ===================================================================
68537aa0a607SDon Lewisdnl always rely on the system version of gdk-pixbuf
68547aa0a607SDon Lewisdnl ===================================================================
68557aa0a607SDon Lewis
68567aa0a607SDon LewisSYSTEM_GDKPIXBUF=YES
68577aa0a607SDon LewisAC_SUBST(SYSTEM_GDKPIXBUF)
68587aa0a607SDon Lewis
68597aa0a607SDon Lewisdnl ===================================================================
68607aa0a607SDon Lewisdnl always rely on the system version of glib
68617aa0a607SDon Lewisdnl ===================================================================
68627aa0a607SDon Lewis
68637aa0a607SDon LewisSYSTEM_GLIB=YES
68647aa0a607SDon LewisAC_SUBST(SYSTEM_GLIB)
68657aa0a607SDon Lewis
68667aa0a607SDon Lewisdnl ===================================================================
68677aa0a607SDon Lewisdnl always rely on the system version of gettext
68687aa0a607SDon Lewisdnl ===================================================================
68697aa0a607SDon Lewis
68707aa0a607SDon LewisSYSTEM_GETTEXT=YES
68717aa0a607SDon LewisAC_SUBST(SYSTEM_GETTEXT)
68727aa0a607SDon Lewis
68737aa0a607SDon Lewisif test "$_os" = "FreeBSD"; then
68747aa0a607SDon Lewis    LIBINTL_PREFIX=
68757aa0a607SDon Lewis    for dir in $CPPFLAGS; do
68767aa0a607SDon Lewis      if dir=`expr -- $dir : '-I\(.*\)'`; then
68777aa0a607SDon Lewis        if test -f "$dir/libintl.h" ; then
68787aa0a607SDon Lewis          LIBINTL_PREFIX=`dirname $dir`
68797aa0a607SDon Lewis        fi
68807aa0a607SDon Lewis      fi
68817aa0a607SDon Lewis    done
68827aa0a607SDon Lewis    AC_SUBST(LIBINTL_PREFIX)
68837aa0a607SDon Lewisfi
68847aa0a607SDon Lewis
68857aa0a607SDon Lewisdnl ===================================================================
68867aa0a607SDon Lewisdnl always rely on the system version of pango
68877aa0a607SDon Lewisdnl ===================================================================
68887aa0a607SDon Lewis
68897aa0a607SDon LewisSYSTEM_PANGO=YES
68907aa0a607SDon LewisAC_SUBST(SYSTEM_PANGO)
68917aa0a607SDon Lewis
68927aa0a607SDon Lewisdnl ===================================================================
68937aa0a607SDon Lewisdnl Test whether to build libpng or rely on the system version
68947aa0a607SDon Lewisdnl ===================================================================
68957aa0a607SDon LewisAC_MSG_CHECKING([whether to build own version of libpng])
68967aa0a607SDon Lewis
68977aa0a607SDon Lewiscase "$_os" in
68987aa0a607SDon Lewis	WINNT*) # Windows
68997aa0a607SDon Lewis	    SYSTEM_LIBPNG=NO
69007aa0a607SDon Lewis	    AC_MSG_RESULT([yes])
69017aa0a607SDon Lewis		;;
69027aa0a607SDon Lewis	Darwin*)
69037aa0a607SDon Lewis	    SYSTEM_LIBPNG=NO
69047aa0a607SDon Lewis	    AC_MSG_RESULT([yes])
69057aa0a607SDon Lewis	    ;;
69067aa0a607SDon Lewis   *)
69077aa0a607SDon Lewis   SYSTEM_LIBPNG=YES
69087aa0a607SDon Lewis   AC_MSG_RESULT([no])
69097aa0a607SDon Lewis   ;;
69107aa0a607SDon Lewisesac
69117aa0a607SDon LewisAC_SUBST(SYSTEM_LIBPNG)
69127aa0a607SDon Lewis
69137aa0a607SDon Lewisdnl ===================================================================
69147aa0a607SDon Lewisdnl Test whether to build libjpeg or rely on the system version
69157aa0a607SDon Lewisdnl ===================================================================
69167aa0a607SDon Lewisdnl FIXME: this is currently because we have jpeg-6b for our filters
69177aa0a607SDon Lewisdnl        and jpeg-8 as dependency for librsvg
69187aa0a607SDon Lewisdnl        this should be unified into using only one version for both
69197aa0a607SDon Lewis
69207aa0a607SDon LewisAC_MSG_CHECKING([whether to build own version of libjpeg])
69217aa0a607SDon Lewis
69227aa0a607SDon Lewisif test "$SYSTEM_JPEG" = "YES"; then
69237aa0a607SDon LewisSYSTEM_LIBJPEG=YES
69247aa0a607SDon Lewiselse
69257aa0a607SDon Lewiscase "$_os" in
69267aa0a607SDon Lewis	WINNT*) # Windows
69277aa0a607SDon Lewis	    SYSTEM_LIBJPEG=NO
69287aa0a607SDon Lewis		;;
69297aa0a607SDon Lewis	Darwin*)
69307aa0a607SDon Lewis	    SYSTEM_LIBJPEG=NO
69317aa0a607SDon Lewis	    ;;
69327aa0a607SDon Lewis   *)
69337aa0a607SDon Lewis        SYSTEM_LIBJPEG=YES
69347aa0a607SDon Lewis        ;;
69357aa0a607SDon Lewisesac
69367aa0a607SDon Lewisfi
69377aa0a607SDon Lewis
69387aa0a607SDon Lewisif test "$SYSTEM_LIBJPEG" = "YES"; then
69397aa0a607SDon Lewis   AC_MSG_RESULT([no])
69407aa0a607SDon Lewiselse
69417aa0a607SDon Lewis   AC_MSG_RESULT([yes])
69427aa0a607SDon Lewisfi
69437aa0a607SDon LewisAC_SUBST(SYSTEM_LIBJPEG)
69447aa0a607SDon Lewis
69457aa0a607SDon Lewisdnl ===================================================================
69467aa0a607SDon Lewisdnl Test whether rat scan was requested and whether apache-rat is available
69477aa0a607SDon Lewisdnl ===================================================================
69487aa0a607SDon LewisRAT_JAR=
69497aa0a607SDon LewisAC_MSG_CHECKING([whether to trigger rat scan])
69507aa0a607SDon Lewisif test -z "$with_rat_scan" -o "$with_rat_scan" = "no"; then
69517aa0a607SDon Lewis    AC_MSG_RESULT([no])
69527aa0a607SDon Lewiselse
69537aa0a607SDon Lewis    if test "$WITH_JAVA" = "no"; then
69547aa0a607SDon Lewis        AC_MSG_ERROR([no, java disabled, enable with --with-java])
69557aa0a607SDon Lewis    elif test "$enable_saxon" = "no"; then
69567aa0a607SDon Lewis        AC_MSG_ERROR([no, saxon disabled, enable with --enable-category-b])
69577aa0a607SDon Lewis    elif test "$with_rat_scan" = "yes"; then
69587aa0a607SDon Lewis        AC_MSG_RESULT([yes, use pre-built library])
69597aa0a607SDon Lewis        RAT_JAR_HOME="BUILD"
69607aa0a607SDon Lewis        BUILD_TYPE="$BUILD_TYPE RAT"
69617aa0a607SDon Lewis    else
69627aa0a607SDon Lewis        AC_MSG_RESULT([yes, use pre-installed library])
69637aa0a607SDon Lewis        AC_MSG_CHECKING([whether apache-rat is available])
69647aa0a607SDon Lewis        if test -d "$with_rat_scan"; then
69657aa0a607SDon Lewis            RAT_JAR_HOME=$with_rat_scan
69667aa0a607SDon Lewis        else
69677aa0a607SDon Lewis            AC_MSG_ERROR([$with_rat_scan is not a directory])
69687aa0a607SDon Lewis        fi
69697aa0a607SDon Lewis    fi
69707aa0a607SDon Lewisfi
69717aa0a607SDon LewisAC_SUBST(RAT_JAR_HOME)
69727aa0a607SDon Lewis
69737aa0a607SDon Lewis
69747aa0a607SDon Lewisdnl ===================================================================
69757aa0a607SDon Lewisdnl Test for the presence of Ant and that it works
69767aa0a607SDon Lewisdnl ===================================================================
69777aa0a607SDon Lewis
69787aa0a607SDon Lewisif test "$SOLAR_JAVA" != ""; then
69797aa0a607SDon LewisANT_HOME=; export ANT_HOME
69807aa0a607SDon LewisWITH_ANT_HOME=; export WITH_ANT_HOME
69817aa0a607SDon Lewisif test -z "$with_ant_home"; then
69827aa0a607SDon Lewis   if test "$_os" = "OS2"; then
69837aa0a607SDon Lewis     AC_PATH_PROGS(ANT, ant.cmd)
69847aa0a607SDon Lewis   else
69857aa0a607SDon Lewis     AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
69867aa0a607SDon Lewis   fi
69877aa0a607SDon Lewiselse
69887aa0a607SDon Lewis   if test "$_os" = "WINNT"; then
69897aa0a607SDon Lewis      with_ant_home=`cygpath -u "$with_ant_home"`
69907aa0a607SDon Lewis   fi
69917aa0a607SDon Lewis   if test "$_os" = "OS2"; then
69927aa0a607SDon Lewis     AC_PATH_PROGS(ANT, ant.cmd,,$with_ant_home/bin:$PATH)
69937aa0a607SDon Lewis   else
69947aa0a607SDon Lewis     AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
69957aa0a607SDon Lewis   fi
69967aa0a607SDon Lewis   WITH_ANT_HOME=$with_ant_home
69977aa0a607SDon Lewis   ANT_HOME=$with_ant_home
69987aa0a607SDon Lewisfi
69997aa0a607SDon Lewis
70007aa0a607SDon Lewisif test -z "$ANT"; then
70017aa0a607SDon Lewis  AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
70027aa0a607SDon Lewiselse
70037aa0a607SDon Lewis  # resolve relative or absolute symlink
70047aa0a607SDon Lewis  while test -h "$ANT"; do
70057aa0a607SDon Lewis     a_cwd=`pwd`
70067aa0a607SDon Lewis     a_basename=`basename "$ANT"`
70077aa0a607SDon Lewis     a_script=`ls -l "$ANT" | sed "s/.*${a_basename} -> //g"`
70087aa0a607SDon Lewis     cd "`dirname "$ANT"`"
70097aa0a607SDon Lewis     cd "`dirname "$a_script"`"
70107aa0a607SDon Lewis     ANT="`pwd`"/"`basename "$a_script"`"
70117aa0a607SDon Lewis     cd "$a_cwd"
70127aa0a607SDon Lewis  done
70137aa0a607SDon Lewis
70147aa0a607SDon Lewis  if test "$_os" = "OS2"; then
70157aa0a607SDon Lewis    ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
70167aa0a607SDon Lewis    export ANT_HOME
70177aa0a607SDon Lewis  fi
70187aa0a607SDon Lewis
70197aa0a607SDon Lewis  AC_MSG_CHECKING([if $ANT works])
70207aa0a607SDon Lewiscat > conftest.java << EOF
70217aa0a607SDon Lewis    public class conftest {
70227aa0a607SDon Lewis	int testmethod(int a, int b) {
70237aa0a607SDon Lewis            return a + b;
70247aa0a607SDon Lewis	}
70257aa0a607SDon Lewis    }
70267aa0a607SDon LewisEOF
70277aa0a607SDon Lewis
70287aa0a607SDon Lewiscat > conftest.xml << EOF
70297aa0a607SDon Lewis    <project name="conftest" default="conftest">
70307aa0a607SDon Lewis	<target name="conftest">
70317aa0a607SDon Lewis            <javac srcdir="." includes="conftest.java">
70327aa0a607SDon Lewis	    </javac>
70337aa0a607SDon Lewis	</target>
70347aa0a607SDon Lewis    </project>
70357aa0a607SDon LewisEOF
70367aa0a607SDon Lewis  oldJAVA_HOME=$JAVA_HOME
70377aa0a607SDon Lewis  if test "$JAVACISGCJ" = "yes"; then
70387aa0a607SDon Lewis    JAVA_HOME=; export JAVA_HOME
70397aa0a607SDon Lewis    ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
70407aa0a607SDon Lewis  else
70417aa0a607SDon Lewis    ant_cmd="$ANT -buildfile conftest.xml 1>&2"
70427aa0a607SDon Lewis  fi
70437aa0a607SDon Lewis  AC_TRY_EVAL(ant_cmd)
70447aa0a607SDon Lewis  if test $? = 0 && test -f ./conftest.class ; then
70457aa0a607SDon Lewis    AC_MSG_RESULT([Ant works])
70467aa0a607SDon Lewis    if test -z "$WITH_ANT_HOME"; then
70477aa0a607SDon Lewis        ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
70487aa0a607SDon Lewis        if test -z "$ANT_HOME"; then
70497aa0a607SDon Lewis            ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
70507aa0a607SDon Lewis        fi
70517aa0a607SDon Lewis    else
70527aa0a607SDon Lewis        ANT_HOME="$WITH_ANT_HOME"
70537aa0a607SDon Lewis    fi
70547aa0a607SDon Lewis  else
70557aa0a607SDon Lewis    echo "configure: Ant test failed" >&5
70567aa0a607SDon Lewis    cat conftest.java >&5
70577aa0a607SDon Lewis    cat conftest.xml >&5
70587aa0a607SDon Lewis    AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
70597aa0a607SDon Lewis    ANT_HOME=""
70607aa0a607SDon Lewis    echo "Ant does not work - Some Java projects will not build!" >>warn
70617aa0a607SDon Lewis  fi
70627aa0a607SDon Lewis  JAVA_HOME=$oldJAVA_HOME
70637aa0a607SDon Lewis  rm -f conftest* core core.* *.core
70647aa0a607SDon Lewisfi
70657aa0a607SDon Lewisif test -z "$ANT_HOME"; then
70667aa0a607SDon Lewis   ANT_HOME="NO_ANT_HOME"
70677aa0a607SDon Lewisfi
70687aa0a607SDon LewisAC_SUBST(ANT_HOME)
70697aa0a607SDon Lewis
70707aa0a607SDon Lewisdnl Checking for ant.jar
70717aa0a607SDon Lewisif test "$ANT_HOME" != "NO_ANT_HOME"; then
70727aa0a607SDon Lewis   AC_MSG_CHECKING([Ant lib directory])
70737aa0a607SDon Lewis   if test -f $ANT_HOME/lib/ant.jar; then
70747aa0a607SDon Lewis	  ANT_LIB="$ANT_HOME/lib"
70757aa0a607SDon Lewis   else
70767aa0a607SDon Lewis      if test -f $ANT_HOME/ant.jar; then
70777aa0a607SDon Lewis	     ANT_LIB="$ANT_HOME"
70787aa0a607SDon Lewis      else
70797aa0a607SDon Lewis          if test -f /usr/share/java/ant.jar; then
70807aa0a607SDon Lewis              ANT_LIB=/usr/share/java
70817aa0a607SDon Lewis          else
70827aa0a607SDon Lewis             if test -f /usr/share/ant-core/lib/ant.jar; then
70837aa0a607SDon Lewis                 ANT_LIB=/usr/share/ant-core/lib
70847aa0a607SDon Lewis             else
70857aa0a607SDon Lewis                if test -f $ANT_HOME/lib/ant/ant.jar; then
70867aa0a607SDon Lewis                    ANT_LIB="$ANT_HOME/lib/ant"
70877aa0a607SDon Lewis                else
70887aa0a607SDon Lewis                   if test -f /usr/share/lib/ant/ant.jar; then
70897aa0a607SDon Lewis                       ANT_LIB=/usr/share/lib/ant
70907aa0a607SDon Lewis                   else
70917aa0a607SDon Lewis                       AC_MSG_ERROR([Ant libraries not found!])
70927aa0a607SDon Lewis                   fi
70937aa0a607SDon Lewis                fi
70947aa0a607SDon Lewis             fi
70957aa0a607SDon Lewis          fi
70967aa0a607SDon Lewis      fi
70977aa0a607SDon Lewis   fi
70987aa0a607SDon Lewis   AC_MSG_RESULT([Ant lib directory found.])
70997aa0a607SDon Lewisfi
71007aa0a607SDon LewisAC_SUBST(ANT_LIB)
71017aa0a607SDon Lewisfi
71027aa0a607SDon Lewis
71037aa0a607SDon Lewisant_minver=1.6.0
71047aa0a607SDon Lewis# update for more extensions...
71057aa0a607SDon Lewisif test "$ENABLE_MEDIAWIKI" = "YES"; then
71067aa0a607SDon Lewis  ant_minver=1.7.0
71077aa0a607SDon Lewisfi
71087aa0a607SDon Lewisant_minminor1=`echo $ant_minver | cut -d"." -f2`
71097aa0a607SDon Lewis
71107aa0a607SDon LewisAC_MSG_CHECKING([whether ant is >= $ant_minver])
71117aa0a607SDon Lewisant_version=`$ANT -version | $AWK '{ print $4; }'`
71127aa0a607SDon Lewisant_version_major=`echo $ant_version | cut -d. -f1`
71137aa0a607SDon Lewisant_version_minor=`echo $ant_version | cut -d. -f2`
71147aa0a607SDon Lewisecho "configure: ant_version $ant_version " >&5
71157aa0a607SDon Lewisecho "configure: ant_version_major $ant_version_major " >&5
71167aa0a607SDon Lewisecho "configure: ant_version_minor $ant_version_minor " >&5
71177aa0a607SDon Lewisif test "$ant_version_major" -ge "2"; then
71187aa0a607SDon Lewis   AC_MSG_RESULT([yes, $ant_version])
71197aa0a607SDon Lewiselif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
71207aa0a607SDon Lewis   AC_MSG_RESULT([yes, $ant_version])
71217aa0a607SDon Lewiselse
71227aa0a607SDon Lewis   AC_MSG_ERROR([no, you need at least ant >= $ant_minver])
71237aa0a607SDon Lewisfi
71247aa0a607SDon Lewis
71257aa0a607SDon Lewisif test "$ENABLE_MEDIAWIKI" = "YES"; then
71267aa0a607SDon LewisAC_MSG_CHECKING([whether ant supports mapper type="regexp"])
71277aa0a607SDon Lewisrm -rf confdir
71287aa0a607SDon Lewismkdir confdir
71297aa0a607SDon Lewiscat > conftest.java << EOF
71307aa0a607SDon Lewis    public class conftest {
71317aa0a607SDon Lewis        int testmethod(int a, int b) {
71327aa0a607SDon Lewis            return a + b;
71337aa0a607SDon Lewis        }
71347aa0a607SDon Lewis    }
71357aa0a607SDon LewisEOF
71367aa0a607SDon Lewis
71377aa0a607SDon Lewiscat > conftest.xml << EOF
71387aa0a607SDon Lewis    <project name="conftest" default="conftest">
71397aa0a607SDon Lewis        <target name="conftest" depends="copytest">
71407aa0a607SDon Lewis            <javac srcdir="." includes="conftest.java">
71417aa0a607SDon Lewis            </javac>
71427aa0a607SDon Lewis        </target>
71437aa0a607SDon Lewis        <target name="copytest">
71447aa0a607SDon Lewis             <copy todir="confdir">
71457aa0a607SDon Lewis                 <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
71467aa0a607SDon Lewis                 <filterset/>
71477aa0a607SDon Lewis                 <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
71487aa0a607SDon Lewis             </copy>
71497aa0a607SDon Lewis        </target>
71507aa0a607SDon Lewis    </project>
71517aa0a607SDon LewisEOF
71527aa0a607SDon Lewis  if test "$JAVACISGCJ" = "yes"; then
71537aa0a607SDon Lewis    JAVA_HOME=; export JAVA_HOME
71547aa0a607SDon Lewis    ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
71557aa0a607SDon Lewis  else
71567aa0a607SDon Lewis    ant_cmd="$ANT -buildfile conftest.xml 1>&2"
71577aa0a607SDon Lewis  fi
71587aa0a607SDon Lewis  AC_TRY_EVAL(ant_cmd)
71597aa0a607SDon Lewis  if test $? = 0 && test -f ./conftest.class ; then
71607aa0a607SDon Lewis    AC_MSG_RESULT([yes])
71617aa0a607SDon Lewis    rm -rf confdir
71627aa0a607SDon Lewis  else
71637aa0a607SDon Lewis    echo "configure: Ant test failed" >&5
71647aa0a607SDon Lewis    cat conftest.java >&5
71657aa0a607SDon Lewis    cat conftest.xml >&5
71667aa0a607SDon Lewis    rm -rf confdir
71677aa0a607SDon Lewis    AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
71687aa0a607SDon Lewis  fi
71697aa0a607SDon Lewisfi
71707aa0a607SDon Lewisrm -f conftest* core core.* *.core
71717aa0a607SDon Lewis
71727aa0a607SDon LewisOOO_JUNIT_JAR=
71737aa0a607SDon Lewisif test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
71747aa0a607SDon Lewis    AC_MSG_CHECKING([for JUnit 4])
71757aa0a607SDon Lewis    if test "$with_junit" = "yes"; then
71767aa0a607SDon Lewis        if test -e /usr/share/java/junit4.jar; then
71777aa0a607SDon Lewis            OOO_JUNIT_JAR=/usr/share/java/junit4.jar
71787aa0a607SDon Lewis        else
71797aa0a607SDon Lewis           if test -e /usr/share/lib/java/junit.jar; then
71807aa0a607SDon Lewis              OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
71817aa0a607SDon Lewis           else
71827aa0a607SDon Lewis              OOO_JUNIT_JAR=/usr/share/java/junit.jar
71837aa0a607SDon Lewis           fi
71847aa0a607SDon Lewis        fi
71857aa0a607SDon Lewis    else
71867aa0a607SDon Lewis        OOO_JUNIT_JAR=$with_junit
71877aa0a607SDon Lewis    fi
71887aa0a607SDon Lewis    if test "$_os" = "WINNT"; then
71897aa0a607SDon Lewis        OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
71907aa0a607SDon Lewis    fi
71917aa0a607SDon Lewis    "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
71927aa0a607SDon Lewis        grep org/junit/Before.class > /dev/null 2>&5
71937aa0a607SDon Lewis    if test $? -eq 0; then
71947aa0a607SDon Lewis        AC_MSG_RESULT([$OOO_JUNIT_JAR])
71957aa0a607SDon Lewis    else
71967aa0a607SDon Lewis        AC_MSG_RESULT([no])
71977aa0a607SDon Lewis        AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
71987aa0a607SDon Lewislocation (/usr/share/java), specify its pathname via
71997aa0a607SDon Lewis--with-junit=..., or disable it via --without-junit])
72007aa0a607SDon Lewis    fi
72017aa0a607SDon Lewisfi
72027aa0a607SDon LewisAC_SUBST(OOO_JUNIT_JAR)
72037aa0a607SDon Lewis
72047aa0a607SDon LewisAC_MSG_CHECKING([which languages to be built])
72057aa0a607SDon LewisWITH_LANG="$with_lang"
72067aa0a607SDon Lewisif test -z "$WITH_LANG"; then
72077aa0a607SDon Lewis   AC_MSG_RESULT([en-US])
72087aa0a607SDon Lewiselse
72097aa0a607SDon Lewis   AC_MSG_RESULT([$WITH_LANG])
72107aa0a607SDon Lewis   ADDITIONAL_REPOSITORIES="$ADDITIONAL_REPOSITORIES ../extras"
72117aa0a607SDon Lewis   BUILD_TYPE="$BUILD_TYPE L10N"
72127aa0a607SDon Lewisfi
72137aa0a607SDon LewisAC_SUBST(WITH_LANG)
72147aa0a607SDon Lewis
72157aa0a607SDon LewisAC_MSG_CHECKING([which languages have poor help localizations])
72167aa0a607SDon LewisWITH_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations"
72177aa0a607SDon Lewisif test -z "$WITH_POOR_HELP_LOCALIZATIONS"; then
72187aa0a607SDon Lewis   AC_MSG_RESULT([none])
72197aa0a607SDon Lewiselse
72207aa0a607SDon Lewis   AC_MSG_RESULT([$WITH_POOR_HELP_LOCALIZATIONS])
72217aa0a607SDon Lewisfi
72227aa0a607SDon LewisAC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
72237aa0a607SDon Lewis
72247aa0a607SDon LewisAC_MSG_CHECKING([which dictionaries to include])
72257aa0a607SDon Lewisif test -z "$with_dict"; then
72267aa0a607SDon Lewis   WITH_DICT=,ALL,
72277aa0a607SDon Lewis   AC_MSG_RESULT([ALL])
72287aa0a607SDon Lewiselse
72297aa0a607SDon Lewis   WITH_DICT=","$with_dict","
72307aa0a607SDon Lewis   AC_MSG_RESULT([$with_dict])
72317aa0a607SDon Lewisfi
72327aa0a607SDon LewisAC_SUBST(WITH_DICT)
72337aa0a607SDon Lewis
72347aa0a607SDon LewisAC_MSG_CHECKING([for additional 'intro' bitmaps])
72357aa0a607SDon LewisINTRO_BITMAPS=
72367aa0a607SDon Lewisif test -z "$with_intro_bitmaps" -o "$with_intro_bitmaps" = "no" ; then
72377aa0a607SDon Lewis   INTRO_BITMAPS=
72387aa0a607SDon Lewis   AC_MSG_RESULT([none])
72397aa0a607SDon Lewiselse
72407aa0a607SDon Lewis   for bitmap in `echo $with_intro_bitmaps | tr ',' ' '` ; do
72417aa0a607SDon Lewis      case "$bitmap" in
72427aa0a607SDon Lewis         *.png) ;;
72437aa0a607SDon Lewis         *)     bitmap= ; AC_MSG_WARN([Intro bitmaps should be .png files!]) ;;
72447aa0a607SDon Lewis      esac
72457aa0a607SDon Lewis      if test -n "$bitmap" ; then
72467aa0a607SDon Lewis         INTRO_BITMAPS="$INTRO_BITMAPS $bitmap"
72477aa0a607SDon Lewis      fi
72487aa0a607SDon Lewis   done
72497aa0a607SDon Lewis   AC_MSG_RESULT([$INTRO_BITMAPS])
72507aa0a607SDon Lewisfi
72517aa0a607SDon LewisAC_SUBST(INTRO_BITMAPS)
72527aa0a607SDon Lewis
72537aa0a607SDon LewisAC_MSG_CHECKING([for additional 'about' bitmaps])
72547aa0a607SDon LewisABOUT_BITMAPS=
72557aa0a607SDon Lewisif test -z "$with_about_bitmaps" -o "$with_about_bitmaps" = "no" ; then
72567aa0a607SDon Lewis   ABOUT_BITMAPS=
72577aa0a607SDon Lewis   AC_MSG_RESULT([none])
72587aa0a607SDon Lewiselse
72597aa0a607SDon Lewis   for bitmap in `echo $with_about_bitmaps | tr ',' ' '` ; do
72607aa0a607SDon Lewis      case "$bitmap" in
72617aa0a607SDon Lewis         *.png) ;;
72627aa0a607SDon Lewis         *)     bitmap= ; AC_MSG_WARN([About bitmaps should be .png files!]) ;;
72637aa0a607SDon Lewis      esac
72647aa0a607SDon Lewis      if test -n "$bitmap" ; then
72657aa0a607SDon Lewis         ABOUT_BITMAPS="$ABOUT_BITMAPS $bitmap"
72667aa0a607SDon Lewis      fi
72677aa0a607SDon Lewis   done
72687aa0a607SDon Lewis   AC_MSG_RESULT([$ABOUT_BITMAPS])
72697aa0a607SDon Lewisfi
72707aa0a607SDon LewisAC_SUBST(ABOUT_BITMAPS)
72717aa0a607SDon Lewis
72727aa0a607SDon LewisOOO_VENDOR=
72737aa0a607SDon LewisAC_MSG_CHECKING([for vendor])
72747aa0a607SDon Lewisif test -z "$with_vendor" -o "$with_vendor" = "no" ; then
72757aa0a607SDon Lewis   AC_MSG_RESULT([not set])
72767aa0a607SDon Lewiselse
72777aa0a607SDon Lewis   OOO_VENDOR="$with_vendor"
72787aa0a607SDon Lewis   AC_MSG_RESULT([$OOO_VENDOR])
72797aa0a607SDon Lewisfi
72807aa0a607SDon LewisAC_SUBST(OOO_VENDOR)
72817aa0a607SDon Lewis
72827aa0a607SDon LewisUNIXWRAPPERNAME=
72837aa0a607SDon LewisAC_MSG_CHECKING([for UNIX wrapper name])
72847aa0a607SDon Lewisif test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes" ; then
72857aa0a607SDon Lewis   AC_MSG_RESULT([not set])
72867aa0a607SDon Lewiselse
72877aa0a607SDon Lewis   UNIXWRAPPERNAME="$with_unix_wrapper"
72887aa0a607SDon Lewis   AC_MSG_RESULT([$UNIXWRAPPERNAME])
72897aa0a607SDon Lewisfi
72907aa0a607SDon LewisAC_SUBST(UNIXWRAPPERNAME)
72917aa0a607SDon Lewis
72927aa0a607SDon LewisAC_MSG_CHECKING([whether to statically link to Gtk])
72937aa0a607SDon Lewisif test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
72947aa0a607SDon Lewis   ENABLE_STATIC_GTK="TRUE"
72957aa0a607SDon Lewis   AC_MSG_RESULT([yes])
72967aa0a607SDon Lewiselse
72977aa0a607SDon Lewis   ENABLE_STATIC_GTK="FALSE"
72987aa0a607SDon Lewis   AC_MSG_RESULT([no])
72997aa0a607SDon Lewisfi
73007aa0a607SDon LewisAC_SUBST(ENABLE_STATIC_GTK)
73017aa0a607SDon Lewis
73027aa0a607SDon LewisAC_MSG_CHECKING([whether to use layout dialogs])
73037aa0a607SDon Lewisif test -n "$enable_layout" && test "$enable_layout" != "no"; then
73047aa0a607SDon Lewis   ENABLE_LAYOUT="TRUE"
73057aa0a607SDon Lewis   AC_MSG_RESULT([yes])
73067aa0a607SDon Lewiselse
73077aa0a607SDon Lewis   ENABLE_LAYOUT="FALSE"
73087aa0a607SDon Lewis   AC_MSG_RESULT([no])
73097aa0a607SDon Lewisfi
73107aa0a607SDon LewisAC_SUBST(ENABLE_LAYOUT)
73117aa0a607SDon Lewis
73127aa0a607SDon Lewis# ===================================================================
73137aa0a607SDon Lewis# De- or increase default verbosity of build process
73147aa0a607SDon Lewis# ===================================================================
73157aa0a607SDon LewisAC_MSG_CHECKING([build verbosity])
73167aa0a607SDon Lewisif test -n "$enable_verbose"; then
73177aa0a607SDon Lewis   if test "$enable_verbose" = "yes"; then
73187aa0a607SDon Lewis      VERBOSE="TRUE"
73197aa0a607SDon Lewis      AC_MSG_RESULT([high])
73207aa0a607SDon Lewis   fi
73217aa0a607SDon Lewis   if test "$enable_verbose" = "no"; then
73227aa0a607SDon Lewis      VERBOSE="FALSE"
73237aa0a607SDon Lewis      AC_MSG_RESULT([low])
73247aa0a607SDon Lewis   fi
73257aa0a607SDon Lewiselse
73267aa0a607SDon Lewis   AC_MSG_RESULT([not set])
73277aa0a607SDon Lewisfi
73287aa0a607SDon LewisAC_SUBST(VERBOSE)
73297aa0a607SDon Lewis
73307aa0a607SDon Lewisdnl ===================================================================
73317aa0a607SDon Lewisdnl Hook up OOos nodep environmental variable to automake's equivalent
73327aa0a607SDon Lewisdnl --enable-dependency-tracking configure option
73337aa0a607SDon Lewisdnl ===================================================================
73347aa0a607SDon LewisAC_MSG_CHECKING([whether to enable dependency tracking])
73357aa0a607SDon Lewisif test "$enable_dependency_tracking" = "no"; then
73367aa0a607SDon Lewis    nodep=TRUE
73377aa0a607SDon Lewis    AC_MSG_RESULT([no])
73387aa0a607SDon Lewiselse
73397aa0a607SDon Lewis    AC_MSG_RESULT([yes])
73407aa0a607SDon Lewisfi
73417aa0a607SDon LewisAC_SUBST(nodep)
73427aa0a607SDon Lewis
73437aa0a607SDon Lewisdnl ===================================================================
73447aa0a607SDon Lewisdnl Setting up the environment.
73457aa0a607SDon Lewisdnl ===================================================================
73467aa0a607SDon Lewisecho "********************************************************************"
73477aa0a607SDon Lewisecho "*                                                                  *"
73487aa0a607SDon Lewisecho "*   Setting up the build environment variables.                    *"
73497aa0a607SDon Lewisecho "*                                                                  *"
73507aa0a607SDon Lewisecho "********************************************************************"
73517aa0a607SDon Lewis
73527aa0a607SDon Lewisif test -z "$COMPATH"; then
73537aa0a607SDon Lewis   AC_MSG_ERROR([No compiler found.])
73547aa0a607SDon Lewisfi
73557aa0a607SDon LewisAC_SUBST(COMPATH)
73567aa0a607SDon LewisAC_SUBST(CC_PATH)
73577aa0a607SDon Lewis
73587aa0a607SDon LewisAC_MSG_CHECKING([solver path])
73597aa0a607SDon Lewisif test -z "$with_local_solver"; then
73607aa0a607SDon Lewis   LOCAL_SOLVER="DEFAULT"
73617aa0a607SDon Lewis   AC_MSG_RESULT([default])
73627aa0a607SDon Lewiselse
73637aa0a607SDon Lewis   LOCAL_SOLVER=$with_local_solver
73647aa0a607SDon Lewis   AC_MSG_RESULT([$with_local_solver])
73657aa0a607SDon Lewisfi
73667aa0a607SDon LewisAC_SUBST(LOCAL_SOLVER)
73677aa0a607SDon Lewis
73687aa0a607SDon LewisAC_SUBST(BUILD_TYPE)
73697aa0a607SDon LewisAC_SUBST(ADDITIONAL_REPOSITORIES)
73707aa0a607SDon Lewis
73717aa0a607SDon Lewis# make sure config.guess is +x; we execute config.guess, so it has to be so;
73727aa0a607SDon Lewischmod +x ./config.guess
73737aa0a607SDon Lewis
73747aa0a607SDon Lewis# Create files from their *.in templates.
73757aa0a607SDon LewisAC_CONFIG_FILES([set_soenv Makefile])
73767aa0a607SDon Lewis
73777aa0a607SDon LewisAC_MSG_NOTICE([writing config.status])
73787aa0a607SDon LewisAC_OUTPUT
73797aa0a607SDon Lewis
73807aa0a607SDon Lewisdnl Executing the set_soenv script to setup the environment variables.
73817aa0a607SDon Lewischmod a+x set_soenv
73827aa0a607SDon Lewisif test -z "$enable_check_only"; then
73837aa0a607SDon Lewis   './set_soenv'
73847aa0a607SDon Lewiselse
73857aa0a607SDon Lewis   echo
73867aa0a607SDon Lewis   echo Test Complete
73877aa0a607SDon Lewis   echo No environment file will be generated
73887aa0a607SDon Lewis   echo
73897aa0a607SDon Lewis   num_warnings=`wc -l warn`
73907aa0a607SDon Lewis   _num=`echo $num_warnings | $AWK '{ print $1 }'`
73917aa0a607SDon Lewis   if test $_num -gt 0; then
73927aa0a607SDon Lewis      echo The following warning\(s\) were generated by configure
73937aa0a607SDon Lewis      echo ----------------------------------------------------
73947aa0a607SDon Lewis      echo
73957aa0a607SDon Lewis      cat warn
73967aa0a607SDon Lewis      echo
73977aa0a607SDon Lewis   else
73987aa0a607SDon Lewis      echo There were no warnings
73997aa0a607SDon Lewis   fi
74007aa0a607SDon Lewis   echo
74017aa0a607SDon Lewisfi
7402