xref: /trunk/main/configure.ac (revision a0ec95a2099733839179c4365fc38cb23c013321)
1cfc83b6cSPedro Giffunidnl * *************************************************************
2cfc83b6cSPedro Giffunidnl *
3cfc83b6cSPedro Giffunidnl *  Licensed to the Apache Software Foundation (ASF) under one
4cfc83b6cSPedro Giffunidnl *  or more contributor license agreements.  See the NOTICE file
5cfc83b6cSPedro Giffunidnl *  distributed with this work for additional information
6cfc83b6cSPedro Giffunidnl *  regarding copyright ownership.  The ASF licenses this file
7cfc83b6cSPedro Giffunidnl *  to you under the Apache License, Version 2.0 (the
8cfc83b6cSPedro Giffunidnl *  "License"); you may not use this file except in compliance
9cfc83b6cSPedro Giffunidnl *  with the License.  You may obtain a copy of the License at
10cfc83b6cSPedro Giffunidnl *
11cfc83b6cSPedro Giffunidnl *    http://www.apache.org/licenses/LICENSE-2.0
12cfc83b6cSPedro Giffunidnl *
13cfc83b6cSPedro Giffunidnl *  Unless required by applicable law or agreed to in writing,
14cfc83b6cSPedro Giffunidnl *  software distributed under the License is distributed on an
15cfc83b6cSPedro Giffunidnl *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16cfc83b6cSPedro Giffunidnl *  KIND, either express or implied.  See the License for the
17cfc83b6cSPedro Giffunidnl *  specific language governing permissions and limitations
18cfc83b6cSPedro Giffunidnl *  under the License.
19cfc83b6cSPedro Giffunidnl *
20cfc83b6cSPedro Giffunidnl * *************************************************************
210495d53eSpfgAC_REVISION( $Revision$ )
22cfc83b6cSPedro GiffuniAC_PREREQ(2.50)
23cfc83b6cSPedro GiffuniAC_INIT()
24cfc83b6cSPedro Giffuniecho "$@" >config.parms
25cfc83b6cSPedro GiffuniAC_ARG_WITH(dmake-path,
26cfc83b6cSPedro Giffuni[  --with-dmake-path=<PATH TO EXECUTABLE>   Specify the location of dmake ],
27cfc83b6cSPedro Giffuni[  DMAKE_PATH="$withval"
28cfc83b6cSPedro Giffuni])
29cfc83b6cSPedro GiffuniAC_ARG_WITH(dmake-url,
30cfc83b6cSPedro Giffuni[  --with-dmake-url=<URL>   Specify the location of downloadable dmake source code. For example:
31e986c8d8SMatthias Seidel                          https://sourceforge.net/projects/oooextras.mirror/files/dmake-4.12.tar.bz2
32cfc83b6cSPedro Giffuni                          Note that dmake is under GPL license.],
33cfc83b6cSPedro Giffuni[  DMAKE_URL="$withval"
34cfc83b6cSPedro Giffuni])
35cfc83b6cSPedro GiffuniAC_ARG_WITH(packager-list,
36cfc83b6cSPedro Giffuni[  --with-packager-list=<PATH TO PACK LIST>   Specify a file to drive the packaging process.
37cfc83b6cSPedro Giffuni                          The file must follow the format explained in
38cfc83b6cSPedro Giffuni                          instsetoo_native/util/pack.lst
39cfc83b6cSPedro Giffuni],,)
40cfc83b6cSPedro GiffuniAC_ARG_WITH(gnu-patch,
41cfc83b6cSPedro Giffuni[  --with-gnu-patch        Specify location of GNU patch on Solaris or FreeBSD
42cfc83b6cSPedro Giffuni],,)
43cfc83b6cSPedro GiffuniAC_ARG_WITH(gnu-cp,
44cfc83b6cSPedro Giffuni[  --with-gnu-cp           Specify location of GNU cp on Solaris
45cfc83b6cSPedro Giffuni],,)
46cfc83b6cSPedro GiffuniAC_ARG_WITH(gperf,
47cfc83b6cSPedro Giffuni[  --with-gperf           Specify location of gperf on Solaris or FreeBSD
48cfc83b6cSPedro Giffuni],,)
49cfc83b6cSPedro GiffuniAC_ARG_ENABLE(graphite,
50cfc83b6cSPedro Giffuni[  --enable-graphite       Enables the compilation of Graphite smart font rendering
51cfc83b6cSPedro Giffuni],,)
52cfc83b6cSPedro GiffuniAC_ARG_WITH(system-graphite,
53cfc83b6cSPedro Giffuni[  --with-system-graphite    use graphite library already installed on system
54cfc83b6cSPedro Giffuni],,)
55cfc83b6cSPedro GiffuniAC_ARG_WITH(system-apache-commons,
56cfc83b6cSPedro Giffuni[  --with-system-apache-commons    use apache-commons jar files already installed on system
57cfc83b6cSPedro Giffuni],,)
58cfc83b6cSPedro GiffuniAC_ARG_ENABLE(online-update,
59cfc83b6cSPedro Giffuni[  --disable-online-update Disables the Online Update feature.
60cfc83b6cSPedro Giffuni],,enable_online_update=yes)
61cfc83b6cSPedro GiffuniAC_ARG_ENABLE(unit-tests,
62cfc83b6cSPedro Giffuni[  --disable-unit-tests     Disables default unit tests (eg. unit tests using Google test, ...).
63cfc83b6cSPedro Giffuni],,enable_unit_tests=yes)
64cfc83b6cSPedro GiffuniAC_ARG_ENABLE(ldap,
65cfc83b6cSPedro Giffuni[  --disable-ldap          Disables the use of LDAP backend via OpenLDAP
66cfc83b6cSPedro Giffuni],,)
67cfc83b6cSPedro GiffuniAC_ARG_ENABLE(fetch-external,
68cfc83b6cSPedro Giffuni[  --disable-fetch-external Disables fetching external tarballs from web sources.
69cfc83b6cSPedro Giffuni],,)
70cfc83b6cSPedro GiffuniAC_ARG_WITH(external-tar,
71cfc83b6cSPedro Giffuni[  --with-external-tar=<TARFILE PATH>   Specify path to tarfiles manually ],
72cfc83b6cSPedro Giffuni[ TARFILE_LOCATION="$withval"
73cfc83b6cSPedro Giffuni])
74cfc83b6cSPedro GiffuniAC_ARG_WITH(openldap,
75cfc83b6cSPedro Giffuni[  --with-openldap         Enables the use of the OpenLDAP
76cfc83b6cSPedro Giffuni],,)
77cfc83b6cSPedro GiffuniAC_ARG_ENABLE(lockdown,
78e986c8d8SMatthias Seidel[  --enable-lockdown       Enables the gconf integration work in AOO
79cfc83b6cSPedro Giffuni],,)
80cfc83b6cSPedro GiffuniAC_ARG_ENABLE(vba,
81cfc83b6cSPedro Giffuni[  --disable-vba           disables the vba compatibility feature
82cfc83b6cSPedro Giffuni],,)
83cfc83b6cSPedro GiffuniAC_ARG_WITH(vba-package-format,
84cfc83b6cSPedro Giffuni[  --with-vba-package-format   specify package format for vba compatibility api.
85cfc83b6cSPedro Giffuni                          Specifying "builtin" means the api component and
86cfc83b6cSPedro Giffuni                          associated type library are part of the installation set.
87cfc83b6cSPedro Giffuni                          Specifying "extn" creates an uno extension that is
88cfc83b6cSPedro Giffuni                          part of the installation set ( located in the program
89cfc83b6cSPedro Giffuni                          directory ) that MUST be optionly registered using
90cfc83b6cSPedro Giffuni                          either the unopkg executeable or the extension manager
91cfc83b6cSPedro Giffuni                          gui.
92cfc83b6cSPedro Giffuni
93cfc83b6cSPedro Giffuni                          Note: "builtin" is the default, "extn" can cause
94cfc83b6cSPedro Giffuni                          problems.
95cfc83b6cSPedro Giffuni                          Usage: --with-vba-package-format="builtin" or
96cfc83b6cSPedro Giffuni                                 --with-vba-package-format="extn"
97cfc83b6cSPedro Giffuni],,)
98cfc83b6cSPedro GiffuniAC_ARG_ENABLE(pch,
99cfc83b6cSPedro Giffuni[  --enable-pch            EXPERIMENTAL: Enables precompiled header support for C++.
100cfc83b6cSPedro Giffuni],,)
101cfc83b6cSPedro GiffuniAC_ARG_WITH(fonts,
102e986c8d8SMatthias Seidel[  --without-fonts         AOO includes some third-party fonts to provide a reliable
103cfc83b6cSPedro Giffuni                          basis for help content, templates, samples, etc.
104cfc83b6cSPedro Giffuni                          When these fonts are already known to be available on the
105cfc83b6cSPedro Giffuni                          system then you should use this option.
106cfc83b6cSPedro Giffuni],,)
107cfc83b6cSPedro GiffuniAC_ARG_WITH(ppds,
108cfc83b6cSPedro Giffuni[  --without-ppds          Removes Postscript Printer definition files from
109cfc83b6cSPedro Giffuni                          Apache Openoffice installation set, for people building
110cfc83b6cSPedro Giffuni                          for specific distributions where PPDs are known to be
111cfc83b6cSPedro Giffuni                          already available (every recent distro with CUPS
112cfc83b6cSPedro Giffuni                          backend)
113cfc83b6cSPedro Giffuni],,)
114cfc83b6cSPedro GiffuniAC_ARG_WITH(afms,
115cfc83b6cSPedro Giffuni[  --without-afms          Removes bitmap font files from Apache Openoffice
116cfc83b6cSPedro Giffuni                          installation set, for people building for specific
117cfc83b6cSPedro Giffuni                          distributions where AFM files or TrueType Fonts
118cfc83b6cSPedro Giffuni                          are known to be available.
119cfc83b6cSPedro Giffuni],,)
120cfc83b6cSPedro GiffuniAC_ARG_ENABLE(epm,
121cfc83b6cSPedro Giffuni[  --disable-epm           AOO includes self-packaging code, that requires
122cfc83b6cSPedro Giffuni                          epm, however epm is useless for large scale
123cfc83b6cSPedro Giffuni                          package building.
124cfc83b6cSPedro Giffuni],,enable_epm="yes")
125cfc83b6cSPedro GiffuniAC_ARG_WITH(epm,
126cfc83b6cSPedro Giffuni[  --with-epm         Decides which epm to use. Default is to use
127cfc83b6cSPedro Giffuni              the one from the system if one is built. When
128cfc83b6cSPedro Giffuni              either this is not there or you say =internal
129cfc83b6cSPedro Giffuni              epm will be built.
130cfc83b6cSPedro Giffuni],,)
131cfc83b6cSPedro GiffuniAC_ARG_WITH(epm-url,
132b48104e3Sjim[  --with-epm-url=<URL>    Specify the location of downloadable epm source code. For example:
1334c04325dSMatthias Seidel                            https://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz
134cfc83b6cSPedro Giffuni                          or
1354c04325dSMatthias Seidel                            http://epm.sourcearchive.com/downloads/3.7-1/epm_3.7.orig.tar.gz
136b48104e3Sjim                          Version 3.7 or later is required. Note that epm is under GPL license.
137cfc83b6cSPedro Giffuni],[  EPM_URL="$withval"
138cfc83b6cSPedro Giffuni])
139cfc83b6cSPedro GiffuniAC_ARG_WITH(package-format,
140e986c8d8SMatthias Seidel[  --with-package-format   specify package format(s) for AOO installsets.
141cfc83b6cSPedro Giffuni                          Default is "normal" one of the OS/Distribution.
142cfc83b6cSPedro Giffuni
143cfc83b6cSPedro Giffuni                          Usage: --with-package-format="foo bar"
144cfc83b6cSPedro Giffuni],,)
145cfc83b6cSPedro GiffuniAC_ARG_ENABLE(odk,
146c4211d71SMatthias Seidel[  --disable-odk           AOO includes an ODK, office development kit
147c4211d71SMatthias Seidel                          which some packagers may want to build without
148cfc83b6cSPedro Giffuni],,enable_odk="yes")
149cfc83b6cSPedro GiffuniAC_ARG_ENABLE(mathmldtd,
150cfc83b6cSPedro Giffuni[  --disable-mathmldtd     disable mathmldtd
151cfc83b6cSPedro Giffuni                          (useful for distributions that want to avoid packaging
152cfc83b6cSPedro Giffuni                          it)
153cfc83b6cSPedro Giffuni],,enable_mathmldtd="yes")
154cfc83b6cSPedro GiffuniAC_ARG_ENABLE(evolution2,
155cfc83b6cSPedro Giffuni[  --enable-evolution2     Allows the built-in evolution 2 addressbook
156cfc83b6cSPedro Giffuni                          connectivity build to be enabled.
157cfc83b6cSPedro Giffuni],,)
158cfc83b6cSPedro GiffuniAC_ARG_WITH(system-stdlibs,
159cfc83b6cSPedro Giffuni[  --with-system-stdlibs   use libstdc++/libgcc_s already on system
160cfc83b6cSPedro Giffuni],,)
161cfc83b6cSPedro GiffuniAC_ARG_ENABLE(cups,
162cfc83b6cSPedro Giffuni[  --disable-cups          disable CUPS support (for printing on UNIX)
163cfc83b6cSPedro Giffuni],,enable_cups=yes)
164cfc83b6cSPedro GiffuniAC_ARG_ENABLE(fontconfig,
165cfc83b6cSPedro Giffuni[  --disable-fontconfig    disable support for the fontconfig library
166cfc83b6cSPedro Giffuni],,enable_fontconfig=yes)
167cfc83b6cSPedro GiffuniAC_ARG_ENABLE(directx,
168cfc83b6cSPedro Giffuni[  --disable-directx       Remove DirectX implementation for the new XCanvas
169cfc83b6cSPedro Giffuni                          interface. The DirectX support requires more stuff
170cfc83b6cSPedro Giffuni                          installed on Windows to compile.
171cfc83b6cSPedro Giffuni                          (DirectX SDK, GDI+ libs)
172cfc83b6cSPedro Giffuni],,enable_directx=yes)
173cfc83b6cSPedro GiffuniAC_ARG_ENABLE(activex,
174407bc2eeSMatthias Seidel[  --disable-activex       Disable the use of ActiveX for Windows build.
175cfc83b6cSPedro Giffuni                          This switch is mandatory when using VC++ 2005/2008 Express.
176cfc83b6cSPedro Giffuni                          Alternatively you can use the Windows Driver Kit (WDK) and
177cfc83b6cSPedro Giffuni                          configure with the following switches:
178cfc83b6cSPedro Giffuni                          --with-atl-include-dir=$WDK_HOME\inc\atl71
179cfc83b6cSPedro Giffuni                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
180cfc83b6cSPedro Giffuni                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
181cfc83b6cSPedro Giffuni                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
182cfc83b6cSPedro Giffuni],,)
183cfc83b6cSPedro Giffuni
184cfc83b6cSPedro GiffuniAC_ARG_ENABLE(atl,
185407bc2eeSMatthias Seidel[  --disable-atl          Disable the use of ATL for Windows build.
186cfc83b6cSPedro Giffuni                          This switch is mandatory when using VC++ 2005/2008 Express.
187cfc83b6cSPedro Giffuni                          Alternatively you can use the Windows Driver Kit (WDK) and
188cfc83b6cSPedro Giffuni                          configure with the following switches:
189cfc83b6cSPedro Giffuni                          --with-atl-include-dir=$WDK_HOME\inc\atl71
190cfc83b6cSPedro Giffuni                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
191cfc83b6cSPedro Giffuni                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
192cfc83b6cSPedro Giffuni                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
193cfc83b6cSPedro Giffuni],,)
194cfc83b6cSPedro Giffuni
195cfc83b6cSPedro GiffuniAC_ARG_WITH(atl-include-dir,
196407bc2eeSMatthias Seidel[  --with-atl-include-dir      Path to ATL include directory for Windows build.
197cfc83b6cSPedro Giffuni                          This switch is mandatory when using VC++ 2008 Express
198cfc83b6cSPedro Giffuni                          and configuring with ATL/ActiveX enabled.
199cfc83b6cSPedro Giffuni                          You can use the Windows Driver Kit (WDK) and
200cfc83b6cSPedro Giffuni                          configure with the following switch:
201cfc83b6cSPedro Giffuni                          --with-atl-include-dir=$WDK_HOME\inc\atl71
202cfc83b6cSPedro Giffuni],,)
203cfc83b6cSPedro Giffuni
204cfc83b6cSPedro GiffuniAC_ARG_WITH(atl-lib-dir,
205407bc2eeSMatthias Seidel[  --with-atl-lib-dir          Path to ATL libraries directory for Windows build.
206cfc83b6cSPedro Giffuni                          This switch is mandatory when using VC++ 2008 Express
207cfc83b6cSPedro Giffuni                          and configuring with ATL/ActiveX enabled.
208cfc83b6cSPedro Giffuni                          You can use the Windows Driver Kit (WDK) and
209cfc83b6cSPedro Giffuni                          configure with the following switch:
210cfc83b6cSPedro Giffuni                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
211cfc83b6cSPedro Giffuni],,)
212cfc83b6cSPedro Giffuni
213cfc83b6cSPedro GiffuniAC_ARG_WITH(mfc-include-dir,
214407bc2eeSMatthias Seidel[  --with-mfc-include-dir       Path to MFC include directory for Windows build.
215cfc83b6cSPedro Giffuni                          This switch is mandatory when using VC++ 2008 Express
216cfc83b6cSPedro Giffuni                          and configuring with ATL/ActiveX enabled.
217cfc83b6cSPedro Giffuni                          You can use the Windows Driver Kit (WDK) and
218cfc83b6cSPedro Giffuni                          configure with the following switch:
219cfc83b6cSPedro Giffuni                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
220cfc83b6cSPedro Giffuni],,)
221cfc83b6cSPedro Giffuni
222cfc83b6cSPedro GiffuniAC_ARG_WITH(mfc-lib-dir,
223407bc2eeSMatthias Seidel[  --with-mfc-lib-dir          Path to MFC libraries directory for Windows build.
224cfc83b6cSPedro Giffuni                          This switch is mandatory when using VC++ 2008 Express
225cfc83b6cSPedro Giffuni                          and configuring with ATL/ActiveX enabled.
226cfc83b6cSPedro Giffuni                          You can use the Windows Driver Kit (WDK) and
227cfc83b6cSPedro Giffuni                          configure with the following switch:
228cfc83b6cSPedro Giffuni                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
229cfc83b6cSPedro Giffuni],,)
230cfc83b6cSPedro Giffuni
231cfc83b6cSPedro Giffuni
232cfc83b6cSPedro GiffuniAC_ARG_ENABLE(symbols,
233cfc83b6cSPedro Giffuni[  --enable-symbols        Include debugging symbols in output.
234cfc83b6cSPedro Giffuni                          WARNING - a complete build needs 8 Gb of space and
235cfc83b6cSPedro Giffuni                          takes much longer. (enables -g compiler flag)
236cfc83b6cSPedro Giffuni
237cfc83b6cSPedro Giffuni                          --enable-symbols=SMALL sets the gcc -g1 setting
238cfc83b6cSPedro Giffuni                          which is smaller.
239cfc83b6cSPedro Giffuni
240cfc83b6cSPedro Giffuni                          Enabling symbols disables the stripping of the solver
241cfc83b6cSPedro Giffuni                          (--disable-strip-solver).
242cfc83b6cSPedro Giffuni],,)
243cfc83b6cSPedro GiffuniAC_ARG_ENABLE(strip-solver,
244cfc83b6cSPedro Giffuni[  --disable-strip-solver  Disable the stripping of the solver.
245cfc83b6cSPedro Giffuni                          By default the solver is stripped unless a build with
246cfc83b6cSPedro Giffuni                          debugging symbols (--enable-symbols) is requested.
247cfc83b6cSPedro Giffuni
248cfc83b6cSPedro Giffuni                          This switch allows to override this setting.
249cfc83b6cSPedro Giffuni],,)
250cfc83b6cSPedro GiffuniAC_ARG_ENABLE(werror,
251cfc83b6cSPedro Giffuni[  --enable-werror         Turn warnings to errors. (Has no effect in modules
252cfc83b6cSPedro Giffuni                          where the treating of warnings as errors is disabled
253cfc83b6cSPedro Giffuni                          explicitly)
254cfc83b6cSPedro Giffuni],,)
255cfc83b6cSPedro GiffuniAC_ARG_ENABLE(debug,
256cfc83b6cSPedro Giffuni[  --enable-debug          Include debugging symbols from --enable-symbols
257cfc83b6cSPedro Giffuni                          plus extra debugging code. Extra large build!
258cfc83b6cSPedro Giffuni                          (enables -g compiler flag and dmake debug=true)
259cfc83b6cSPedro Giffuni],,)
260cfc83b6cSPedro GiffuniAC_ARG_ENABLE(dbgutil,
261cfc83b6cSPedro Giffuni[  --enable-dbgutil        Include additional debugging utilities, such as
262cfc83b6cSPedro Giffuni                          assertions, object counting, etc. Larger build.
263cfc83b6cSPedro Giffuni                          Independent from --enable-debug
264cfc83b6cSPedro Giffuni],,)
265cfc83b6cSPedro GiffuniAC_ARG_ENABLE(crashdump,
266cfc83b6cSPedro Giffuni[  --enable-crashdump      Enable the crashdump feature code.
267cfc83b6cSPedro Giffuni],,)
268cfc83b6cSPedro GiffuniAC_ARG_ENABLE(cl-standard,
269cfc83b6cSPedro Giffuni[  --enable-cl-standard    For Microsoft C/C++ compiler users, use non-optimizing
270cfc83b6cSPedro Giffuni                          standard compiler. ( This just disables optimization
271cfc83b6cSPedro Giffuni                          options and therefore removes a lot of warnings when
272cfc83b6cSPedro Giffuni                          using the cheaper standard compiler. )
273cfc83b6cSPedro Giffuni],,)
274edd74ba5SDamjan JovanovicAC_ARG_ENABLE(win64,
275edd74ba5SDamjan Jovanovic[  --enable-win64          Enable building 64 bit OpenOffice on 64 bit Windows, (as
276edd74ba5SDamjan Jovanovic                          opposed to 32 bit OpenOffice that is usually built there).
277edd74ba5SDamjan Jovanovic                          This is a temporary option during the transition,
278edd74ba5SDamjan Jovanovic                          as 64 bit OpenOffice doesn't fully build on Windows yet.
279edd74ba5SDamjan Jovanovic],,enable_win64=no)
280cfc83b6cSPedro GiffuniAC_ARG_ENABLE(win-x64-shellext,
281cfc83b6cSPedro Giffuni[  --enable-win-x64-shellext    Enable the build/usage of Windows 64bit shell extensions.
282d507b48eSMatthias Seidel                          These extensions are used for the system integration on
283cfc83b6cSPedro Giffuni              Windows 64bit systems. For example supporting the search
284cfc83b6cSPedro Giffuni              in ODF files with the standard Windows search feature.
285cfc83b6cSPedro Giffuni],,)
286cfc83b6cSPedro GiffuniAC_ARG_ENABLE(gtk,
287cfc83b6cSPedro Giffuni[  --disable-gtk           Determines whether to use Gtk+ vclplug on platforms
288cfc83b6cSPedro Giffuni                          where Gtk+ is available.
289cfc83b6cSPedro Giffuni],,enable_gtk=yes)
290cfc83b6cSPedro GiffuniAC_ARG_ENABLE(gstreamer,
291cfc83b6cSPedro Giffuni[  --enable-gstreamer      Determines whether to use the GStreamer media
292cfc83b6cSPedro Giffuni                          backend on platforms where GStreamer is available.
293cfc83b6cSPedro Giffuni],,enable_gstreamer=no)
294cfc83b6cSPedro GiffuniAC_ARG_ENABLE(systray,
295cfc83b6cSPedro Giffuni[  --disable-systray       Determines whether to build the systray quickstarter.
296cfc83b6cSPedro Giffuni],,enable_systray=yes)
297cfc83b6cSPedro GiffuniAC_ARG_ENABLE(cairo,
298cfc83b6cSPedro Giffuni[  --enable-cairo          Determines whether to use Cairo library on
299cfc83b6cSPedro Giffuni                          platforms where Cairo is available.
300cfc83b6cSPedro Giffuni],,enable_cairo=no)
301cfc83b6cSPedro GiffuniAC_ARG_WITH(system-cairo,
302cfc83b6cSPedro Giffuni[  --with-system-cairo      Use Cairo libraries already on system
303cfc83b6cSPedro Giffuni],,)
304cfc83b6cSPedro GiffuniAC_ARG_ENABLE(cairo-canvas,
305cfc83b6cSPedro Giffuni[  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
306cfc83b6cSPedro Giffuni                          platforms where Cairo is available.
307cfc83b6cSPedro Giffuni],,enable_cairo_canvas=yes)
308cfc83b6cSPedro GiffuniAC_ARG_ENABLE(opengl,
309cfc83b6cSPedro Giffuni[  --enable-opengl         Determines whether to build the OpenGL 3D slide
310cfc83b6cSPedro Giffuni                          transitions component
311cfc83b6cSPedro Giffuni],,enable_opengl=no)
312cfc83b6cSPedro GiffuniAC_ARG_ENABLE(dbus,
313cfc83b6cSPedro Giffuni[  --enable-dbus           Determines whether to enable presentation mode
314cfc83b6cSPedro Giffuni                          screensaver control under GNOME via DBUS
315cfc83b6cSPedro Giffuni],,enable_dbus=no)
316cfc83b6cSPedro GiffuniAC_ARG_ENABLE(gconf,
317cfc83b6cSPedro Giffuni[  --disable-gconf         Determines whether to use the GConf support
318cfc83b6cSPedro Giffuni],,enable_gconf=yes)
319cfc83b6cSPedro GiffuniAC_ARG_ENABLE(gnome-vfs,
320cfc83b6cSPedro Giffuni[  --disable-gnome-vfs     Determines whether to use the Gnome Virtual Filing
321cfc83b6cSPedro Giffuni                          System on platforms where that VFS is available
322ca91c472SDamjan Jovanovic],,enable_gnome_vfs=no)
323cfc83b6cSPedro GiffuniAC_ARG_ENABLE(gio,
324cfc83b6cSPedro Giffuni[  --enable-gio            Determines whether to use the GIO support
325ca91c472SDamjan Jovanovic],,enable_gio=yes)
326cfc83b6cSPedro GiffuniAC_ARG_ENABLE(static-gtk,
327cfc83b6cSPedro Giffuni[  --enable-static-gtk     Modules that are linked against gtk libraries use
328cfc83b6cSPedro Giffuni                          the static libraries instead of the dynamic ones.
329cfc83b6cSPedro Giffuni                          (enables -Bstatic linker flag for gtk libraries)
330cfc83b6cSPedro Giffuni],,)
331cfc83b6cSPedro GiffuniAC_ARG_ENABLE(layout,
332cfc83b6cSPedro Giffuni[  --enable-layout         Enable the compilation and use of layout dialogs
333cfc83b6cSPedro Giffuni],,)
334cfc83b6cSPedro GiffuniAC_ARG_ENABLE(nss-module,
335cfc83b6cSPedro Giffuni[  --disable-nss-module    Whether to use the NSS module that is used for xml-security
336cfc83b6cSPedro Giffuni],,enable_nss_module=yes)
337cfc83b6cSPedro GiffuniAC_ARG_ENABLE(kde,
338cfc83b6cSPedro Giffuni[  --enable-kde            Determines whether to use Qt/KDE vclplug on platforms
339cfc83b6cSPedro Giffuni                          where Qt and KDE are available.
340cfc83b6cSPedro Giffuni],,)
341cfc83b6cSPedro GiffuniAC_ARG_ENABLE(kde4,
342cfc83b6cSPedro Giffuni[  --enable-kde4            Determines whether to use Qt4/KDE4 vclplug on platforms
343cfc83b6cSPedro Giffuni                          where Qt4 and KDE4 are available. May be used with --enable-kde
344cfc83b6cSPedro Giffuni                          if you want to support both KDE3 and KDE4.
345cfc83b6cSPedro Giffuni],,)
346cfc83b6cSPedro GiffuniAC_ARG_ENABLE(rpath,
347cfc83b6cSPedro Giffuni[  --disable-rpath         Disable the use of relative paths in shared libraries
348cfc83b6cSPedro Giffuni],,)
349cfc83b6cSPedro GiffuniAC_ARG_ENABLE(pam,
350cfc83b6cSPedro Giffuni[  --disable-pam           Disable pam support.
351cfc83b6cSPedro Giffuni],,)
352cfc83b6cSPedro GiffuniAC_ARG_ENABLE(pam-link,
353cfc83b6cSPedro Giffuni[  --enable-pam-link       link with libpam instead of dynamically open it
354cfc83b6cSPedro Giffuni],,)
355cfc83b6cSPedro GiffuniAC_ARG_ENABLE(crypt-link,
356cfc83b6cSPedro Giffuni[  --disable-crypt-link    disable linking with libcrypt instead of dynamically
357cfc83b6cSPedro Giffuni                          open it (needed for ancient GNU/Linux distributions
358cfc83b6cSPedro Giffuni                          without crypt()/libcrypt)
359cfc83b6cSPedro Giffuni],,enable_crypt_link=yes)
360cfc83b6cSPedro GiffuniAC_ARG_ENABLE(xrender-link,
361cfc83b6cSPedro Giffuni[  --enable-xrender-link   link with libXrender instead of dynamically open it
362cfc83b6cSPedro Giffuni],,)
363cfc83b6cSPedro GiffuniAC_ARG_ENABLE(randr,
364cfc83b6cSPedro Giffuni[  --disable-randr         disable RandR support in the vcl project
365cfc83b6cSPedro Giffuni],,enable_randr=yes)
366cfc83b6cSPedro GiffuniAC_ARG_ENABLE(randr-link,
367cfc83b6cSPedro Giffuni[  --disable-randr-link    disable linking with libXrandr, instead dynamically
368cfc83b6cSPedro Giffuni                           open it at runtime
369cfc83b6cSPedro Giffuni],,enable_randr_link=yes)
370cfc83b6cSPedro GiffuniAC_ARG_WITH(bundled-extension-blobs,
371cfc83b6cSPedro Giffuni[  --with-bundled-extension-blobs Whitespace separated list of files in the tarball directory
372cfc83b6cSPedro Giffuni                          that are to be bundled as-is for installation as extensions
373cfc83b6cSPedro Giffuni                          at the first program start. Make sure to only bundle extensions
374cfc83b6cSPedro Giffuni                          which can be installed without requiring a license dialog
375cfc83b6cSPedro Giffuni                          and comply with their distribution requirements by updating the
376cfc83b6cSPedro Giffuni                          files LICENSE_aggregated and NOTICE_aggregated accordingly
377cfc83b6cSPedro Giffuni],,)
378cfc83b6cSPedro Giffuni#AC_ARG_WITH(bundled-prereg-extensions,
379cfc83b6cSPedro Giffuni#[  --with-bundled-prereg-extensions Whitespace separated list of files in the tarball directory that
380cfc83b6cSPedro Giffuni#                          are to be bundled as pre-registered extensions. Make sure to only bundle
381cfc83b6cSPedro Giffuni#                          extensions which can be installed without requiring a license dialog
382cfc83b6cSPedro Giffuni#],,)
383cfc83b6cSPedro GiffuniAC_ARG_ENABLE(bundled-dictionaries,
384cfc83b6cSPedro Giffuni[  --enable-bundled-dictionaries  Download dictionaries (spelling, hyphenation, thesaurus)
385cfc83b6cSPedro Giffuni                           according to main/extensions.lst and bundle them. Make sure to
386cfc83b6cSPedro Giffuni                           comply with their distribution requirements and update the
387cfc83b6cSPedro Giffuni                           files LICENSE_aggregated and NOTICE_aggregated accordingly
388cfc83b6cSPedro Giffuni],,enable_bundled_dictionaries=no)
389cfc83b6cSPedro Giffuni
390cfc83b6cSPedro Giffuni# Remove the following switches when not in release mode.
391cfc83b6cSPedro GiffuniAC_ARG_WITH(system-dicts,
392cfc83b6cSPedro Giffuni[  --with-system-dicts    Use dictionaries from system paths- Specify
393cfc83b6cSPedro Giffuni                         them via --with-{dict,hyph,thes}-path=/path
394cfc83b6cSPedro Giffuni                        if you want to override the default ones
395cfc83b6cSPedro Giffuni],,)
396cfc83b6cSPedro GiffuniAC_ARG_WITH(external-dict-dir,
397cfc83b6cSPedro Giffuni[  --with-external-dict-dir Specify external dictionary dir
398cfc83b6cSPedro Giffuni],,)
399cfc83b6cSPedro GiffuniAC_ARG_WITH(external-hyph-dir,
400cfc83b6cSPedro Giffuni[  --with-external-hyph-dir Specify external hyphenation pattern dir
401cfc83b6cSPedro Giffuni],,)
402cfc83b6cSPedro GiffuniAC_ARG_WITH(external-thes-dir,
403cfc83b6cSPedro Giffuni[  --with-external-thes-dir Specify external thesaurus dir
404cfc83b6cSPedro Giffuni],,)
405cfc83b6cSPedro Giffuni# End of remove.
406cfc83b6cSPedro Giffuni
407cfc83b6cSPedro Giffuni
408cfc83b6cSPedro GiffuniAC_ARG_WITH(system-libs,
409cfc83b6cSPedro Giffuni[  --with-system-libs      Use libs already on system -- enables all
410cfc83b6cSPedro Giffuni                          --with-system-* flags except
411cfc83b6cSPedro Giffuni                          odbc/sane/xrender-header(s)
412cfc83b6cSPedro Giffuni],,)
413cfc83b6cSPedro GiffuniAC_ARG_WITH(system-headers,
414cfc83b6cSPedro Giffuni[  --with-system-headers   Use headers already on system -- enables all
415cfc83b6cSPedro Giffuni                          --with-system-* flags for external packages
416cfc83b6cSPedro Giffuni                          whose headers are the only entities used i.e.
417cfc83b6cSPedro Giffuni                          boost/vigra/odbc/sane/xrender-header(s)
418cfc83b6cSPedro Giffuni],,)
419cfc83b6cSPedro GiffuniAC_ARG_WITH(system-jars,
420cfc83b6cSPedro Giffuni[  --without-system-jars   When building with --with-system-libs, also the
421cfc83b6cSPedro Giffuni                          needed jars are expected on the system. Use this to
422cfc83b6cSPedro Giffuni                          disable that.
423cfc83b6cSPedro Giffuni                          (except for the db case where --with-system-db
424cfc83b6cSPedro Giffuni                          *has to* imply using the db.jar from there, too)
425cfc83b6cSPedro Giffuni],,)
426cfc83b6cSPedro GiffuniAC_ARG_WITH(system-zlib,
427cfc83b6cSPedro Giffuni[  --with-system-zlib      Use zlib already on system
428cfc83b6cSPedro Giffuni],,)
429cfc83b6cSPedro GiffuniAC_ARG_WITH(system-nss,
430cfc83b6cSPedro Giffuni[  --with-system-nss       Use NSS already on system
431cfc83b6cSPedro Giffuni],,)
432cfc83b6cSPedro GiffuniAC_ARG_WITH(system-openssl,
433cfc83b6cSPedro Giffuni[  --with-system-openssl   Use OpenSSL already on system
434cfc83b6cSPedro Giffuni],,)
435cfc83b6cSPedro GiffuniAC_ARG_WITH(system-jpeg,
436cfc83b6cSPedro Giffuni[  --with-system-jpeg      Use jpeg already on system
437cfc83b6cSPedro Giffuni],,)
438cfc83b6cSPedro GiffuniAC_ARG_WITH(system-expat,
439cfc83b6cSPedro Giffuni[  --with-system-expat     Use expat already on system
440cfc83b6cSPedro Giffuni],,)
441cfc83b6cSPedro GiffuniAC_ARG_WITH(system-libxml,
442cfc83b6cSPedro Giffuni[  --with-system-libxml    Use libxml already on system
443cfc83b6cSPedro Giffuni],,)
444cfc83b6cSPedro GiffuniAC_ARG_WITH(system-python,
445cfc83b6cSPedro Giffuni[  --with-system-python    Use python already on system
446cfc83b6cSPedro Giffuni],,)
447cfc83b6cSPedro GiffuniAC_ARG_WITH(system-icu,
448cfc83b6cSPedro Giffuni[  --with-system-icu       Use icu already on system
449cfc83b6cSPedro Giffuni],,)
450cfc83b6cSPedro GiffuniAC_ARG_WITH(system-poppler,
451cfc83b6cSPedro Giffuni[  --with-system-poppler   Use poppler already on system
452cfc83b6cSPedro Giffuni],,)
453cfc83b6cSPedro GiffuniAC_ARG_WITH(system-lucene,
454cfc83b6cSPedro Giffuni[  --with-system-lucene    Use lucene already on system
455cfc83b6cSPedro Giffuni],,)
456cfc83b6cSPedro GiffuniAC_ARG_WITH(lucene-core-jar,
457cfc83b6cSPedro Giffuni[  --with-lucene-core-jar=JARFILE   Specify path to jarfile manually ],
458cfc83b6cSPedro Giffuni[ LUCENE_CORE_JAR="$withval"
459cfc83b6cSPedro Giffuni])
460cfc83b6cSPedro GiffuniAC_ARG_WITH(lucene-analyzers-jar,
461cfc83b6cSPedro Giffuni[  --with-lucene-analyzers-jar=JARFILE   Specify path to jarfile manually ],
462cfc83b6cSPedro Giffuni[ LUCENE_ANALYZERS_JAR="$withval"
463cfc83b6cSPedro Giffuni])
464cfc83b6cSPedro GiffuniAC_ARG_ENABLE(mysql-connector,
465cfc83b6cSPedro Giffuni[  --enable-mysql-connector     enables the build of the MySQL Connector/OOo extension.
466cfc83b6cSPedro Giffuni                                This requires access to the MySQL Connector/C (aka libmysql) to be given, too, with
467cfc83b6cSPedro Giffuni                                either the --with-system-mysql or --with-libmysql-path option.
468cfc83b6cSPedro Giffuni],,)
469cfc83b6cSPedro GiffuniAC_ARG_WITH(system-mysql,
470cfc83b6cSPedro Giffuni[  --with-system-mysql          Use MySQL libraries already on system, for building the MySQL Connector/OOo extension.
471cfc83b6cSPedro Giffuni                                Requires MYSQLCONFIG to point to the mysql_config executable.
472cfc83b6cSPedro Giffuni],,)
473cfc83b6cSPedro GiffuniAC_ARG_WITH(libmysql-path,
474cfc83b6cSPedro Giffuni[  --with-libmysql-path         Use Connector/C (libmysql) installation for building the MySQL Connector/OOo extension.
475cfc83b6cSPedro Giffuni
476cfc83b6cSPedro Giffuni                                Usage: --with-libmysql-path=<absolute path to your Connector/C installation>
477cfc83b6cSPedro Giffuni],,)
478cfc83b6cSPedro GiffuniAC_ARG_WITH(system-mysql-cppconn,
479cfc83b6cSPedro Giffuni[  --with-system-mysql-cppconn  Use MySQL C++ Connector libraries already on system
480cfc83b6cSPedro Giffuni],,)
481cfc83b6cSPedro GiffuniAC_ARG_WITH(system-hsqldb,
482cfc83b6cSPedro Giffuni[  --with-system-hsqldb    Use hsqldb already on system
483cfc83b6cSPedro Giffuni],,)
484cfc83b6cSPedro GiffuniAC_ARG_WITH(hsqldb-jar,
485cfc83b6cSPedro Giffuni[  --with-hsqldb-jar=JARFILE   Specify path to jarfile manually ],
486cfc83b6cSPedro Giffuni[ HSQLDB_JAR="$withval"
487cfc83b6cSPedro Giffuni])
488cfc83b6cSPedro GiffuniAC_ARG_WITH(system-beanshell,
489cfc83b6cSPedro Giffuni[  --with-system-beanshell Use beanshell already on system (default)
490cfc83b6cSPedro Giffuni],,)
491cfc83b6cSPedro GiffuniAC_ARG_ENABLE(beanshell,
492cfc83b6cSPedro Giffuni[  --disable-beanshell     Disable the use of beanshell.
493cfc83b6cSPedro Giffuni],,)
494cfc83b6cSPedro GiffuniAC_ARG_WITH(beanshell-jar,
495cfc83b6cSPedro Giffuni[  --with-beanshell-jar=JARFILE   Specify path to jarfile manually ],
496cfc83b6cSPedro Giffuni[ BSH_JAR="$withval"
497cfc83b6cSPedro Giffuni])
498cfc83b6cSPedro GiffuniAC_ARG_ENABLE(pdfimport,
499cfc83b6cSPedro Giffuni[  --enable-pdfimport          enables the build of the PDF Import extension
500cfc83b6cSPedro Giffuni],,)
501cfc83b6cSPedro GiffuniAC_ARG_ENABLE(wiki-publisher,
502cfc83b6cSPedro Giffuni[  --enable-wiki-publisher      enables the build of the Wiki Publisher extension
503cfc83b6cSPedro Giffuni],,)
504cfc83b6cSPedro GiffuniAC_ARG_WITH(commons-codec-jar,
505cfc83b6cSPedro Giffuni[  --with-commons-codec-jar=JARFILE   Specify path to jarfile manually ],
506cfc83b6cSPedro Giffuni[ COMMONS_CODEC_JAR="$withval"
507cfc83b6cSPedro Giffuni])
508cfc83b6cSPedro GiffuniAC_ARG_WITH(commons-lang-jar,
509cfc83b6cSPedro Giffuni[  --with-commons-lang-jar=JARFILE   Specify path to jarfile manually ],
510cfc83b6cSPedro Giffuni[ COMMONS_LANG_JAR="$withval"
511cfc83b6cSPedro Giffuni])
512cfc83b6cSPedro GiffuniAC_ARG_WITH(commons-httpclient-jar,
513cfc83b6cSPedro Giffuni[  --with-commons-httpclient-jar=JARFILE   Specify path to jarfile manually ],
514cfc83b6cSPedro Giffuni[ COMMONS_HTTPCLIENT_JAR="$withval"
515cfc83b6cSPedro Giffuni])
516cfc83b6cSPedro GiffuniAC_ARG_WITH(commons-logging-jar,
517cfc83b6cSPedro Giffuni[  --with-commons-logging-jar=JARFILE   Specify path to jarfile manually ],
518cfc83b6cSPedro Giffuni[ COMMONS_LOGGING_JAR="$withval"
519cfc83b6cSPedro Giffuni])
520cfc83b6cSPedro GiffuniAC_ARG_WITH(servlet-api-jar,
521cfc83b6cSPedro Giffuni[  --servlet-api-jar=JARFILE   Specify path to jarfile manually ],
522cfc83b6cSPedro Giffuni[ SERVLETAPI_JAR="$withval"
523cfc83b6cSPedro Giffuni])
524cfc83b6cSPedro GiffuniAC_ARG_ENABLE(report-builder,
525cfc83b6cSPedro Giffuni[  --enable-report-builder  enables the build of the Report Builder extension
526cfc83b6cSPedro Giffuni],,)
527cfc83b6cSPedro GiffuniAC_ARG_WITH(sac-jar,
528cfc83b6cSPedro Giffuni[  --with-sac-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
529cfc83b6cSPedro Giffuni[ SAC_JAR="$withval"
530cfc83b6cSPedro Giffuni])
531cfc83b6cSPedro GiffuniAC_ARG_WITH(libxml-jar,
532cfc83b6cSPedro Giffuni[  --with-libxml-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
533cfc83b6cSPedro Giffuni[ LIBXML_JAR="$withval"
534cfc83b6cSPedro Giffuni])
535cfc83b6cSPedro GiffuniAC_ARG_WITH(flute-jar,
536cfc83b6cSPedro Giffuni[  --with-flute-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
537cfc83b6cSPedro Giffuni[ FLUTE_JAR="$withval"
538cfc83b6cSPedro Giffuni])
539cfc83b6cSPedro GiffuniAC_ARG_WITH(jfreereport-jar,
540cfc83b6cSPedro Giffuni[  --with-jfreereport-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
541cfc83b6cSPedro Giffuni[ JFREEREPORT_JAR="$withval"
542cfc83b6cSPedro Giffuni])
543cfc83b6cSPedro GiffuniAC_ARG_WITH(liblayout-jar,
544cfc83b6cSPedro Giffuni[  --with-liblayout-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
545cfc83b6cSPedro Giffuni[ LIBLAYOUT_JAR="$withval"
546cfc83b6cSPedro Giffuni])
547cfc83b6cSPedro GiffuniAC_ARG_WITH(libloader-jar,
548cfc83b6cSPedro Giffuni[  --with-libloader-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
549cfc83b6cSPedro Giffuni[ LIBLOADER_JAR="$withval"
550cfc83b6cSPedro Giffuni])
551cfc83b6cSPedro GiffuniAC_ARG_WITH(libformula-jar,
552cfc83b6cSPedro Giffuni[  --with-libformula-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
553cfc83b6cSPedro Giffuni[ LIBFORMULA_JAR="$withval"
554cfc83b6cSPedro Giffuni])
555cfc83b6cSPedro GiffuniAC_ARG_WITH(librepository-jar,
556cfc83b6cSPedro Giffuni[  --with-librepository-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
557cfc83b6cSPedro Giffuni[ LIBREPOSITORY_JAR="$withval"
558cfc83b6cSPedro Giffuni])
559cfc83b6cSPedro GiffuniAC_ARG_WITH(libfonts-jar,
560cfc83b6cSPedro Giffuni[  --with-libfonts-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
561cfc83b6cSPedro Giffuni[ LIBFONTS_JAR="$withval"
562cfc83b6cSPedro Giffuni])
563cfc83b6cSPedro GiffuniAC_ARG_WITH(libserializer-jar,
564cfc83b6cSPedro Giffuni[  --with-libserializer-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
565cfc83b6cSPedro Giffuni[ LIBSERIALIZER_JAR="$withval"
566cfc83b6cSPedro Giffuni])
567cfc83b6cSPedro GiffuniAC_ARG_WITH(libbase-jar,
568cfc83b6cSPedro Giffuni[  --with-libbase-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
569cfc83b6cSPedro Giffuni[ LIBBASE_JAR="$withval"
570cfc83b6cSPedro Giffuni])
571cfc83b6cSPedro GiffuniAC_ARG_WITH(system-saxon,
572cfc83b6cSPedro Giffuni[  --with-system-saxon     Use saxon already on system (default)
573cfc83b6cSPedro Giffuni],,)
574cfc83b6cSPedro GiffuniAC_ARG_ENABLE(saxon,
575cfc83b6cSPedro Giffuni[  --disable-saxon         Disable use of saxon
576cfc83b6cSPedro Giffuni],,)
577cfc83b6cSPedro GiffuniAC_ARG_WITH(saxon-jar,
578cfc83b6cSPedro Giffuni[  --with-saxon-jar=JARFILE   Specify path to jarfile manually. This implies --with-system-saxon ],
579cfc83b6cSPedro Giffuni[ SAXON_JAR="$withval"
580cfc83b6cSPedro Giffuni])
581cfc83b6cSPedro GiffuniAC_ARG_WITH(system-libxslt,
582cfc83b6cSPedro Giffuni[  --with-system-libxslt   Use libxslt already on system
583cfc83b6cSPedro Giffuni],,)
584cfc83b6cSPedro GiffuniAC_ARG_WITH(system-odbc,
585cfc83b6cSPedro Giffuni[  --with-system-odbc-headers     Use the odbc headers already on system
586cfc83b6cSPedro Giffuni],,)
587cfc83b6cSPedro GiffuniAC_ARG_WITH(system-sane,
588cfc83b6cSPedro Giffuni[  --with-system-sane-header      Use sane.h already on system
589cfc83b6cSPedro Giffuni],,)
590cfc83b6cSPedro GiffuniAC_ARG_WITH(system-xrender,
591cfc83b6cSPedro Giffuni[  --with-system-xrender-headers  Use XRender headers already on system
592cfc83b6cSPedro Giffuni],,)
593cfc83b6cSPedro GiffuniAC_ARG_WITH(system-curl,
594cfc83b6cSPedro Giffuni[  --with-system-curl      Use curl already on system
595cfc83b6cSPedro Giffuni],,)
596cfc83b6cSPedro GiffuniAC_ARG_WITH(system-boost,
597cfc83b6cSPedro Giffuni[  --with-system-boost     Use boost already on system
598cfc83b6cSPedro Giffuni],,)
599cfc83b6cSPedro GiffuniAC_ARG_WITH(system-mdds,
600cfc83b6cSPedro Giffuni[  --with-system-mdds      Use mdds already on system
601cfc83b6cSPedro Giffuni],,)
602cfc83b6cSPedro GiffuniAC_ARG_WITH(system-vigra,
603cfc83b6cSPedro Giffuni[  --with-system-vigra     Use vigra already on system
604cfc83b6cSPedro Giffuni],,)
605cfc83b6cSPedro GiffuniAC_ARG_ENABLE(hunspell,
606cfc83b6cSPedro Giffuni[  --enable-hunspell       Determines whether to enable the Hunspell library.
607cfc83b6cSPedro Giffuni                          If enabled, the library will be built unless you
608cfc83b6cSPedro Giffuni                          specify --with-system-hunspell to use the library
609cfc83b6cSPedro Giffuni                          already present on your system.
610cfc83b6cSPedro Giffuni                          If disabled, the Spell Checking component will also
611cfc83b6cSPedro Giffuni                          be disabled.
612cfc83b6cSPedro Giffuni                          (Default: hunspell disabled)
613cfc83b6cSPedro Giffuni],,enable_hunspell=no)
614cfc83b6cSPedro GiffuniAC_ARG_WITH(system-hunspell,
615cfc83b6cSPedro Giffuni[  --with-system-hunspell  Use libhunspell already on system
616cfc83b6cSPedro Giffuni],,)
617cfc83b6cSPedro GiffuniAC_ARG_WITH(system-mythes,
618cfc83b6cSPedro Giffuni[  --with-system-mythes    Use mythes already on system
619cfc83b6cSPedro Giffuni],,)
620cfc83b6cSPedro GiffuniAC_ARG_ENABLE(hyphen,
621cfc83b6cSPedro Giffuni[  --enable-hyphen         Determines whether to enable the Hyphen library.
622cfc83b6cSPedro Giffuni                          If enabled, the library will be built unless you
623cfc83b6cSPedro Giffuni                          specify --with-system-hyphen to use the library
624cfc83b6cSPedro Giffuni                          already present on your system.
625cfc83b6cSPedro Giffuni                          If disabled, the Hyphenator component will also
626cfc83b6cSPedro Giffuni                          be disabled.
627cfc83b6cSPedro Giffuni                          (Default: hyphen disabled)
628cfc83b6cSPedro Giffuni],,enable_hyphen=no)
629cfc83b6cSPedro GiffuniAC_ARG_WITH(system-hyphen,
630cfc83b6cSPedro Giffuni[  --with-system-hyphen    Use libhypeh already on system
631cfc83b6cSPedro Giffuni],,)
632cfc83b6cSPedro GiffuniAC_ARG_WITH(system-libtextcat,
633cfc83b6cSPedro Giffuni[  --with-system-libtextcat      Use libtextcat already on system
634cfc83b6cSPedro Giffuni],,)
635cfc83b6cSPedro GiffuniAC_ARG_WITH(external-libtextcat-data,
636cfc83b6cSPedro Giffuni[  --with-system-libtextcat-data Use libtextcat data already on system
637cfc83b6cSPedro Giffuni],,)
638cfc83b6cSPedro GiffuniAC_ARG_WITH(system-redland,
639cfc83b6cSPedro Giffuni[  --with-system-redland   Use redland library already on system
640cfc83b6cSPedro Giffuni],,)
641cfc83b6cSPedro GiffuniAC_ARG_WITH(stlport,
642cfc83b6cSPedro Giffuni[  --with-stlport         Only building --without-stlport is supported.
643cfc83b6cSPedro Giffuni], WITH_STLPORT=$withval , WITH_STLPORT=no)
644cfc83b6cSPedro GiffuniAC_ARG_WITH(jdk-home,
645cfc83b6cSPedro Giffuni[  --with-jdk-home         if you have installed JDK 1.3 or later on your system
646cfc83b6cSPedro Giffuni                          please supply the path here.
647cfc83b6cSPedro Giffuni                          Note that this is not the location of the Java binary
648cfc83b6cSPedro Giffuni                          but the location of the entire distribution.
649cfc83b6cSPedro Giffuni
650cfc83b6cSPedro Giffuni                          Usage: --with-jdk-home=<absolute path to JDK home>
651cfc83b6cSPedro Giffuni],,)
652cfc83b6cSPedro GiffuniAC_ARG_WITH(java,
653cfc83b6cSPedro Giffuni[  --with-java             Build with[[out]] Java support. If you use
654cfc83b6cSPedro Giffuni                          --without-java/--with-java=no then the build will have
655cfc83b6cSPedro Giffuni                          no support for Java components, applets, accessibility
656cfc83b6cSPedro Giffuni                          or XML filters.
657cfc83b6cSPedro Giffuni], if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi, WITH_JAVA=java)
658cfc83b6cSPedro GiffuniAC_ARG_ENABLE(gcjaot,
659cfc83b6cSPedro Giffuni[  --enable-gcjaot         Build with[[out]] using Ahead of Time java compilation
660cfc83b6cSPedro Giffuni                          support to speed up buildsi by compiling the jars also
661cfc83b6cSPedro Giffuni                          to native code..
662cfc83b6cSPedro Giffuni                          --enable-gcjaot is only known to work with bytecode
663cfc83b6cSPedro Giffuni                          created with gcj or ecj
664cfc83b6cSPedro Giffuni],,)
665cfc83b6cSPedro GiffuniAC_ARG_WITH(ant-home,
66637cc8903SMatthias Seidel[  --with-ant-home         If you have installed Apache Ant on your system,
667cfc83b6cSPedro Giffuni                          please supply the path here.
668cfc83b6cSPedro Giffuni                          Note that this is not the location of the Ant binary
669cfc83b6cSPedro Giffuni                          but the location of the entire distribution.
670cfc83b6cSPedro Giffuni
671cfc83b6cSPedro Giffuni                          Usage: --with-ant-home=<absolute path to Ant home>
672cfc83b6cSPedro Giffuni],,)
673cfc83b6cSPedro GiffuniAC_ARG_WITH(junit,
674cfc83b6cSPedro Giffuni[  --with-junit            Specifies the JUnit 4 jar file to use for JUnit-based
675cfc83b6cSPedro Giffuni                          tests.  --without-junit disables those tests.  Not
676f0157b90Skschenk                          relevant in the --without-java case.
677cfc83b6cSPedro Giffuni
678cfc83b6cSPedro Giffuni                          Usage: --with-junit=<absolute path to JUnit 4 jar>
679cfc83b6cSPedro Giffuni],,with_junit=yes)
680947c15fcSDamjan JovanovicAC_ARG_WITH(hamcrest-core,
681947c15fcSDamjan Jovanovic[  --with-hamcrest-core    Specifies the hamcrest-core jar file to use for
682947c15fcSDamjan Jovanovic                          JUnit-based tests.  --without-junit disables those
683947c15fcSDamjan Jovanovic                          tests.  Not relevant in the --without-java or
68411e97782SDamjan Jovanovic                          --without-junit cases, and only needed for JUnit
68511e97782SDamjan Jovanovic                          >= 4.11.
68611e97782SDamjan Jovanovic],,with_hamcrest_core=yes)
687cfc83b6cSPedro GiffuniAC_ARG_WITH(perl-home,
688cfc83b6cSPedro Giffuni[  --with-perl-home        If you have installed the Perl 5 Distribution, on your
689cfc83b6cSPedro Giffuni                          system, please supply the path here.
690cfc83b6cSPedro Giffuni                          Note that this is not the location of the Perl binary
691cfc83b6cSPedro Giffuni                          but the location of the entire distribution.
692cfc83b6cSPedro Giffuni
693cfc83b6cSPedro Giffuni                          Usage: --with-perl-home=<absolute path to Perl 5 home>
694cfc83b6cSPedro Giffuni],,)
695cfc83b6cSPedro GiffuniAC_ARG_WITH(cl-home,
696cfc83b6cSPedro Giffuni[  --with-cl-home          For Windows NT users, please supply the path
697cfc83b6cSPedro Giffuni                          for the Microsoft C/C++ compiler.
698cfc83b6cSPedro Giffuni                          Note that this is not the location of the compiler
699cfc83b6cSPedro Giffuni                          binary but the location of the entire distribution.
700cfc83b6cSPedro Giffuni
701cfc83b6cSPedro Giffuni                          Usage: --with-cl-home=<absolute path to Microsoft C/C++ compiler home>
702cfc83b6cSPedro Giffuni],,)
703cfc83b6cSPedro GiffuniAC_ARG_WITH(mspdb-path,
704cfc83b6cSPedro Giffuni[  --with-mspdb-path       For Microsoft C/C++ compiler users, please supply the
705cfc83b6cSPedro Giffuni                          path pointing to the mspdb71.dll (.NET 2003).
706cfc83b6cSPedro Giffuni
707cfc83b6cSPedro Giffuni                          Usage: --with-mspdb-path=<absolute path to mspdb71.dll>
708cfc83b6cSPedro Giffuni],,)
709cfc83b6cSPedro GiffuniAC_ARG_WITH(midl-path,
710cfc83b6cSPedro Giffuni[  --with-midl-path        For Microsoft C/C++ .NET compiler users, please supply
711cfc83b6cSPedro Giffuni                          the path pointing to the midl.exe.
712cfc83b6cSPedro Giffuni
713cfc83b6cSPedro Giffuni                          Usage: --with-midl-path=<absolute path to midl.exe>
714cfc83b6cSPedro Giffuni],,)
715cfc83b6cSPedro GiffuniAC_ARG_WITH(csc-path,
716cfc83b6cSPedro Giffuni[  --with-csc-path         For Microsoft C/C++ .NET compiler users, please supply
717cfc83b6cSPedro Giffuni                          the path pointing to the csc.exe.
718cfc83b6cSPedro Giffuni
719cfc83b6cSPedro Giffuni                          Usage: --with-csc-path=<absolute path to csc.exe>
720cfc83b6cSPedro Giffuni],,)
721cfc83b6cSPedro GiffuniAC_ARG_WITH(nsis-path,
722cfc83b6cSPedro Giffuni[  --with-nsis-path        For Windows users, please supply the path to the
723cfc83b6cSPedro Giffuni                          "Nullsoft Scriptable Install System" (NSIS). If NSIS
724cfc83b6cSPedro Giffuni                          is found in the path or this option is supplied a self
725cfc83b6cSPedro Giffuni                          contained executable installer for Apache OpenOffice
726cfc83b6cSPedro Giffuni                          will be created.
727cfc83b6cSPedro Giffuni
728cfc83b6cSPedro Giffuni                          Usage: --with-nsis-path=<absolute path to nsis.exe>
729cfc83b6cSPedro Giffuni],,)
730cfc83b6cSPedro GiffuniAC_ARG_WITH(frame-home,
731cfc83b6cSPedro Giffuni[  --with-frame-home       For Microsoft C/C++ .NET compiler users, please supply
732cfc83b6cSPedro Giffuni                          the path pointing to lib/mscoree.lib, usually
733cfc83b6cSPedro Giffuni                          something like:
734cfc83b6cSPedro Giffuni                          "/cygdrive/c/Program Files/Microsoft Visual Studio .NET/FrameworkSDK"
735cfc83b6cSPedro Giffuni
736cfc83b6cSPedro Giffuni                          MS Visual Toolkit compiler users, please supply the
737cfc83b6cSPedro Giffuni                          path pointing to lib/msvcrt.lib, usually something
738cfc83b6cSPedro Giffuni                          like:
739cfc83b6cSPedro Giffuni                          "/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Vc7"
740cfc83b6cSPedro Giffuni
741cfc83b6cSPedro Giffuni                          Usage: --with-frame-home=<absolute path to Framework SDK [[home]]>
742cfc83b6cSPedro Giffuni],,)
743cfc83b6cSPedro GiffuniAC_ARG_WITH(psdk-home,
744cfc83b6cSPedro Giffuni[  --with-psdk-home        For Windows users, please supply the path to the
745cfc83b6cSPedro Giffuni                          Microsoft Platform SDK.
746cfc83b6cSPedro Giffuni
747cfc83b6cSPedro Giffuni                          Usage: --with-psdk-home=<absolute path to Microsoft Platform SDK>
748cfc83b6cSPedro Giffuni],,)
749cfc83b6cSPedro GiffuniAC_ARG_WITH(directx-home,
750cfc83b6cSPedro Giffuni[  --with-directx-home     For Windows users, please supply the path to the
751cfc83b6cSPedro Giffuni                          Microsoft DirectX SDK.
752cfc83b6cSPedro Giffuni
753cfc83b6cSPedro Giffuni                          Usage: --with-directx-home=<absolute path to Microsoft DirectX SDK>
754cfc83b6cSPedro Giffuni],,)
755cfc83b6cSPedro GiffuniAC_ARG_WITH(mozilla-build,
756cfc83b6cSPedro Giffuni[  --with-mozilla-build    For Windows users, please supply the path to the
757cfc83b6cSPedro Giffuni                          mozilla build tools.
758cfc83b6cSPedro Giffuni
759cfc83b6cSPedro Giffuni                          Usage: --with-mozilla-build=<absolute path to mozilla build tools>
760cfc83b6cSPedro Giffuni
761cfc83b6cSPedro Giffuni                          At the moment of this writing, an installer for the mozilla build tools
7629d1669aeSMatthias Seidel                          can be obtained from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/.
763cfc83b6cSPedro Giffuni],[MOZILLABUILD=$withval],)
764cfc83b6cSPedro GiffuniAC_ARG_WITH(local-solenv,
765cfc83b6cSPedro Giffuni[  --with-local-solenv     If you have solenv in a location other than ./solenv,
766cfc83b6cSPedro Giffuni                          please supply the path here.
767cfc83b6cSPedro Giffuni
768cfc83b6cSPedro Giffuni                          Usage: --with-local-solenv=<absolute path to solenv>
769cfc83b6cSPedro Giffuni],,)
770cfc83b6cSPedro GiffuniAC_ARG_WITH(local-solver,
771cfc83b6cSPedro Giffuni[  --with-local-solver     if you have solver in a location other than ./solver,
772cfc83b6cSPedro Giffuni                          please supply the path here.
773cfc83b6cSPedro Giffuni
774cfc83b6cSPedro Giffuni                          Usage: --with-local-solver=<absolute path to solver>
775cfc83b6cSPedro Giffuni],,)
776cfc83b6cSPedro GiffuniAC_ARG_ENABLE(javascript,
777cfc83b6cSPedro Giffuni[  --disable-javascript    Disables support for JavaScript macros.
778cfc83b6cSPedro Giffuni],,)
779cfc83b6cSPedro GiffuniAC_ARG_WITH(system-apr,
780cfc83b6cSPedro Giffuni[  --with-system-apr       Use apr library already installed on the system
781cfc83b6cSPedro Giffuni],,)
782cfc83b6cSPedro GiffuniAC_ARG_WITH(system-apr-util,
783cfc83b6cSPedro Giffuni[  --with-system-apr-util  Use apr-util library already installed on the system
784cfc83b6cSPedro Giffuni],,)
785cfc83b6cSPedro GiffuniAC_ARG_WITH(system-serf,
786cfc83b6cSPedro Giffuni[  --with-system-serf      Use serf library already installed on the system
787cfc83b6cSPedro Giffuni],,)
788cfc83b6cSPedro GiffuniAC_ARG_WITH(system-coinmp,
789cfc83b6cSPedro Giffuni[  --with-system-coinmp    Use CoinMP library already installed on the system
790cfc83b6cSPedro Giffuni],,)
791cfc83b6cSPedro GiffuniAC_ARG_ENABLE(coinmp,
792cfc83b6cSPedro Giffuni[  --disable-coinmp        Do not use CoinMP as the Calc solver.
793cfc83b6cSPedro Giffuni],,)
794cfc83b6cSPedro GiffuniAC_ARG_ENABLE(check-only,
795cfc83b6cSPedro Giffuni[  --enable-check-only     Use this option option if you just want to check your
796cfc83b6cSPedro Giffuni                          environment.  This option stops the generation of an
797cfc83b6cSPedro Giffuni                          ????env.set
798cfc83b6cSPedro Giffuni
799cfc83b6cSPedro Giffuni                          Usage: --enable-check-only=yes
800cfc83b6cSPedro Giffuni],,)
801cfc83b6cSPedro GiffuniAC_ARG_ENABLE(ccache-skip,
802cfc83b6cSPedro Giffuni[[  --enable-ccache-skip    [default=auto] allow the use of --ccache-skip to
803cfc83b6cSPedro Giffuni                          escape compiler flags that would otherwise prevent
804cfc83b6cSPedro Giffuni                          caching of the result (currently used on Mac only)
805cfc83b6cSPedro Giffuni                          NOTE: requires patched version because of a bug in
806cfc83b6cSPedro Giffuni                          ccache (see issue 104567 for details and patch)
807cfc83b6cSPedro Giffuni                          explicitly enable if your version of ccache does not
808cfc83b6cSPedro Giffuni                          identify as version 2.4_OOo
809cfc83b6cSPedro Giffuni]],,enable_ccache_skip=auto)
810cfc83b6cSPedro GiffuniAC_ARG_WITH(lang,
811cfc83b6cSPedro Giffuni[  --with-lang             Use this option to build Apache OpenOffice with
812cfc83b6cSPedro Giffuni                          additional language support. English (US) is always
813cfc83b6cSPedro Giffuni                          included by default. Separate multiple languages with
814cfc83b6cSPedro Giffuni                          space. For all languages, use --with-lang=ALL.
815cfc83b6cSPedro Giffuni
816cfc83b6cSPedro Giffuni                          Usage: --with-lang="es sw tu cs sk"
817cfc83b6cSPedro Giffuni],,)
818cfc83b6cSPedro GiffuniAC_ARG_WITH(poor-help-localizations,
819cfc83b6cSPedro Giffuni[  --with-poor-help-localizations
820cfc83b6cSPedro Giffuni                           Use this option to specify which languages have
821cfc83b6cSPedro Giffuni                          unusable help localizations. Separate multiple
822cfc83b6cSPedro Giffuni                          languages with space.
823cfc83b6cSPedro Giffuni
824cfc83b6cSPedro Giffuni                          Usage: --with-poor-help-localizations="af ar be-BY ca"
825cfc83b6cSPedro Giffuni],,)
826cfc83b6cSPedro GiffuniAC_ARG_WITH(dict,
827cfc83b6cSPedro Giffuni[  --with-dict             Use this option to build Apache OpenOffice with
828cfc83b6cSPedro Giffuni                          dictionary support. ALL dictionaries are always
829cfc83b6cSPedro Giffuni                          included by default unless overridden with
830cfc83b6cSPedro Giffuni                          this option. Separate multiple dictionaries with
831cfc83b6cSPedro Giffuni                          commas. For all dictionaries, use --with-dict=ALL.
832cfc83b6cSPedro Giffuni
833cfc83b6cSPedro Giffuni                          Usage: --with-dict=ENGB,ENUS,ITIT
834cfc83b6cSPedro Giffuni],,)
835cfc83b6cSPedro GiffuniAC_ARG_WITH(intro-bitmaps,
836cfc83b6cSPedro Giffuni[  --with-intro-bitmaps    Prefer the specified intro bitmaps over the
837cfc83b6cSPedro Giffuni                          the default one.  Can be more than one (separated by
838cfc83b6cSPedro Giffuni                          commas), the order means priority of fallback if the
839cfc83b6cSPedro Giffuni                          first does not exist (in the installed tree).
840cfc83b6cSPedro Giffuni
841cfc83b6cSPedro Giffuni                          Usage: --with-intro-bitmaps=/path/my_ooo_intro.bmp
842cfc83b6cSPedro Giffuni],,)
843cfc83b6cSPedro GiffuniAC_ARG_WITH(about-bitmaps,
844cfc83b6cSPedro Giffuni[  --with-about-bitmaps    Similarly to --with-intro-bitmaps, this allows
845cfc83b6cSPedro Giffuni                          specification of bitmaps for the About box.
846cfc83b6cSPedro Giffuni
847cfc83b6cSPedro Giffuni                          Usage: --with-about-bitmaps=/path/my_ooo_about.bmp
848cfc83b6cSPedro Giffuni],,)
849cfc83b6cSPedro GiffuniAC_ARG_WITH(vendor,
850cfc83b6cSPedro Giffuni[  --with-vendor           Set vendor of the build.
851cfc83b6cSPedro Giffuni
852cfc83b6cSPedro Giffuni                          Usage: --with-vendor="John the Builder"
853cfc83b6cSPedro Giffuni],,)
854cfc83b6cSPedro GiffuniAC_ARG_WITH(unix-wrapper,
855cfc83b6cSPedro Giffuni[  --with-unix-wrapper    Redefines the name of the UNIX wrapper that will be used
856cfc83b6cSPedro Giffuni                          in the desktop files and in the desktop-integration RPMs.
857cfc83b6cSPedro Giffuni
858cfc83b6cSPedro Giffuni                          Usage: --with-unix-wrapper=ooffice
859cfc83b6cSPedro Giffuni],,)
860cfc83b6cSPedro GiffuniAC_ARG_WITH(asm-home,
861cfc83b6cSPedro Giffuni[  --with-asm-home         For Windows users, please supply the path for the
862cfc83b6cSPedro Giffuni                          ml.exe assembler.
863cfc83b6cSPedro Giffuni
864cfc83b6cSPedro Giffuni                          Usage: --with-asm-home=<path to ml.exe directory>
865cfc83b6cSPedro Giffuni],,)
866ad35682bStruckmanAC_ARG_WITH(nasm-home,
867ad35682bStruckman[  --with-nasm-home        For Windows users, please supply the path for the
868ad35682bStruckman                          nasm.exe assembler.
869ad35682bStruckman
870ad35682bStruckman                          Usage: --with-nasm-home=<path to nasm.exe directory>
871ad35682bStruckman],,)
872cfc83b6cSPedro GiffuniAC_ARG_WITH(os-version,
873cfc83b6cSPedro Giffuni[  --with-os-version       For FreeBSD users, use this option option to override
874cfc83b6cSPedro Giffuni                          the detected OSVERSION.
875cfc83b6cSPedro Giffuni
876cfc83b6cSPedro Giffuni                          Usage: --with-os-version=<OSVERSION>
877cfc83b6cSPedro Giffuni],,)
878cfc83b6cSPedro GiffuniAC_ARG_WITH(unzip-home,
879cfc83b6cSPedro Giffuni[  --with-unzip-home       Deprecated: use --with-zip-home instead],,)
880cfc83b6cSPedro GiffuniAC_ARG_WITH(zip-home,
881407bc2eeSMatthias Seidel[  --with-zip-home         If you use a non standard zip, for example Windows
882cfc83b6cSPedro Giffuni                          please supply the path for zip
883cfc83b6cSPedro Giffuni
884cfc83b6cSPedro Giffuni                          Usage: --with-zip-home=<path to zip executable>
885cfc83b6cSPedro Giffuni],,)
886cfc83b6cSPedro GiffuniAC_ARG_WITH(mingwin,
887cfc83b6cSPedro Giffuni[  --with-mingwin          For Windows users, use the mingwin32 compiler within
888cfc83b6cSPedro Giffuni                          cygwin environment
889cfc83b6cSPedro Giffuni
890cfc83b6cSPedro Giffuni                          Usage: --with-mingwin=yes
891cfc83b6cSPedro Giffuni
892cfc83b6cSPedro Giffuni                          For !Windows use, use the mingw32 C++ compiler to
893cfc83b6cSPedro Giffuni                          (re-) build unowinreg.dll. Specify the MinGW C++
894cfc83b6cSPedro Giffuni                          Compilers name.
895cfc83b6cSPedro Giffuni
896cfc83b6cSPedro Giffuni                          Usage: --with-mingwin=i586-mingw32msvc-g++
897cfc83b6cSPedro Giffuni],WITH_MINGWIN=$withval,WITH_MINGWIN=0)
898cfc83b6cSPedro GiffuniAC_ARG_WITH(build-version,
899cfc83b6cSPedro Giffuni[  --with-build-version    Allows the builder to add a custom version tag
900cfc83b6cSPedro Giffuni                          that will appear in the Help/About box for QA
901cfc83b6cSPedro Giffuni                          purposes.
902cfc83b6cSPedro Giffuni
903cfc83b6cSPedro Giffuni                          Usage: --with-build-version="Built by Jim"
904cfc83b6cSPedro Giffuni],with_build_version=$withval)
905cfc83b6cSPedro GiffuniAC_ARG_WITH(alloc,
906cfc83b6cSPedro Giffuni[  --with-alloc            Define which allocator to build with
907cfc83b6cSPedro Giffuni                          (choices are oo, system, tcmalloc, jemalloc)
908cfc83b6cSPedro Giffuni
909cfc83b6cSPedro Giffuni                          Note that on FreeBSD/NetBSD system==jemalloc
910cfc83b6cSPedro Giffuni],,)
911cfc83b6cSPedro GiffuniAC_ARG_ENABLE(verbose,
912cfc83b6cSPedro Giffuni[  --enable-verbose        Increase build verbosity.
913cfc83b6cSPedro Giffuni  --disable-verbose       Decrease build verbosity.
914cfc83b6cSPedro Giffuni],,)
915cfc83b6cSPedro GiffuniAC_ARG_ENABLE(dependency-tracking,
916cfc83b6cSPedro Giffuni[  --disable-dependency-tracking  Disables generation of dependency information.
917cfc83b6cSPedro Giffuni],,)
918cfc83b6cSPedro GiffuniAC_ARG_ENABLE(category-b,
919cfc83b6cSPedro Giffuni[  --enable-category-b     Activate components under a category B license
920cfc83b6cSPedro Giffuni                          (see http://www.apache.org/legal/3party.html#category-b):
9214c76cf94Spfg                          MPL (hunspell, hyphen, nss, saxon, rhino),
922cfc83b6cSPedro Giffuni                          CPL (silgraphite), CPL/EPL (CoinMP), OFL (fonts).
923cfc83b6cSPedro Giffuni                          Flags for individual libraries override this one.
924cfc83b6cSPedro Giffuni],,)
925cfc83b6cSPedro GiffuniAC_ARG_WITH(arm-target,
926cfc83b6cSPedro Giffuni[  --arm-target            The minimal targeted arm processor
927cfc83b6cSPedro Giffuni                              used for the build environment.
928cfc83b6cSPedro Giffuni                              Cases :
929cfc83b6cSPedro Giffuni                                arm-target < 6 : armv4t compatibility
930cfc83b6cSPedro Giffuni                                arm-target = 6 : exact armv6 compatibility
931cfc83b6cSPedro Giffuni                                arm-target > 6 : armv7-a compatibility
932cfc83b6cSPedro Giffuni
933cfc83b6cSPedro Giffuni                              Usage: --with-arm-target=7
934cfc83b6cSPedro Giffuni],with_arm_target=$withval,with_arm_target=4)
9350d16e2e7SJim JagielskiAC_ARG_WITH(macosx-target,
9360d16e2e7SJim Jagielski[  --macosx-target            The minimal macOS/OSX deployment and build target
9370d16e2e7SJim Jagielski
938eda86b37SJim Jagielski                              Usage: --with-macosx-target=10.7
9390d16e2e7SJim Jagielski],with_macosx_target=$withval,with_macosx_target=10.7)
940cfc83b6cSPedro GiffuniAC_ARG_WITH(rat-scan,
941cfc83b6cSPedro Giffuni[  --with-rat-scan         Scan source code for license headers.
942cfc83b6cSPedro Giffuni                          Use as --with-rat-scan to automatically download pre-built Rat binaries.
943cfc83b6cSPedro Giffuni                          Alternatively use as --with-rat-scan=<path-to-rat-direcetory> to use
944cfc83b6cSPedro Giffuni                          a separately installed library.
945cfc83b6cSPedro Giffuni],with_rat_scan=$withval,)
946cfc83b6cSPedro Giffuni
947cfc83b6cSPedro GiffuniBUILD_TYPE="OOo"
948cfc83b6cSPedro GiffuniADDITIONAL_REPOSITORIES="../ext_libraries"
949cfc83b6cSPedro GiffuniSCPDEFS=""
950cfc83b6cSPedro Giffuni
951cfc83b6cSPedro Giffunidnl ===================================================================
95231353920Spfgdnl Check configure script vs. configure.ac
953cfc83b6cSPedro Giffunidnl ===================================================================
954cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether configure is up-to-date])
95531353920Spfgif test "configure" -ot "configure.ac"; then
956cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
957cfc83b6cSPedro Giffuni   AC_MSG_ERROR([configure is not up-to-date, run autoconf first!])
958cfc83b6cSPedro Giffunielse
959cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
960cfc83b6cSPedro Giffunifi
961cfc83b6cSPedro Giffunidnl ===================================================================
962cfc83b6cSPedro Giffunidnl Message.
963cfc83b6cSPedro Giffunidnl ===================================================================
964cfc83b6cSPedro Giffuniecho "********************************************************************"
965cfc83b6cSPedro Giffuniecho "*                                                                  *"
966cfc83b6cSPedro Giffuniecho "*   Apache OpenOffice build configuration.                         *"
967cfc83b6cSPedro Giffuniecho "*                                                                  *"
968cfc83b6cSPedro Giffuniecho "*   The configure process checks your platform to see whether      *"
969cfc83b6cSPedro Giffuniecho "*   you can build Apache OpenOffice on it.                         *"
970cfc83b6cSPedro Giffuniecho "*   This process checks all pre-requisites and generates a file    *"
971cfc83b6cSPedro Giffuniecho "*   containing the necessary environment variables.                *"
972cfc83b6cSPedro Giffuniecho "*   Source this file after configure has ended successfully.       *"
973cfc83b6cSPedro Giffuniecho "*                                                                  *"
974cfc83b6cSPedro Giffuniecho "*   Warnings that are generated during the configure process       *"
975cfc83b6cSPedro Giffuniecho "*   must be taken into account since it can be a reason for        *"
976cfc83b6cSPedro Giffuniecho "*   an unsuccessful build of Apache OpenOffice.                    *"
977cfc83b6cSPedro Giffuniecho "*                                                                  *"
978cfc83b6cSPedro Giffuniecho "********************************************************************"
979cfc83b6cSPedro Giffuniecho ""
980cfc83b6cSPedro Giffuniecho "********************************************************************"
981cfc83b6cSPedro Giffuniecho "*                                                                  *"
982cfc83b6cSPedro Giffuniecho "*   Checking the platform pre-requisites.                          *"
983cfc83b6cSPedro Giffuniecho "*                                                                  *"
984cfc83b6cSPedro Giffuniecho "********************************************************************"
985cfc83b6cSPedro Giffuniecho ""
986cfc83b6cSPedro Giffunidnl ===================================================================
987cfc83b6cSPedro Giffunidnl Configure pre-requisites.
988cfc83b6cSPedro Giffunidnl ===================================================================
989cfc83b6cSPedro Giffunicat /dev/null > warn
990cfc83b6cSPedro Giffuni
991cfc83b6cSPedro GiffuniAC_PROG_EGREP
992308295dbSJim Jagielskiif test -z "$GREP"; then
993308295dbSJim JagielskiGREP=$EGREP
994308295dbSJim Jagielskifi
995cfc83b6cSPedro GiffuniAC_PROG_AWK
996cfc83b6cSPedro GiffuniAC_PATH_PROG( AWK, $AWK)
997cfc83b6cSPedro Giffuniif test -z "$AWK"; then
998cfc83b6cSPedro Giffuni   AC_MSG_ERROR([install awk to run this script])
999cfc83b6cSPedro Giffunifi
1000cfc83b6cSPedro Giffuni
1001cfc83b6cSPedro GiffuniAC_PATH_PROGS(SED, sed )
1002cfc83b6cSPedro Giffuniif test -z "$SED"; then
1003cfc83b6cSPedro Giffuni   AC_MSG_ERROR([install sed to run this script])
1004cfc83b6cSPedro Giffunifi
1005cfc83b6cSPedro Giffuni
1006cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for solenv environment])
1007cfc83b6cSPedro Giffuniif test -z "$with_local_solenv"; then
1008cfc83b6cSPedro Giffuni   LOCAL_SOLENV="DEFAULT"
1009cfc83b6cSPedro Giffuni   AC_MSG_RESULT([default])
1010cfc83b6cSPedro Giffunielse
1011cfc83b6cSPedro Giffuni   LOCAL_SOLENV=$with_local_solenv
1012cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$with_local_solenv])
1013cfc83b6cSPedro Giffunifi
1014cfc83b6cSPedro GiffuniAC_SUBST(LOCAL_SOLENV)
1015cfc83b6cSPedro Giffuni
1016cfc83b6cSPedro Giffuniif test "$LOCAL_SOLENV" = "DEFAULT"; then
1017cfc83b6cSPedro Giffuni  _solenv="./solenv"
1018cfc83b6cSPedro Giffunielse
1019cfc83b6cSPedro Giffuni  _solenv="$LOCAL_SOLENV"
1020cfc83b6cSPedro Giffunifi
1021cfc83b6cSPedro GiffuniAC_SUBST(_solenv)
1022cfc83b6cSPedro Giffuni
1023cfc83b6cSPedro Giffuniif test -e $_solenv/inc/minor.mk; then
1024cfc83b6cSPedro Giffuni   # Get UPD number from ./solenv/inc/minor.mk
102528633775SPedro Giffuni   UPD="`$GREP RSCVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`"
1026cfc83b6cSPedro Giffuni   AC_SUBST(UPD)
102728633775SPedro Giffuni   SOURCEVERSION="`$GREP SOURCEVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`"
1028cfc83b6cSPedro Giffuni   AC_SUBST(SOURCEVERSION)
1029cfc83b6cSPedro Giffunielse
1030cfc83b6cSPedro Giffuni   AC_MSG_ERROR([$_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation...])
1031cfc83b6cSPedro Giffunifi
1032cfc83b6cSPedro Giffuni
1033cfc83b6cSPedro Giffuni
1034cfc83b6cSPedro Giffunidnl ==================================================================
1035cfc83b6cSPedro Giffunidnl Checks for custom pack.lst
1036cfc83b6cSPedro Giffunidnl ==================================================================
1037cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for custom pack.lst])
1038cfc83b6cSPedro GiffuniCUSTOM_PACK_LIST=
1039cfc83b6cSPedro GiffuniUSE_PACKAGER=
1040cfc83b6cSPedro Giffuniif test -n "$with_packager_list" ; then
1041cfc83b6cSPedro Giffuni    if test -e $with_packager_list; then
1042cfc83b6cSPedro Giffuni      CUSTOM_PACK_LIST=$with_packager_list
1043cfc83b6cSPedro Giffuni      USE_PACKAGER=YES
1044cfc83b6cSPedro Giffuni    fi
1045cfc83b6cSPedro Giffunifi
1046cfc83b6cSPedro Giffuniif test -n "$CUSTOM_PACK_LIST"; then
1047cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$CUSTOM_PACK_LIST])
1048cfc83b6cSPedro Giffunielse
1049cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1050cfc83b6cSPedro Giffunifi
1051cfc83b6cSPedro GiffuniAC_SUBST(CUSTOM_PACK_LIST)
1052cfc83b6cSPedro GiffuniAC_SUBST(USE_PACKAGER)
1053cfc83b6cSPedro Giffuni
1054cfc83b6cSPedro Giffuni
1055cfc83b6cSPedro Giffunidnl ===================================================================
1056cfc83b6cSPedro Giffunidnl Checks for the operating system and processor.
1057cfc83b6cSPedro Giffunidnl ===================================================================
1058cfc83b6cSPedro GiffuniAC_CANONICAL_SYSTEM
1059cfc83b6cSPedro Giffuniif test "$build" != "$host" -o "$build" != "$target" \
1060cfc83b6cSPedro Giffuni  -o "$host" != "$target"; then
1061cfc83b6cSPedro Giffuni    AC_MSG_WARN([cross-compiling by any means is not supported (yet)!])
1062cfc83b6cSPedro Giffuni    echo "cross-compiling by any means is not supported (yet)!" >> warn
1063cfc83b6cSPedro Giffunifi
1064cfc83b6cSPedro Giffuni
106528633775SPedro Giffuniif echo "$build_os" | $GREP cygwin; then
1066cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([Cygwin version])
1067cfc83b6cSPedro Giffuni   CygwinVer=`uname -r`
1068cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$CygwinVer])
1069cfc83b6cSPedro Giffuni   if test "`echo $CygwinVer | $AWK -F . '{ print $1$2 }'`" -lt "15"; then
1070cfc83b6cSPedro Giffuni      AC_MSG_ERROR([You need at least Cygwin V1.5.x])
1071cfc83b6cSPedro Giffuni   fi
1072cfc83b6cSPedro Giffunielse
1073cfc83b6cSPedro Giffuni   CygwinVer="false"
1074cfc83b6cSPedro Giffunifi
1075cfc83b6cSPedro Giffuni
1076cfc83b6cSPedro Giffuni# get info about the system provided release/version details
1077cfc83b6cSPedro Giffunihead /etc/*-release
1078cfc83b6cSPedro Giffuniuname -a
1079cfc83b6cSPedro Giffuni
1080cfc83b6cSPedro Giffunidnl ===================================================================
1081cfc83b6cSPedro Giffunidnl The following is a list of supported systems.
1082cfc83b6cSPedro Giffunidnl Sequential to keep the logic very simple
1083cfc83b6cSPedro Giffunidnl These values may be checked and reset later.
1084cfc83b6cSPedro Giffunidnl ===================================================================
1085cfc83b6cSPedro Giffunicase "$build_os" in
1086cfc83b6cSPedro Giffuni    solaris*)
1087cfc83b6cSPedro Giffuni        test_gtk=yes
1088cfc83b6cSPedro Giffuni        test_cairo=yes
1089cfc83b6cSPedro Giffuni        test_kde=yes
1090cfc83b6cSPedro Giffuni        test_cups=yes
1091cfc83b6cSPedro Giffuni            test_randr=yes
1092cfc83b6cSPedro Giffuni        test_freetype=yes
1093cfc83b6cSPedro Giffuni            test_gstreamer=yes
1094cfc83b6cSPedro Giffuni        _os=SunOS
1095cfc83b6cSPedro Giffuni        AC_PATH_PROG( GNUTAR, gtar,,$PATH:/usr/sfw/bin)
1096cfc83b6cSPedro Giffuni        if test -z "$GNUTAR"; then
1097cfc83b6cSPedro Giffuni            AC_MSG_ERROR([gtar (gnu tar) not found but needed. Install it (SUN Freeware package).])
1098cfc83b6cSPedro Giffuni        fi
1099cfc83b6cSPedro Giffuni        AC_SUBST(GNUTAR)
1100cfc83b6cSPedro Giffuni
1101cfc83b6cSPedro Giffuni        dnl ===========================================================
1102cfc83b6cSPedro Giffuni        dnl check whether we're using solaris 6,7,8 - sparc or intel.
1103cfc83b6cSPedro Giffuni        dnl ===========================================================
1104cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([the Solaris operating system release])
1105cfc83b6cSPedro Giffuni        _os_release=`echo $build_os | $SED -e s/solaris2\.//`
1106cfc83b6cSPedro Giffuni        if test "$_os_release" -lt "6"; then
1107cfc83b6cSPedro Giffuni                AC_MSG_ERROR([use solaris >= 6 to build Apache OpenOffice])
1108cfc83b6cSPedro Giffuni        else
1109cfc83b6cSPedro Giffuni                AC_MSG_RESULT([ok ($_os_release)])
1110cfc83b6cSPedro Giffuni        fi
1111cfc83b6cSPedro Giffuni
1112cfc83b6cSPedro Giffuni        dnl check whether we're using a sparc or i386 processor
1113cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([the processor type])
1114cfc83b6cSPedro Giffuni        if test "$build_cpu" = "sparc" -o "$build_cpu" = "i386"; then
1115cfc83b6cSPedro Giffuni                AC_MSG_RESULT([ok ($build_cpu)])
1116cfc83b6cSPedro Giffuni        else
1117cfc83b6cSPedro Giffuni                AC_MSG_ERROR([only sparc and i386 processors are supported])
1118cfc83b6cSPedro Giffuni        fi
1119cfc83b6cSPedro Giffuni        ;;
1120cfc83b6cSPedro Giffuni    linux-gnu*|k*bsd*-gnu*)
1121cfc83b6cSPedro Giffuni        test_gtk=yes
1122cfc83b6cSPedro Giffuni        test_cairo=yes
1123cfc83b6cSPedro Giffuni        test_kde=yes
1124cfc83b6cSPedro Giffuni        test_kde4=yes
1125cfc83b6cSPedro Giffuni        test_cups=yes
1126cfc83b6cSPedro Giffuni            test_randr=yes
1127cfc83b6cSPedro Giffuni        test_freetype=yes
1128cfc83b6cSPedro Giffuni            test_gstreamer=yes
1129cfc83b6cSPedro Giffuni            _os=Linux
1130cfc83b6cSPedro Giffuni        ;;
1131cfc83b6cSPedro Giffuni    gnu)
1132cfc83b6cSPedro Giffuni        test_cups=no
1133cfc83b6cSPedro Giffuni        _os=GNU
1134cfc83b6cSPedro Giffuni        ;;
1135cfc83b6cSPedro Giffuni    cygwin*) # Windows
1136cfc83b6cSPedro Giffuni        test_cups=no
1137cfc83b6cSPedro Giffuni        test_cairo=yes
1138cfc83b6cSPedro Giffuni        test_freetype=no
1139cfc83b6cSPedro Giffuni            test_gstreamer=no
1140cfc83b6cSPedro Giffuni        _os=WINNT
1141cfc83b6cSPedro Giffuni        ;;
1142cfc83b6cSPedro Giffuni    darwin*) # Mac OS X
1143cfc83b6cSPedro Giffuni        test_cups=yes
1144cfc83b6cSPedro Giffuni        test_gtk=yes
1145cfc83b6cSPedro Giffuni        test_cairo=yes
1146cfc83b6cSPedro Giffuni            test_randr=no
1147cfc83b6cSPedro Giffuni        test_freetype=no
1148cfc83b6cSPedro Giffuni            test_gstreamer=no
1149cfc83b6cSPedro Giffuni        _os=Darwin
1150cfc83b6cSPedro Giffuni            if test "$enable_systray" = "yes" && test "$enable_gtk" != "no"; then
1151cfc83b6cSPedro Giffuni               AC_MSG_WARN([Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray])
1152cfc83b6cSPedro Giffuni               echo "Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >>warn
1153cfc83b6cSPedro Giffuni               enable_systray=no
1154cfc83b6cSPedro Giffuni            fi
1155cfc83b6cSPedro Giffuni        if test ! -n "$CC"; then
1156cfc83b6cSPedro Giffuni           CC="`xcrun -f clang` -arch x86_64"
1157cfc83b6cSPedro Giffuni        fi
1158cfc83b6cSPedro Giffuni        if test ! -n "$CXX"; then
115987bf159bSJim Jagielski           CXX="`xcrun -f clang++` -arch x86_64"
1160cfc83b6cSPedro Giffuni        fi
1161221de5adSjim        # Don't use OSVERSION until we know no conflicts result from it
1162221de5adSjim        _darwin_version="`uname -r | $AWK -F . '{ print $1 }'`"
1163221de5adSjim        _osx_version="10.`expr $_darwin_version - 4`"
1164221de5adSjim        AC_MSG_NOTICE([Detected Darwin version: $_darwin_version ($_osx_version)])
1165cfc83b6cSPedro Giffuni        ;;
1166cfc83b6cSPedro Giffuni    os2*)
1167cfc83b6cSPedro Giffuni        test_x=no
1168cfc83b6cSPedro Giffuni        test_cups=no
1169cfc83b6cSPedro Giffuni            test_randr=no
1170cfc83b6cSPedro Giffuni        test_gtk=no
1171cfc83b6cSPedro Giffuni        test_freetype=no
1172cfc83b6cSPedro Giffuni            test_gstreamer=no
1173906a4e93SYuri Dario        test_cairo=yes
1174cfc83b6cSPedro Giffuni        _os=OS2
1175cfc83b6cSPedro Giffuni        ;;
1176cfc83b6cSPedro Giffuni    freebsd*)
1177cfc83b6cSPedro Giffuni        test_gtk=yes
1178cfc83b6cSPedro Giffuni        test_cairo=yes
1179cfc83b6cSPedro Giffuni        test_kde=yes
1180cfc83b6cSPedro Giffuni        test_kde4=yes
1181cfc83b6cSPedro Giffuni        test_cups=yes
1182cfc83b6cSPedro Giffuni            test_randr=yes
1183cfc83b6cSPedro Giffuni        test_freetype=yes
1184cfc83b6cSPedro Giffuni            test_gstreamer=yes
1185cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([the FreeBSD operating system release])
1186cfc83b6cSPedro Giffuni        if test -n "$with_os_version"; then
1187cfc83b6cSPedro Giffuni            OSVERSION="$with_os_version"
1188cfc83b6cSPedro Giffuni        else
1189cfc83b6cSPedro Giffuni            OSVERSION=`/sbin/sysctl -n kern.osreldate`
1190cfc83b6cSPedro Giffuni        fi
1191cfc83b6cSPedro Giffuni        AC_MSG_RESULT([found OSVERSION=$OSVERSION])
1192cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([which thread library to use])
1193cfc83b6cSPedro Giffuni        if test "$OSVERSION" -lt "500016"; then
1194cfc83b6cSPedro Giffuni            PTHREAD_CFLAGS="-D_THREAD_SAFE"
1195cfc83b6cSPedro Giffuni            PTHREAD_LIBS="-pthread"
1196cfc83b6cSPedro Giffuni        elif test "$OSVERSION" -lt "502102"; then
1197cfc83b6cSPedro Giffuni            PTHREAD_CFLAGS="-D_THREAD_SAFE"
1198cfc83b6cSPedro Giffuni            PTHREAD_LIBS="-lc_r"
1199cfc83b6cSPedro Giffuni        else
1200cfc83b6cSPedro Giffuni            PTHREAD_CFLAGS=""
1201cfc83b6cSPedro Giffuni            PTHREAD_LIBS="-pthread"
1202cfc83b6cSPedro Giffuni        fi
1203cfc83b6cSPedro Giffuni        AC_MSG_RESULT([$PTHREAD_LIBS])
1204cfc83b6cSPedro Giffuni        _os=FreeBSD
1205cfc83b6cSPedro Giffuni        ;;
1206cfc83b6cSPedro Giffuni    osf)
1207cfc83b6cSPedro Giffuni        test_cups=no
1208cfc83b6cSPedro Giffuni            test_randr=no
1209cfc83b6cSPedro Giffuni        _os=OSF1
1210cfc83b6cSPedro Giffuni        ;;
1211cfc83b6cSPedro Giffuni    netbsd)
1212cfc83b6cSPedro Giffuni        test_gtk=yes
1213cfc83b6cSPedro Giffuni        test_cairo=yes
1214cfc83b6cSPedro Giffuni        test_kde=yes
1215cfc83b6cSPedro Giffuni        test_kde4=yes
1216cfc83b6cSPedro Giffuni        test_cups=no
1217cfc83b6cSPedro Giffuni            test_randr=yes
1218cfc83b6cSPedro Giffuni        test_freetype=yes
1219cfc83b6cSPedro Giffuni            test_gstreamer=yes
1220cfc83b6cSPedro Giffuni        PTHREAD_CFLAGS="-pthread"
1221cfc83b6cSPedro Giffuni        PTHREAD_LIBS="-pthread -lpthread"
1222cfc83b6cSPedro Giffuni        _os=NetBSD
1223cfc83b6cSPedro Giffuni        ;;
1224cfc83b6cSPedro Giffuni    aix*)
1225cfc83b6cSPedro Giffuni        test_cups=no
1226cfc83b6cSPedro Giffuni            test_randr=no
1227cfc83b6cSPedro Giffuni        test_freetype=yes
1228cfc83b6cSPedro Giffuni            test_gstreamer=yes
1229cfc83b6cSPedro Giffuni        PTHREAD_LIBS=-pthread
1230cfc83b6cSPedro Giffuni        echo "AIX is an alpha port --- Use at own risk" >> warn
1231cfc83b6cSPedro Giffuni        _os=AIX
1232cfc83b6cSPedro Giffuni        ;;
1233cfc83b6cSPedro Giffuni   *)
1234cfc83b6cSPedro Giffuni   AC_MSG_ERROR([$_os operating system is not suitable to build Apache OpenOffice!])
1235cfc83b6cSPedro Giffuni   ;;
1236cfc83b6cSPedro Giffuniesac
1237cfc83b6cSPedro Giffuni
1238cfc83b6cSPedro GiffuniAC_SUBST(OSVERSION)
1239cfc83b6cSPedro GiffuniAC_SUBST(PTHREAD_CFLAGS)
1240cfc83b6cSPedro GiffuniAC_SUBST(PTHREAD_LIBS)
1241cfc83b6cSPedro Giffuni
1242cfc83b6cSPedro Giffuni
1243cfc83b6cSPedro Giffunidnl Ensure pkg-config is initialized before any possible use
1244cfc83b6cSPedro GiffuniPKG_PROG_PKG_CONFIG
1245cfc83b6cSPedro Giffuni
1246cfc83b6cSPedro Giffuni
1247cfc83b6cSPedro Giffunidnl ===================================================================
1248cfc83b6cSPedro Giffunidnl Set the ENABLE_CRASHDUMP variable.
1249cfc83b6cSPedro Giffunidnl ===================================================================
1250cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable crashdump feature])
1251cfc83b6cSPedro Giffuniif test "$enable_crashdump" = "yes"; then
1252cfc83b6cSPedro Giffuni   ENABLE_CRASHDUMP="TRUE"
1253cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE CRASHREP"
1254cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1255cfc83b6cSPedro Giffunielse
1256cfc83b6cSPedro Giffuni   ENABLE_CRASHDUMP=""
1257cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1258cfc83b6cSPedro Giffunifi
1259cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_CRASHDUMP)
1260cfc83b6cSPedro Giffuni
1261cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
1262cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE TWAIN"
1263cfc83b6cSPedro Giffunifi
1264cfc83b6cSPedro Giffuni
1265cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
1266cfc83b6cSPedro Giffuni   dnl ===================================================================
1267cfc83b6cSPedro Giffuni   dnl Set the VC_STANDARD variable.
1268cfc83b6cSPedro Giffuni   dnl ===================================================================
1269cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether to use the standard non-optimizing compiler])
1270cfc83b6cSPedro Giffuni   if test "$enable_cl_standard" = "" -o "$enable_cl_standard" = "no"; then
1271cfc83b6cSPedro Giffuni      VC_STANDARD=""
1272cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
1273cfc83b6cSPedro Giffuni   else
1274cfc83b6cSPedro Giffuni      VC_STANDARD="TRUE"
1275cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
1276cfc83b6cSPedro Giffuni   fi
1277cfc83b6cSPedro Giffuni   AC_SUBST(VC_STANDARD)
1278cfc83b6cSPedro Giffunifi
1279cfc83b6cSPedro Giffuni
1280cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
1281cfc83b6cSPedro Giffuni   dnl ===================================================================
1282cfc83b6cSPedro Giffuni   dnl Set the BUILD_X64 variable.
1283cfc83b6cSPedro Giffuni   dnl ===================================================================
1284cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether to build/use the Windows 64bit shell extensions])
1285cfc83b6cSPedro Giffuni   if test "$enable_win_x64_shellext" = "" -o "$enable_win_x64_shellext" = "no"; then
1286cfc83b6cSPedro Giffuni      BUILD_X64=""
1287cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
1288cfc83b6cSPedro Giffuni   else
1289cfc83b6cSPedro Giffuni      BUILD_X64="TRUE"
1290cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
1291cfc83b6cSPedro Giffuni   fi
1292cfc83b6cSPedro Giffuni   AC_SUBST(BUILD_X64)
1293edd74ba5SDamjan Jovanovic
1294edd74ba5SDamjan Jovanovic   dnl ===================================================================
1295edd74ba5SDamjan Jovanovic   dnl Set the BUILD_WIN64 variable.
1296edd74ba5SDamjan Jovanovic   dnl ===================================================================
1297edd74ba5SDamjan Jovanovic   AC_MSG_CHECKING([whether to build 64 bit OpenOffice on 64 bit Windows])
1298edd74ba5SDamjan Jovanovic   if test "$build_cpu" = "x86_64" ; then
1299edd74ba5SDamjan Jovanovic      if test "x$enable_win64" != "xno" ; then
1300edd74ba5SDamjan Jovanovic         BUILD_WIN64="TRUE"
1301edd74ba5SDamjan Jovanovic         AC_MSG_RESULT([yes])
1302edd74ba5SDamjan Jovanovic         OOWINTOOL="./oowintool"
1303edd74ba5SDamjan Jovanovic      else
1304edd74ba5SDamjan Jovanovic         BUILD_WIN64=""
1305edd74ba5SDamjan Jovanovic         AC_MSG_RESULT([no])
1306edd74ba5SDamjan Jovanovic         OOWINTOOL="./oowintool --aoo32-on-win64"
1307edd74ba5SDamjan Jovanovic      fi
1308edd74ba5SDamjan Jovanovic   else
1309edd74ba5SDamjan Jovanovic      if test "x$enable_win64" != "xno" ; then
1310edd74ba5SDamjan Jovanovic         AC_MSG_ERROR([the --enable-win64 option can only be used on an AMD64 CPU])
1311edd74ba5SDamjan Jovanovic      fi
1312edd74ba5SDamjan Jovanovic      BUILD_WIN64=""
1313edd74ba5SDamjan Jovanovic      AC_MSG_RESULT([no])
1314edd74ba5SDamjan Jovanovic      OOWINTOOL="./oowintool"
1315edd74ba5SDamjan Jovanovic   fi
1316edd74ba5SDamjan Jovanovic   AC_SUBST(BUILD_WIN64)
1317cfc83b6cSPedro Giffunifi
1318cfc83b6cSPedro Giffuni
1319cfc83b6cSPedro Giffunidnl ===================================================================
1320cfc83b6cSPedro Giffunidnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
1321cfc83b6cSPedro Giffunidnl ===================================================================
1322cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to turn warnings to errors])
1323cfc83b6cSPedro Giffuniif test -n "$enable_werror" && test "$enable_werror" != "no"; then
1324cfc83b6cSPedro Giffuni   ENABLE_WERROR="TRUE"
1325cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1326cfc83b6cSPedro Giffuni   AC_MSG_WARN([Turning warnings to errors has no effect in modules or])
1327cfc83b6cSPedro Giffuni   AC_MSG_WARN([on platforms where it has been disabled explicitely])
1328cfc83b6cSPedro Giffuni   echo "Turning warnings to errors has no effect in modules or on platforms where it has been disabled explicitely" >> warn
1329cfc83b6cSPedro Giffunielse
1330cfc83b6cSPedro Giffuni   ENABLE_WERROR="FALSE"
1331cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1332cfc83b6cSPedro Giffunifi
1333cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_WERROR)
1334cfc83b6cSPedro Giffuni
1335cfc83b6cSPedro Giffunidnl ===================================================================
1336cfc83b6cSPedro Giffunidnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
1337cfc83b6cSPedro Giffunidnl ===================================================================
1338cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to do a debug build])
1339cfc83b6cSPedro Giffuniif test -n "$enable_debug" && test "$enable_debug" != "no"; then
1340cfc83b6cSPedro Giffuni   ENABLE_DEBUG="TRUE"
1341cfc83b6cSPedro Giffuni   if test -z "$enable_symbols"; then
1342cfc83b6cSPedro Giffuni      enable_symbols="yes"
1343cfc83b6cSPedro Giffuni   fi
1344cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1345cfc83b6cSPedro Giffunielse
1346cfc83b6cSPedro Giffuni   ENABLE_DEBUG="FALSE"
1347cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1348cfc83b6cSPedro Giffunifi
1349cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_DEBUG)
1350cfc83b6cSPedro Giffuni
1351cfc83b6cSPedro Giffunidnl ===================================================================
1352cfc83b6cSPedro Giffunidnl Set the ENABLE_DBGUTIL variable
1353cfc83b6cSPedro Giffunidnl ===================================================================
1354cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build with additional debug utilities])
1355cfc83b6cSPedro Giffuniif test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
1356cfc83b6cSPedro Giffuni   PROEXT=""
1357cfc83b6cSPedro Giffuni   PRODUCT=""
1358cfc83b6cSPedro Giffuni   PROFULLSWITCH=""
1359cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1360cfc83b6cSPedro Giffunielse
1361cfc83b6cSPedro Giffuni   PRODUCT="full"
1362cfc83b6cSPedro Giffuni   PROFULLSWITCH="product=full"
1363cfc83b6cSPedro Giffuni   PROEXT=".pro"
1364cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no, full product build])
1365cfc83b6cSPedro Giffunifi
1366cfc83b6cSPedro GiffuniAC_SUBST(PRODUCT)
1367cfc83b6cSPedro GiffuniAC_SUBST(PROFULLSWITCH)
1368cfc83b6cSPedro GiffuniAC_SUBST(PROEXT)
1369cfc83b6cSPedro Giffuni
1370cfc83b6cSPedro Giffunidnl ===================================================================
1371cfc83b6cSPedro Giffunidnl First setting is whether to include symbols into final build.
1372cfc83b6cSPedro Giffunidnl ===================================================================
1373cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to include symbols into final build])
1374cfc83b6cSPedro Giffuniif test -n "$enable_symbols" && test "$enable_symbols" != "no"; then
1375cfc83b6cSPedro Giffuni    if test "$enable_symbols" = "yes" -o "$enable_symbols" = "TRUE"; then
1376cfc83b6cSPedro Giffuni        ENABLE_SYMBOLS="TRUE"
1377cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes])
1378cfc83b6cSPedro Giffuni    else
1379cfc83b6cSPedro Giffuni        if test "$enable_symbols" = "SMALL" -o "$enable_symbols" = "small"; then
1380cfc83b6cSPedro Giffuni            ENABLE_SYMBOLS="SMALL"
1381cfc83b6cSPedro Giffuni            AC_MSG_RESULT([yes, small ones])
1382cfc83b6cSPedro Giffuni        else if test "$enable_symbols" != "no" ; then
1383cfc83b6cSPedro Giffuni                 echo enable symbols is: $enable_symbols
1384cfc83b6cSPedro Giffuni                 AC_MSG_ERROR([--enable-symbols only accepts yes, TRUE or SMALL as parameter.])
1385cfc83b6cSPedro Giffuni                 else
1386cfc83b6cSPedro Giffuni                         ENABLE_SYMBOLS=
1387cfc83b6cSPedro Giffuni             fi
1388cfc83b6cSPedro Giffuni        fi
1389cfc83b6cSPedro Giffuni    fi
1390cfc83b6cSPedro Giffunielse
1391cfc83b6cSPedro Giffuni   ENABLE_SYMBOLS=
1392cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1393cfc83b6cSPedro Giffunifi
1394cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_SYMBOLS)
1395cfc83b6cSPedro Giffuni
1396cfc83b6cSPedro Giffunidnl ===================================================================
1397cfc83b6cSPedro Giffunidnl Determine if the solver is to be stripped or not.
1398cfc83b6cSPedro Giffunidnl ===================================================================
1399cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to strip the solver or not.])
1400cfc83b6cSPedro Giffuniif test -n "$enable_strip_solver"; then
1401cfc83b6cSPedro Giffuni   if test "$enable_strip_solver" = "yes"; then
1402cfc83b6cSPedro Giffuni      DISABLE_STRIP=
1403cfc83b6cSPedro Giffuni   else if test "$enable_strip_solver" = "no"; then
1404cfc83b6cSPedro Giffuni           DISABLE_STRIP="TRUE"
1405cfc83b6cSPedro Giffuni        else
1406cfc83b6cSPedro Giffuni           AC_MSG_ERROR([--disable-strip-solver only accepts yes or no as parameter.])
1407cfc83b6cSPedro Giffuni        fi
1408cfc83b6cSPedro Giffuni   fi
1409cfc83b6cSPedro Giffunielse
1410cfc83b6cSPedro Giffuni   if test -n "$ENABLE_SYMBOLS"; then
1411cfc83b6cSPedro Giffuni      DISABLE_STRIP="TRUE"
1412cfc83b6cSPedro Giffuni   else
1413cfc83b6cSPedro Giffuni      DISABLE_STRIP=
1414cfc83b6cSPedro Giffuni   fi
1415cfc83b6cSPedro Giffunifi
1416cfc83b6cSPedro Giffuniif test -z "$DISABLE_STRIP"; then
1417cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1418cfc83b6cSPedro Giffunielse
1419cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1420cfc83b6cSPedro Giffunifi
1421cfc83b6cSPedro GiffuniAC_SUBST(DISABLE_STRIP)
1422cfc83b6cSPedro Giffuni
1423cfc83b6cSPedro Giffunidnl ===================================================================
1424cfc83b6cSPedro Giffunidnl Build options
1425cfc83b6cSPedro Giffunidnl ===================================================================
1426cfc83b6cSPedro Giffuni
1427cfc83b6cSPedro Giffuni# Disable or enable category-B librariets: nss, hunspell, hyphen, saxon,
1428cfc83b6cSPedro Giffuni# rhino, silgraphite.
1429cfc83b6cSPedro Giffuni
1430cfc83b6cSPedro Giffuni# Note that further below they may be enabled or disabled again by
1431cfc83b6cSPedro Giffuni# more specific options.
1432cfc83b6cSPedro Giffuni
1433cfc83b6cSPedro GiffuniENABLE_CATEGORY_B=
1434cfc83b6cSPedro Giffuni
1435cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable category B components])
1436cfc83b6cSPedro Giffuni# Category B modules (libraries):
1437cfc83b6cSPedro Giffuni#   nss (nss)
1438cfc83b6cSPedro Giffuni#   hunspell (hunspell)
1439cfc83b6cSPedro Giffuni#   hyphen (hyphen)
1440cfc83b6cSPedro Giffuni#   saxon (saxon)
1441cfc83b6cSPedro Giffuni#   rhino (rhino)
1442cfc83b6cSPedro Giffuni#   graphite (silgraphite)
1443cfc83b6cSPedro Giffuniif test "$enable_category_b" = "yes"; then
1444cfc83b6cSPedro Giffuni   ENABLE_CATEGORY_B=YES
1445cfc83b6cSPedro Giffuni   enable_hunspell="yes"
1446cfc83b6cSPedro Giffuni   enable_hyphen="yes"
1447cfc83b6cSPedro Giffuni   enable_saxon="yes"
1448cfc83b6cSPedro Giffuni   enable_javascript="yes"
1449cfc83b6cSPedro Giffuni   enable_graphite="yes"
1450cfc83b6cSPedro Giffuni   enable_coinmp="yes"
1451cfc83b6cSPedro Giffuni   enable_category_b_fonts="yes"
1452cfc83b6cSPedro Giffuni
1453cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes: allow modules nss, hunspell, hyphen, saxon, rhino, beanshell, graphite, coinmp to be built])
1454cfc83b6cSPedro Giffunielse
1455cfc83b6cSPedro Giffuni   # Disable libraries.
1456cfc83b6cSPedro Giffuni   enable_nss_module="no"
1457cfc83b6cSPedro Giffuni   enable_hunspell="no"
1458cfc83b6cSPedro Giffuni   enable_hyphen="no"
1459cfc83b6cSPedro Giffuni   enable_saxon="no"
1460cfc83b6cSPedro Giffuni   enable_javascript="no"
1461cfc83b6cSPedro Giffuni   enable_graphite="no"
1462cfc83b6cSPedro Giffuni   enable_coinmp="no"
1463cfc83b6cSPedro Giffuni   enable_category_b_fonts="no"
1464cfc83b6cSPedro Giffuni
1465cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no: disabled modules nss, hunspell, hyphen, saxon, rhino, graphite, coinmp])
1466cfc83b6cSPedro Giffunifi
1467cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_CATEGORY_B)
1468cfc83b6cSPedro Giffuni
1469cfc83b6cSPedro Giffuni# gstreamer is used only via pre-installed libraries: not a problem
1470cfc83b6cSPedro Giffuni
1471cfc83b6cSPedro Giffunidnl ===================================================================
1472cfc83b6cSPedro Giffunidnl Online Update
1473cfc83b6cSPedro Giffunidnl ===================================================================
1474cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable the Online Update support])
1475cfc83b6cSPedro Giffuniif test "$enable_online_update" = "yes" -o "$enable_online_update" = "TRUE"; then
1476cfc83b6cSPedro Giffuni   ENABLE_ONLINE_UPDATE="YES"
1477cfc83b6cSPedro Giffuni   SCPDEFS="$SCPDEFS -DENABLE_ONLINE_UPDATE"
1478cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1479cfc83b6cSPedro Giffunielse
1480cfc83b6cSPedro Giffuni   ENABLE_ONLINE_UPDATE=""
1481cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1482cfc83b6cSPedro Giffunifi
1483cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_ONLINE_UPDATE)
1484cfc83b6cSPedro Giffuni
1485cfc83b6cSPedro Giffunidnl ===================================================================
1486cfc83b6cSPedro Giffunidnl Unit Tests
1487cfc83b6cSPedro Giffunidnl ===================================================================
1488cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable unit tests])
1489cfc83b6cSPedro Giffuniif test "$enable_unit_tests" = "yes" -o "$enable_unit_tests" = "TRUE"; then
1490cfc83b6cSPedro Giffuni   ENABLE_UNIT_TESTS="YES"
1491cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE GTEST"
1492cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1493cfc83b6cSPedro Giffunielse
1494cfc83b6cSPedro Giffuni   ENABLE_UNIT_TESTS=""
1495cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1496cfc83b6cSPedro Giffunifi
1497cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_UNIT_TESTS)
1498cfc83b6cSPedro Giffuni
1499cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable native CUPS support])
1500cfc83b6cSPedro Giffuniif test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then
1501cfc83b6cSPedro Giffuni   ENABLE_CUPS="TRUE"
1502cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1503cfc83b6cSPedro Giffunielse
1504cfc83b6cSPedro Giffuni   ENABLE_CUPS=""
1505cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1506cfc83b6cSPedro Giffunifi
1507cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_CUPS)
1508cfc83b6cSPedro Giffuni
1509cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable fontconfig support])
1510cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a \( "$enable_fontconfig" = "yes" -o "$enable_fontconfig" = "TRUE" \); then
1511cfc83b6cSPedro Giffuni   ENABLE_FONTCONFIG="TRUE"
1512cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
1513cfc83b6cSPedro Giffunielse
1514cfc83b6cSPedro Giffuni   ENABLE_FONTCONFIG=""
1515cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1516cfc83b6cSPedro Giffunifi
1517cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_FONTCONFIG)
1518cfc83b6cSPedro Giffuni
1519cfc83b6cSPedro Giffunidnl ===================================================================
1520cfc83b6cSPedro Giffunidnl find external tarballs.
1521cfc83b6cSPedro Giffunidnl ===================================================================
1522cfc83b6cSPedro Giffuniif test -z $TARFILE_LOCATION; then
1523cfc83b6cSPedro Giffuni   TARFILE_LOCATION="DEFAULT"
1524cfc83b6cSPedro Giffunifi
1525cfc83b6cSPedro GiffuniAC_SUBST(TARFILE_LOCATION)
1526cfc83b6cSPedro Giffuni
1527cfc83b6cSPedro Giffuniif test -z "$enable_fetch_external" || test "$enable_fetch_external" = "yes" \
1528cfc83b6cSPedro Giffuni   && test -z "$with_system_libs" -a "$with_system_jars" != "no"; then
1529cfc83b6cSPedro Giffuni   DO_FETCH_TARBALLS="yes"
1530cfc83b6cSPedro Giffunifi
1531cfc83b6cSPedro GiffuniAC_SUBST(DO_FETCH_TARBALLS)
1532cfc83b6cSPedro Giffuni
1533cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
1534cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether to use DirectX])
1535cfc83b6cSPedro Giffuni   ENABLE_DIRECT_DRAW=""
1536cfc83b6cSPedro Giffuni   if test "$enable_directx" = "yes" -o "$enable_directx" = "TRUE" -o "$enable_directx" = ""; then
1537cfc83b6cSPedro Giffuni      ENABLE_DIRECTX="TRUE"
1538cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
1539cfc83b6cSPedro Giffuni   else
1540cfc83b6cSPedro Giffuni      ENABLE_DIRECTX=""
1541cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
1542cfc83b6cSPedro Giffuni   fi
1543cfc83b6cSPedro Giffuni   AC_SUBST(ENABLE_DIRECTX)
1544cfc83b6cSPedro Giffuni
1545cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether to use ActiveX])
1546cfc83b6cSPedro Giffuni   if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
1547cfc83b6cSPedro Giffuni      DISABLE_ACTIVEX=""
1548cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
1549cfc83b6cSPedro Giffuni   else
1550cfc83b6cSPedro Giffuni      DISABLE_ACTIVEX="TRUE"
1551cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
1552cfc83b6cSPedro Giffuni   fi
1553cfc83b6cSPedro Giffuni
1554cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether to use ATL])
1555cfc83b6cSPedro Giffuni   if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
1556cfc83b6cSPedro Giffuni      DISABLE_ATL=""
1557cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
1558cfc83b6cSPedro Giffuni   else
1559cfc83b6cSPedro Giffuni      DISABLE_ATL="TRUE"
1560cfc83b6cSPedro Giffuni      dnl ActiveX depends on ATL, it should be disabled
1561cfc83b6cSPedro Giffuni      DISABLE_ACTIVEX="TRUE"
1562cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
1563cfc83b6cSPedro Giffuni   fi
1564cfc83b6cSPedro Giffuni
1565cfc83b6cSPedro Giffuni   AC_SUBST(DISABLE_ATL)
1566cfc83b6cSPedro Giffuni   AC_SUBST(DISABLE_ACTIVEX)
1567cfc83b6cSPedro Giffuni
1568cfc83b6cSPedro Giffunifi
1569cfc83b6cSPedro Giffuni
1570cfc83b6cSPedro Giffunidnl ===================================================================
1571cfc83b6cSPedro Giffunidnl Disable rpath in shared libraries?
1572cfc83b6cSPedro Giffunidnl ===================================================================
1573cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to use RPATH in shared libraries])
1574cfc83b6cSPedro Giffuniif test "$enable_rpath" = "no"; then
1575cfc83b6cSPedro Giffuni   ENABLE_RPATH="no"
1576cfc83b6cSPedro Giffunielse
1577cfc83b6cSPedro Giffuni   ENABLE_RPATH="yes"
1578cfc83b6cSPedro Giffunifi
1579cfc83b6cSPedro GiffuniAC_MSG_RESULT([$ENABLE_RPATH])
1580cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_RPATH)
1581cfc83b6cSPedro Giffuni
1582cfc83b6cSPedro Giffunidnl ===================================================================
1583cfc83b6cSPedro Giffunidnl Check extensions to be bundled as literal blobs
1584cfc83b6cSPedro Giffunidnl ===================================================================
1585cfc83b6cSPedro Giffuniif test -n "$with_bundled_extension_blobs"; then
1586cfc83b6cSPedro Giffuni    BUNDLED_EXTENSION_BLOBS="$with_bundled_extension_blobs"
1587cfc83b6cSPedro Giffunielse
1588cfc83b6cSPedro Giffuni    BUNDLED_EXTENSION_BLOBS=
1589cfc83b6cSPedro Giffunifi
1590cfc83b6cSPedro GiffuniAC_SUBST(BUNDLED_EXTENSION_BLOBS)
1591cfc83b6cSPedro Giffuni
1592cfc83b6cSPedro Giffuni#dnl ===================================================================
1593407bc2eeSMatthias Seidel#dnl Check extensions that are to be bundled as pre-registered
1594cfc83b6cSPedro Giffuni#dnl ===================================================================
1595cfc83b6cSPedro Giffuniif test -n "$with_bundled_prereg_extensions"; then
1596cfc83b6cSPedro Giffuni    BUNDLED_PREREG_EXTENSIONS="$with_bundled_prereg_extensions"
1597cfc83b6cSPedro Giffunielse
1598cfc83b6cSPedro Giffuni    BUNDLED_PREREG_EXTENSIONS=
1599cfc83b6cSPedro Giffunifi
1600cfc83b6cSPedro GiffuniAC_SUBST(BUNDLED_PREREG_EXTENSIONS)
1601cfc83b6cSPedro Giffuni
1602cfc83b6cSPedro Giffunidnl ===================================================================
1603cfc83b6cSPedro Giffunidnl Configure system provided dictionary/hyphenation/thesaurus
1604cfc83b6cSPedro Giffunidnl ===================================================================
1605cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([whether to use dicts from external paths])
1606cfc83b6cSPedro Giffuni  if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
1607cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
1608cfc83b6cSPedro Giffuni    SYSTEM_DICTS=YES
1609cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for spelling dictionary directory])
1610cfc83b6cSPedro Giffuni    if test -n "$with_external_dict_dir"; then
1611cfc83b6cSPedro Giffuni        DICT_SYSTEM_DIR=file://$with_external_dict_dir
1612cfc83b6cSPedro Giffuni    else
1613cfc83b6cSPedro Giffuni        DICT_SYSTEM_DIR=file:///usr/share/hunspell
1614cfc83b6cSPedro Giffuni    fi
1615cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$DICT_SYSTEM_DIR])
1616cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for hyphenation patterns directory])
1617cfc83b6cSPedro Giffuni    if test -n "$with_external_hyph_dir"; then
1618cfc83b6cSPedro Giffuni        HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
1619cfc83b6cSPedro Giffuni    else
1620cfc83b6cSPedro Giffuni        HYPH_SYSTEM_DIR=file:///usr/share/hyphen
1621cfc83b6cSPedro Giffuni    fi
1622cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
1623cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for thesaurus directory])
1624cfc83b6cSPedro Giffuni    if test -n "$with_external_thes_dir"; then
1625cfc83b6cSPedro Giffuni        THES_SYSTEM_DIR=file://$with_external_thes_dir
1626cfc83b6cSPedro Giffuni    else
1627cfc83b6cSPedro Giffuni        THES_SYSTEM_DIR=file:///usr/share/mythes
1628cfc83b6cSPedro Giffuni    fi
1629cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$THES_SYSTEM_DIR])
1630cfc83b6cSPedro Giffuni  else
1631cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
1632cfc83b6cSPedro Giffuni    SYSTEM_DICTS=NO
1633cfc83b6cSPedro Giffuni  fi
1634cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_DICTS)
1635cfc83b6cSPedro GiffuniAC_SUBST(DICT_SYSTEM_DIR)
1636cfc83b6cSPedro GiffuniAC_SUBST(HYPH_SYSTEM_DIR)
1637cfc83b6cSPedro GiffuniAC_SUBST(THES_SYSTEM_DIR)
1638cfc83b6cSPedro Giffuni
1639cfc83b6cSPedro Giffuniif test $_os = "WINNT"; then
1640cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([Windows build environment sanity])
1641cfc83b6cSPedro Giffuni   dnl ===================================================================
1642407bc2eeSMatthias Seidel   dnl Sanity check! Native Windows programs cannot use cygwin symlinks!
1643cfc83b6cSPedro Giffuni   dnl ===================================================================
1644cfc83b6cSPedro Giffuni   dnl As long as awk instead of $AWK is used somewhere in the sources,
1645cfc83b6cSPedro Giffuni   dnl check for $AWK and awk. $AWK is pointing to gawk in cygwin.
1646cfc83b6cSPedro Giffuni      if test -L $AWK -o -L `which awk` -o -L `which tar` -o -L `which gunzip` ; then
1647cfc83b6cSPedro Giffuni         AC_MSG_ERROR([$AWK, awk, tar or gunzip is a cygwin symlink!
1648407bc2eeSMatthias SeidelNative Windows programs cannot use cygwin symlinks. Remove the symbolic
1649cfc83b6cSPedro Giffunilink, and copy the program to the name of the link.])
1650cfc83b6cSPedro Giffuni      fi
1651cfc83b6cSPedro Giffuni   dnl ===================================================================
1652cfc83b6cSPedro Giffuni   dnl Another sanity check! More a band-aid. winenv.* adds guw.exe to
1653cfc83b6cSPedro Giffuni   dnl CC and CXX but the configure checks here assume that guw.exe
1654cfc83b6cSPedro Giffuni   dnl (if needed at all) is not yet present.
1655cfc83b6cSPedro Giffuni   dnl ===================================================================
1656cfc83b6cSPedro Giffuni   CC=`echo $CC | $SED "s/^guw.exe //"`
1657cfc83b6cSPedro Giffuni   CXX=`echo $CXX | $SED "s/^guw.exe //"`
1658cfc83b6cSPedro Giffuni   dnl ===================================================================
1659cfc83b6cSPedro Giffuni   dnl If $CC is set to a MinGW compiler, e.g. "gcc -mno-cygwin" enable
1660cfc83b6cSPedro Giffuni   dnl $WITH_MINGWIN
1661cfc83b6cSPedro Giffuni   dnl ===================================================================
1662cfc83b6cSPedro Giffuni      if test -n "$CC";then
1663cfc83b6cSPedro Giffuni         if test "`$CC -dumpmachine 2>/dev/null | $SED -e 's/^.*-//'`" = "mingw32"; then
1664cfc83b6cSPedro Giffuni            WITH_MINGWIN="yes"
1665cfc83b6cSPedro Giffuni         fi
1666cfc83b6cSPedro Giffuni      fi
1667cfc83b6cSPedro Giffuni   dnl ===================================================================
1668cfc83b6cSPedro Giffuni   if test "$WITH_MINGWIN" = "yes" ; then
1669cfc83b6cSPedro Giffuni      if test -z "$CC"; then
1670cfc83b6cSPedro Giffuni         CC="gcc -mno-cygwin"
1671cfc83b6cSPedro Giffuni         CXX="g++ -mno-cygwin"
1672cfc83b6cSPedro Giffuni      fi
1673cfc83b6cSPedro Giffuni   fi
1674cfc83b6cSPedro Giffuni   AC_MSG_RESULT([ok])
1675cfc83b6cSPedro Giffunifi
1676cfc83b6cSPedro GiffuniAC_SUBST(WITH_MINGWIN)
1677cfc83b6cSPedro Giffuni
1678cfc83b6cSPedro Giffunidnl ===================================================================
1679cfc83b6cSPedro Giffunidnl Extra check for Windows. cygwin builds need gcc to build dmake
1680cfc83b6cSPedro Giffunidnl and g++ to build guw.exe although MS cl (or MinGW) is used to
1681e986c8d8SMatthias Seideldnl build AOO.
1682cfc83b6cSPedro Giffunidnl ===================================================================
1683cfc83b6cSPedro Giffuniif test "$_os" = "WINNT" ; then
1684cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for cygwin gcc/g++])
1685cfc83b6cSPedro Giffuni   if which gcc > /dev/null && which g++ > /dev/null ; then
1686cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found])
1687cfc83b6cSPedro Giffuni   else
1688cfc83b6cSPedro Giffuni      AC_MSG_ERROR([cygwin gcc and g++ are needed, please install them.])
1689cfc83b6cSPedro Giffuni   fi
1690cfc83b6cSPedro Giffunifi
1691cfc83b6cSPedro Giffuni
1692cfc83b6cSPedro Giffuni
1693cfc83b6cSPedro Giffunidnl ===================================================================
1694cfc83b6cSPedro Giffunidnl Check whether the bash shell can be used.
1695cfc83b6cSPedro Giffunidnl ===================================================================
1696cfc83b6cSPedro GiffuniAC_PATH_PROG(SHELLPATH, bash)
1697cfc83b6cSPedro Giffuniif test -z "$SHELLPATH"; then
1698cfc83b6cSPedro Giffuni   AC_MSG_ERROR([bash not found in \$PATH])
1699cfc83b6cSPedro Giffunielse
1700cfc83b6cSPedro Giffuni   SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/bash$//p"`
1701cfc83b6cSPedro Giffunifi
1702cfc83b6cSPedro GiffuniAC_SUBST(SHELLPATH)
1703cfc83b6cSPedro Giffuni
1704cfc83b6cSPedro Giffunidnl ===================================================================
1705cfc83b6cSPedro Giffunidnl  Checks for c compiler,
1706cfc83b6cSPedro Giffunidnl  The check for the c++ compiler is later on.
1707cfc83b6cSPedro Giffunidnl ===================================================================
1708cfc83b6cSPedro GiffuniAC_MSG_CHECKING([gcc home])
1709cfc83b6cSPedro Giffuniif test -z "$with_gcc_home"; then
1710cfc83b6cSPedro Giffuni    GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
1711cfc83b6cSPedro Giffunielse
1712cfc83b6cSPedro Giffuni    GCC_HOME="$with_gcc_home"
1713cfc83b6cSPedro Giffunifi
1714cfc83b6cSPedro GiffuniAC_MSG_RESULT($GCC_HOME)
1715cfc83b6cSPedro GiffuniAC_SUBST(GCC_HOME)
1716cfc83b6cSPedro Giffuni
1717cfc83b6cSPedro Giffunisave_CC=$CC
1718cfc83b6cSPedro Giffunisave_CXX=$CXX
1719cfc83b6cSPedro Giffuni
1720cfc83b6cSPedro Giffuniif test -n "$with_gcc_home"; then
1721cfc83b6cSPedro Giffuni   if test -z "$CC"; then
1722cfc83b6cSPedro Giffuni      CC="$with_gcc_home/bin/gcc"
1723cfc83b6cSPedro Giffuni   fi
1724cfc83b6cSPedro Giffunifi
1725cfc83b6cSPedro Giffuni
1726cfc83b6cSPedro Giffunidnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1727cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
1728cfc83b6cSPedro Giffuni   AC_PROG_CC
1729cfc83b6cSPedro Giffunifi
1730cfc83b6cSPedro Giffuni
1731cfc83b6cSPedro GiffuniCOMPATH=`dirname "$CC"`
1732cfc83b6cSPedro Giffuniif test "$COMPATH" = "." ; then
1733cfc83b6cSPedro Giffuni    AC_PATH_PROGS(COMPATH, $CC)
1734cfc83b6cSPedro Giffuni    dnl double square bracket to get single because of M4 quote...
1735cfc83b6cSPedro Giffuni    COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
1736cfc83b6cSPedro Giffunifi
1737cfc83b6cSPedro GiffuniCC_PATH="$COMPATH/"
1738cfc83b6cSPedro GiffuniCOMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
1739cfc83b6cSPedro Giffuni
1740cfc83b6cSPedro Giffunidnl ===================================================================
1741cfc83b6cSPedro Giffunidnl Test the gcc version, 3 is OK
1742cfc83b6cSPedro Giffunidnl ===================================================================
1743cfc83b6cSPedro GiffuniGCCVER=20995
1744cfc83b6cSPedro Giffuniif test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then
1745cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([the GNU gcc compiler version])
1746cfc83b6cSPedro Giffuni   _gcc_version=`$CC -dumpversion`
1747cfc83b6cSPedro Giffuni   _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
1748cfc83b6cSPedro Giffuni   GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1749cfc83b6cSPedro Giffuni
1750cfc83b6cSPedro Giffuni   if test "$_gcc_major" -lt "3"; then
1751cfc83b6cSPedro Giffuni      AC_MSG_ERROR([found version "$_gcc_version", use version 3+ of the gcc compiler])
1752cfc83b6cSPedro Giffuni   else
1753cfc83b6cSPedro Giffuni      if test "$GCCVER" -eq "030203"; then
1754cfc83b6cSPedro Giffuni        if test "$ENABLE_SYMBOLS" = "SMALL"; then
1755cfc83b6cSPedro Giffuni           AC_MSG_ERROR([version "$_gcc_version" gives internal error with small.])
1756cfc83b6cSPedro Giffuni        fi
1757cfc83b6cSPedro Giffuni      fi
1758cfc83b6cSPedro Giffuni   fi
1759cfc83b6cSPedro Giffuni   if test "$_os" = "Darwin" ; then
1760cfc83b6cSPedro Giffuni         AC_MSG_RESULT([implicitly using CC=$CC])
1761cfc83b6cSPedro Giffuni   else
1762cfc83b6cSPedro Giffuni      AC_MSG_RESULT([checked (gcc $_gcc_version)])
1763cfc83b6cSPedro Giffuni   fi
1764cfc83b6cSPedro Giffuni   if test "$_os" = "SunOS"; then
1765cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([gcc linker])
176628633775SPedro Giffuni      if $CC -Wl,--version 2>&1 |head -n 1| $GREP -v GNU > /dev/null;then
1767cfc83b6cSPedro Giffuni          AC_MSG_ERROR([failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris])
1768cfc83b6cSPedro Giffuni      fi
1769cfc83b6cSPedro Giffuni      AC_MSG_RESULT([ok (GNU ld)])
1770cfc83b6cSPedro Giffuni   fi
1771cfc83b6cSPedro Giffunifi
1772cfc83b6cSPedro GiffuniAC_SUBST(GCCVER)
1773cfc83b6cSPedro Giffuni
1774cfc83b6cSPedro GiffuniHAVE_LD_BSYMBOLIC_FUNCTIONS=
1775cfc83b6cSPedro Giffuniif test "$GCC" = "yes"; then
1776cfc83b6cSPedro Giffuni   AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
1777cfc83b6cSPedro Giffuni   bsymbolic_functions_ldflags_save=$LDFLAGS
1778cfc83b6cSPedro Giffuni   LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
1779cfc83b6cSPedro Giffuni   AC_LINK_IFELSE([AC_LANG_PROGRAM([
1780cfc83b6cSPedro Giffuni   #include <stdio.h>
1781cfc83b6cSPedro Giffuni   ],[
1782cfc83b6cSPedro Giffuni    printf ("hello world\n");
1783cfc83b6cSPedro Giffuni   ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
1784cfc83b6cSPedro Giffuni   if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
1785cfc83b6cSPedro Giffuni     AC_MSG_RESULT( found )
1786cfc83b6cSPedro Giffuni   else
1787cfc83b6cSPedro Giffuni     AC_MSG_RESULT( not found )
1788cfc83b6cSPedro Giffuni   fi
1789cfc83b6cSPedro Giffuni   LDFLAGS=$bsymbolic_functions_ldflags_save
1790cfc83b6cSPedro Giffunifi
1791cfc83b6cSPedro GiffuniAC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
1792cfc83b6cSPedro Giffuni
1793cfc83b6cSPedro Giffunidnl ===================================================================
1794cfc83b6cSPedro Giffunidnl Set the ENABLE_PCH variable. (Activate --enable-pch)
1795cfc83b6cSPedro Giffunidnl ===================================================================
1796cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable pch feature])
1797cfc83b6cSPedro Giffuniif test -n "$enable_pch" && test "$enable_pch" != "no"; then
1798cfc83b6cSPedro Giffuni   if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
1799cfc83b6cSPedro Giffuni       ENABLE_PCH="TRUE"
1800cfc83b6cSPedro Giffuni       AC_MSG_RESULT([yes])
1801cfc83b6cSPedro Giffunidnl There is no PCH support in GCC versions prior to this
1802cfc83b6cSPedro Giffuni   elif test "$GCC" = "yes" -a "$GCCVER" -gt "030400"; then
1803cfc83b6cSPedro Giffuni       ENABLE_PCH="TRUE"
1804cfc83b6cSPedro Giffuni       AC_MSG_RESULT([yes])
1805cfc83b6cSPedro Giffuni   else
1806cfc83b6cSPedro Giffuni       ENABLE_PCH=""
1807cfc83b6cSPedro Giffuni       AC_MSG_WARN([Precompiled header not yet supported for your platform/compiler])
1808cfc83b6cSPedro Giffuni   fi
1809cfc83b6cSPedro Giffunielse
1810cfc83b6cSPedro Giffuni   ENABLE_PCH=""
1811cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
1812cfc83b6cSPedro Giffunifi
1813cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_PCH)
1814cfc83b6cSPedro Giffuni
1815cfc83b6cSPedro Giffunidnl ===================================================================
1816cfc83b6cSPedro Giffunidnl Search all the common names for GNU make
1817cfc83b6cSPedro Giffunidnl ===================================================================
1818cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for GNU make])
1819308295dbSJim Jagielskifor a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
182028633775SPedro Giffuni      $a --version 2> /dev/null | $GREP GNU  2>&1 > /dev/null
1821cfc83b6cSPedro Giffuni      if test $? -eq 0;  then
1822cfc83b6cSPedro Giffuni           GNUMAKE=$a
1823cfc83b6cSPedro Giffuni           break
1824cfc83b6cSPedro Giffuni      fi
1825cfc83b6cSPedro Giffunidone
1826cfc83b6cSPedro GiffuniAC_MSG_RESULT($GNUMAKE)
1827cfc83b6cSPedro Giffuniif test -z "$GNUMAKE"; then
1828cfc83b6cSPedro Giffuni    AC_MSG_ERROR([not found. install GNU make.])
1829cfc83b6cSPedro Giffunifi
1830cfc83b6cSPedro Giffuni
1831cfc83b6cSPedro GiffuniAC_MSG_CHECKING([the GNU make version])
183228633775SPedro Giffuni_make_version=`$GNUMAKE --version | $GREP GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
1833cfc83b6cSPedro Giffuni_make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1834cfc83b6cSPedro Giffuniif test "$_make_longver" -ge "038100" ; then
1835cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$GNUMAKE $_make_version])
1836cfc83b6cSPedro Giffunielse
1837cfc83b6cSPedro Giffuni   AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
1838cfc83b6cSPedro Giffunifi
1839cfc83b6cSPedro GiffuniAC_SUBST(GNUMAKE)
1840cfc83b6cSPedro Giffuni
1841cfc83b6cSPedro Giffunidnl ===================================================================
1842cfc83b6cSPedro Giffunidnl Search for a pre-installed dmake
1843cfc83b6cSPedro Giffunidnl ===================================================================
1844cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for dmake])
1845cfc83b6cSPedro GiffuniDMAKE="no"
1846cfc83b6cSPedro Giffuni# Override system dmake if --with-dmake-path or --with-dmake-url is used.
1847cfc83b6cSPedro Giffuniif test -z "$with_dmake_path" && test -z "$with_dmake_url"; then
1848cfc83b6cSPedro Giffuni   AC_PATH_PROG(DMAKE, dmake, no)
1849cfc83b6cSPedro Giffuni   IS_SYSTEM_DMAKE=NO
1850cfc83b6cSPedro Giffuni   if test "$DMAKE" != "no"; then
1851cfc83b6cSPedro Giffuni      AC_MSG_RESULT([using system dmake])
1852cfc83b6cSPedro Giffuni      DMAKE_PATH="$DMAKE"
1853cfc83b6cSPedro Giffuni      IS_SYSTEM_DMAKE=YES
1854cfc83b6cSPedro Giffuni   fi
1855cfc83b6cSPedro Giffunielif test -n "$with_dmake_path" ; then
1856cfc83b6cSPedro Giffuni   # Did not find pre-installed dmake.
1857cfc83b6cSPedro Giffuni   # Is it at a nonstandard location provided by --with-dmake-path ?
1858cfc83b6cSPedro Giffuni   AC_MSG_NOTICE([looking for dmake at $DMAKE_PATH])
1859cfc83b6cSPedro Giffuni   if test -x "$with_dmake_path" ; then
1860cfc83b6cSPedro Giffuni      AC_MSG_RESULT([using user provided dmake])
1861cfc83b6cSPedro Giffuni      DMAKE=$with_dmake_path
1862cfc83b6cSPedro Giffuni   fi
1863cfc83b6cSPedro Giffunifi
1864cfc83b6cSPedro Giffuni
1865cfc83b6cSPedro GiffuniDMAKE_URL=
1866cfc83b6cSPedro Giffuniif test "$DMAKE" = "no"; then
1867cfc83b6cSPedro Giffuni    AC_MSG_NOTICE([no system or user-provided dmake found])
1868cfc83b6cSPedro Giffuni    # Check if a URL was supplied from which we can download the source and compile it.
1869cfc83b6cSPedro Giffuni    if test -n "$with_dmake_url" ; then
1870cfc83b6cSPedro Giffuni       # At this moment we can not verify the URL or the content that we want to download.
1871cfc83b6cSPedro Giffuni       # Neither can we apply the test below for ruling out that it is the SunStudio dmake.
1872cfc83b6cSPedro Giffuni       DMAKE_URL=$with_dmake_url
1873cfc83b6cSPedro Giffuni       AC_MSG_RESULT([dmake will be downloaded and compiled in bootstrap])
1874cfc83b6cSPedro Giffuni       DMAKE=
1875cfc83b6cSPedro Giffuni    else
1876cfc83b6cSPedro Giffuni       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.])
1877cfc83b6cSPedro Giffuni       BUILD_DMAKE=YES
1878cfc83b6cSPedro Giffuni    fi
1879cfc83b6cSPedro Giffunielse
1880cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([whether the found dmake is the right dmake])
1881cfc83b6cSPedro Giffuni    # we need to find out whether that dmake we found is "our" dmake
1882cfc83b6cSPedro Giffuni    # or the dmake from Sun's SunStudio Compiler which is something
1883cfc83b6cSPedro Giffuni    # different
1884cfc83b6cSPedro Giffuni    # This test _should_ work because the one accepts -V (ours) and one
1885cfc83b6cSPedro Giffuni    # (the other) not...
188628633775SPedro Giffuni    $DMAKE -V 2>/dev/null | $GREP -E 'dmake(.exe)? .* Version .*' >/dev/null
1887cfc83b6cSPedro Giffuni    if test $? -eq 0; then
1888cfc83b6cSPedro Giffuni       BUILD_DMAKE=NO
1889cfc83b6cSPedro Giffuni       AC_MSG_RESULT([yes])
1890cfc83b6cSPedro Giffuni       AC_MSG_CHECKING([the dmake version])
1891cfc83b6cSPedro Giffuni       DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
1892cfc83b6cSPedro Giffuni       if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
1893cfc83b6cSPedro Giffuni          AC_MSG_RESULT([OK, >= 4.11])
1894cfc83b6cSPedro Giffuni       elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
1895cfc83b6cSPedro Giffuni            test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
1896cfc83b6cSPedro Giffuni          AC_MSG_RESULT([OK, >= 4.11])
1897cfc83b6cSPedro Giffuni       else
1898cfc83b6cSPedro Giffuni          AC_MSG_ERROR([too old. >= 4.11 is needed])
1899cfc83b6cSPedro Giffuni          DMAKE=no
1900cfc83b6cSPedro Giffuni       fi
1901cfc83b6cSPedro Giffuni    else
1902cfc83b6cSPedro Giffuni       AC_MSG_WARN([no])
1903cfc83b6cSPedro Giffuni       DMAKE=no
1904cfc83b6cSPedro Giffuni    fi
1905cfc83b6cSPedro Giffunifi
1906cfc83b6cSPedro Giffuniif test "$DMAKE" = "no"; then
1907cfc83b6cSPedro Giffuni   AC_MSG_ERROR([please use --with-dmake-path or --with-dmake-url to specify dmake executable or source])
1908cfc83b6cSPedro Giffunifi
1909cfc83b6cSPedro GiffuniAC_SUBST(DMAKE_URL)
1910cfc83b6cSPedro GiffuniAC_SUBST(DMAKE_PATH)
1911cfc83b6cSPedro GiffuniAC_SUBST(IS_SYSTEM_DMAKE)
1912cfc83b6cSPedro Giffuni
1913cfc83b6cSPedro Giffuni
1914cfc83b6cSPedro Giffunidnl ===================================================================
1915cfc83b6cSPedro Giffunidnl Search all the common names for GNU or BSD tar
1916cfc83b6cSPedro Giffunidnl ===================================================================
1917cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for GNU or compatible BSD tar])
1918cfc83b6cSPedro Giffunifor a in $GNUTAR gtar gnutar bsdtar tar; do
191928633775SPedro Giffuni      $a --version 2> /dev/null | $EGREP "GNU|libarchive"  2>&1 > /dev/null
1920cfc83b6cSPedro Giffuni      if test $? -eq 0;  then
1921cfc83b6cSPedro Giffuni           GNUTAR=$a
1922cfc83b6cSPedro Giffuni           break
1923cfc83b6cSPedro Giffuni      fi
1924cfc83b6cSPedro Giffunidone
1925cfc83b6cSPedro GiffuniAC_MSG_RESULT($GNUTAR)
1926cfc83b6cSPedro Giffuniif test -z "$GNUTAR"; then
1927cfc83b6cSPedro Giffuni    AC_MSG_ERROR([not found. install GNU tar.])
1928cfc83b6cSPedro Giffunifi
1929cfc83b6cSPedro Giffuni
1930cfc83b6cSPedro GiffuniAC_SUBST(GNUTAR)
1931cfc83b6cSPedro Giffuni
1932cfc83b6cSPedro Giffunidnl ===================================================================
1933cfc83b6cSPedro Giffunidnl  Test the solaris compiler version
1934cfc83b6cSPedro Giffunidnl ===================================================================
1935cfc83b6cSPedro Giffuniif test "$_os" = "SunOS"; then
1936cfc83b6cSPedro Giffuni   if test "$CC" = "cc"; then
1937cfc83b6cSPedro Giffuni      AC_PATH_PROGS(_cc, cc)
1938cfc83b6cSPedro Giffuni      COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
1939cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
1940cfc83b6cSPedro Giffuni      dnl cc -V outputs to standard error!!!!
194128633775SPedro Giffuni      _sunstudio_string=`$CC -V 2>&1 | $GREP '^cc' | sed -e 's/.* C //'`
1942cfc83b6cSPedro Giffuni      _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
1943cfc83b6cSPedro Giffuni      _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
1944cfc83b6cSPedro Giffuni      if test "$_sunstudio_major" != "5"; then
1945cfc83b6cSPedro Giffuni         AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
1946cfc83b6cSPedro Giffuni      else
1947cfc83b6cSPedro Giffuni         _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" }'`
1948cfc83b6cSPedro Giffuni         if test "$_sunstudio_minor" = "false"; then
1949cfc83b6cSPedro Giffuni            AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
1950cfc83b6cSPedro Giffuni         else
1951cfc83b6cSPedro Giffuni            dnl compiler will do
1952cfc83b6cSPedro Giffuni            AC_MSG_RESULT([checked])
1953cfc83b6cSPedro Giffuni         fi
1954cfc83b6cSPedro Giffuni      fi
1955cfc83b6cSPedro Giffuni   fi
1956cfc83b6cSPedro Giffunifi
1957cfc83b6cSPedro Giffuni
1958cfc83b6cSPedro Giffuniif test "$GCC" = "yes"; then
1959cfc83b6cSPedro Giffuni   AC_MSG_CHECKING( for --hash-style=both linker support )
1960cfc83b6cSPedro Giffuni   hash_style_ldflags_save=$LDFLAGS
1961cfc83b6cSPedro Giffuni   LDFLAGS="$LDFLAGS -Wl,--hash-style=both"
1962cfc83b6cSPedro Giffuni   AC_LINK_IFELSE([AC_LANG_PROGRAM([
1963cfc83b6cSPedro Giffuni   #include <stdio.h>
1964cfc83b6cSPedro Giffuni   ],[
1965cfc83b6cSPedro Giffuni    printf ("hello world\n");
1966cfc83b6cSPedro Giffuni   ])], HAVE_LD_HASH_STYLE=TRUE, HAVE_LD_HASH_STYLE=FALSE)
1967cfc83b6cSPedro Giffuni   if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then
1968cfc83b6cSPedro Giffuni     AC_MSG_RESULT( found )
1969cfc83b6cSPedro Giffuni   else
1970cfc83b6cSPedro Giffuni     AC_MSG_RESULT( not found )
1971cfc83b6cSPedro Giffuni   fi
1972cfc83b6cSPedro Giffuni   LDFLAGS=$hash_style_ldflags_save
1973cfc83b6cSPedro Giffunifi
1974cfc83b6cSPedro GiffuniAC_SUBST(HAVE_LD_HASH_STYLE)
1975cfc83b6cSPedro Giffuni
1976cfc83b6cSPedro Giffunidnl ===================================================================
1977cfc83b6cSPedro Giffunidnl  Test the Compaq compiler for OSF1
1978cfc83b6cSPedro Giffunidnl ===================================================================
1979cfc83b6cSPedro Giffuniif test "$_os" = "OSF1"; then
1980cfc83b6cSPedro Giffuni   if test "$CC" = "cc"; then
1981cfc83b6cSPedro Giffuni      AC_PATH_PROGS(_cc, cc)
1982cfc83b6cSPedro Giffuni      COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
1983cfc83b6cSPedro Giffuni      AC_MSG_WARN([******* $_cc , $COMPATH])
1984cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([the Compaq C compiler version])
1985cfc83b6cSPedro Giffuni      dnl cc -V outputs to standard error!!!!
1986cfc83b6cSPedro Giffuni      _compaqc_version=`$CC -V 2>&1 | $AWK '{ print $3 }'`
1987cfc83b6cSPedro Giffuni      _compaqc_major=`echo $_compaqc_version | $AWK -F. '{ print $1 }'`
1988cfc83b6cSPedro Giffuni      if test "$_compaqc_major" != "T6"; then
1989cfc83b6cSPedro Giffuni         AC_MSG_ERROR([found version "$_compaqc_version", use version 6 of the Compaq C compiler])
1990cfc83b6cSPedro Giffuni      else
1991cfc83b6cSPedro Giffuni         dnl compiler will do
1992cfc83b6cSPedro Giffuni         AC_MSG_RESULT([checked])
1993cfc83b6cSPedro Giffuni      fi
1994cfc83b6cSPedro Giffuni   fi
1995cfc83b6cSPedro Giffunifi
1996cfc83b6cSPedro Giffuni
1997cfc83b6cSPedro Giffunidnl ===================================================================
1998cfc83b6cSPedro Giffunidnl Check whether there's a Perl version available.
1999cfc83b6cSPedro Giffunidnl ===================================================================
2000cfc83b6cSPedro Giffuniif test -z "$with_perl_home"; then
2001cfc83b6cSPedro Giffuni   AC_PATH_PROG(PERL, perl)
2002cfc83b6cSPedro Giffunielse
2003cfc83b6cSPedro Giffuni   if test "$_os" = "WINNT"; then
2004cfc83b6cSPedro Giffuni      with_perl_home=`cygpath -u "$with_perl_home"`
2005cfc83b6cSPedro Giffuni   fi
2006cfc83b6cSPedro Giffuni   _perl_path="$with_perl_home/bin/perl"
2007cfc83b6cSPedro Giffuni   if test -x "$_perl_path"; then
2008cfc83b6cSPedro Giffuni      PERL=$_perl_path
2009cfc83b6cSPedro Giffuni   else
2010cfc83b6cSPedro Giffuni      AC_MSG_ERROR([$_perl_path not found])
2011cfc83b6cSPedro Giffuni   fi
2012cfc83b6cSPedro Giffunifi
2013cfc83b6cSPedro Giffuni
2014cfc83b6cSPedro Giffunidnl ===================================================================
2015cfc83b6cSPedro Giffunidnl Testing for Perl version 5 or greater.
2016cfc83b6cSPedro Giffunidnl $] is the perl version variable, it is returned as an integer
2017cfc83b6cSPedro Giffunidnl ===================================================================
2018cfc83b6cSPedro Giffuniif test "$PERL"; then
2019cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([the Perl version])
2020cfc83b6cSPedro Giffuni   ${PERL} -e "exit($]);"
2021cfc83b6cSPedro Giffuni   _perl_version=$?
2022cfc83b6cSPedro Giffuni   if test "$_perl_version" -lt 5; then
2023cfc83b6cSPedro Giffuni      AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
2024cfc83b6cSPedro Giffuni   fi
2025cfc83b6cSPedro Giffuni   AC_MSG_RESULT([checked (perl $_perl_version)])
2026cfc83b6cSPedro Giffunielse
2027cfc83b6cSPedro Giffuni   AC_MSG_ERROR([Perl not found, install version 5 of Perl])
2028cfc83b6cSPedro Giffunifi
2029cfc83b6cSPedro GiffuniAC_SUBST(PERL)
2030cfc83b6cSPedro Giffuni
2031cfc83b6cSPedro Giffunidnl ===================================================================
2032cfc83b6cSPedro Giffunidnl Testing for required Perl modules
2033cfc83b6cSPedro Giffunidnl The list of required Perl modules is documented here:
2034cfc83b6cSPedro Giffunidnl     http://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO#General_Build_Requirements
2035cfc83b6cSPedro Giffunidnl ===================================================================
2036cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for required Perl modules])
20379b3da915SDamjan Jovanovicif `$PERL -e 'use Archive::Zip;
20389b3da915SDamjan Jovanovic              use LWP::UserAgent;
20399b3da915SDamjan Jovanovic              use XML::Parser;
20409b3da915SDamjan Jovanovic              use Digest::SHA;
20419b3da915SDamjan Jovanovic              use Digest::MD5;
20429b3da915SDamjan Jovanovic              use LWP::Protocol::https;'>/dev/null 2>&1`; then
2043cfc83b6cSPedro Giffuni    AC_MSG_RESULT([all modules found])
2044cfc83b6cSPedro Giffunielse
2045cfc83b6cSPedro Giffuni    # Find out which modules are missing.
2046cfc83b6cSPedro Giffuni    missing_perl_modules=
2047cfc83b6cSPedro Giffuni    if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
2048cfc83b6cSPedro Giffuni       missing_perl_modules=Archive::Zip
2049cfc83b6cSPedro Giffuni    fi
2050cfc83b6cSPedro Giffuni    if ! `$PERL -e 'use LWP::UserAgent;'>/dev/null 2>&1`; then
2051cfc83b6cSPedro Giffuni       missing_perl_modules="$missing_perl_modules LWP::UserAgent"
2052cfc83b6cSPedro Giffuni    fi
2053cfc83b6cSPedro Giffuni    if ! `$PERL -e 'use XML::Parser;'>/dev/null 2>&1`; then
2054cfc83b6cSPedro Giffuni       missing_perl_modules="$missing_perl_modules XML::Parser"
2055cfc83b6cSPedro Giffuni    fi
2056fec5e19eSarielch    if ! `$PERL -e 'use Digest::SHA;'>/dev/null 2>&1`; then
2057fec5e19eSarielch       missing_perl_modules="$missing_perl_modules Digest::SHA"
2058fec5e19eSarielch    fi
2059fec5e19eSarielch    if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
2060fec5e19eSarielch       missing_perl_modules="$missing_perl_modules Digest::MD5"
2061fec5e19eSarielch    fi
2062fec5e19eSarielch    if ! `$PERL -e 'use LWP::Protocol::https;'>/dev/null 2>&1`; then
2063fec5e19eSarielch       missing_perl_modules="$missing_perl_modules LWP::Protocol::https"
2064fec5e19eSarielch    fi
2065cfc83b6cSPedro Giffuni    AC_MSG_ERROR([
2066cfc83b6cSPedro Giffuni    The missing Perl modules are: $missing_perl_modules
2067cfc83b6cSPedro Giffuni    Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
2068cfc83b6cSPedro Giffunifi
2069cfc83b6cSPedro Giffuni
2070cfc83b6cSPedro Giffunidnl ===================================================================
2071cfc83b6cSPedro Giffunidnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2072cfc83b6cSPedro Giffunidnl ===================================================================
2073cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
2074cfc83b6cSPedro Giffuni    if test "$WITH_MINGWIN" != "yes"; then
2075cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([for friendly registry keys])
2076cfc83b6cSPedro Giffuni        # VS.Net 2003, VS.Net 2005
2077cfc83b6cSPedro Giffuni        if test -z "$with_cl_home"; then
2078edd74ba5SDamjan Jovanovic            vctest=`$OOWINTOOL --msvc-productdir`;
2079cfc83b6cSPedro Giffuni            if test -x "$vctest/bin/cl.exe"; then
2080cfc83b6cSPedro Giffuni                with_cl_home=$vctest;
2081cfc83b6cSPedro Giffuni            fi
2082cfc83b6cSPedro Giffuni        else
2083cfc83b6cSPedro Giffuni            with_cl_home=`cygpath -u "$with_cl_home"`
2084cfc83b6cSPedro Giffuni        fi
2085cfc83b6cSPedro Giffuni        AC_MSG_RESULT([done])
2086cfc83b6cSPedro Giffuni
2087cfc83b6cSPedro Giffuni        dnl ===========================================================
2088cfc83b6cSPedro Giffuni        dnl  Check for mspdb71.dll/mspdb80.dll
2089cfc83b6cSPedro Giffuni        dnl ===========================================================
2090cfc83b6cSPedro Giffuni        dnl  .NET 2003/5/8 Compiler
2091cfc83b6cSPedro Giffuni        if test -n "$with_mspdb_path";then
2092cfc83b6cSPedro Giffuni            with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2093cfc83b6cSPedro Giffuni        fi
2094cfc83b6cSPedro Giffuni        if test -e "$with_mspdb_path/mspdb71.dll" -o -e "$with_mspdb_path/mspdb80.dll"; then
2095cfc83b6cSPedro Giffuni            MSPDB_PATH="$with_mspdb_path"
2096cfc83b6cSPedro Giffuni        fi
2097cfc83b6cSPedro Giffuni        dnl .NET 2003 case
2098cfc83b6cSPedro Giffuni        if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb71.dll"; then
2099cfc83b6cSPedro Giffuni            MSPDB_PATH="$with_cl_home/../Common7/IDE"
2100cfc83b6cSPedro Giffuni        fi
2101cfc83b6cSPedro Giffuni        dnl .NET 2005/2008 case
2102cfc83b6cSPedro Giffuni        if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2103cfc83b6cSPedro Giffuni            MSPDB_PATH="$with_cl_home/../Common7/IDE"
2104cfc83b6cSPedro Giffuni        fi
2105cfc83b6cSPedro Giffuni        dnl Windows SDK 6.0 case
2106cfc83b6cSPedro Giffuni        if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2107cfc83b6cSPedro Giffuni            MSPDB_PATH="$with_cl_home/bin"
2108cfc83b6cSPedro Giffuni        fi
2109cfc83b6cSPedro Giffuni
2110cfc83b6cSPedro Giffuni        if test -z "$MSPDB_PATH";then
2111cfc83b6cSPedro Giffuni            dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2112cfc83b6cSPedro Giffuni            AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2113cfc83b6cSPedro Giffuni            AC_PATH_PROG(MSPDB_PATH, mspdb71.dll)
2114cfc83b6cSPedro Giffuni            MSPDB_PATH=`dirname "$MSPDB_PATH"`
2115cfc83b6cSPedro Giffuni        fi
2116cfc83b6cSPedro Giffuni
2117cfc83b6cSPedro Giffuni        if test -z "$MSPDB_PATH"; then
2118cfc83b6cSPedro Giffuni            AC_MSG_ERROR([You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path])
2119cfc83b6cSPedro Giffuni        fi
2120cfc83b6cSPedro Giffuni        MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2121cfc83b6cSPedro Giffuni        MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2122cfc83b6cSPedro Giffuni        dnl The path needs to be added before cl is called
2123cfc83b6cSPedro Giffuni        PATH="$MSPDB_PATH:$PATH"
2124cfc83b6cSPedro Giffuni
2125cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2126edd74ba5SDamjan Jovanovic        case "$build_cpu" in
2127edd74ba5SDamjan Jovanovic          i?86)
2128edd74ba5SDamjan Jovanovic            cl_subdirectory="bin"
2129edd74ba5SDamjan Jovanovic            ;;
2130edd74ba5SDamjan Jovanovic          x86_64)
2131edd74ba5SDamjan Jovanovic            if test "$BUILD_WIN64" = "TRUE" ; then
2132edd74ba5SDamjan Jovanovic              cl_subdirectory="bin/amd64"
2133cfc83b6cSPedro Giffuni            else
2134edd74ba5SDamjan Jovanovic              cl_subdirectory="bin"
2135cfc83b6cSPedro Giffuni            fi
2136edd74ba5SDamjan Jovanovic            ;;
2137edd74ba5SDamjan Jovanovic          *)
2138edd74ba5SDamjan Jovanovic            AC_MSG_ERROR([Unknown/unsupported Windows CPU $build_cpu.])
2139edd74ba5SDamjan Jovanovic            ;;
2140edd74ba5SDamjan Jovanovic        esac
2141edd74ba5SDamjan Jovanovic        if test -x "$with_cl_home/$cl_subdirectory/cl.exe"; then
2142edd74ba5SDamjan Jovanovic            CC="$with_cl_home/$cl_subdirectory/cl.exe"
2143edd74ba5SDamjan Jovanovic            COMPATH="$with_cl_home"
2144cfc83b6cSPedro Giffuni            # This gives us a posix path with 8.3 filename restrictions
2145cfc83b6cSPedro Giffuni            CC=`cygpath -d "$CC"`
2146cfc83b6cSPedro Giffuni            CC=`cygpath -u "$CC"`
2147edd74ba5SDamjan Jovanovic            COMPATH=`cygpath -d "$COMPATH"`
2148edd74ba5SDamjan Jovanovic            COMPATH=`cygpath -u "$COMPATH"`
2149cfc83b6cSPedro Giffuni            # Remove /cl.exe from CC case insensitive
2150cfc83b6cSPedro Giffuni            AC_MSG_RESULT([found ($CC)])
2151cfc83b6cSPedro Giffuni            export INCLUDE=`cygpath -d "$COMPATH/Include"`
2152cfc83b6cSPedro Giffuni            dnl  Check which Microsoft C/C++ compiler is found
2153cfc83b6cSPedro Giffuni            AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2154cfc83b6cSPedro Giffunidnl      The following find microsoft, matches nn.nn.nnnn then pulls numbers out.
2155cfc83b6cSPedro Giffuni            CCTXTVER=`$CC 2>&1 | head -n1`
2156cfc83b6cSPedro Giffuni            CCNUMVER=`echo $CCTXTVER | $AWK "/Microsoft/ && /..\\...\\...../ {
2157cfc83b6cSPedro Giffuni                            x = match( \\\$0, /..\\...\\...../ )
2158cfc83b6cSPedro Giffuni                            CCversion = substr( \\\$0, RSTART, RLENGTH)
2159cfc83b6cSPedro Giffuni                            tokencount = split (CCversion,vertoken,\".\")
2160cfc83b6cSPedro Giffuni                            for ( i = 1 ; i <= tokencount ; i++ ) {
2161cfc83b6cSPedro Giffuni                                printf (\"%04d\",vertoken[[i]] )
2162cfc83b6cSPedro Giffuni                            }
2163cfc83b6cSPedro Giffuni                            }"`
2164cfc83b6cSPedro Giffuni            AC_MSG_RESULT([found Compiler version $CCNUMVER in \"$CCTXTVER\"])
2165cfc83b6cSPedro Giffuni            if test "$CCNUMVER" -ge "001500000000"; then
2166cfc83b6cSPedro Giffuni                COMEX=12
2167cfc83b6cSPedro Giffuni                MSVSVER=2008
2168cfc83b6cSPedro Giffuni                AC_MSG_RESULT([found .NET 2008 / VS 9.0.])
2169cfc83b6cSPedro Giffuni            else
2170cfc83b6cSPedro Giffuni                AC_MSG_ERROR([Compiler too old. Use Microsoft C/C++ .NET 2008.])
2171cfc83b6cSPedro Giffuni            fi
2172cfc83b6cSPedro Giffuni        else
2173edd74ba5SDamjan Jovanovic            AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home.])
2174cfc83b6cSPedro Giffuni        fi
2175cfc83b6cSPedro Giffuni    else
2176cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([the Mingwin32 C++ Compiler])
2177cfc83b6cSPedro Giffuni        if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then
2178cfc83b6cSPedro Giffuni            AC_MSG_RESULT([found.])
217928633775SPedro Giffuni            if $CC -dumpspecs | $GREP -q "mno-cygwin"; then
2180cfc83b6cSPedro Giffuni                USE_MINGW="cygwin"
2181cfc83b6cSPedro Giffuni            else
2182cfc83b6cSPedro Giffuni                USE_MINGW="pure-mingw"
2183cfc83b6cSPedro Giffuni            fi
2184cfc83b6cSPedro Giffuni        else
2185cfc83b6cSPedro Giffuni            AC_MSG_ERROR([Mingwin32 C++ Compiler not found.])
2186cfc83b6cSPedro Giffuni        fi
2187cfc83b6cSPedro Giffuni    fi
2188cfc83b6cSPedro Giffunifi
2189cfc83b6cSPedro GiffuniAC_SUBST(COMEX)
2190cfc83b6cSPedro GiffuniAC_SUBST(MSPDB_PATH)
2191cfc83b6cSPedro GiffuniAC_SUBST(USE_MINGW)
2192cfc83b6cSPedro Giffuni
2193386ca866SDon Lewisdnl Compiler detection, logic from setsoenv.in
2194386ca866SDon Lewiscase "$build_os" in
2195386ca866SDon Lewis    *cygwin*)
2196386ca866SDon Lewis        if test "$WITH_MINGWIN" = "yes"; then
2197386ca866SDon Lewis            COM="GCC";
2198386ca866SDon Lewis        else
2199386ca866SDon Lewis            COM="MSC";
2200386ca866SDon Lewis        fi;;
2201386ca866SDon Lewis    os2*)
2202386ca866SDon Lewis        COM="GCC";;
2203386ca866SDon Lewis    netbsd | kfreebsd* | freebsd* | linux* | darwin* )
2204386ca866SDon Lewis        if $CC --version 2>&1 | $GREP clang > /dev/null ; then
2205386ca866SDon Lewis            COM="CLANG";
2206386ca866SDon Lewis        else
2207386ca866SDon Lewis            COM="GCC";
2208386ca866SDon Lewis        fi;;
2209386ca866SDon Lewis    solaris*)
2210386ca866SDon Lewis        case "$CC" in
2211386ca866SDon Lewis            *gcc*)  COM="GCC";;
2212386ca866SDon Lewis            *)  COM="C52";;
2213386ca866SDon Lewis        esac;;
2214386ca866SDon Lewis    osf | aix*)
2215386ca866SDon Lewis        COM="CXX";;
2216386ca866SDon Lewis    *) AC_MSG_ERROR([Unable to decipher compiler for $build_os]);;
2217386ca866SDon Lewisesac
2218386ca866SDon LewisAC_SUBST(COM)
2219386ca866SDon Lewis
2220386ca866SDon Lewisdnl  Decode the compiler version.  Logic from main/solenv/inc/tg_compv.mk.
2221386ca866SDon Lewiscase $COM in
2222386ca866SDon Lewis    GCC)
2223*a0ec95a2SMatthias Seidel        CCVER=`${CC} -dumpfullversion -dumpversion 2>&1`;
2224386ca866SDon Lewis        CCNUMVER=`echo ${CCVER} | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2225386ca866SDon Lewis        if test "${CCNUMVER}" -ge 000300000001; then
2226386ca866SDon Lewis            COMID="gcc3";
2227386ca866SDon Lewis            COMNAME="gcc3";
2228386ca866SDon Lewis        elif test "${CCNUMVER}" -ge 000300000001; then
2229386ca866SDon Lewis            COMID="GCC";
2230386ca866SDon Lewis            COMNAME="gcc2";
2231386ca866SDon Lewis        else
2232386ca866SDon Lewis            AC_MSG_ERROR([gcc too old]);
2233386ca866SDon Lewis        fi
2234386ca866SDon Lewis        ;;
2235386ca866SDon Lewis    CLANG)
2236386ca866SDon Lewis        CCVER=`${CC} --version 2>&1 | head -n1 | sed -e"s/.*version //" -e"s/ .*//"`;
2237386ca866SDon Lewis        CCNUMVER=`echo ${CCVER} | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2238386ca866SDon Lewis        # The version in tg_compv.mk for darwin does not look correct
2239386ca866SDon Lewis        # CCNUMVER = `echo ${CCVER} | sed -e"s/\.//";
224014d982deSJim Jagielski        case "$build_os" in
224114d982deSJim Jagielski            darwin*) # Mac OS X
224214d982deSJim Jagielski                COMID="s5abi";
224314d982deSJim Jagielski                COMNAME="s5abi";
224414d982deSJim Jagielski                ;;
224514d982deSJim Jagielski            *)
2246386ca866SDon Lewis                COMID="gcc3";
2247386ca866SDon Lewis                COMNAME="gcc3";
22486e64234aSJim Jagielski                ;;
224914d982deSJim Jagielski        esac
2250271f99acSDamjan Jovanovic        ;;
2251386ca866SDon Lewis    MSC)
2252386ca866SDon Lewis        CCVER=`${CC} 2>&1 | $AWK -f ${_solenv}/bin/getcompver.awk`;
2253386ca866SDon Lewis        CCNUMVER=`${CC} 2>&1 | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2254386ca866SDon Lewis        if test "${CCNUMVER}" -ge 001200000000; then
2255386ca866SDon Lewis            COMID="MSC";
2256edd74ba5SDamjan Jovanovic            case "$build_cpu" in
2257edd74ba5SDamjan Jovanovic              i?86)
2258386ca866SDon Lewis                COMNAME="msci";
2259edd74ba5SDamjan Jovanovic                ;;
2260edd74ba5SDamjan Jovanovic              x86_64)
2261edd74ba5SDamjan Jovanovic                if test "$BUILD_WIN64" = "TRUE" ; then
2262edd74ba5SDamjan Jovanovic                  COMNAME="mscx";
2263edd74ba5SDamjan Jovanovic                else
2264edd74ba5SDamjan Jovanovic                  COMNAME="msci";
2265edd74ba5SDamjan Jovanovic                fi
2266edd74ba5SDamjan Jovanovic                ;;
2267edd74ba5SDamjan Jovanovic              *)
2268edd74ba5SDamjan Jovanovic                AC_MSG_ERROR([Unknown/unsupported Windows CPU $build_cpu.])
2269edd74ba5SDamjan Jovanovic                ;;
2270edd74ba5SDamjan Jovanovic            esac
2271386ca866SDon Lewis        else
2272386ca866SDon Lewis            AC_MSG_ERROR([MSC compiler too old]);
2273386ca866SDon Lewis        fi
2274386ca866SDon Lewis        ;;
2275386ca866SDon Lewis    C55 | C54 | C52 | C40 | sunpro)
2276386ca866SDon Lewis        CCVER=`${CC} -V 2>&1 | $AWK -f ${_solenv}/bin/getcompver.awk`;
2277386ca866SDon Lewis        CCNUMVER=`${CC} -V 2>&1 | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2278386ca866SDon Lewis        if test "${CCNUMVER}" -ge 00050002; then
2279386ca866SDon Lewis            COMID="C52";
2280386ca866SDon Lewis            COMNAME="sunpro5";
2281386ca866SDon Lewis        else
2282386ca866SDon Lewis            AC_MSG_ERROR([Sun compiler too old]);
2283386ca866SDon Lewis        fi
2284386ca866SDon Lewis        ;;
2285386ca866SDon Lewis    *)
2286386ca866SDon Lewis        AC_MSG_ERROR([Unable to detect compiler version]);;
2287386ca866SDon Lewisesac
2288386ca866SDon LewisAC_SUBST(CCVER)
2289386ca866SDon LewisAC_SUBST(CCNUMVER)
2290386ca866SDon LewisAC_SUBST(COMID)
2291386ca866SDon LewisAC_SUBST(COMNAME)
2292386ca866SDon Lewis
2293386ca866SDon Lewisif test "$_os" = "FreeBSD"; then
2294386ca866SDon Lewis    FBSD_GCC_RPATH=
2295386ca866SDon Lewis    if "$COM" = "GCC"; then
2296386ca866SDon Lewis        rpath=`$CC --print-file-name libstdc++.so`
2297386ca866SDon Lewis        rpath=`realpath $rpath`
2298386ca866SDon Lewis        rpath=`dirname $rpath`
2299386ca866SDon Lewis    if test "$rpath" != "/usr/lib" ; then
2300386ca866SDon Lewis            FBSD_GCC_RPATH="-Wl,-rpath=$rpath"
2301386ca866SDon Lewis    fi
2302386ca866SDon Lewis    fi
2303386ca866SDon Lewis    AC_SUBST(FBSD_GCC_RPATH)
2304386ca866SDon Lewisfi
2305386ca866SDon Lewis
2306cfc83b6cSPedro Giffunidnl ===================================================================
2307cfc83b6cSPedro Giffunidnl  .NET needs special treatment
2308cfc83b6cSPedro Giffunidnl ===================================================================
2309cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
2310cfc83b6cSPedro Giffuniif test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then
2311cfc83b6cSPedro Giffuni    dnl Check midl.exe
2312cfc83b6cSPedro Giffuni    AC_PATH_PROG(MIDL_PATH, midl.exe)
2313cfc83b6cSPedro Giffuni    if test -n "$MIDL_PATH";then
2314cfc83b6cSPedro Giffuni        MIDL_PATH=`dirname "$MIDL_PATH"`
2315cfc83b6cSPedro Giffuni    fi
2316cfc83b6cSPedro Giffuni    if test -n "$with_midl_path";then
2317cfc83b6cSPedro Giffuni        with_midl_path=`cygpath -u "$with_midl_path"`
2318cfc83b6cSPedro Giffuni    fi
2319cfc83b6cSPedro Giffuni    if test -x "$with_midl_path/midl.exe"; then
2320cfc83b6cSPedro Giffuni        MIDL_PATH="$with_midl_path"
2321cfc83b6cSPedro Giffuni    fi
2322cfc83b6cSPedro Giffuni    if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
2323cfc83b6cSPedro Giffuni        MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
2324cfc83b6cSPedro Giffuni    fi
2325cfc83b6cSPedro Giffuni    if test -z "$MIDL_PATH" ; then
2326edd74ba5SDamjan Jovanovic      vstest=`$OOWINTOOL --msvs-productdir`;
2327cfc83b6cSPedro Giffuni      if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
2328cfc83b6cSPedro Giffuni          MIDL_PATH="$vstest/Common7/Tools/Bin"
2329cfc83b6cSPedro Giffuni      fi
2330cfc83b6cSPedro Giffuni    fi
2331cfc83b6cSPedro Giffuni    if test -z "$MIDL_PATH" ; then
2332edd74ba5SDamjan Jovanovic        psdktest=`$OOWINTOOL --psdk-home`
2333cfc83b6cSPedro Giffuni        if test -x "$psdktest/Bin/midl.exe" ; then
2334cfc83b6cSPedro Giffuni            MIDL_PATH="$psdktest/Bin"
2335cfc83b6cSPedro Giffuni        fi
2336cfc83b6cSPedro Giffuni    fi
2337cfc83b6cSPedro Giffuni    if test ! -x "$MIDL_PATH/midl.exe"; then
2338cfc83b6cSPedro Giffuni        AC_MSG_ERROR([midl.exe not found. Make sure it's in the path or use --with-midl-path])
2339cfc83b6cSPedro Giffuni    fi
2340cfc83b6cSPedro Giffuni    # Convert to posix path with 8.3 filename restrictions ( No spaces )
2341cfc83b6cSPedro Giffuni    MIDL_PATH=`cygpath -d "$MIDL_PATH"`
2342cfc83b6cSPedro Giffuni    MIDL_PATH=`cygpath -u "$MIDL_PATH"`
2343cfc83b6cSPedro Giffuni
2344cfc83b6cSPedro Giffuni    dnl Check csc.exe
2345cfc83b6cSPedro Giffuni    AC_PATH_PROG(CSC_PATH, csc.exe)
2346cfc83b6cSPedro Giffuni    if test -n "$CSC_PATH";then
2347cfc83b6cSPedro Giffuni        CSC_PATH=`dirname "$CSC_PATH"`
2348cfc83b6cSPedro Giffuni    fi
2349cfc83b6cSPedro Giffuni    if test -n "$with_csc_path";then
2350cfc83b6cSPedro Giffuni        with_csc_path=`cygpath -u "$with_csc_path"`
2351cfc83b6cSPedro Giffuni    fi
2352cfc83b6cSPedro Giffuni    if test -x "$with_csc_path/csc.exe"; then
2353cfc83b6cSPedro Giffuni        CSC_PATH="$with_csc_path"
2354cfc83b6cSPedro Giffuni    else
2355edd74ba5SDamjan Jovanovic       csctest=`$OOWINTOOL --csc-compilerdir`;
2356cfc83b6cSPedro Giffuni       if test -x "$csctest/csc.exe"; then
2357cfc83b6cSPedro Giffuni          CSC_PATH="$csctest"
2358cfc83b6cSPedro Giffuni       fi
2359cfc83b6cSPedro Giffuni    fi
2360cfc83b6cSPedro Giffuni    if test ! -x "$CSC_PATH/csc.exe"; then
2361cfc83b6cSPedro Giffuni        AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
2362cfc83b6cSPedro Giffuni    fi
2363cfc83b6cSPedro Giffuni    # Convert to posix path with 8.3 filename restrictions ( No spaces )
2364cfc83b6cSPedro Giffuni    CSC_PATH=`cygpath -d "$CSC_PATH"`
2365cfc83b6cSPedro Giffuni    CSC_PATH=`cygpath -u "$CSC_PATH"`
2366cfc83b6cSPedro Giffuni
2367cfc83b6cSPedro Giffuni    dnl Check mscoree.lib / .NET Frameworks dir
2368cfc83b6cSPedro Giffuni    dnl For VS2003/2005 $with_frame_home has to point to the directory with lib/mscoree.lib.
2369cfc83b6cSPedro Giffuni       AC_MSG_CHECKING(.NET Framework)
2370cfc83b6cSPedro Giffuni        if test -n "$with_frame_home"; then
2371cfc83b6cSPedro Giffuni        with_frame_home=`cygpath -u "$with_frame_home"`
2372cfc83b6cSPedro Giffuni        fi
2373cfc83b6cSPedro Giffuni        if test -f "$with_frame_home/lib/mscoree.lib"; then
2374cfc83b6cSPedro Giffuni            FRAME_HOME="$with_frame_home"
2375cfc83b6cSPedro Giffuni        fi
2376cfc83b6cSPedro Giffuni        if test -z "$FRAME_HOME" -a -e "$with_cl_home/../SDK/v1.1/lib/mscoree.lib"; then
2377cfc83b6cSPedro Giffuni            FRAME_HOME="$with_cl_home/../SDK/v1.1"
2378cfc83b6cSPedro Giffuni        fi
2379cfc83b6cSPedro Giffuni        if test -z "$FRAME_HOME" ; then
2380edd74ba5SDamjan Jovanovic          frametest=`$OOWINTOOL --dotnetsdk-dir`
2381cfc83b6cSPedro Giffuni          if test -f "$frametest/lib/mscoree.lib"; then
2382cfc83b6cSPedro Giffuni             FRAME_HOME="$frametest"
2383cfc83b6cSPedro Giffuni          else
2384edd74ba5SDamjan Jovanovic             frametest=`$OOWINTOOL --psdk-home`
2385cfc83b6cSPedro Giffuni             if test -f "$frametest/lib/mscoree.lib"; then
2386cfc83b6cSPedro Giffuni                FRAME_HOME="$frametest"
2387cfc83b6cSPedro Giffuni             fi
2388cfc83b6cSPedro Giffuni          fi
2389cfc83b6cSPedro Giffuni        fi
2390cfc83b6cSPedro Giffuni        if test ! -f "$FRAME_HOME/lib/mscoree.lib"; then
2391cfc83b6cSPedro Giffuni        AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home])
2392cfc83b6cSPedro Giffuni        fi
2393cfc83b6cSPedro Giffuni        AC_MSG_RESULT(found)
2394cfc83b6cSPedro Giffuni    # Convert to posix path with 8.3 filename restrictions ( No spaces )
2395cfc83b6cSPedro Giffuni    FRAME_HOME=`cygpath -d "$FRAME_HOME"`
2396cfc83b6cSPedro Giffuni    FRAME_HOME=`cygpath -u "$FRAME_HOME"`
2397cfc83b6cSPedro Giffunifi
2398cfc83b6cSPedro GiffuniAC_SUBST(MIDL_PATH)
2399cfc83b6cSPedro GiffuniAC_SUBST(CSC_PATH)
2400cfc83b6cSPedro GiffuniAC_SUBST(FRAME_HOME)
2401cfc83b6cSPedro Giffunifi
2402cfc83b6cSPedro Giffuni
2403cfc83b6cSPedro Giffunidnl ===================================================================
2404407bc2eeSMatthias Seideldnl Check if stdc headers are available excluding Windows.
2405cfc83b6cSPedro Giffunidnl ===================================================================
2406cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
2407cfc83b6cSPedro Giffuni   AC_HEADER_STDC
2408cfc83b6cSPedro Giffunifi
2409cfc83b6cSPedro Giffuni
2410cfc83b6cSPedro Giffunidnl ===================================================================
2411cfc83b6cSPedro Giffunidnl Find pre-processors.
2412cfc83b6cSPedro Giffunidnl ===================================================================
2413cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
2414cfc83b6cSPedro Giffuni   AC_PROG_CXXCPP
2415cfc83b6cSPedro Giffuni
2416cfc83b6cSPedro Giffunidnl Check whether there's a C pre-processor.
2417cfc83b6cSPedro Giffunidnl ===================================================================
2418cfc83b6cSPedro Giffunidnl When using SunStudio compiler, there is a bug with the cc
2419cfc83b6cSPedro Giffunidnl preprocessor, so use CC preprocessor as the cc preprocessor
2420cfc83b6cSPedro Giffunidnl See Issuezilla #445.
2421cfc83b6cSPedro Giffunidnl ===================================================================
2422cfc83b6cSPedro Giffuni   if test "$_os" = "SunOS"; then
2423cfc83b6cSPedro Giffuni      CPP=$CXXCPP
2424cfc83b6cSPedro Giffuni   else
2425cfc83b6cSPedro Giffuni      AC_PROG_CPP
2426cfc83b6cSPedro Giffuni   fi
2427cfc83b6cSPedro Giffunifi
2428cfc83b6cSPedro Giffuni
2429cfc83b6cSPedro GiffuniAC_CHECK_SIZEOF(long)
2430cfc83b6cSPedro GiffuniSIZEOF_LONG=$ac_cv_sizeof_long
2431cfc83b6cSPedro GiffuniAC_SUBST(SIZEOF_LONG)
2432cfc83b6cSPedro GiffuniAC_C_BIGENDIAN
2433cfc83b6cSPedro GiffuniWORDS_BIGENDIAN=$ac_cv_c_bigendian
2434cfc83b6cSPedro GiffuniAC_SUBST(WORDS_BIGENDIAN)
2435cfc83b6cSPedro Giffuni
2436cfc83b6cSPedro Giffunidnl Check for large file support
2437cfc83b6cSPedro GiffuniAC_SYS_LARGEFILE
2438cfc83b6cSPedro Giffuniif test -n "$ac_cv_sys_file_offset_bits"; then
2439cfc83b6cSPedro Giffuni   LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
2440cfc83b6cSPedro Giffunifi
2441cfc83b6cSPedro Giffuniif test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
2442cfc83b6cSPedro Giffuni   LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
2443cfc83b6cSPedro Giffunifi
2444cfc83b6cSPedro GiffuniAC_SUBST(LFS_CFLAGS)
2445cfc83b6cSPedro Giffuni
2446cfc83b6cSPedro Giffunidnl ===================================================================
2447cfc83b6cSPedro Giffunidnl Check if valgrind.h is available
2448cfc83b6cSPedro Giffunidnl ===================================================================
2449cfc83b6cSPedro Giffuniif test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
2450cfc83b6cSPedro Giffuni   dnl Test $prefix (currently only testing for /usr and /usr/local)
2451cfc83b6cSPedro Giffuni   dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
2452cfc83b6cSPedro Giffuni   VALGRIND_CFLAGS=""
2453cfc83b6cSPedro Giffuni   prev_cppflags=$CPPFLAGS
2454cfc83b6cSPedro Giffuni   if test -z "$VALGRIND_CFLAGS"; then
2455cfc83b6cSPedro Giffuni      CPPFLAGS="-I/usr/include/valgrind"
2456cfc83b6cSPedro Giffuni      AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
2457cfc83b6cSPedro Giffuni   fi
2458cfc83b6cSPedro Giffuni   if test -z "$VALGRIND_CFLAGS"; then
2459cfc83b6cSPedro Giffuni      CPPFLAGS="-I/usr/local/include/valgrind"
2460cfc83b6cSPedro Giffuni      AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
2461cfc83b6cSPedro Giffuni   fi
2462cfc83b6cSPedro Giffuni   if test -n "$VALGRIND_CFLAGS"; then
2463cfc83b6cSPedro Giffuni      CPPFLAGS=$VALGRIND_CFLAGS
2464cfc83b6cSPedro Giffuni      AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
2465cfc83b6cSPedro Giffuni   fi
2466cfc83b6cSPedro Giffuni   CPPFLAGS=$prev_cppflags
2467cfc83b6cSPedro Giffunifi
2468cfc83b6cSPedro GiffuniAC_SUBST([VALGRIND_CFLAGS])
2469cfc83b6cSPedro Giffuni
2470cfc83b6cSPedro Giffunidnl ===================================================================
2471cfc83b6cSPedro Giffunidnl Check if cups/cups.h is available
2472cfc83b6cSPedro Giffunidnl ===================================================================
2473cfc83b6cSPedro Giffuniif test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then
2474cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(cups/cups.h, [],
2475cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR([cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?])], [])
2476cfc83b6cSPedro Giffunifi
2477cfc83b6cSPedro Giffuni
2478cfc83b6cSPedro Giffunidnl ===================================================================
2479cfc83b6cSPedro Giffunidnl Check if PAM/pam_appl.h is available on Linux or FreeBSD
2480cfc83b6cSPedro Giffunidnl ===================================================================
2481cfc83b6cSPedro Giffuniif test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then
2482cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([whether to enable pam support])
2483cfc83b6cSPedro Giffuni  if test -z "$enable_pam" || test "$enable_pam" != "no"; then
2484cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
2485cfc83b6cSPedro Giffuni    PAM=YES
2486cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(security/pam_appl.h, [],
2487cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR([pam_appl.h could not be found. libpam-dev or pam-devel missing?])], [])
2488cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([whether to link to libpam])
2489cfc83b6cSPedro Giffuni    if test -n "$enable_pam_link" -a "$enable_pam_link" != "no"; then
2490cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
2491cfc83b6cSPedro Giffuni      PAM_LINK=YES
2492cfc83b6cSPedro Giffuni      AC_CHECK_LIB(pam, pam_start, [],
2493cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libpam not found or functional)], [])
2494cfc83b6cSPedro Giffuni    else
2495cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no, dynamically open it])
2496cfc83b6cSPedro Giffuni      PAM_LINK=NO
2497cfc83b6cSPedro Giffuni    fi
2498cfc83b6cSPedro Giffuni  else
2499cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
2500cfc83b6cSPedro Giffuni    PAM=NO
2501cfc83b6cSPedro Giffuni    PAM_LINK=NO
2502cfc83b6cSPedro Giffuni    dnl check getspnam_r for needed args (4 or 5)
2503cfc83b6cSPedro Giffuni    AX_FUNC_WHICH_GETSPNAM_R
2504cfc83b6cSPedro Giffuni  fi
2505cfc83b6cSPedro Giffunifi
2506cfc83b6cSPedro GiffuniAC_SUBST(PAM)
2507cfc83b6cSPedro GiffuniAC_SUBST(NEW_SHADOW_API)
2508cfc83b6cSPedro GiffuniAC_SUBST(PAM_LINK)
2509cfc83b6cSPedro Giffuni
2510cfc83b6cSPedro Giffuniif test "$_os" = "Linux"; then
2511cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([whether to link to libcrypt])
2512cfc83b6cSPedro Giffuni    if test -n "$enable_crypt_link" -a "$enable_crypt_link" != "no"; then
2513cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes])
2514cfc83b6cSPedro Giffuni        CRYPT_LINK=YES
2515cfc83b6cSPedro Giffuni        AC_CHECK_LIB(crypt, crypt, [],
2516cfc83b6cSPedro Giffuni            [AC_MSG_ERROR(libcrypt not found or functional)], [])
2517cfc83b6cSPedro Giffuni    else
2518cfc83b6cSPedro Giffuni        AC_MSG_RESULT([no, dynamically open it])
2519cfc83b6cSPedro Giffuni        CRYPT_LINK=NO
2520cfc83b6cSPedro Giffuni    fi
2521cfc83b6cSPedro Giffunifi
2522cfc83b6cSPedro GiffuniAC_SUBST(CRYPT_LINK)
2523cfc83b6cSPedro Giffuni
2524cfc83b6cSPedro Giffunidnl ===================================================================
2525cfc83b6cSPedro Giffunidnl Testing for c++ compiler and version...
2526cfc83b6cSPedro Giffunidnl ===================================================================
2527cfc83b6cSPedro Giffuniif test -n "$with_gcc_home"; then
2528cfc83b6cSPedro Giffuni   if test -z "$CXX"; then
2529cfc83b6cSPedro Giffuni      CXX="$with_gcc_home/bin/g++"
2530cfc83b6cSPedro Giffuni   fi
2531cfc83b6cSPedro Giffunifi
2532cfc83b6cSPedro Giffuni
2533cfc83b6cSPedro Giffuniif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
2534cfc83b6cSPedro Giffuni   if test -e "$CC"; then
2535cfc83b6cSPedro Giffuni      CXX="$CC"
2536cfc83b6cSPedro Giffuni   fi
2537cfc83b6cSPedro Giffunifi
2538cfc83b6cSPedro Giffuni
2539cfc83b6cSPedro Giffunidnl Autoconf 2.53 can do this test for cl.exe, 2.13 can't!
2540cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
2541cfc83b6cSPedro Giffuni   AC_PROG_CXX
2542cfc83b6cSPedro Giffunifi
2543cfc83b6cSPedro Giffuni
2544cfc83b6cSPedro Giffunidnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
2545cfc83b6cSPedro Giffuniif test "$GXX" = "yes"; then
2546cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([the GNU C++ compiler version])
2547cfc83b6cSPedro Giffuni
2548cfc83b6cSPedro Giffuni   _gpp_version=`$CXX -dumpversion`
2549cfc83b6cSPedro Giffuni   _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
2550cfc83b6cSPedro Giffuni
2551cfc83b6cSPedro Giffuni   AC_MSG_RESULT([checked (g++ $_gpp_version)])
2552cfc83b6cSPedro Giffuni
2553cfc83b6cSPedro Giffuni   if test "$_gpp_majmin" = "304"; then
2554cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([whether $CXX has the enum bug])
2555cfc83b6cSPedro GiffuniAC_TRY_RUN([
2556cfc83b6cSPedro Giffuniextern "C" void abort (void);
2557cfc83b6cSPedro Giffuniextern "C" void exit (int status);
2558cfc83b6cSPedro Giffuni
2559cfc83b6cSPedro Giffunienum E { E0, E1, E2, E3, E4, E5 };
2560cfc83b6cSPedro Giffuni
2561cfc83b6cSPedro Giffunivoid
2562cfc83b6cSPedro Giffunitest (enum E e)
2563cfc83b6cSPedro Giffuni{
2564cfc83b6cSPedro Giffuni  if (e == E2 || e == E3 || e == E1)
2565cfc83b6cSPedro Giffuni  exit (1);
2566cfc83b6cSPedro Giffuni}
2567cfc83b6cSPedro Giffuni
2568cfc83b6cSPedro Giffuniint
2569cfc83b6cSPedro Giffunimain (void)
2570cfc83b6cSPedro Giffuni{
2571cfc83b6cSPedro Giffuni  test (E4);
2572cfc83b6cSPedro Giffuni  test (E5);
2573cfc83b6cSPedro Giffuni  test (E0);
2574cfc83b6cSPedro Giffuni  return 0;
2575cfc83b6cSPedro Giffuni}
2576cfc83b6cSPedro Giffuni],[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])])
2577cfc83b6cSPedro Giffuni   fi
2578cfc83b6cSPedro Giffunifi
2579cfc83b6cSPedro Giffuni
2580cfc83b6cSPedro Giffunidnl ===================================================================
2581cfc83b6cSPedro Giffunidnl Set the mingw runtime library include directories
2582cfc83b6cSPedro Giffunidnl ===================================================================
2583cfc83b6cSPedro Giffuniif test "$WITH_MINGWIN" = "yes"; then
2584cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for mingwin runtime include path])
2585cfc83b6cSPedro Giffuni   cat >conftest.$ac_ext <<_ACEOF
2586cfc83b6cSPedro Giffuni#include <stddef.h>
2587cfc83b6cSPedro Giffuni#include <bits/c++config.h>
2588cfc83b6cSPedro Giffuni_ACEOF
2589cfc83b6cSPedro Giffuni   _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`
2590cfc83b6cSPedro Giffuni   rm conftest.$ac_ext
2591cfc83b6cSPedro Giffuni   if test -n "$_mingw_lib_include_path"; then
2592cfc83b6cSPedro Giffuni      _temp=""
2593cfc83b6cSPedro Giffuni      for a in $_mingw_lib_include_path
2594cfc83b6cSPedro Giffuni         do
2595cfc83b6cSPedro Giffuni            a=`cygpath -d "$a"`
2596cfc83b6cSPedro Giffuni            _temp="$_temp "`cygpath -u "$a"`
2597cfc83b6cSPedro Giffuni         done
2598cfc83b6cSPedro Giffuni      _mingw_lib_include_path=$_temp
2599cfc83b6cSPedro Giffuni   fi
2600cfc83b6cSPedro Giffuni   if test -z "$_mingw_lib_include_path"; then
2601cfc83b6cSPedro Giffuni      _mingw_lib_include_path="NO_LIB_INCLUDE"
2602cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no mingwin runtime includes])
2603cfc83b6cSPedro Giffuni   else
2604cfc83b6cSPedro Giffuni      AC_MSG_RESULT([$_mingw_lib_include_path])
2605cfc83b6cSPedro Giffuni   fi
2606cfc83b6cSPedro Giffuni  MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
2607cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_LIB_INCLUDE_PATH)
2608cfc83b6cSPedro Giffunidnl mingw gcc 4.4.0 needs backward in include path to use hash_set/hash_map
2609cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for mingwin c++ backward include path])
2610cfc83b6cSPedro Giffuni   cat >conftest.$ac_ext <<_ACEOF
2611cfc83b6cSPedro Giffuni#include <hash_set>
2612cfc83b6cSPedro Giffuni_ACEOF
2613cfc83b6cSPedro Giffuni   _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`
2614cfc83b6cSPedro Giffuni   rm conftest.$ac_ext
2615cfc83b6cSPedro Giffuni   if test -n "$_mingw_backward_include_path"; then
2616cfc83b6cSPedro Giffuni      _mingw_backward_include_path=`cygpath -d $_mingw_backward_include_path`
2617cfc83b6cSPedro Giffuni      _mingw_backward_include_path=`cygpath -u $_mingw_backward_include_path`
2618cfc83b6cSPedro Giffuni      AC_MSG_RESULT([$_mingw_backward_include_path])
2619cfc83b6cSPedro Giffuni   else
2620cfc83b6cSPedro Giffuni      _mingw_backward_include_path="NO_BACKWARD_INCLUDE"
2621cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no mingwin c++ backward includes])
2622cfc83b6cSPedro Giffuni   fi
2623cfc83b6cSPedro Giffuni  MINGW_BACKWARD_INCLUDE_PATH="$_mingw_backward_include_path"
2624cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_BACKWARD_INCLUDE_PATH)
2625cfc83b6cSPedro Giffuni  mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
2626cfc83b6cSPedro Giffuni  MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
2627cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([whether to use dynamic libgcc])
2628cfc83b6cSPedro Giffuni  if test -e "$MINGW_CLIB_DIR/libgcc_s.a"; then
2629cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([dynamic libgcc name])
2630cfc83b6cSPedro Giffuni    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'`
2631cfc83b6cSPedro Giffuni    MINGW_GCCDLL=`cd $COMPATH/bin && ls $MINGW_GCCDLL_pattern 2>/dev/null`
2632cfc83b6cSPedro Giffuni    if test -n "$MINGW_GCCDLL"; then
2633cfc83b6cSPedro Giffuni        MINGW_SHARED_GCCLIB=YES
2634cfc83b6cSPedro Giffuni        AC_MSG_RESULT([use $MINGW_GCCDLL])
2635cfc83b6cSPedro Giffuni    else
2636cfc83b6cSPedro Giffuni        AC_MSG_RESULT([no])
2637cfc83b6cSPedro Giffuni    fi
2638cfc83b6cSPedro Giffuni  else
2639cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
2640cfc83b6cSPedro Giffuni  fi
2641cfc83b6cSPedro Giffuni  if test -e "$MINGW_CLIB_DIR/libgcc_eh.a"; then
2642cfc83b6cSPedro Giffuni      MINGW_GCCLIB_EH=YES
2643cfc83b6cSPedro Giffuni  fi
2644cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([whether to use dynamic libstdc++])
2645cfc83b6cSPedro Giffuni  MINGW_SHARED_LIBSTDCPP=
2646cfc83b6cSPedro Giffuni  if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then
2647cfc83b6cSPedro Giffuni    MINGW_SHARED_LIBSTDCPP=stdc++_s
2648cfc83b6cSPedro Giffuni  fi
2649cfc83b6cSPedro Giffuni  if test -e "$MINGW_CLIB_DIR/libstdc++.dll.a" ; then
2650cfc83b6cSPedro Giffuni    MINGW_SHARED_LIBSTDCPP=stdc++.dll
2651cfc83b6cSPedro Giffuni  fi
2652cfc83b6cSPedro Giffuni  if test -n "$MINGW_SHARED_LIBSTDCPP" ; then
2653cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([dynamic libstdc++ name])
2654cfc83b6cSPedro Giffuni    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'`
2655cfc83b6cSPedro Giffuni    MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null`
2656cfc83b6cSPedro Giffuni    if test -n "$MINGW_GXXDLL"; then
2657cfc83b6cSPedro Giffuni        MINGW_SHARED_LIBSTDCPP=-l$MINGW_SHARED_LIBSTDCPP
2658cfc83b6cSPedro Giffuni        MINGW_SHARED_GXXLIB=YES
2659cfc83b6cSPedro Giffuni        AC_MSG_RESULT([use $MINGW_GXXDLL])
2660cfc83b6cSPedro Giffuni    else
2661cfc83b6cSPedro Giffuni        MINGW_SHARED_LIBSTDCPP=
2662cfc83b6cSPedro Giffuni        AC_MSG_RESULT([no])
2663cfc83b6cSPedro Giffuni    fi
2664cfc83b6cSPedro Giffuni  else
2665cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
2666cfc83b6cSPedro Giffuni  fi
2667cfc83b6cSPedro Giffuni  MINGW_CLIB_DIR=`cygpath $MINGW_CLIB_DIR`
2668cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_CLIB_DIR)
2669cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_SHARED_GCCLIB)
2670cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_GCCLIB_EH)
2671cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_SHARED_GXXLIB)
2672cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_SHARED_LIBSTDCPP)
2673cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_GCCDLL)
2674cfc83b6cSPedro Giffuni  AC_SUBST(MINGW_GXXDLL)
2675cfc83b6cSPedro Giffunifi
2676cfc83b6cSPedro Giffuni
2677cfc83b6cSPedro Giffunidnl ===================================================================
2678cfc83b6cSPedro Giffunidnl Extra checking for the SUN OS compiler
2679cfc83b6cSPedro Giffunidnl ===================================================================
2680cfc83b6cSPedro Giffuniif test "$_os" = "SunOS"; then
2681cfc83b6cSPedro Giffuni   dnl SunStudio C++ compiler packaged with SunStudio C compiler
2682cfc83b6cSPedro Giffuni   if test "$CC" = "cc"; then
2683cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([SunStudio C++ Compiler])
2684cfc83b6cSPedro Giffuni      if test "$CXX" != "CC"; then
2685cfc83b6cSPedro Giffuni         AC_MSG_WARN([SunStudio C++ was not found])
2686cfc83b6cSPedro Giffuni         echo "SunStudio C++ was not found" >> warn
2687cfc83b6cSPedro Giffuni      else
2688cfc83b6cSPedro Giffuni         AC_MSG_RESULT([checked])
2689cfc83b6cSPedro Giffuni      fi
2690cfc83b6cSPedro Giffuni   fi
2691cfc83b6cSPedro Giffunifi
2692cfc83b6cSPedro Giffunidnl ===================================================================
2693cfc83b6cSPedro Giffunidnl Extra checking for the OSF compiler
2694cfc83b6cSPedro Giffunidnl ===================================================================
2695cfc83b6cSPedro Giffuniif test "$_os" = "OSF1"; then
2696cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([Compaq C++ compiler version])
2697cfc83b6cSPedro Giffuni   dnl cxx -V outputs to standard error!!!!
2698cfc83b6cSPedro Giffuni   _compaqcxx_version=`$CXX -V 2>&1 | $AWK '{ print $3 }'`
2699cfc83b6cSPedro Giffuni   _compaqcxx_major=`echo $_compaqcxx_version | $AWK -F. '{ print $1 }'`
2700cfc83b6cSPedro Giffuni   if test "$_compaqcxx_major" != "V6"; then
2701cfc83b6cSPedro Giffuni      AC_MSG_WARN([found version "$_compaqc_version", use version 6 of the Compaq C++ compiler])
2702cfc83b6cSPedro Giffuni      echo "found version $_compaqc_version, use version 6 of the Compaq C++ compiler" >> warn
2703cfc83b6cSPedro Giffuni   else
2704cfc83b6cSPedro Giffuni      dnl compiler will do
2705cfc83b6cSPedro Giffuni      AC_MSG_RESULT([checked])
2706cfc83b6cSPedro Giffuni   fi
2707cfc83b6cSPedro Giffunifi
2708cfc83b6cSPedro Giffuni
2709cfc83b6cSPedro Giffunidnl *************************************************************
2710cfc83b6cSPedro Giffunidnl Testing for exception handling - dwarf2 or sjlj exceptions...
2711cfc83b6cSPedro Giffunidnl *************************************************************
2712cfc83b6cSPedro GiffuniAC_MSG_CHECKING([exception type])
2713cfc83b6cSPedro GiffuniAC_LANG_PUSH([C++])
2714cfc83b6cSPedro Giffuniif test "$WITH_MINGWIN" = "yes"; then
2715cfc83b6cSPedro Giffuni  AC_TRY_LINK(
2716cfc83b6cSPedro Giffuni    [#include <iostream>
2717cfc83b6cSPedro Giffuni
2718cfc83b6cSPedro Giffuniextern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
2719cfc83b6cSPedro Giffuni
2720cfc83b6cSPedro Giffuni    ],
2721cfc83b6cSPedro Giffuni    [_Unwind_SjLj_RaiseException() ],
2722cfc83b6cSPedro Giffuni    [exceptions_type="sjlj"],
2723cfc83b6cSPedro Giffuni    [exceptions_type="dwarf2"]
2724cfc83b6cSPedro Giffuni  )
2725cfc83b6cSPedro Giffunifi
2726cfc83b6cSPedro Giffuni
2727cfc83b6cSPedro GiffuniAC_MSG_RESULT($exceptions_type)
2728cfc83b6cSPedro GiffuniAC_LANG_POP([C++])
2729cfc83b6cSPedro GiffuniEXCEPTIONS="$exceptions_type"
2730cfc83b6cSPedro GiffuniAC_SUBST(EXCEPTIONS)
2731cfc83b6cSPedro Giffuni
2732cfc83b6cSPedro Giffunidnl ===================================================================
2733cfc83b6cSPedro Giffunidnl Checks for what the default STL should be
2734cfc83b6cSPedro Giffunidnl ===================================================================
2735cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([what the default STL should be])
2736cfc83b6cSPedro Giffuni   DEFAULT_TO_STLPORT="no"
2737cfc83b6cSPedro Giffuniif test "$WITH_STLPORT" != "no"; then
2738cfc83b6cSPedro Giffuni   AC_MSG_ERROR([Option --with-stlport is no longer available.])
2739cfc83b6cSPedro Giffunielse
2740cfc83b6cSPedro Giffuni   USE_SYSTEM_STL="YES"
2741cfc83b6cSPedro Giffunifi
2742cfc83b6cSPedro Giffuni
2743cfc83b6cSPedro GiffuniAC_SUBST(USE_SYSTEM_STL)
2744cfc83b6cSPedro Giffuni
2745cfc83b6cSPedro Giffunidnl ===================================================================
2746cfc83b6cSPedro Giffunidnl visibility feature
2747cfc83b6cSPedro Giffunidnl ===================================================================
2748cfc83b6cSPedro Giffuniif test "$GCC" = "yes"; then
2749cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
2750cfc83b6cSPedro Giffuni   save_CFLAGS=$CFLAGS
2751cfc83b6cSPedro Giffuni   CFLAGS="$CFLAGS -fvisibility=hidden"
2752cfc83b6cSPedro Giffuni   AC_TRY_LINK([], [ return 0; ], [ HAVE_GCC_VISIBILITY_FEATURE=TRUE ], [])
2753cfc83b6cSPedro Giffuni   CFLAGS=$save_CFLAGS
2754cfc83b6cSPedro Giffuni   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2755cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
2756cfc83b6cSPedro Giffuni   else
2757cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
2758cfc83b6cSPedro Giffuni   fi
2759cfc83b6cSPedro Giffunifi
2760cfc83b6cSPedro Giffuni
2761cfc83b6cSPedro Giffuni# ===================================================================
2762cfc83b6cSPedro Giffuni# use --ccache-skip?
2763cfc83b6cSPedro Giffuni# ===================================================================
2764cfc83b6cSPedro Giffunidnl used to escape compiler options for ccache that otherwise prevent
2765cfc83b6cSPedro Giffunidnl caching of the results (like "-x objective-c++" for Mac)
2766cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether we are allowed and able to use --ccache-skip])
2767cfc83b6cSPedro Giffuniif test "$_os" != "Darwin" ; then
2768cfc83b6cSPedro Giffuni   AC_MSG_RESULT([only used on Mac currently, skipping])
2769cfc83b6cSPedro Giffunielif test "$enable_ccache_skip" = "no" ; then
2770cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no - diabled explicitly])
2771cfc83b6cSPedro Giffunielif test "$enable_ccache_skip" = "yes" ; then
2772cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes - enabled explicitly, skipping checks])
2773cfc83b6cSPedro Giffuni   AC_SUBST([USE_CCACHE], [YES])
2774cfc83b6cSPedro Giffunielif test "$enable_ccache_skip" = "auto" ; then
2775cfc83b6cSPedro Giffuni   # checking for ccache presence/version
2776cfc83b6cSPedro Giffuni   AC_MSG_RESULT([probing...])
2777cfc83b6cSPedro Giffuni   AC_PATH_PROG([CCACHE],[ccache],[not_found])
2778cfc83b6cSPedro Giffuni   if test "$CCACHE" = "not_found" ; then
2779cfc83b6cSPedro Giffuni      AC_MSG_NOTICE([not enabling --ccache-skip (ccache not found)])
2780cfc83b6cSPedro Giffuni   else
2781cfc83b6cSPedro Giffuni      # check ccache version
2782cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([whether version of ccache is suitable])
2783cfc83b6cSPedro Giffuni      CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2784cfc83b6cSPedro Giffuni      if test "$CCACHE_VERSION" = "2.4_OOo"; then
2785cfc83b6cSPedro Giffuni         AC_MSG_RESULT([yes])
2786cfc83b6cSPedro Giffuni         AC_MSG_CHECKING([whether ccache is actually used for the build])
2787cfc83b6cSPedro Giffuni         AC_LANG_PUSH([C++])
2788cfc83b6cSPedro Giffuni         save_CXXFLAGS=$CXXFLAGS
2789cfc83b6cSPedro Giffuni         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
2790cfc83b6cSPedro Giffuni         dnl an empty program will do, we're checking the compiler flags
2791cfc83b6cSPedro Giffuni         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2792cfc83b6cSPedro Giffuni            [use_ccache=yes], [use_ccache=no])
2793cfc83b6cSPedro Giffuni         if test $use_ccache = yes ; then
2794cfc83b6cSPedro Giffuni            AC_MSG_RESULT([yes, will enable --ccache-skip])
2795cfc83b6cSPedro Giffuni            AC_SUBST([USE_CCACHE], [YES])
2796cfc83b6cSPedro Giffuni         else
2797cfc83b6cSPedro Giffuni            AC_MSG_RESULT([no, will not enable --ccache-skip])
2798cfc83b6cSPedro Giffuni         fi
2799cfc83b6cSPedro Giffuni         CXXFLAGS=$save_CXXFLAGS
2800cfc83b6cSPedro Giffuni         AC_LANG_POP([C++])
2801cfc83b6cSPedro Giffuni      else
2802cfc83b6cSPedro Giffuni         AC_MSG_RESULT([no])
2803cfc83b6cSPedro Giffuni         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip])
2804cfc83b6cSPedro Giffuni      fi
2805cfc83b6cSPedro Giffuni   fi
2806cfc83b6cSPedro Giffunielse
2807cfc83b6cSPedro Giffuni   AC_MSG_ERROR([invalid option to --enable-ccache-skip. Valid values are "auto", "yes" and "no"])
2808cfc83b6cSPedro Giffunifi
2809cfc83b6cSPedro Giffuni
2810cfc83b6cSPedro Giffunidnl ===================================================================
2811cfc83b6cSPedro Giffunidnl system stl sanity tests
2812cfc83b6cSPedro Giffunidnl ===================================================================
2813cfc83b6cSPedro Giffuniif false ; then # TODO: update TR1 compliant STLs
2814cfc83b6cSPedro Giffuniif test "$USE_SYSTEM_STL" = "YES"; then
2815cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([system stl sanity])
2816cfc83b6cSPedro Giffuni   AC_LANG_PUSH([C++])
2817cfc83b6cSPedro Giffuni
2818cfc83b6cSPedro Giffuni   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2819cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([if STL headers are visibility safe])
2820cfc83b6cSPedro Giffuni      AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
2821cfc83b6cSPedro Giffuni      AC_MSG_RESULT([$stlvisok])
2822cfc83b6cSPedro Giffuni      if test "$stlvisok" = "no"; then
2823cfc83b6cSPedro Giffuni         AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
2824cfc83b6cSPedro Giffuni         echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
2825cfc83b6cSPedro Giffuni         unset HAVE_GCC_VISIBILITY_FEATURE
2826cfc83b6cSPedro Giffuni      fi
2827cfc83b6cSPedro Giffuni   fi
2828cfc83b6cSPedro Giffuni
2829cfc83b6cSPedro Giffuni   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2830cfc83b6cSPedro Giffuni      sharedlink_ldflags_save=$LDFLAGS
2831cfc83b6cSPedro Giffuni      LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
2832cfc83b6cSPedro Giffuni
2833cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
2834cfc83b6cSPedro Giffuni      AC_TRY_LINK([#include <sstream>
2835cfc83b6cSPedro Giffuniusing namespace std;
2836cfc83b6cSPedro Giffuni],[istringstream strm( "test" ); return 0;],
2837cfc83b6cSPedro Giffuni      $EGREP -q  unresolvable conftest.err;
2838cfc83b6cSPedro Giffuni      if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi,
2839cfc83b6cSPedro Giffuni      gccvisok=no)
2840cfc83b6cSPedro Giffuni      AC_MSG_RESULT([$gccvisok])
2841cfc83b6cSPedro Giffuni      if test "$gccvisok" = "no"; then
2842cfc83b6cSPedro Giffuni         AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility])
2843cfc83b6cSPedro Giffuni         echo "Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >> warn
2844cfc83b6cSPedro Giffuni         unset HAVE_GCC_VISIBILITY_FEATURE
2845cfc83b6cSPedro Giffuni      fi
2846cfc83b6cSPedro Giffuni
2847cfc83b6cSPedro Giffuni      LDFLAGS=$sharedlink_ldflags_save
2848cfc83b6cSPedro Giffuni   fi
2849cfc83b6cSPedro Giffuni
2850cfc83b6cSPedro Giffuni   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2851cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
2852cfc83b6cSPedro Giffuni      cat >visibility.cxx <<_ACEOF
2853cfc83b6cSPedro Giffuni#pragma GCC visibility push(hidden)
2854cfc83b6cSPedro Giffunistruct __attribute__ ((visibility ("default"))) TestStruct {
2855cfc83b6cSPedro Giffuni  static void Init();
2856cfc83b6cSPedro Giffuni};
2857cfc83b6cSPedro Giffuni__attribute__ ((visibility ("default"))) void TestFunc() {
2858cfc83b6cSPedro Giffuni  TestStruct::Init();
2859cfc83b6cSPedro Giffuni}
2860cfc83b6cSPedro Giffuni_ACEOF
2861cfc83b6cSPedro Giffuni      if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
2862cfc83b6cSPedro Giffuni         gccvisbroken=yes
2863cfc83b6cSPedro Giffuni      else
2864cfc83b6cSPedro Giffuni         case "$build_cpu" in
2865cfc83b6cSPedro Giffuni            i?86|x86_64)
2866cfc83b6cSPedro Giffuni               if $EGREP -q '@PLT' visibility.s; then
2867cfc83b6cSPedro Giffuni                  gccvisbroken=no
2868cfc83b6cSPedro Giffuni               else
2869cfc83b6cSPedro Giffuni                  gccvisbroken=yes
2870cfc83b6cSPedro Giffuni               fi
2871cfc83b6cSPedro Giffuni               ;;
2872cfc83b6cSPedro Giffuni            *)
2873cfc83b6cSPedro Giffuni               gccvisbroken=no
2874cfc83b6cSPedro Giffuni               ;;
2875cfc83b6cSPedro Giffuni         esac
2876cfc83b6cSPedro Giffuni      fi
2877cfc83b6cSPedro Giffuni      rm -f visibility.s visibility.cxx
2878cfc83b6cSPedro Giffuni
2879cfc83b6cSPedro Giffuni      AC_MSG_RESULT([$gccvisbroken])
2880cfc83b6cSPedro Giffuni      if test "$gccvisbroken" = "yes"; then
2881cfc83b6cSPedro Giffuni         AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
2882cfc83b6cSPedro Giffuni         echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
2883cfc83b6cSPedro Giffuni         unset HAVE_GCC_VISIBILITY_FEATURE
2884cfc83b6cSPedro Giffuni      fi
2885cfc83b6cSPedro Giffuni   fi
2886cfc83b6cSPedro Giffuni
2887cfc83b6cSPedro Giffuni   AC_LANG_POP([C++])
2888cfc83b6cSPedro Giffunifi
2889cfc83b6cSPedro Giffunifi # endof TODO: update TR1 compliant STLs
2890cfc83b6cSPedro Giffuni
2891cfc83b6cSPedro GiffuniAC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
2892cfc83b6cSPedro Giffuni
2893cfc83b6cSPedro Giffunidnl ===================================================================
2894cfc83b6cSPedro Giffunidnl allocator
2895cfc83b6cSPedro Giffunidnl ===================================================================
2896cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which memory allocator to use])
2897cfc83b6cSPedro Giffuniif test "$with_alloc" = "system"; then
2898cfc83b6cSPedro Giffuni    AC_MSG_RESULT([system])
2899cfc83b6cSPedro Giffuni    ALLOC="SYS_ALLOC";
2900cfc83b6cSPedro Giffuni    AC_CHECK_FUNCS([malloc realloc calloc free])
2901cfc83b6cSPedro Giffunifi
2902cfc83b6cSPedro Giffuniif test "$with_alloc" = "tcmalloc"; then
2903cfc83b6cSPedro Giffuni    AC_MSG_RESULT(tcmalloc)
290428633775SPedro Giffuni    if ! echo $build_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
2905cfc83b6cSPedro Giffuni        AC_MSG_ERROR([tcmalloc only available/usable on ix86])
2906cfc83b6cSPedro Giffuni    fi
2907cfc83b6cSPedro Giffuni    AC_CHECK_LIB(tcmalloc, malloc, [],
2908cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
2909cfc83b6cSPedro Giffuni    ALLOC="TCMALLOC";
2910cfc83b6cSPedro Giffunifi
2911cfc83b6cSPedro Giffuniif test "$with_alloc" = "jemalloc"; then
2912cfc83b6cSPedro Giffuni  if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
2913cfc83b6cSPedro Giffuni    AC_MSG_RESULT(jemalloc)
2914cfc83b6cSPedro Giffuni    save_CFLAGS=$CFLAGS
2915cfc83b6cSPedro Giffuni    CFLAGS="$CFLAGS -pthread"
2916cfc83b6cSPedro Giffuni    AC_CHECK_LIB(jemalloc, malloc, [],
2917cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
2918cfc83b6cSPedro Giffuni    ALLOC="JEMALLOC";
2919cfc83b6cSPedro Giffuni    CFLAGS=$save_CFLAGS
2920cfc83b6cSPedro Giffuni  else
2921cfc83b6cSPedro Giffuni    AC_MSG_RESULT([system])
2922cfc83b6cSPedro Giffuni    ALLOC="SYS_ALLOC";
2923cfc83b6cSPedro Giffuni    AC_CHECK_FUNCS([malloc realloc calloc free])
2924cfc83b6cSPedro Giffuni  fi
2925cfc83b6cSPedro Giffunifi
2926cfc83b6cSPedro Giffuniif test "$with_alloc" = "internal" -o -z "$with_alloc"; then
2927cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
2928cfc83b6cSPedro Giffunifi
2929cfc83b6cSPedro GiffuniAC_SUBST(ALLOC)
2930cfc83b6cSPedro Giffuni
2931cfc83b6cSPedro Giffunidnl ===================================================================
2932cfc83b6cSPedro Giffunidnl Custom build version
2933cfc83b6cSPedro Giffunidnl ===================================================================
2934cfc83b6cSPedro Giffuni
2935cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to add custom build version])
2936cfc83b6cSPedro Giffuniif test "z$with_build_version" != "z"; then
2937cfc83b6cSPedro Giffuni   BUILD_VER_STRING=$with_build_version
2938cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes, $BUILD_VER_STRING])
2939cfc83b6cSPedro Giffunielse
29403ee2ad5bSpfg   BUILD_VER_STRING=
2941cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
2942cfc83b6cSPedro Giffunifi
2943cfc83b6cSPedro GiffuniAC_SUBST(BUILD_VER_STRING)
2944cfc83b6cSPedro Giffuni
2945cfc83b6cSPedro Giffunidnl ===================================================================
2946cfc83b6cSPedro Giffunidnl Java support enable
2947cfc83b6cSPedro Giffunidnl ===================================================================
2948cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build with Java support])
2949cfc83b6cSPedro Giffuniif test "$WITH_JAVA" != "no"; then
2950cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
2951cfc83b6cSPedro Giffuni   SOLAR_JAVA="TRUE"
2952cfc83b6cSPedro Giffunielse
2953cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
2954cfc83b6cSPedro Giffuni   SOLAR_JAVA=""
2955cfc83b6cSPedro Giffuni
2956cfc83b6cSPedro Giffuni   AC_MSG_WARN([building without java will mean some features will not be available])
2957cfc83b6cSPedro Giffuni   echo "building without java will mean some features will not be available" >>warn
2958cfc83b6cSPedro Giffunifi
2959cfc83b6cSPedro GiffuniAC_SUBST(SOLAR_JAVA)
2960cfc83b6cSPedro Giffuni
2961cfc83b6cSPedro Giffuniif test "$_os" = "Linux" && test "$build_cpu" = "powerpc"; then
2962cfc83b6cSPedro Giffuni   # IBMs JDK needs this...
2963cfc83b6cSPedro Giffuni   JITC_PROCESSOR_TYPE=6
2964cfc83b6cSPedro Giffuni   export JITC_PROCESSOR_TYPE
2965cfc83b6cSPedro Giffunifi
2966cfc83b6cSPedro Giffuni
2967cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
2968cfc83b6cSPedro Giffuni   if test -z "$with_jdk_home"; then
2969edd74ba5SDamjan Jovanovic      _jdk_home=`$OOWINTOOL --jdk-home`
2970cfc83b6cSPedro Giffuni       if test -d "$_jdk_home"; then
2971cfc83b6cSPedro Giffuni          with_jdk_home="$_jdk_home"
2972cfc83b6cSPedro Giffuni       fi
2973cfc83b6cSPedro Giffuni   else
2974cfc83b6cSPedro Giffuni      with_jdk_home=`cygpath -u "$with_jdk_home"`
2975cfc83b6cSPedro Giffuni   fi
2976cfc83b6cSPedro Giffunifi
2977cfc83b6cSPedro Giffuni
2978cfc83b6cSPedro Giffunidnl ===================================================================
2979cfc83b6cSPedro Giffunidnl Checks for java
2980cfc83b6cSPedro Giffunidnl ===================================================================
2981cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
2982cfc83b6cSPedro Giffuni   JAVA_HOME=; export JAVA_HOME
2983cfc83b6cSPedro Giffuni   if test -z "$with_jdk_home"; then
2984cfc83b6cSPedro Giffuni      AC_PATH_PROG(JAVAINTERPRETER, $WITH_JAVA)
2985cfc83b6cSPedro Giffuni   else
2986cfc83b6cSPedro Giffuni      _java_path="$with_jdk_home/bin/$WITH_JAVA"
2987cfc83b6cSPedro Giffuni      dnl Check if there is a java interpreter at all.
2988cfc83b6cSPedro Giffuni      if test -x "$_java_path"; then
2989cfc83b6cSPedro Giffuni         JAVAINTERPRETER=$_java_path
2990cfc83b6cSPedro Giffuni      else
2991cfc83b6cSPedro Giffuni         AC_MSG_ERROR([$_java_path not found, please use --with-jdk-home])
2992cfc83b6cSPedro Giffuni      fi
2993cfc83b6cSPedro Giffuni   fi
2994cfc83b6cSPedro Giffuni   if test "$_os" = "WINNT"; then
299528633775SPedro Giffuni      if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
2996cfc83b6cSPedro Giffuni          JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
2997cfc83b6cSPedro Giffuni      fi
2998cfc83b6cSPedro Giffuni      JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
2999cfc83b6cSPedro Giffuni      JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
3000cfc83b6cSPedro Giffuni   elif test "$_os" = "Darwin"; then
3001cfc83b6cSPedro Giffuni         JAVAIFLAGS=""
3002cfc83b6cSPedro Giffuni   fi
3003cfc83b6cSPedro Giffunifi
3004cfc83b6cSPedro Giffuni
3005cfc83b6cSPedro Giffunidnl ===================================================================
3006cfc83b6cSPedro Giffunidnl Checks for JDK.
3007cfc83b6cSPedro Giffunidnl ===================================================================
3008cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
3009cfc83b6cSPedro Giffuni   _gij_longver=0
3010cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([the installed JDK])
3011cfc83b6cSPedro Giffuni   if test -n "$JAVAINTERPRETER"; then
3012cfc83b6cSPedro Giffuni      dnl java -version sends output to stderr!
301328633775SPedro Giffuni      if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
3014cfc83b6cSPedro Giffuni         AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3015cfc83b6cSPedro Giffuni#        dnl Kaffe specific tests
3016cfc83b6cSPedro Giffuni#        KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP "  Version:" | $SED -r "s/.*  Version: ([[0-9\.]]*).*/\1/"`
3017cfc83b6cSPedro Giffuni#        if test -z "$KAFFE_VER"; then
3018cfc83b6cSPedro Giffuni#          AC_MSG_ERROR([looks like Kaffe but version detection failed])
3019cfc83b6cSPedro Giffuni#        fi
3020cfc83b6cSPedro Giffuni#        _kaffe_ver=`echo "$KAFFE_VER" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3021cfc83b6cSPedro Giffuni#        if test "$_kaffe_ver" -lt 10100; then
3022cfc83b6cSPedro Giffuni#           AC_MSG_ERROR([Kaffe is too old ($KAFFE_VER - $_kaffe_ver), you need at least 1.1.0])
3023cfc83b6cSPedro Giffuni#        fi
3024cfc83b6cSPedro Giffuni#        JDK=kaffe
3025cfc83b6cSPedro Giffuni#
3026cfc83b6cSPedro Giffuni#        dnl TODO: define some project exclusion variables
3027cfc83b6cSPedro Giffuni#
3028cfc83b6cSPedro Giffuni#        AC_MSG_RESULT([checked (Kaffe $KAFFE_VER)])
3029cfc83b6cSPedro Giffuni#        AC_MSG_WARN([EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile])
3030cfc83b6cSPedro Giffuni#        echo "EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile" >>warn
3031cfc83b6cSPedro Giffuni#        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
303228633775SPedro Giffuni      elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
3033cfc83b6cSPedro Giffuni        JDK=gcj
3034cfc83b6cSPedro Giffuni        AC_MSG_RESULT([checked (gcj)])
303528633775SPedro Giffuni        _gij_version=`$JAVAINTERPRETER --version | $GREP GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
3036cfc83b6cSPedro Giffuni        _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3037cfc83b6cSPedro Giffuni
303828633775SPedro Giffuni      elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | $GREP -c "BEA"` -gt 0; then
3039cfc83b6cSPedro Giffuni         AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3040cfc83b6cSPedro Giffuni#        JDK=bea
3041cfc83b6cSPedro Giffuni#
3042cfc83b6cSPedro Giffuni#        dnl BEA JDK specific tests
3043cfc83b6cSPedro Giffuni#        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3044cfc83b6cSPedro Giffuni#        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3045cfc83b6cSPedro Giffuni#
3046cfc83b6cSPedro Giffuni#        if test "$_jdk_ver" -lt 10500; then
3047cfc83b6cSPedro Giffuni#          AC_MSG_ERROR([JDK is too old, you need at least BEA JDK 1.5.0])
3048cfc83b6cSPedro Giffuni#        fi
3049cfc83b6cSPedro Giffuni#
3050cfc83b6cSPedro Giffuni#        AC_MSG_RESULT([checked (BEA JDK $_jdk)])
3051cfc83b6cSPedro Giffuni#
3052cfc83b6cSPedro Giffuni#        if test "$with_jdk_home" = ""; then
3053cfc83b6cSPedro Giffuni#             AC_MSG_ERROR([In order to successfully build Apache OpenOffice using the BEA JDK,
3054cfc83b6cSPedro Giffuni#you must use the "--with-jdk-home" configure option explicitly])
3055cfc83b6cSPedro Giffuni#        fi
3056cfc83b6cSPedro Giffuni#
3057cfc83b6cSPedro Giffuni#        AC_MSG_WARN([A bug in certain BEA JREs can prevent you from successfully compiling some modules])
3058cfc83b6cSPedro Giffuni#        echo "A bug in certain BEA JREs can prevent you from successfully compiling some modules" >>warn
3059cfc83b6cSPedro Giffuni#
3060cfc83b6cSPedro Giffuni#        JAVA_HOME=$with_jdk_home
3061cfc83b6cSPedro Giffuni#
306228633775SPedro Giffuni      elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | $GREP -c "IBM"` -gt 0; then
3063cfc83b6cSPedro Giffuni        JDK=ibm
3064cfc83b6cSPedro Giffuni
3065cfc83b6cSPedro Giffuni        dnl IBM JDK specific tests
3066cfc83b6cSPedro Giffuni        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3067cfc83b6cSPedro Giffuni        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3068cfc83b6cSPedro Giffuni
3069cfc83b6cSPedro Giffuni        if test "$_jdk_ver" -lt 10500; then
3070cfc83b6cSPedro Giffuni             AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
3071cfc83b6cSPedro Giffuni        fi
3072cfc83b6cSPedro Giffuni
3073cfc83b6cSPedro Giffuni        AC_MSG_RESULT([checked (IBM JDK $_jdk)])
3074cfc83b6cSPedro Giffuni
3075cfc83b6cSPedro Giffuni        if test "$with_jdk_home" = ""; then
3076cfc83b6cSPedro Giffuni             AC_MSG_ERROR([In order to successfully build Apache OpenOffice using the IBM JDK,
3077cfc83b6cSPedro Giffuniyou must use the "--with-jdk-home" configure option explicitly])
3078cfc83b6cSPedro Giffuni        fi
3079cfc83b6cSPedro Giffuni
3080cfc83b6cSPedro Giffuni        JAVA_HOME=$with_jdk_home
3081cfc83b6cSPedro Giffuni
3082cfc83b6cSPedro Giffuni      else
3083cfc83b6cSPedro Giffuni        JDK=sun
3084cfc83b6cSPedro Giffuni
3085cfc83b6cSPedro Giffuni        dnl SUN JDK specific tests
3086cfc83b6cSPedro Giffuni        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3087cfc83b6cSPedro Giffuni        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3088cfc83b6cSPedro Giffuni
3089cfc83b6cSPedro Giffuni        if test "$_jdk_ver" -lt 10500; then
3090cfc83b6cSPedro Giffuni             AC_MSG_ERROR([JDK is too old, you need at least 1.5])
3091cfc83b6cSPedro Giffuni        fi
3092cfc83b6cSPedro Giffuni        AC_MSG_RESULT([checked (JDK $_jdk)])
3093cfc83b6cSPedro Giffuni        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
3094cfc83b6cSPedro Giffuni        if test "$_os" = "WINNT"; then
3095cfc83b6cSPedro Giffuni          JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
3096cfc83b6cSPedro Giffuni        fi
3097cfc83b6cSPedro Giffuni        if test "$_os" = "OS2"; then
3098cfc83b6cSPedro Giffuni          JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
3099cfc83b6cSPedro Giffuni        fi
3100cfc83b6cSPedro Giffuni      fi
3101cfc83b6cSPedro Giffuni   else
3102cfc83b6cSPedro Giffuni      AC_MSG_ERROR([JAVA not found. You need at least jdk-1.5, or gcj-4])
3103cfc83b6cSPedro Giffuni   fi
3104cfc83b6cSPedro Giffunielse
3105cfc83b6cSPedro Giffuni   dnl Java disabled
3106cfc83b6cSPedro Giffuni   JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
3107cfc83b6cSPedro Giffunifi
3108cfc83b6cSPedro Giffuni
3109cfc83b6cSPedro Giffunidnl ===================================================================
3110cfc83b6cSPedro Giffunidnl Checks for javac
3111cfc83b6cSPedro Giffunidnl ===================================================================
3112cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
3113cfc83b6cSPedro Giffuni    if test "$JDK" = "gcj"; then
3114cfc83b6cSPedro Giffuni        javacompiler=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
3115cfc83b6cSPedro Giffuni    else
3116cfc83b6cSPedro Giffuni        javacompiler="javac"
3117cfc83b6cSPedro Giffuni    fi
3118cfc83b6cSPedro Giffuni    if test "$_os" = "OS2"; then
311928633775SPedro Giffuni      if test x`echo "$javacompiler" | $GREP -i '\.exe$'` = x; then
3120cfc83b6cSPedro Giffuni          javacompiler="${javacompiler}.exe"
3121cfc83b6cSPedro Giffuni      fi
3122cfc83b6cSPedro Giffuni    fi
3123cfc83b6cSPedro Giffuni    if test -z "$with_jdk_home"; then
3124cfc83b6cSPedro Giffuni        AC_PATH_PROG(JAVACOMPILER, $javacompiler)
3125cfc83b6cSPedro Giffuni    else
3126cfc83b6cSPedro Giffuni        _javac_path="$with_jdk_home/bin/$javacompiler"
3127cfc83b6cSPedro Giffuni        dnl Check if there is a java compiler at all.
3128cfc83b6cSPedro Giffuni        if test -x "$_javac_path"; then
3129cfc83b6cSPedro Giffuni            JAVACOMPILER=$_javac_path
3130cfc83b6cSPedro Giffuni        fi
3131cfc83b6cSPedro Giffuni    fi
3132cfc83b6cSPedro Giffuni    if test -z "$JAVACOMPILER"; then
3133cfc83b6cSPedro Giffuni      AC_MSG_ERROR([$javacompiler not found, please use --with-jdk-home])
3134cfc83b6cSPedro Giffuni    fi
3135cfc83b6cSPedro Giffuni    if test "$_os" = "WINNT"; then
313628633775SPedro Giffuni       if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
3137cfc83b6cSPedro Giffuni          JAVACOMPILER="${JAVACOMPILER}.exe"
3138cfc83b6cSPedro Giffuni       fi
3139cfc83b6cSPedro Giffuni       JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
3140cfc83b6cSPedro Giffuni       JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
3141cfc83b6cSPedro Giffuni    fi
3142cfc83b6cSPedro Giffuni    if test "$_os" = "OS2"; then
314328633775SPedro Giffuni       if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
3144cfc83b6cSPedro Giffuni          JAVACOMPILER="${JAVACOMPILER}.exe"
3145cfc83b6cSPedro Giffuni       fi
3146cfc83b6cSPedro Giffuni    fi
3147cfc83b6cSPedro Giffuni
314828633775SPedro Giffuni    if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
3149cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([re-checking JDK])
3150cfc83b6cSPedro Giffuni        JDK=gcj
3151cfc83b6cSPedro Giffuni        AC_MSG_RESULT([checked (ecj)])
3152cfc83b6cSPedro Giffuni        #TODO: what's to do here? some switch to do 1.5 compiling?
3153cfc83b6cSPedro Giffuni        JAVAFLAGS="-source 1.5 -target 1.5"
3154cfc83b6cSPedro Giffuni        _gij_longver="40200"
3155cfc83b6cSPedro Giffuni    fi
3156cfc83b6cSPedro Giffunifi
3157cfc83b6cSPedro Giffuni
3158cfc83b6cSPedro GiffuniJAVACISGCJ=""
3159cfc83b6cSPedro Giffunidnl ===================================================================
3160cfc83b6cSPedro Giffunidnl Checks that javac is gcj
3161cfc83b6cSPedro Giffunidnl ===================================================================
3162cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
316328633775SPedro Giffuni    if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
3164cfc83b6cSPedro Giffuni        JAVACISGCJ="yes"
3165cfc83b6cSPedro Giffuni    fi
3166cfc83b6cSPedro Giffunifi
3167cfc83b6cSPedro GiffuniAC_SUBST(JAVACISGCJ)
3168cfc83b6cSPedro Giffuni
3169cfc83b6cSPedro Giffunidnl ===================================================================
3170cfc83b6cSPedro Giffunidnl Checks for javadoc
3171cfc83b6cSPedro Giffunidnl ===================================================================
3172cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
3173cfc83b6cSPedro Giffuni    if test -z "$with_jdk_home"; then
3174cfc83b6cSPedro Giffuni        AC_PATH_PROG(JAVADOC, javadoc)
3175cfc83b6cSPedro Giffuni    else
3176cfc83b6cSPedro Giffuni        _javadoc_path="$with_jdk_home/bin/javadoc"
3177cfc83b6cSPedro Giffuni        if test "$_os" = "OS2"; then
317828633775SPedro Giffuni          if test x`echo "$_javadoc_path" | $GREP -i '\.exe$'` = x; then
3179cfc83b6cSPedro Giffuni              _javadoc_path="${_javadoc_path}.exe"
3180cfc83b6cSPedro Giffuni          fi
3181cfc83b6cSPedro Giffuni        fi
3182cfc83b6cSPedro Giffuni        dnl Check if there is a javadoc at all.
3183cfc83b6cSPedro Giffuni        if test -x "$_javadoc_path"; then
3184cfc83b6cSPedro Giffuni            JAVADOC=$_javadoc_path
3185cfc83b6cSPedro Giffuni        else
3186cfc83b6cSPedro Giffuni            AC_PATH_PROG(JAVADOC, javadoc)
3187cfc83b6cSPedro Giffuni        fi
3188cfc83b6cSPedro Giffuni    fi
3189cfc83b6cSPedro Giffuni    if test -z "$JAVADOC"; then
3190cfc83b6cSPedro Giffuni      AC_MSG_ERROR([$_javadoc_path not found, please use --with-jdk-home])
3191cfc83b6cSPedro Giffuni    fi
3192cfc83b6cSPedro Giffuni    if test "$_os" = "WINNT"; then
319328633775SPedro Giffuni        if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
3194cfc83b6cSPedro Giffuni            JAVADOC="${JAVADOC}.exe"
3195cfc83b6cSPedro Giffuni        fi
3196cfc83b6cSPedro Giffuni        JAVADOC=`cygpath -d "$JAVADOC"`
3197cfc83b6cSPedro Giffuni        JAVADOC=`cygpath -u "$JAVADOC"`
3198cfc83b6cSPedro Giffuni    fi
3199cfc83b6cSPedro Giffuni    if test "$_os" = "OS2"; then
320028633775SPedro Giffuni        if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
3201cfc83b6cSPedro Giffuni            JAVADOC="${JAVADOC}.exe"
3202cfc83b6cSPedro Giffuni        fi
3203cfc83b6cSPedro Giffuni    fi
3204cfc83b6cSPedro Giffunifi
3205cfc83b6cSPedro Giffuni
3206cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
3207cfc83b6cSPedro Giffuni    dnl first check if we have been asked to autodetect JAVA_HOME with a recent gij
3208cfc83b6cSPedro Giffuni    if test "$JDK" = "gcj" -a -z "$JAVA_HOME"; then
3209cfc83b6cSPedro Giffuni      if test "x$with_jdk_home" = "x" -a "$_gij_longver" -ge "40200"; then
3210cfc83b6cSPedro Giffuni        cat > findhome.java <<_ACEOF
3211cfc83b6cSPedro Giffuni[import java.io.File;
3212cfc83b6cSPedro Giffuni
3213cfc83b6cSPedro Giffuniclass findhome
3214cfc83b6cSPedro Giffuni{
3215cfc83b6cSPedro Giffuni    public static void main(String args[])
3216cfc83b6cSPedro Giffuni    {
3217cfc83b6cSPedro Giffuni        String jrelocation = System.getProperty("java.home");
3218cfc83b6cSPedro Giffuni        File jre = new File(jrelocation);
3219cfc83b6cSPedro Giffuni        System.out.println(jre.getParent());
3220cfc83b6cSPedro Giffuni    }
3221cfc83b6cSPedro Giffuni}]
3222cfc83b6cSPedro Giffuni_ACEOF
3223cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([if javac works])
3224cfc83b6cSPedro Giffuni        javac_cmd="$JAVACOMPILER findhome.java 1>&2"
3225cfc83b6cSPedro Giffuni        AC_TRY_EVAL(javac_cmd)
3226cfc83b6cSPedro Giffuni        if test $? = 0 && test -f ./findhome.class ; then
3227cfc83b6cSPedro Giffuni          AC_MSG_RESULT([javac works])
3228cfc83b6cSPedro Giffuni        else
3229cfc83b6cSPedro Giffuni          echo "configure: javac test failed" >&5
3230cfc83b6cSPedro Giffuni          cat findhome.java >&5
3231cfc83b6cSPedro Giffuni          AC_MSG_ERROR([javac does not work - java projects will not build!])
3232cfc83b6cSPedro Giffuni        fi
3233cfc83b6cSPedro Giffuni
3234cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([if gij knows its java.home])
3235cfc83b6cSPedro Giffuni        JAVA_HOME=`$JAVAINTERPRETER findhome`
3236cfc83b6cSPedro Giffuni        if test $? = 0 && test "$JAVA_HOME" != "" ; then
3237cfc83b6cSPedro Giffuni          AC_MSG_RESULT([$JAVA_HOME])
3238cfc83b6cSPedro Giffuni        else
3239cfc83b6cSPedro Giffuni          echo "configure: java test failed" >&5
3240cfc83b6cSPedro Giffuni          cat findhome.java >&5
3241cfc83b6cSPedro Giffuni          AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
3242cfc83b6cSPedro Giffuni        fi
3243cfc83b6cSPedro Giffuni      else
3244cfc83b6cSPedro Giffuni        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$WITH_JAVA,,p"`
3245cfc83b6cSPedro Giffuni      fi
3246cfc83b6cSPedro Giffuni    fi
3247cfc83b6cSPedro Giffuni
3248cfc83b6cSPedro Giffuni    dnl second sanity check JAVA_HOME if possible
3249cfc83b6cSPedro Giffuni    if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
3250cfc83b6cSPedro Giffuni      # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
3251cfc83b6cSPedro Giffuni      if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
3252cfc83b6cSPedro Giffuni         javac_link_f=`readlink -f "$JAVACOMPILER" 2>/dev/null`
3253cfc83b6cSPedro Giffuni         if test $? == 0 && test "$JAVACOMPILER" != "$javac_link_f"; then
3254cfc83b6cSPedro Giffuni          # try to recover first by looking whether we have a alternatives
3255cfc83b6cSPedro Giffuni          # system as in Debian or newer SuSEs where following /usr/bin/javac
3256cfc83b6cSPedro Giffuni          # over /etc/alternatives/javac leads to the right bindir where we
3257cfc83b6cSPedro Giffuni          # just need to strip a bit away to get a valid JAVA_HOME
3258cfc83b6cSPedro Giffuni          # Solaris 11 is even worse, because target is relative, so use -f
3259cfc83b6cSPedro Giffuni            JAVA_HOME="$javac_link_f"
3260cfc83b6cSPedro Giffuni         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
3261cfc83b6cSPedro Giffuni          # Darwin readlink(1) is so primitive it doesn't even support -f
3262cfc83b6cSPedro Giffuni          # maybe only one level of symlink (e.g. on Mac)
3263cfc83b6cSPedro Giffuni            JAVA_HOME=`readlink $JAVACOMPILER`
3264cfc83b6cSPedro Giffuni         else
3265cfc83b6cSPedro Giffuni          # else warn
3266cfc83b6cSPedro Giffuni          AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
3267cfc83b6cSPedro Giffuni          AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
3268cfc83b6cSPedro Giffuni          echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
3269cfc83b6cSPedro Giffuni          echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
3270cfc83b6cSPedro Giffuni          fi
3271cfc83b6cSPedro Giffuni         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
3272cfc83b6cSPedro Giffuni         if test "$JAVA_HOME" != "/usr"; then
3273cfc83b6cSPedro Giffuni            if test "$_os" = "Darwin"; then
3274cfc83b6cSPedro Giffuni               dnl Leopard returns a non-suitable path with readlink - points to "Current" only
3275cfc83b6cSPedro Giffuni               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
3276cfc83b6cSPedro Giffuni               dnl Tiger already returns a JDK path..
3277cfc83b6cSPedro Giffuni               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
3278cfc83b6cSPedro Giffuni            else
3279cfc83b6cSPedro Giffuni               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
3280cfc83b6cSPedro Giffuni            fi
3281cfc83b6cSPedro Giffuni         fi
3282cfc83b6cSPedro Giffuni      fi
3283cfc83b6cSPedro Giffuni      # now check if $JAVA_HOME is really valid
3284cfc83b6cSPedro Giffuni      if test "$_os" = "Darwin"; then
3285cfc83b6cSPedro Giffuni         if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
3286cfc83b6cSPedro Giffuni            JAVA_HOME_OK="NO"
3287cfc83b6cSPedro Giffuni         fi
3288cfc83b6cSPedro Giffuni      elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
3289cfc83b6cSPedro Giffuni         JAVA_HOME_OK="NO"
3290cfc83b6cSPedro Giffuni      fi
3291cfc83b6cSPedro Giffuni      if test "$JAVA_HOME_OK" = "NO"; then
3292cfc83b6cSPedro Giffuni         AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
3293cfc83b6cSPedro Giffuni         AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
3294cfc83b6cSPedro Giffuni         AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
3295cfc83b6cSPedro Giffuni         echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
3296cfc83b6cSPedro Giffuni         echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
3297cfc83b6cSPedro Giffuni         echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
3298cfc83b6cSPedro Giffuni#         if test "$JDK" = "gcj"; then
3299cfc83b6cSPedro Giffuni#             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
3300cfc83b6cSPedro Giffuni#         fi
3301cfc83b6cSPedro Giffuni      fi
3302cfc83b6cSPedro Giffuni    fi
3303cfc83b6cSPedro Giffunifi
3304cfc83b6cSPedro Giffuni
3305cfc83b6cSPedro GiffuniAWTLIB=
3306cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
3307cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for jawt lib name])
3308cfc83b6cSPedro Giffuni   if test "$JDK" = "gcj"; then
3309cfc83b6cSPedro Giffuni      save_CFLAGS=$CFLAGS
3310cfc83b6cSPedro Giffuni      save_LDFLAGS=$LDFLAGS
3311cfc83b6cSPedro Giffuni      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
3312cfc83b6cSPedro Giffuni      LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
3313cfc83b6cSPedro Giffuni      exec 6>/dev/null # no output
3314cfc83b6cSPedro Giffuni      AC_CHECK_HEADER(jni.h, [],
3315cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
3316cfc83b6cSPedro Giffuni      AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
3317cfc83b6cSPedro Giffuni      exec 6>&1 # output on again
3318cfc83b6cSPedro Giffuni      CFLAGS=$save_CFLAGS
3319cfc83b6cSPedro Giffuni      LDFLAGS=$save_LDFLAGS
3320cfc83b6cSPedro Giffuni   fi
3321cfc83b6cSPedro Giffuni   # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
3322cfc83b6cSPedro Giffuni   # A workaround is to link also against libpmawt.so
3323cfc83b6cSPedro Giffuni   if test "$JDK" = "ibm" ; then
3324cfc83b6cSPedro Giffuni      save_CFLAGS=$CFLAGS
3325cfc83b6cSPedro Giffuni      save_LDFLAGS=$LDFLAGS
3326cfc83b6cSPedro Giffuni      save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
3327cfc83b6cSPedro Giffuni      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
3328cfc83b6cSPedro Giffuni      LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
3329cfc83b6cSPedro Giffuni      LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
3330cfc83b6cSPedro Giffuni      export LD_LIBRARY_PATH
3331cfc83b6cSPedro Giffuni      exec 6>/dev/null # no output
3332cfc83b6cSPedro Giffuni      AC_CHECK_HEADER(jni.h, [],
3333cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR([jni.h could not be found.])], [])
3334cfc83b6cSPedro Giffuni      AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
3335cfc83b6cSPedro Giffuni      if test -z "$AWTLIB"; then
3336cfc83b6cSPedro Giffuni         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
3337cfc83b6cSPedro Giffuni         AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
3338cfc83b6cSPedro Giffuni      fi
3339cfc83b6cSPedro Giffuni      exec 6>&1 # output on again
3340cfc83b6cSPedro Giffuni      CFLAGS=$save_CFLAGS
3341cfc83b6cSPedro Giffuni      LDFLAGS=$save_LDFLAGS
3342cfc83b6cSPedro Giffuni      LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
3343cfc83b6cSPedro Giffuni   fi
3344cfc83b6cSPedro Giffuni   if test -z "$AWTLIB"; then
3345cfc83b6cSPedro Giffuni      AWTLIB=-ljawt
3346cfc83b6cSPedro Giffuni   fi
3347cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$AWTLIB])
3348cfc83b6cSPedro Giffuni   AC_SUBST(AWTLIB)
3349cfc83b6cSPedro Giffunifi
3350cfc83b6cSPedro Giffuni
3351cfc83b6cSPedro Giffunidnl ===================================================================
3352cfc83b6cSPedro Giffunidnl Check for optional gcj for AOT
3353cfc83b6cSPedro Giffunidnl ===================================================================
3354cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
3355cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([whether to enable gcj aot compilation])
3356cfc83b6cSPedro Giffuni  if test -n "$enable_gcjaot" && test "$enable_gcjaot" != "no"; then
3357cfc83b6cSPedro Giffuni     AC_MSG_RESULT([yes])
335828633775SPedro Giffuni     if test `echo $WITH_JAVA | $GREP -c "gij"` -eq 0; then
3359cfc83b6cSPedro Giffuni        gcjaot="gcj"
3360cfc83b6cSPedro Giffuni     else
3361cfc83b6cSPedro Giffuni        gcjaot=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g"`
3362cfc83b6cSPedro Giffuni     fi
3363cfc83b6cSPedro Giffuni     AC_MSG_RESULT([$gcjaot])
3364cfc83b6cSPedro Giffuni     if test -n "$with_jdk_home"; then
3365cfc83b6cSPedro Giffuni        _javac_path="$with_jdk_home/bin/$gcjaot"
3366cfc83b6cSPedro Giffuni        dnl Check if there is a gcj at all.
3367cfc83b6cSPedro Giffuni        if test -x "$_javac_path"; then
3368cfc83b6cSPedro Giffuni           JAVAAOTCOMPILER=$_javac_path
3369cfc83b6cSPedro Giffuni        fi
3370cfc83b6cSPedro Giffuni     fi
3371cfc83b6cSPedro Giffuni     if test -z "$JAVAAOTCOMPILER"; then
3372cfc83b6cSPedro Giffuni        AC_PATH_PROG(JAVAAOTCOMPILER, $gcjaot)
3373cfc83b6cSPedro Giffuni     fi
3374cfc83b6cSPedro Giffuni     if test -z "$JAVAAOTCOMPILER"; then
3375cfc83b6cSPedro Giffuni        AC_MSG_WARN([$gcjaot not found, please use --with-jdk-home])
3376cfc83b6cSPedro Giffuni     fi
3377cfc83b6cSPedro Giffuni  else
3378cfc83b6cSPedro Giffuni     AC_MSG_RESULT([no])
3379cfc83b6cSPedro Giffuni  fi
3380cfc83b6cSPedro Giffunifi
3381cfc83b6cSPedro Giffuni
3382cfc83b6cSPedro GiffuniAC_SUBST(JAVA_HOME)
3383cfc83b6cSPedro GiffuniAC_SUBST(JDK)
3384cfc83b6cSPedro GiffuniAC_SUBST(JAVAFLAGS)
3385cfc83b6cSPedro GiffuniAC_SUBST(JAVAINTERPRETER)
3386cfc83b6cSPedro GiffuniAC_SUBST(JAVAIFLAGS)
3387cfc83b6cSPedro GiffuniAC_SUBST(JAVACOMPILER)
3388cfc83b6cSPedro GiffuniAC_SUBST(JAVAAOTCOMPILER)
3389cfc83b6cSPedro GiffuniAC_SUBST(JAVADOC)
3390cfc83b6cSPedro Giffuni
3391cfc83b6cSPedro Giffunidnl ===================================================================
3392cfc83b6cSPedro Giffunidnl Checks for specific files.
3393cfc83b6cSPedro Giffunidnl ===================================================================
3394cfc83b6cSPedro Giffuni
3395cfc83b6cSPedro Giffunidnl ===================================================================
3396cfc83b6cSPedro Giffunidnl Checks for programs.
3397cfc83b6cSPedro Giffunidnl ===================================================================
3398cfc83b6cSPedro Giffuni
3399cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable EPM for packing])
3400cfc83b6cSPedro Giffuniif test "$enable_epm" = "yes"; then
3401cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
3402cfc83b6cSPedro Giffuni   dnl ===================================================================
3403407bc2eeSMatthias Seidel   dnl Check for epm - not needed for Windows
3404cfc83b6cSPedro Giffuni   dnl ===================================================================
3405cfc83b6cSPedro Giffuni   if test "$_os" != "WINNT"; then
3406cfc83b6cSPedro Giffuni      if test -n "$with_epm"; then
3407cfc83b6cSPedro Giffuni          EPM=$with_epm
3408cfc83b6cSPedro Giffuni      else
3409cfc83b6cSPedro Giffuni         AC_PATH_PROG(EPM, epm, no)
3410cfc83b6cSPedro Giffuni      fi
3411cfc83b6cSPedro Giffuni
3412cfc83b6cSPedro Giffuni      # Override system epm and --with-epm if --with-epm-url is used.
3413cfc83b6cSPedro Giffuni      if test -n "$with_epm_url" ; then
3414cfc83b6cSPedro Giffuni         # At this moment we can not verify the URL or the content that we want to download.
3415cfc83b6cSPedro Giffuni         EPM_URL=$with_epm_url
3416cfc83b6cSPedro Giffuni         AC_MSG_RESULT([epm will be downloaded and compiled in bootstrap])
3417cfc83b6cSPedro Giffuni         EPM=
3418cfc83b6cSPedro Giffuni         echo "EPM will be built."
3419cfc83b6cSPedro Giffuni         BUILD_EPM=YES
3420cfc83b6cSPedro Giffuni         BUILD_TYPE="$BUILD_TYPE EPM"
3421cfc83b6cSPedro Giffuni      else
3422cfc83b6cSPedro Giffuni         if test "$EPM" = "no" ; then
3423cfc83b6cSPedro Giffuni        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.])
3424cfc83b6cSPedro Giffuni     else
3425cfc83b6cSPedro Giffuni        # Gentoo has some epm which is something different...
3426cfc83b6cSPedro Giffuni            AC_MSG_CHECKING([whether the found epm is the right epm])
342728633775SPedro Giffuni            if $EPM | $GREP "ESP Package Manager" >/dev/null 2>/dev/null; then
3428cfc83b6cSPedro Giffuni               AC_MSG_RESULT([yes])
3429cfc83b6cSPedro Giffuni            else
3430cfc83b6cSPedro Giffuni           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.])
3431cfc83b6cSPedro Giffuni            fi
3432cfc83b6cSPedro Giffuni            AC_MSG_CHECKING([epm version])
343328633775SPedro Giffuni            EPM_VERSION=`$EPM | $GREP 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
3434cfc83b6cSPedro Giffuni        if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
3435cfc83b6cSPedro Giffuni                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
3436cfc83b6cSPedro Giffuni               AC_MSG_RESULT([OK, >= 3.7])
3437cfc83b6cSPedro Giffuni               BUILD_EPM=NO
3438cfc83b6cSPedro Giffuni           if test "$_os" = "Darwin"; then
34392e39503fSjim              _osxpkgbuild='no'
3440b48104e3Sjim              AC_MSG_CHECKING([checking if OS X pkgbuild is supported])
3441b48104e3Sjim              if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "4" || \
3442b48104e3Sjim                 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "4" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "3"; then
3443b48104e3Sjim                   AC_MSG_RESULT([OK, >= 4.3])
34442e39503fSjim                   _osxpkgbuild='yes'
3445b48104e3Sjim              else
3446cfc83b6cSPedro Giffuni                  AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
344728633775SPedro Giffuni                  _pm=`strings $EPM | $GREP PackageMaker | cut -d" " -f1`
3448cfc83b6cSPedro Giffuni                  if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
3449cfc83b6cSPedro Giffuni                     AC_MSG_ERROR([$_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker)])
3450cfc83b6cSPedro Giffuni                  elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
3451cfc83b6cSPedro Giffuni                     AC_MSG_RESULT([$_pm, ok])
3452cfc83b6cSPedro Giffuni                  else # we never should get here, but go safe
3453cfc83b6cSPedro Giffuni                     AC_MSG_ERROR([$_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker)])
3454cfc83b6cSPedro Giffuni                  fi
3455cfc83b6cSPedro Giffuni              fi
3456b48104e3Sjim           fi
3457cfc83b6cSPedro Giffuni        else
3458cfc83b6cSPedro Giffuni               AC_MSG_ERROR([too old. epm >= 3.7 is required.])
3459cfc83b6cSPedro Giffuni        fi
3460cfc83b6cSPedro Giffuni         fi
3461cfc83b6cSPedro Giffuni      fi
3462cfc83b6cSPedro Giffuni   fi
3463cfc83b6cSPedro Giffuni
3464cfc83b6cSPedro Giffuni   # test which package format to use
3465cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([which package format to use])
3466cfc83b6cSPedro Giffuni
3467cfc83b6cSPedro Giffuni   # defaults
3468cfc83b6cSPedro Giffuni   case "$_os" in
3469cfc83b6cSPedro Giffuni    OS2)
3470cfc83b6cSPedro Giffuni        PKGFORMAT=native
3471cfc83b6cSPedro Giffuni        ;;
3472cfc83b6cSPedro Giffuni    Darwin)
3473cfc83b6cSPedro Giffuni        PKGFORMAT=dmg
3474cfc83b6cSPedro Giffuni        ;;
3475cfc83b6cSPedro Giffuni    SunOS)
3476cfc83b6cSPedro Giffuni        PKGFORMAT=pkg
3477cfc83b6cSPedro Giffuni        ;;
3478cfc83b6cSPedro Giffuni    Linux)
3479cfc83b6cSPedro Giffuni      # if building on Debian, default should be deb...
3480cfc83b6cSPedro Giffuni      if test -e /etc/debian_version; then
3481cfc83b6cSPedro Giffuni         PKGFORMAT=deb
3482cfc83b6cSPedro Giffuni      else
3483cfc83b6cSPedro Giffuni         PKGFORMAT=rpm
3484cfc83b6cSPedro Giffuni      fi
3485cfc83b6cSPedro Giffuni        ;;
3486cfc83b6cSPedro Giffuni    AIX)
3487cfc83b6cSPedro Giffuni        PKGFORMAT=aix
3488cfc83b6cSPedro Giffuni        ;;
3489cfc83b6cSPedro Giffuni    *BSD)
3490cfc83b6cSPedro Giffuni        PKGFORMAT=bsd
3491cfc83b6cSPedro Giffuni        ;;
3492cfc83b6cSPedro Giffuni    OSF1)
3493cfc83b6cSPedro Giffuni        PKGFORMAT=setld
3494cfc83b6cSPedro Giffuni        ;;
3495cfc83b6cSPedro Giffuni    WINNT)
3496cfc83b6cSPedro Giffuni        PKGFORMAT=msi
3497cfc83b6cSPedro Giffuni        ;;
34989d1669aeSMatthias Seidel    # we never should get here since we check the architecture/os at the beginning,
3499cfc83b6cSPedro Giffuni    # but go sure...
3500cfc83b6cSPedro Giffuni    *)
3501cfc83b6cSPedro Giffuni        AC_MSG_ERROR([unknown system])
3502cfc83b6cSPedro Giffuni   esac
3503cfc83b6cSPedro Giffuni   if test -n "$with_package_format"; then
3504cfc83b6cSPedro Giffuni    for i in $with_package_format; do
3505cfc83b6cSPedro Giffuni        case "$i" in
3506cfc83b6cSPedro Giffuni            aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
3507cfc83b6cSPedro Giffuni            ;;
3508cfc83b6cSPedro Giffuni        *)
3509cfc83b6cSPedro Giffuni            AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
3510cfc83b6cSPedro Giffuniaix - AIX software distribution
3511cfc83b6cSPedro Giffunibsd - FreeBSD, NetBSD, or OpenBSD software distribution
3512cfc83b6cSPedro Giffunidepot or swinstall - HP-UX software distribution
3513cfc83b6cSPedro Giffunideb - Debian software distribution
3514cfc83b6cSPedro Giffuniinst or tardist - IRIX software distribution
3515cfc83b6cSPedro Giffuniosx - MacOS X software distribution
3516cfc83b6cSPedro Giffunipkg - Solaris software distribution
3517cfc83b6cSPedro Giffunirpm - RedHat software distribution
3518cfc83b6cSPedro Giffunisetld - Tru64 (setld) software distribution
3519cfc83b6cSPedro Giffuninative - "Native" software distribution for the platform
3520cfc83b6cSPedro Giffuniportable - Portable software distribution
3521e986c8d8SMatthias SeidelAOO additionally supports:
3522cfc83b6cSPedro Giffuniarchive - .tar.gz or .zip
3523cfc83b6cSPedro Giffunidmg - Mac OS X .dmg
3524cfc83b6cSPedro Giffuniinstalled - installation tree
3525cfc83b6cSPedro Giffunimsi - Windows .msi
3526cfc83b6cSPedro Giffuni            ])
3527cfc83b6cSPedro Giffuni            ;;
3528cfc83b6cSPedro Giffuni        esac
3529cfc83b6cSPedro Giffuni    done
3530cfc83b6cSPedro Giffuni    PKGFORMAT="$with_package_format"
3531cfc83b6cSPedro Giffuni   fi
3532cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$PKGFORMAT])
3533cfc83b6cSPedro Giffuni   if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
3534cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([for rpm])
3535cfc83b6cSPedro Giffuni      for a in "$RPM" rpmbuild rpm; do
3536cfc83b6cSPedro Giffuni         $a --usage >/dev/null 2> /dev/null
3537cfc83b6cSPedro Giffuni         if test $? -eq 0; then
3538cfc83b6cSPedro Giffuni            RPM=$a
3539cfc83b6cSPedro Giffuni            break
3540cfc83b6cSPedro Giffuni         else
3541cfc83b6cSPedro Giffuni            $a --version >/dev/null 2> /dev/null
3542cfc83b6cSPedro Giffuni            if test $? -eq 0; then
3543cfc83b6cSPedro Giffuni               RPM=$a
3544cfc83b6cSPedro Giffuni               break
3545cfc83b6cSPedro Giffuni            fi
3546cfc83b6cSPedro Giffuni         fi
3547cfc83b6cSPedro Giffuni       done
3548cfc83b6cSPedro Giffuni       if test -z "$RPM" ; then
3549cfc83b6cSPedro Giffuni          AC_MSG_ERROR([not found])
3550cfc83b6cSPedro Giffuni       elif "$RPM" --usage 2>&1 | $EGREP -- -bb >/dev/null; then
3551cfc83b6cSPedro Giffuni          RPM_PATH=`which $RPM`
3552cfc83b6cSPedro Giffuni          AC_MSG_RESULT([$RPM_PATH])
3553cfc83b6cSPedro Giffuni       else
3554cfc83b6cSPedro Giffuni          AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
3555cfc83b6cSPedro Giffuni       fi
3556cfc83b6cSPedro Giffuni   fi
3557cfc83b6cSPedro Giffuni   if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
3558cfc83b6cSPedro Giffuni      AC_PATH_PROG(DPKG, dpkg, no)
3559cfc83b6cSPedro Giffuni      if test "$DPKG" = "no"; then
3560cfc83b6cSPedro Giffuni         AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
3561cfc83b6cSPedro Giffuni      fi
3562cfc83b6cSPedro Giffuni   fi
3563cfc83b6cSPedro Giffuni   if echo "$PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
3564cfc83b6cSPedro Giffuni      if test "$_os" = "Darwin"; then
35652e39503fSjim         if test "$_osxpkgbuild" = "no"; then
3566cfc83b6cSPedro Giffuni            AC_MSG_CHECKING([for PackageMaker availability])
3567cfc83b6cSPedro Giffuni            if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
3568cfc83b6cSPedro Giffuni               AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
3569cfc83b6cSPedro Giffuni            else
3570cfc83b6cSPedro Giffuni               AC_MSG_RESULT([ok])
3571cfc83b6cSPedro Giffuni            fi
35722e39503fSjim         fi
3573cfc83b6cSPedro Giffuni      else
3574cfc83b6cSPedro Giffuni         AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
3575cfc83b6cSPedro Giffuni       fi
3576cfc83b6cSPedro Giffuni   fi
3577cfc83b6cSPedro Giffuni   if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
3578cfc83b6cSPedro Giffuni      echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
3579cfc83b6cSPedro Giffuni        if test "$EPM" != "no" && test "$EPM" != "internal"; then
3580cfc83b6cSPedro Giffuni           if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
3581e986c8d8SMatthias Seidel               AC_MSG_CHECKING([whether epm is patched for AOOs needs])
358228633775SPedro Giffuni               if $GREP "Patched for Apache OpenOffice" $EPM >/dev/null 2>/dev/null; then
3583cfc83b6cSPedro Giffuni                  AC_MSG_RESULT([yes])
3584cfc83b6cSPedro Giffuni               else
3585cfc83b6cSPedro Giffuni                  AC_MSG_RESULT([no])
358628633775SPedro Giffuni                  if echo "$PKGFORMAT" | $GREP -q rpm; then
3587cfc83b6cSPedro Giffuni                      _pt="rpm"
3588cfc83b6cSPedro Giffuni                      AC_MSG_WARN([the rpms will need to be installed with --nodeps])
3589cfc83b6cSPedro Giffuni                      echo "the rpms will need to be installed with --nodeps" >> warn
3590cfc83b6cSPedro Giffuni                  else
3591cfc83b6cSPedro Giffuni                      _pt="pkg"
3592cfc83b6cSPedro Giffuni                  fi
3593cfc83b6cSPedro Giffuni                  AC_MSG_WARN([the ${_pt}s will not be relocateable])
3594cfc83b6cSPedro Giffuni                  echo "the ${_pt}s will not be relocateable" >> warn
3595cfc83b6cSPedro Giffuni                  AC_MSG_WARN([if you want to make sure installation without --nodeps and
3596cfc83b6cSPedro Giffuni                  relocation will work, you need to patch your epm with the
3597cfc83b6cSPedro Giffuni                  patch in epm/epm-3.7.patch or build with
3598cfc83b6cSPedro Giffuni                  --with-epm=internal which will build a suitable epm])
3599cfc83b6cSPedro Giffuni               fi
3600cfc83b6cSPedro Giffuni           fi
3601cfc83b6cSPedro Giffuni        fi
3602cfc83b6cSPedro Giffuni   fi
3603cfc83b6cSPedro Giffuni   if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
3604cfc83b6cSPedro Giffuni      AC_PATH_PROG(PKGMK, pkgmk, no)
3605cfc83b6cSPedro Giffuni      if test "$PKGMK" = "no"; then
3606cfc83b6cSPedro Giffuni         AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
3607cfc83b6cSPedro Giffuni      fi
3608cfc83b6cSPedro Giffuni   fi
3609cfc83b6cSPedro Giffuni   AC_SUBST(RPM)
3610cfc83b6cSPedro Giffuni   AC_SUBST(DPKG)
3611cfc83b6cSPedro Giffuni   AC_SUBST(PKGMK)
3612cfc83b6cSPedro Giffunielse
3613cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
3614cfc83b6cSPedro Giffuni   BUILD_EPM=NO
3615cfc83b6cSPedro Giffuni   EPM=NO
3616cfc83b6cSPedro Giffuni   PKGFORMAT=native
3617cfc83b6cSPedro Giffunifi
3618cfc83b6cSPedro GiffuniAC_SUBST(BUILD_EPM)
3619cfc83b6cSPedro GiffuniAC_SUBST(EPM_URL)
3620cfc83b6cSPedro GiffuniAC_SUBST(EPM)
3621cfc83b6cSPedro GiffuniAC_SUBST(PKGFORMAT)
3622cfc83b6cSPedro Giffuni
3623cfc83b6cSPedro Giffunidnl ===================================================================
3624cfc83b6cSPedro Giffunidnl Check for gperf
3625cfc83b6cSPedro Giffunidnl ===================================================================
3626cfc83b6cSPedro GiffuniAC_PATH_PROG(GPERF, gperf)
3627cfc83b6cSPedro Giffuniif test -z "$with_gperf"; then
3628cfc83b6cSPedro Giffuni    AC_PATH_PROG(GPERF, gperf)
3629cfc83b6cSPedro Giffuni    if test -z "$GPERF"; then
3630cfc83b6cSPedro Giffuni       AC_MSG_ERROR([gperf not found but needed. Install it and/or specify --with-gperf=/path/to/it.])
3631cfc83b6cSPedro Giffuni    fi
3632cfc83b6cSPedro Giffunielse
3633cfc83b6cSPedro Giffuni  if test -x "$with_gperf"; then
3634cfc83b6cSPedro Giffuni    GPERF=$with_gperf
3635cfc83b6cSPedro Giffuni  else
3636cfc83b6cSPedro Giffuni    AC_MSG_ERROR([--with-gperf did not point to an executable])
3637cfc83b6cSPedro Giffuni  fi
3638cfc83b6cSPedro Giffunifi
3639cfc83b6cSPedro GiffuniAC_MSG_CHECKING([gperf version])
3640cfc83b6cSPedro Giffuniif test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
3641cfc83b6cSPedro Giffuni    AC_MSG_RESULT([OK])
3642cfc83b6cSPedro Giffuni   GPERF=$GPERF
3643cfc83b6cSPedro Giffunielse
3644cfc83b6cSPedro Giffuni    AC_MSG_ERROR([too old, you need at least 3.0.0])
3645cfc83b6cSPedro Giffunifi
3646cfc83b6cSPedro GiffuniAC_SUBST(GPERF)
3647cfc83b6cSPedro Giffuni
3648cfc83b6cSPedro Giffunidnl ===================================================================
36498550753cSPedro Giffunidnl Check for building stax
36508550753cSPedro Giffunidnl ===================================================================
36518550753cSPedro GiffuniAC_MSG_CHECKING([whether to build the stax])
36528550753cSPedro Giffuniif test -f "./stax/download/stax-1.2.0.jar"; then
36538550753cSPedro Giffuni   BUILD_STAX=NO
36548550753cSPedro Giffuni   AC_MSG_RESULT([no, will use the prebuilt stax/download/stax-1.2.0.jar])
36558550753cSPedro Giffunielse
36568550753cSPedro Giffuni   BUILD_STAX=YES
36578550753cSPedro Giffuni   AC_MSG_RESULT([yes])
36588550753cSPedro Giffunifi
36598550753cSPedro GiffuniAC_SUBST(BUILD_STAX)
36608550753cSPedro Giffuni
36618550753cSPedro Giffunidnl ===================================================================
3662cfc83b6cSPedro Giffunidnl Check for building ODK
3663cfc83b6cSPedro Giffunidnl ===================================================================
3664cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the ODK])
3665cfc83b6cSPedro Giffuniif test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
3666cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
3667cfc83b6cSPedro Giffuni   if test "$WITH_JAVA" != "no"; then
3668cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for external/unowinreg/unowinreg.dll])
3669cfc83b6cSPedro Giffuni   if ! test -f "./external/unowinreg/unowinreg.dll"; then
3670cfc83b6cSPedro Giffuni      HAVE_UNOWINREG_DLL=no
3671cfc83b6cSPedro Giffuni   else
3672cfc83b6cSPedro Giffuni      HAVE_UNOWINREG_DLL=yes
3673cfc83b6cSPedro Giffuni   fi
3674cfc83b6cSPedro Giffuni   if test "$HAVE_UNOWINREG_DLL" = "yes"; then
3675cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found])
3676cfc83b6cSPedro Giffuni      BUILD_UNOWINREG=NO
3677cfc83b6cSPedro Giffuni   else
3678cfc83b6cSPedro Giffuni      if test "$_os" = "WINNT"; then
3679cfc83b6cSPedro Giffuni         AC_MSG_RESULT([not found, will be built])
3680cfc83b6cSPedro Giffuni      else
3681cfc83b6cSPedro Giffuni         AC_MSG_WARN([not found, will be cross-built using mingw32])
3682cfc83b6cSPedro Giffuni      fi
3683cfc83b6cSPedro Giffuni      BUILD_UNOWINREG=YES
3684cfc83b6cSPedro Giffuni   fi
3685cfc83b6cSPedro Giffuni   if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then
3686cfc83b6cSPedro Giffuni      if test -z "$WITH_MINGWIN" || test "$WITH_MINGWIN" = "0"; then
3687cfc83b6cSPedro Giffuni         AC_MSG_ERROR([for rebuilding unowinreg.dll you need the mingw32 C++ compiler.
3688cfc83b6cSPedro Giffuni         Specify mingw32 g++ executable name with --with-mingwin.
3689cfc83b6cSPedro Giffuni         Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and
3690cfc83b6cSPedro Giffuni         put it into external/unowinreg using your browser or a command equivalent to:
3691cfc83b6cSPedro Giffuni         wget -O external/unowinreg/unowinreg.dll http://www.openoffice.org/tools/unowinreg_prebuild/680/unowinreg.dll])
3692cfc83b6cSPedro Giffuni      fi
3693cfc83b6cSPedro Giffuni      if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
3694cfc83b6cSPedro Giffuni         if ! test -x "$WITH_MINGWIN"; then MINGWCXX=false; else MINGWCXX=`basename $WITH_MINGWIN`; fi
3695cfc83b6cSPedro Giffuni      else
3696cfc83b6cSPedro Giffuni         AC_CHECK_TOOL(MINGWCXX, $WITH_MINGWIN, false)
3697cfc83b6cSPedro Giffuni      fi
3698cfc83b6cSPedro Giffuni      if test "$MINGWCXX" = "false"; then
3699cfc83b6cSPedro Giffuni         AC_MSG_ERROR(specified MinGW32 C++ cross-compiler not found. Install it or correct name.)
3700cfc83b6cSPedro Giffuni      fi
3701cfc83b6cSPedro Giffuni      AC_MSG_CHECKING(whether we are using the MinGW32 cross C++ compiler)
370228633775SPedro Giffuni      if ! echo "`$MINGWCXX -dumpmachine`" | $GREP -q mingw32; then
3703cfc83b6cSPedro Giffuni         AC_MSG_ERROR(no)
3704cfc83b6cSPedro Giffuni      else
3705cfc83b6cSPedro Giffuni         AC_MSG_RESULT(yes)
3706cfc83b6cSPedro Giffuni      fi
3707cfc83b6cSPedro Giffuni      if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
3708b63233d8Sdamjan         if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`"; then MINGWSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/)); fi
3709cfc83b6cSPedro Giffuni      else
3710cfc83b6cSPedro Giffuni         AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`, false)
3711cfc83b6cSPedro Giffuni      fi
3712cfc83b6cSPedro Giffuni      if test "$MINGWSTRIP" = "false"; then
3713cfc83b6cSPedro Giffuni         AC_MSG_ERROR(MinGW32 binutils needed. Install them.)
3714cfc83b6cSPedro Giffuni      fi
3715cfc83b6cSPedro Giffuni      AC_LANG_PUSH([C++])
3716cfc83b6cSPedro Giffuni      save_CXX=$CXX
3717cfc83b6cSPedro Giffuni      save_CXXCPP=$CXXCPP
3718cfc83b6cSPedro Giffuni      CXX=$MINGWCXX
3719cfc83b6cSPedro Giffuni      CXXCPP="$MINGWCXX -E"
3720cfc83b6cSPedro Giffuni      save_CXXFLAGS=$CXXFLAGS
3721cfc83b6cSPedro Giffuni      save_CPPFLAGS=$CPPFLAGS
3722cfc83b6cSPedro Giffuni      CXXFLAGS="$CXXFLAGS -I$JAVA_HOME/include"
3723cfc83b6cSPedro Giffuni      CPPFLAGS="$CPPFLAGS -I$JAVA_HOME/include"
3724cfc83b6cSPedro Giffuni      # LIBS contains -lcrypt etc due to the AC_CHECK_LIBS which obviously
3725cfc83b6cSPedro Giffuni      # do not make sense here (and 'd make the check fail)
3726cfc83b6cSPedro Giffuni      save_LIBS=$LIBS
3727cfc83b6cSPedro Giffuni      LIBS=""
3728cfc83b6cSPedro Giffuni      AC_HAVE_LIBRARY(kernel32)
3729cfc83b6cSPedro Giffuni      AC_HAVE_LIBRARY(advapi32)
3730cfc83b6cSPedro Giffuni      AC_CHECK_HEADER(windows.h, [], [AC_MSG_ERROR([windows.h missing])])
3731cfc83b6cSPedro Giffuni      CXXFLAGS=$save_CXXFLAGS
3732cfc83b6cSPedro Giffuni      CPPFLAGS=$save_CPPFLAGS
3733cfc83b6cSPedro Giffuni      CXX=$save_CXX
3734cfc83b6cSPedro Giffuni      CXXCPP=$save_CXXCPP
3735cfc83b6cSPedro Giffuni      LIBS=$save_LIBS
3736cfc83b6cSPedro Giffuni      AC_LANG_POP([C++])
3737cfc83b6cSPedro Giffuni      fi
3738cfc83b6cSPedro Giffuni   fi
3739cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE ODK"
3740cfc83b6cSPedro Giffunielse
3741cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
3742cfc83b6cSPedro Giffuni   BUILD_UNOWINREG=NO
3743cfc83b6cSPedro Giffunifi
3744cfc83b6cSPedro GiffuniAC_SUBST(BUILD_UNOWINREG)
3745cfc83b6cSPedro GiffuniAC_SUBST(MINGWCXX)
3746cfc83b6cSPedro GiffuniAC_SUBST(MINGWSTRIP)
3747cfc83b6cSPedro Giffuni
3748cfc83b6cSPedro Giffunidnl ===================================================================
3749cfc83b6cSPedro Giffunidnl Check for system stdlibs
3750cfc83b6cSPedro Giffunidnl ===================================================================
3751cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
3752cfc83b6cSPedro Giffuniif test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \
3753cfc83b6cSPedro Giffuni   test "$with_system_stdlibs" != "no"; then
3754cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
3755cfc83b6cSPedro Giffuni   SYSTEM_STDLIBS=YES
3756cfc83b6cSPedro Giffunielse
3757cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
3758cfc83b6cSPedro Giffuni   SYSTEM_STDLIBS=NO
3759cfc83b6cSPedro Giffunifi
3760cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_STDLIBS)
3761cfc83b6cSPedro Giffuni
3762cfc83b6cSPedro Giffunidnl ===================================================================
3763cfc83b6cSPedro Giffunidnl Check for system zlib
3764cfc83b6cSPedro Giffunidnl ===================================================================
3765cfc83b6cSPedro Giffuniif test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then
3766cfc83b6cSPedro Giffuni   with_system_zlib=yes
3767cfc83b6cSPedro Giffunifi
3768cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which zlib to use])
3769cfc83b6cSPedro Giffuniif test -n "$with_system_zlib" -o -n "$with_system_libs" && \
3770cfc83b6cSPedro Giffuni    test "$with_system_zlib" != "no"; then
3771cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
3772cfc83b6cSPedro Giffuni    SYSTEM_ZLIB=YES
3773cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(zlib.h, [],
3774cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
3775cfc83b6cSPedro Giffuni    AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
3776cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(zlib not found or functional)], [])
3777cfc83b6cSPedro Giffunielse
3778cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
3779cfc83b6cSPedro Giffuni    SYSTEM_ZLIB=NO
3780cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE ZLIB"
3781cfc83b6cSPedro Giffunifi
3782cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_ZLIB)
3783cfc83b6cSPedro Giffuni
3784cfc83b6cSPedro Giffunidnl ===================================================================
3785cfc83b6cSPedro Giffunidnl Check for system jpeg
3786cfc83b6cSPedro Giffunidnl ===================================================================
3787cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which jpeg to use])
3788cfc83b6cSPedro Giffuniif test -n "$with_system_jpeg" -o -n "$with_system_libs" && \
3789cfc83b6cSPedro Giffuni    test "$with_system_jpeg" != "no"; then
3790cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
3791cfc83b6cSPedro Giffuni    SYSTEM_JPEG=YES
3792cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(jpeglib.h, [],
3793cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
3794cfc83b6cSPedro Giffuni    AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
3795cfc83b6cSPedro Giffuni    [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
3796cfc83b6cSPedro Giffunielse
3797cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
3798cfc83b6cSPedro Giffuni    SYSTEM_JPEG=NO
3799cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE JPEG"
3800cfc83b6cSPedro Giffunifi
3801cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_JPEG)
3802cfc83b6cSPedro Giffuni
3803cfc83b6cSPedro Giffunidnl ===================================================================
3804cfc83b6cSPedro Giffunidnl Check for system expat
3805cfc83b6cSPedro Giffunidnl ===================================================================
3806cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which expat to use])
3807cfc83b6cSPedro Giffuniif test -n "$with_system_expat" -o -n "$with_system_libs" && \
3808cfc83b6cSPedro Giffuni    test "$with_system_expat" != "no"; then
3809cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
3810cfc83b6cSPedro Giffuni    SYSTEM_EXPAT=YES
3811cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(expat.h, [],
3812cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(expat.h not found. install expat)], [])
3813cfc83b6cSPedro Giffuni    AC_CHECK_LIB(expat, XML_ParserCreate, [],
3814cfc83b6cSPedro Giffuni    [AC_MSG_RESULT(expat library not found or functional.)], [])
3815cfc83b6cSPedro Giffunielse
3816cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
3817cfc83b6cSPedro Giffuni    SYSTEM_EXPAT=NO
3818cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE EXPAT"
3819cfc83b6cSPedro Giffunifi
3820cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_EXPAT)
3821cfc83b6cSPedro Giffuni
3822cfc83b6cSPedro Giffunidnl ===================================================================
3823cfc83b6cSPedro Giffunidnl Check whether freetype is available
3824cfc83b6cSPedro Giffunidnl ===================================================================
3825cfc83b6cSPedro Giffuniif test  "$test_freetype" = "yes"; then
3826cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether freetype is available])
3827cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
3828cfc83b6cSPedro Giffunifi
3829cfc83b6cSPedro GiffuniAC_SUBST(FREETYPE_CFLAGS)
3830cfc83b6cSPedro GiffuniAC_SUBST(FREETYPE_LIBS)
3831cfc83b6cSPedro Giffuni
3832cfc83b6cSPedro Giffunidnl ===================================================================
3833cfc83b6cSPedro Giffunidnl Check whether freetype2 supports emboldening
3834cfc83b6cSPedro Giffunidnl ===================================================================
3835cfc83b6cSPedro Giffuniif test  "$test_freetype" = "yes"; then
3836cfc83b6cSPedro Giffuni    save_CPPFLAGS="$CPPFLAGS"
3837cfc83b6cSPedro Giffuni    save_LDFLAGS="$LDFLAGS"
3838cfc83b6cSPedro Giffuni    save_LIBS="$LIBS"
3839cfc83b6cSPedro Giffuni    CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
3840cfc83b6cSPedro Giffuni    LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
3841cfc83b6cSPedro Giffuni    AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
3842cfc83b6cSPedro Giffuni                 [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
3843cfc83b6cSPedro Giffuni    LDFLAGS="$save_LDFLAGS"
3844cfc83b6cSPedro Giffuni    CPPFLAGS="$save_CPPFLAGS"
3845cfc83b6cSPedro Giffuni    LIBS="$save_LIBS"
3846cfc83b6cSPedro Giffunifi
3847cfc83b6cSPedro GiffuniAC_SUBST(USE_FT_EMBOLDEN)
3848cfc83b6cSPedro Giffuni
3849cfc83b6cSPedro Giffuniif test -n "$with_system_libxslt" -o -n "$with_system_libs" && \
3850cfc83b6cSPedro Giffuni   test "$with_system_libxslt" != "no"; then
3851cfc83b6cSPedro Giffuni    if test -z "$with_system_libxml" -a -z "$with_system_libs" || \
3852cfc83b6cSPedro Giffuni      test "$with_system_libxml" = "no"; then
3853cfc83b6cSPedro Giffuni      # somehow AC_MSG_WARN won't work...
3854cfc83b6cSPedro Giffuni       echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml"
3855cfc83b6cSPedro Giffuni       echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml" >> warn
3856cfc83b6cSPedro Giffuni       with_system_libxml=yes
3857cfc83b6cSPedro Giffuni    fi
3858cfc83b6cSPedro Giffunifi
3859cfc83b6cSPedro Giffuniif test -n "$with_system_libxml" -o -n "$with_system_libs" && \
3860cfc83b6cSPedro Giffuni   test "$with_system_libxml" != "no"; then
3861cfc83b6cSPedro Giffuni    if test -z "$with_system_libxslt" -a -z "$with_system_libs" || \
3862cfc83b6cSPedro Giffuni      test "$with_system_libxslt" = "no"; then
3863cfc83b6cSPedro Giffuni      # somehow AC_MSG_WARN won't work...
3864cfc83b6cSPedro Giffuni       echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt"
3865cfc83b6cSPedro Giffuni       echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt" >> warn
3866cfc83b6cSPedro Giffuni       with_system_libxslt=yes
3867cfc83b6cSPedro Giffuni    fi
3868cfc83b6cSPedro Giffunifi
3869cfc83b6cSPedro Giffuni
3870cfc83b6cSPedro Giffunidnl ===================================================================
3871cfc83b6cSPedro Giffunidnl Check for system libxslt
3872cfc83b6cSPedro Giffunidnl ===================================================================
3873cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libxslt to use])
3874cfc83b6cSPedro Giffuniif test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \
3875cfc83b6cSPedro Giffuni       "$_os" = "Darwin" && \
3876cfc83b6cSPedro Giffuni   test "$with_system_libxslt" != "no"; then
3877cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
3878cfc83b6cSPedro Giffuni   SYSTEM_LIBXSLT=YES
3879cfc83b6cSPedro Giffuni
3880cfc83b6cSPedro Giffuni    if test "$_os" != "Darwin"; then
3881cfc83b6cSPedro Giffuni        PKG_CHECK_MODULES(LIBXSLT, libxslt)
3882cfc83b6cSPedro Giffuni    else
3883cfc83b6cSPedro Giffuni        LIBXSLT_CFLAGS=`xslt-config --cflags`
3884cfc83b6cSPedro Giffuni        LIBXSLT_LIBS=`xslt-config --libs`
3885cfc83b6cSPedro Giffuni    fi
3886cfc83b6cSPedro Giffuni
3887cfc83b6cSPedro Giffuni   dnl Check for xsltproc
3888cfc83b6cSPedro Giffuni   AC_PATH_PROG(XSLTPROC, xsltproc, no)
3889cfc83b6cSPedro Giffuni   if test "$XSLTPROC" = "no"; then
3890cfc83b6cSPedro Giffuni      AC_MSG_ERROR([xsltproc is required])
3891cfc83b6cSPedro Giffuni   fi
3892cfc83b6cSPedro Giffunielse
3893cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
3894cfc83b6cSPedro Giffuni   SYSTEM_LIBXSLT=NO
3895cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE LIBXSLT"
3896cfc83b6cSPedro Giffunifi
3897cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBXSLT)
3898cfc83b6cSPedro GiffuniAC_SUBST(LIBXSLT_CFLAGS)
3899cfc83b6cSPedro GiffuniAC_SUBST(LIBXSLT_LIBS)
3900cfc83b6cSPedro Giffuni
3901cfc83b6cSPedro Giffuni
3902cfc83b6cSPedro Giffunidnl ===================================================================
3903cfc83b6cSPedro Giffunidnl Check for system libxml
3904cfc83b6cSPedro Giffunidnl ===================================================================
3905cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libxml to use])
3906cfc83b6cSPedro Giffuniif test -n "$with_system_libxml" -o -n "$with_system_libs" -o \
3907cfc83b6cSPedro Giffuni            "$_os" = "Darwin" && \
3908cfc83b6cSPedro Giffuni    test "$with_system_libxml" != "no"; then
3909cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
3910cfc83b6cSPedro Giffuni    SYSTEM_LIBXML=YES
3911cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
3912cfc83b6cSPedro Giffuni
3913cfc83b6cSPedro Giffuni    if test "$_os" != "Darwin"; then
3914cfc83b6cSPedro Giffuni        PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
3915cfc83b6cSPedro Giffuni    else
3916cfc83b6cSPedro Giffuni        LIBXML_CFLAGS=`xml2-config --cflags`
3917cfc83b6cSPedro Giffuni        LIBXML_LIBS=`xml2-config --libs`
3918cfc83b6cSPedro Giffuni    fi
3919cfc83b6cSPedro Giffunielse
3920cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
3921cfc83b6cSPedro Giffuni    SYSTEM_LIBXML=NO
3922cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC"
3923cfc83b6cSPedro Giffunifi
3924cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBXML)
3925cfc83b6cSPedro GiffuniAC_SUBST(LIBXML_CFLAGS)
3926cfc83b6cSPedro GiffuniAC_SUBST(LIBXML_LIBS)
3927cfc83b6cSPedro Giffuni
3928cfc83b6cSPedro Giffuni
3929cfc83b6cSPedro Giffunidnl ===================================================================
393063fbc773SJim Jagielskidnl Checks for a MacOS platform SDK compatible with an OSX 10.7 deployment target
3931cfc83b6cSPedro Giffunidnl ===================================================================
3932cfc83b6cSPedro Giffuniif test  "$_os" = "Darwin"; then
39330d16e2e7SJim Jagielski   sdk_target=$with_macosx_target
3934cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([checking SDK compatibility with OSX $sdk_target])
3935cfc83b6cSPedro Giffuni
3936cfc83b6cSPedro Giffuni   sdk_minor=`echo $sdk_target | cut -d"." -f2`
3937cfc83b6cSPedro Giffuni
393863fbc773SJim Jagielski   if test "$sdk_minor" -lt "7"; then
393963fbc773SJim Jagielski      AC_MSG_ERROR([SDK version < 10.7 is not longer supported])
3940cfc83b6cSPedro Giffuni   else
3941cfc83b6cSPedro Giffuni      MACOSX_DEPLOYMENT_TARGET=$sdk_target
3942cfc83b6cSPedro Giffuni
3943c235b4bcSJim Jagielski      dnl Why not MacOSX10.9.sdk? It lacks Python.h (!?)
39444fa6b83dSJim Jagielski      sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx10.(7|8|10|11)" | sed -e "s/.*sdk //" | tail -n1`
3945cfc83b6cSPedro Giffuni      if test -z "$sdk_found"; then
3946cfc83b6cSPedro Giffuni         AC_MSG_ERROR([No SDK with OSX $sdk_target compatibility found])
3947cfc83b6cSPedro Giffuni      else
3948cfc83b6cSPedro Giffuni         AC_MSG_RESULT([yes, by using SDK $sdk_found])
3949cfc83b6cSPedro Giffuni      fi
3950cfc83b6cSPedro Giffuni
3951cfc83b6cSPedro Giffuni      sdk_path=`xcodebuild -version -sdk ${sdk_found} Path`
3952cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([for $sdk_path])
3953cfc83b6cSPedro Giffuni      if test -d "$sdk_path"; then
3954cfc83b6cSPedro Giffuni         AC_MSG_RESULT([yes])
3955cfc83b6cSPedro Giffuni      else
3956cfc83b6cSPedro Giffuni         AC_MSG_ERROR([not found!])
3957cfc83b6cSPedro Giffuni      fi
3958cfc83b6cSPedro Giffuni
3959cfc83b6cSPedro Giffuni      MACOSX_SDK_PATH=$sdk_path
3960c4e9543bSJim Jagielski      SDKROOT=$sdk_path
3961cfc83b6cSPedro Giffuni   fi
3962cfc83b6cSPedro Giffuni
3963cfc83b6cSPedro Giffunifi
3964cfc83b6cSPedro GiffuniAC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3965cfc83b6cSPedro GiffuniAC_SUBST(MACOSX_SDK_PATH)
3966c4e9543bSJim JagielskiAC_SUBST(SDKROOT)
3967cfc83b6cSPedro Giffuni
3968cfc83b6cSPedro Giffuni
3969cfc83b6cSPedro Giffunidnl ===================================================================
3970cfc83b6cSPedro Giffunidnl Check for system python
3971cfc83b6cSPedro Giffunidnl ===================================================================
3972cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which python to use])
3973cfc83b6cSPedro Giffuniif test "$_os" = "Darwin" && test "$with_system_python" != "no"; then
3974cfc83b6cSPedro Giffuni   with_system_python=yes
3975cfc83b6cSPedro Giffuni
3976cfc83b6cSPedro Giffuni   _python="/Library/Frameworks/Python.framework/Versions/Current/bin/python"
3977cfc83b6cSPedro Giffuni   if test ! -f $_python; then
3978cfc83b6cSPedro Giffuni      _python="/usr/bin/python"
3979cfc83b6cSPedro Giffuni   fi
3980cfc83b6cSPedro Giffuni   AC_MSG_RESULT([compiling against system python ($_python)])
3981cfc83b6cSPedro Giffuni
3982cfc83b6cSPedro Giffuni   _python_hexversion=`$_python -c "import sys; print(sys.hexversion);"`
3983cfc83b6cSPedro Giffuni
3984cfc83b6cSPedro Giffuni   dnl hex version of Python 2.7.1 = 34013680
3985cfc83b6cSPedro Giffuni   if test $_python_hexversion -ge 34013680 ; then
3986cfc83b6cSPedro Giffuni      _python_version=`$_python -c "import sys; print sys.version;" | head -c 3`
3987cfc83b6cSPedro Giffuni      AC_MSG_RESULT([compiling against system python (version $_python_version)])
3988cfc83b6cSPedro Giffuni
3989cfc83b6cSPedro Giffuni      _python_ver=`$_python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
3990cfc83b6cSPedro Giffuni
3991cfc83b6cSPedro Giffuni      if test -d "/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"; then
3992cfc83b6cSPedro Giffuni         PYTHON_CFLAGS="-I/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"
3993cfc83b6cSPedro Giffuni         elif test -d "$MACOSX_SDK_PATH/usr/include/python$_python_ver"; then
3994cfc83b6cSPedro Giffuni             PYTHON_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/python$_python_ver"
3995cfc83b6cSPedro Giffuni      else
3996cfc83b6cSPedro Giffuni             PYTHON_CFLAGS="-I$MACOSX_SDK_PATH/System/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"
3997cfc83b6cSPedro Giffuni      fi
3998cfc83b6cSPedro Giffuni   else
3999cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Python 2.7.1 or higher is required])
4000cfc83b6cSPedro Giffuni   fi
4001cfc83b6cSPedro Giffuni
4002cfc83b6cSPedro Giffuni   PYTHON_LIBS="-framework Python"
4003cfc83b6cSPedro Giffunielif test -n "$with_system_python" -o -n "$with_system_libs" && \
4004cfc83b6cSPedro Giffuni    test "$with_system_python" != "no"; then
4005cfc83b6cSPedro Giffuni   with_system_python=yes
4006cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4007cfc83b6cSPedro Giffuni   AM_PATH_PYTHON([2.7])
4008cfc83b6cSPedro Giffuni
4009cfc83b6cSPedro Giffuni   python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
4010cfc83b6cSPedro Giffuni   python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
4011cfc83b6cSPedro Giffuni   PYTHON_CFLAGS="-I$python_include"
4012cfc83b6cSPedro Giffuni   PYTHON_LIBS="-lpython$python_version"
4013cfc83b6cSPedro Giffunifi
4014cfc83b6cSPedro Giffuniif test "$with_system_python" = "yes" ; then
4015cfc83b6cSPedro Giffuni   SYSTEM_PYTHON=YES
4016cfc83b6cSPedro Giffuni   dnl check if the headers really work:
4017cfc83b6cSPedro Giffuni   save_CPPFLAGS="$CPPFLAGS"
4018cfc83b6cSPedro Giffuni   CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
4019cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(Python.h, [],
4020cfc83b6cSPedro Giffuni       [AC_MSG_ERROR(Python headers not found)], [])
4021cfc83b6cSPedro Giffuni   CPPFLAGS="$save_CPPFLAGS"
4022cfc83b6cSPedro Giffunielse
4023cfc83b6cSPedro Giffuni   SYSTEM_PYTHON=NO
4024cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE PYTHON"
4025cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4026cfc83b6cSPedro Giffuni   # Embedded python dies without Home set
4027cfc83b6cSPedro Giffuni   if test "z$HOME" = "z"; then
4028cfc83b6cSPedro Giffuni      export HOME="";
4029cfc83b6cSPedro Giffuni   fi
4030cfc83b6cSPedro Giffuni   # bz2 tarball and bzip2 is not standard
4031cfc83b6cSPedro Giffuni   if test -z "$BZIP2"; then
4032cfc83b6cSPedro Giffuni    AC_PATH_PROG( BZIP2, bzip2)
4033cfc83b6cSPedro Giffuni    if test -z "$BZIP2"; then
4034cfc83b6cSPedro Giffuni        AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
4035cfc83b6cSPedro Giffuni    fi
4036cfc83b6cSPedro Giffuni   fi
4037cfc83b6cSPedro Giffunifi
4038cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_PYTHON)
4039cfc83b6cSPedro GiffuniAC_SUBST(PYTHON_CFLAGS)
4040cfc83b6cSPedro GiffuniAC_SUBST(PYTHON_LIBS)
4041cfc83b6cSPedro GiffuniHOME=`echo $HOME | sed 's:\\\\:/:g'`
4042cfc83b6cSPedro GiffuniAC_SUBST(HOME)
4043cfc83b6cSPedro Giffuni
4044cfc83b6cSPedro Giffunidnl ===================================================================
4045cfc83b6cSPedro Giffunidnl Check for system lucene
4046cfc83b6cSPedro Giffunidnl ===================================================================
4047cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which lucene to use])
4048cfc83b6cSPedro Giffuniif test -n "$with_system_lucene" -o -n "$with_system_libs" && \
4049cfc83b6cSPedro Giffuni       test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then
4050cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
4051cfc83b6cSPedro Giffuni        SYSTEM_LUCENE=YES
4052cfc83b6cSPedro Giffuni        if test -z $LUCENE_CORE_JAR; then
4053cfc83b6cSPedro Giffuni          AC_CHECK_FILE(/usr/share/java/lucene-core-2.9.4.jar,
4054cfc83b6cSPedro Giffuni            [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.9.4.jar ],
4055cfc83b6cSPedro Giffuni            [
4056cfc83b6cSPedro Giffuni              AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
4057cfc83b6cSPedro Giffuni                [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
4058cfc83b6cSPedro Giffuni                [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
4059cfc83b6cSPedro Giffuni                   [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
4060cfc83b6cSPedro Giffuni                   [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
4061cfc83b6cSPedro Giffuni                  )
4062cfc83b6cSPedro Giffuni                ]
4063cfc83b6cSPedro Giffuni              )
4064cfc83b6cSPedro Giffuni            ]
4065cfc83b6cSPedro Giffuni          )
4066cfc83b6cSPedro Giffuni        else
4067cfc83b6cSPedro Giffuni          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
4068cfc83b6cSPedro Giffuni               [AC_MSG_ERROR(lucene-core.jar not found.)], [])
4069cfc83b6cSPedro Giffuni        fi
4070cfc83b6cSPedro Giffuni
4071cfc83b6cSPedro Giffuni        if test -z $LUCENE_ANALYZERS_JAR; then
4072cfc83b6cSPedro Giffuni          AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
4073cfc83b6cSPedro Giffuni            [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
4074cfc83b6cSPedro Giffuni            [
4075cfc83b6cSPedro Giffuni              AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
4076cfc83b6cSPedro Giffuni                [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
4077cfc83b6cSPedro Giffuni                [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
4078cfc83b6cSPedro Giffuni              )
4079cfc83b6cSPedro Giffuni            ]
4080cfc83b6cSPedro Giffuni          )
4081cfc83b6cSPedro Giffuni        else
4082cfc83b6cSPedro Giffuni          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
4083cfc83b6cSPedro Giffuni               [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
4084cfc83b6cSPedro Giffuni        fi
4085cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([whether lucene is version 2.x])
4086cfc83b6cSPedro Giffuni        export LUCENE_CORE_JAR
4087cfc83b6cSPedro Giffuni        if $PERL -e 'use Archive::Zip;
4088cfc83b6cSPedro Giffuni            my $file = "$ENV{'LUCENE_CORE_JAR'}";
4089cfc83b6cSPedro Giffuni            my $zip = Archive::Zip->new( $file );
4090cfc83b6cSPedro Giffuni            my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
4091cfc83b6cSPedro Giffuni            if ( $mf =~ m/Specification-Version: 2.*/ ) {
4092cfc83b6cSPedro Giffuni                exit 0;
4093cfc83b6cSPedro Giffuni            } else {
4094cfc83b6cSPedro Giffuni                exit 1;
4095cfc83b6cSPedro Giffuni            }'; then
4096cfc83b6cSPedro Giffuni            AC_MSG_RESULT([yes])
4097cfc83b6cSPedro Giffuni         else
4098cfc83b6cSPedro Giffuni            AC_MSG_RESULT([no])
4099cfc83b6cSPedro Giffuni            AC_MSG_CHECKING([whether lucene is version 3.x])
4100cfc83b6cSPedro Giffuni
4101cfc83b6cSPedro Giffuni            if $PERL -e 'use Archive::Zip;
4102cfc83b6cSPedro Giffuni                my $file = "$ENV{'LUCENE_CORE_JAR'}";
4103cfc83b6cSPedro Giffuni                my $zip = Archive::Zip->new( $file );
4104cfc83b6cSPedro Giffuni                my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
4105cfc83b6cSPedro Giffuni                if ( $mf =~ m/Specification-Version: 3.*/ ) {
4106cfc83b6cSPedro Giffuni                    exit 0;
4107cfc83b6cSPedro Giffuni                } else {
4108cfc83b6cSPedro Giffuni                    exit 1;
4109cfc83b6cSPedro Giffuni                }'; then
4110cfc83b6cSPedro Giffuni                AC_MSG_RESULT([yes])
4111cfc83b6cSPedro Giffuni             else
4112cfc83b6cSPedro Giffuni                AC_MSG_ERROR([no, you need lucene 2 or 3])
4113cfc83b6cSPedro Giffuni             fi
4114cfc83b6cSPedro Giffuni         fi
4115cfc83b6cSPedro Giffuni
4116cfc83b6cSPedro Giffunielse
4117cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4118cfc83b6cSPedro Giffuni    SYSTEM_LUCENE=NO
4119cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE LUCENE"
4120cfc83b6cSPedro Giffunifi
4121cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LUCENE)
4122cfc83b6cSPedro GiffuniAC_SUBST(LUCENE_CORE_JAR)
4123cfc83b6cSPedro GiffuniAC_SUBST(LUCENE_ANALYZERS_JAR)
4124cfc83b6cSPedro Giffuni
4125cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the MySQL Connector extension])
4126cfc83b6cSPedro Giffuniif test -n "$enable_mysql_connector" -a "$enable_mysql_connector" != "no"; then
4127cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
4128cfc83b6cSPedro Giffuni  ENABLE_MYSQLC=YES
4129cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([for mysqlc module])
4130cfc83b6cSPedro Giffuni  if test -d mysqlc; then
4131cfc83b6cSPedro Giffuni   AC_MSG_RESULT([OK])
4132cfc83b6cSPedro Giffuni  else
4133cfc83b6cSPedro Giffuni   AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
4134cfc83b6cSPedro Giffuni  fi
4135cfc83b6cSPedro Giffuni  BUILD_TYPE="$BUILD_TYPE MYSQLC"
4136cfc83b6cSPedro Giffunielse
4137cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
4138cfc83b6cSPedro Giffuni  ENABLE_MYSQLC=NO
4139cfc83b6cSPedro Giffunifi
4140cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_MYSQLC)
4141cfc83b6cSPedro Giffuni
4142cfc83b6cSPedro Giffuniif test "$ENABLE_MYSQLC" = "YES"; then
4143cfc83b6cSPedro Giffunidnl ===================================================================
4144cfc83b6cSPedro Giffunidnl Check for system MySQL
4145cfc83b6cSPedro Giffunidnl ===================================================================
4146cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for mysql pre-requisites])
4147cfc83b6cSPedro Giffuniif test -n "$with_system_mysql" -o -n "$with_system_libs" && \
4148cfc83b6cSPedro Giffuni       test "$with_system_mysql" != "no" && test "$with_system_libs" != "no"; then
4149cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external MySQL])
4150cfc83b6cSPedro Giffuni    SYSTEM_MYSQL=YES
4151cfc83b6cSPedro Giffuni    AC_PATH_PROG( MYSQLCONFIG, mysql_config)
4152cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([MySQL version])
4153cfc83b6cSPedro Giffuni    if test -z "$MYSQLCONFIG" -o ! -x "$MYSQLCONFIG" ; then
4154cfc83b6cSPedro Giffuni        AC_MSG_ERROR([can not find/execute mysql_config]);
4155cfc83b6cSPedro Giffuni    fi
4156cfc83b6cSPedro Giffuni    MYSQL_VERSION=`$MYSQLCONFIG --version`
4157cfc83b6cSPedro Giffuni    MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
4158cfc83b6cSPedro Giffuni    if test "$MYSQL_MAJOR" -ge "5"; then
4159cfc83b6cSPedro Giffuni        AC_MSG_RESULT([OK])
4160cfc83b6cSPedro Giffuni    else
4161cfc83b6cSPedro Giffuni        AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
4162cfc83b6cSPedro Giffuni    fi
4163cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for MySQL Client library])
4164cfc83b6cSPedro Giffuni    MYSQL_INC=`$MYSQLCONFIG --include`
4165cfc83b6cSPedro Giffuni    MYSQL_LIB=`$MYSQLCONFIG --libs`
4166cfc83b6cSPedro Giffuni    MYSQL_DEFINES=`$MYSQLCONFIG --cflags | sed -e s,$MYSQL_INC,,`
4167cfc83b6cSPedro Giffuni    AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
4168cfc83b6cSPedro Giffunielse
4169cfc83b6cSPedro Giffuni    SYSTEM_MYSQL=NO
4170cfc83b6cSPedro Giffuni    if test -n "$with_libmysql_path"; then
4171cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external Connector/C (libmysql)])
4172cfc83b6cSPedro Giffuni        LIBMYSQL=libmysql.so
4173cfc83b6cSPedro Giffuni        if test "$_os" = "Darwin"; then
4174cfc83b6cSPedro Giffuni            LIBMYSQL=libmysql.dylib
4175cfc83b6cSPedro Giffuni        elif test "$_os" = "WINNT"; then
4176cfc83b6cSPedro Giffuni            LIBMYSQL=libmysql.dll
4177cfc83b6cSPedro Giffuni        fi
4178cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([for $LIBMYSQL])
4179cfc83b6cSPedro Giffuni        if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
4180cfc83b6cSPedro Giffuni            AC_MSG_RESULT([found.])
4181cfc83b6cSPedro Giffuni            LIBMYSQL_PATH=$with_libmysql_path
4182cfc83b6cSPedro Giffuni        else
4183cfc83b6cSPedro Giffuni            AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
4184cfc83b6cSPedro Giffuni        fi
4185cfc83b6cSPedro Giffuni    else
4186cfc83b6cSPedro Giffuni        AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
4187cfc83b6cSPedro Giffuni    fi
4188cfc83b6cSPedro Giffunifi
4189cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_MYSQL)
4190cfc83b6cSPedro GiffuniAC_SUBST(MYSQL_INC)
4191cfc83b6cSPedro GiffuniAC_SUBST(MYSQL_LIB)
4192cfc83b6cSPedro GiffuniAC_SUBST(MYSQL_DEFINES)
4193cfc83b6cSPedro GiffuniAC_SUBST(LIBMYSQL_PATH)
4194cfc83b6cSPedro Giffuni
4195cfc83b6cSPedro GiffuniAC_LANG_PUSH([C++])
4196cfc83b6cSPedro Giffunidnl ===================================================================
4197cfc83b6cSPedro Giffunidnl Check for system MySQL C++ Connector
4198cfc83b6cSPedro Giffunidnl ===================================================================
4199cfc83b6cSPedro Giffuni# FIXME!
4200cfc83b6cSPedro Giffuni# who thought this too-generic cppconn dir was a good idea?
4201cfc83b6cSPedro GiffuniAC_MSG_CHECKING([MySQL Connector/C++])
4202cfc83b6cSPedro Giffuniif test -n "$with_system_mysql_cppconn" -o -n "$with_system_libs" && \
4203cfc83b6cSPedro Giffuni        test "$with_system_mysql_cppconn" != "no" && test "$with_system_libs" != "no"; then
4204cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
4205cfc83b6cSPedro Giffuni    SYSTEM_MYSQL_CPPCONN=YES
4206cfc83b6cSPedro Giffuni        AC_LANG_PUSH([C++])
4207cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(mysql_driver.h, [],
4208cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
4209cfc83b6cSPedro Giffuni    AC_CHECK_LIB(mysqlcppconn, main, [],
4210cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
4211cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([version])
4212cfc83b6cSPedro Giffuni      AC_TRY_RUN([
4213cfc83b6cSPedro Giffuni#include <mysql_driver.h>
4214cfc83b6cSPedro Giffuni
4215cfc83b6cSPedro Giffuniint main(int argc, char **argv) {
4216cfc83b6cSPedro Giffuni    sql::Driver *driver;
4217cfc83b6cSPedro Giffuni    driver = get_driver_instance();
4218cfc83b6cSPedro Giffuni    if (driver->getMajorVersion() > 1 || \
4219cfc83b6cSPedro Giffuni       (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
4220cfc83b6cSPedro Giffuni       (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
4221cfc83b6cSPedro Giffuni        return 0;
4222cfc83b6cSPedro Giffuni      else
4223cfc83b6cSPedro Giffuni        return 1;
4224cfc83b6cSPedro Giffuni}
4225cfc83b6cSPedro Giffuni      ], [AC_MSG_RESULT(OK)], [AC_MSG_ERROR([not suitable, we need >= 1.0.6])])
4226cfc83b6cSPedro Giffuni        AC_LANG_POP([C++])
4227cfc83b6cSPedro Giffuni
4228cfc83b6cSPedro Giffunielse
4229cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
4230cfc83b6cSPedro Giffuni    SYSTEM_MYSQL_CPPCONN=
4231cfc83b6cSPedro Giffunifi
4232cfc83b6cSPedro GiffuniAC_LANG_POP([C++])
4233cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_MYSQL_CPPCONN)
4234cfc83b6cSPedro Giffunifi
4235cfc83b6cSPedro Giffuni
4236cfc83b6cSPedro Giffunidnl ===================================================================
4237cfc83b6cSPedro Giffunidnl Check for system hsqldb
4238cfc83b6cSPedro Giffunidnl ===================================================================
4239cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which hsqldb to use])
4240cfc83b6cSPedro Giffuniif test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \
4241cfc83b6cSPedro Giffuni       test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then
4242cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
4243cfc83b6cSPedro Giffuni        SYSTEM_HSQLDB=YES
4244cfc83b6cSPedro Giffuni        if test -z $HSQLDB_JAR; then
4245cfc83b6cSPedro Giffuni               HSQLDB_JAR=/usr/share/java/hsqldb.jar
4246cfc83b6cSPedro Giffuni        fi
4247cfc83b6cSPedro Giffuni        AC_CHECK_FILE($HSQLDB_JAR, [],
4248cfc83b6cSPedro Giffuni               [AC_MSG_ERROR(hsqldb.jar not found.)], [])
4249cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
4250cfc83b6cSPedro Giffuni        export HSQLDB_JAR
4251cfc83b6cSPedro Giffuni        if $PERL -e 'use Archive::Zip;
4252cfc83b6cSPedro Giffuni            my $file = "$ENV{'HSQLDB_JAR'}";
4253cfc83b6cSPedro Giffuni            my $zip = Archive::Zip->new( $file );
4254cfc83b6cSPedro Giffuni            my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
4255cfc83b6cSPedro Giffuni            if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
4256cfc83b6cSPedro Giffuni               push @l, split(/\n/, $mf);
4257cfc83b6cSPedro Giffuni               foreach my $line (@l) {
4258cfc83b6cSPedro Giffuni                  if ($line =~ m/Specification-Version:/) {
4259cfc83b6cSPedro Giffuni                      ($t, $version) = split (/:/,$line);
4260cfc83b6cSPedro Giffuni                      $version =~ s/^\s//;
4261cfc83b6cSPedro Giffuni                      ($a, $b, $c, $d) = split (/\./,$version);
4262cfc83b6cSPedro Giffuni                      if ($c == "0" && $d > "8")  {
4263cfc83b6cSPedro Giffuni                          exit 0;
4264cfc83b6cSPedro Giffuni                      } else {
4265cfc83b6cSPedro Giffuni                          exit 1;
4266cfc83b6cSPedro Giffuni                      }
4267cfc83b6cSPedro Giffuni                  }
4268cfc83b6cSPedro Giffuni               }
4269cfc83b6cSPedro Giffuni            } else {
4270cfc83b6cSPedro Giffuni                exit 1;
4271cfc83b6cSPedro Giffuni            }'; then
4272cfc83b6cSPedro Giffuni            AC_MSG_RESULT([yes])
4273cfc83b6cSPedro Giffuni         else
4274cfc83b6cSPedro Giffuni            AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
4275cfc83b6cSPedro Giffuni         fi
4276cfc83b6cSPedro Giffunielse
4277cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4278cfc83b6cSPedro Giffuni    SYSTEM_HSQLDB=NO
4279cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE HSQLDB"
4280cfc83b6cSPedro Giffunifi
4281cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_HSQLDB)
4282cfc83b6cSPedro GiffuniAC_SUBST(HSQLDB_JAR)
4283cfc83b6cSPedro Giffuni
4284cfc83b6cSPedro Giffunidnl ===================================================================
4285cfc83b6cSPedro Giffunidnl Check for system beanshell
4286cfc83b6cSPedro Giffunidnl ===================================================================
4287cfc83b6cSPedro GiffuniENABLE_BEANSHELL=YES
4288cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which beanshell to use])
4289cfc83b6cSPedro Giffuniif test -n "$with_system_beanshell" -o -n "$with_system_libs" && \
4290cfc83b6cSPedro Giffuni       test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then
4291cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
4292cfc83b6cSPedro Giffuni        SYSTEM_BSH=YES
4293cfc83b6cSPedro Giffuni        if test -z $BSH_JAR; then
4294cfc83b6cSPedro Giffuni               BSH_JAR=/usr/share/java/bsh.jar
4295cfc83b6cSPedro Giffuni        fi
4296cfc83b6cSPedro Giffuni        AC_CHECK_FILE($BSH_JAR, [],
4297cfc83b6cSPedro Giffuni               [AC_MSG_ERROR(bsh.jar not found.)], [])
4298cfc83b6cSPedro Giffunielif test "x$enable_beanshell" = "xyes"; then
4299cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4300cfc83b6cSPedro Giffuni    SYSTEM_BSH=NO
4301cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE BSH"
4302cfc83b6cSPedro Giffunielse
4303cfc83b6cSPedro Giffuni    AC_MSG_RESULT([none (disabled)])
4304cfc83b6cSPedro Giffuni    SYSTEM_BSH=NO
4305cfc83b6cSPedro Giffuni    ENABLE_BEANSHELL=NO
4306cfc83b6cSPedro Giffunifi
4307cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_BSH)
4308cfc83b6cSPedro GiffuniAC_SUBST(BSH_JAR)
4309cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_BEANSHELL)
4310cfc83b6cSPedro Giffuni
4311cfc83b6cSPedro Giffuni
4312cfc83b6cSPedro Giffunidnl ===================================================================
4313cfc83b6cSPedro Giffunidnl Check for saxon.  It can come from two different places:
4314cfc83b6cSPedro Giffunidnl - pre-installed on the system.  This is checked when the --with-system-saxon
4315cfc83b6cSPedro Giffunidnl   option is given to configure.
4316cfc83b6cSPedro Giffunidnl   The exact place can be specified with the --with-saxon-jar=<path> option.
4317cfc83b6cSPedro Giffunidnl - From the saxon tar ball in ext_sources/.  This is used when --enable-saxon
4318cfc83b6cSPedro Giffunidnl   is given to configure but not any of --with-system-saxon or --with-saxon-jar.
4319cfc83b6cSPedro Giffunidnl ===================================================================
4320cfc83b6cSPedro GiffuniDISABLE_SAXON=
4321cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which saxon to use])
4322cfc83b6cSPedro Giffuniif test -n "$with_system_saxon" -o -n "$with_system_libs" && \
4323cfc83b6cSPedro Giffuni       test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then
4324cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
4325cfc83b6cSPedro Giffuni        SYSTEM_SAXON=YES
4326cfc83b6cSPedro Giffuni        if test -z $SAXON_JAR; then
4327cfc83b6cSPedro Giffuni          AC_CHECK_FILE(/usr/share/java/saxon9.jar,
4328cfc83b6cSPedro Giffuni            [ SAXON_JAR=/usr/share/java/saxon9.jar ],
4329cfc83b6cSPedro Giffuni            [
4330cfc83b6cSPedro Giffuni              AC_CHECK_FILE(/usr/share/java/saxon.jar,
4331cfc83b6cSPedro Giffuni                [ SAXON_JAR=/usr/share/java/saxon.jar ],
4332cfc83b6cSPedro Giffuni                [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
4333cfc83b6cSPedro Giffuni                    [ SAXON_JAR=/usr/share/java/saxon9.jar ],
4334cfc83b6cSPedro Giffuni                    [ AC_MSG_ERROR(saxon.jar replacement not found)]
4335cfc83b6cSPedro Giffuni                  )
4336cfc83b6cSPedro Giffuni                ]
4337cfc83b6cSPedro Giffuni              )
4338cfc83b6cSPedro Giffuni            ]
4339cfc83b6cSPedro Giffuni          )
4340cfc83b6cSPedro Giffuni        else
4341cfc83b6cSPedro Giffuni          AC_CHECK_FILE($SAXON_JAR, [],
4342cfc83b6cSPedro Giffuni               [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
4343cfc83b6cSPedro Giffuni        fi
4344cfc83b6cSPedro Giffuni        if test -n "$SERIALIZER_JAR"; then
4345cfc83b6cSPedro Giffuni          AC_CHECK_FILE($SERIALIZER_JAR, [],
4346cfc83b6cSPedro Giffuni               [AC_MSG_ERROR(serializer.jar not found.)], [])
4347cfc83b6cSPedro Giffuni          AC_SUBST(SERIALIZER_JAR)
4348cfc83b6cSPedro Giffuni        fi
4349cfc83b6cSPedro Giffuni
4350cfc83b6cSPedro Giffunidnl Saxon comes in two practically available versions, the out-of-date saxonb which
4351e986c8d8SMatthias Seideldnl supports the java extensions that AOO uses, and the up-to-date saxon he
4352cfc83b6cSPedro Giffunidnl "home edition" version, which is crippled to not support those java extensions.
4353cfc83b6cSPedro Giffunidnl And as an aside the he one also needs to be tweaked to include
4354cfc83b6cSPedro Giffunidnl a META-INF/services to broadcast that it supports the jaxp transform factory
4355cfc83b6cSPedro Giffuni
4356cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([if saxon works])
4357cfc83b6cSPedro Giffuni        cat > saxontest.java <<_ACEOF
4358cfc83b6cSPedro Giffuni[import javax.xml.transform.TransformerFactory;
4359cfc83b6cSPedro Giffuniimport javax.xml.transform.Transformer;
4360cfc83b6cSPedro Giffuniimport javax.xml.transform.stream.StreamSource;
4361cfc83b6cSPedro Giffuniimport java.io.*;
4362cfc83b6cSPedro Giffuni
4363cfc83b6cSPedro Giffuniimport net.sf.saxon.FeatureKeys;
4364cfc83b6cSPedro Giffuni
4365cfc83b6cSPedro Giffuniclass saxontest {
4366cfc83b6cSPedro Giffuni    public static void main(String[] args) {
4367cfc83b6cSPedro Giffuni      System.setProperty("javax.xml.transform.TransformerFactory",
4368cfc83b6cSPedro Giffuni        "net.sf.saxon.TransformerFactoryImpl");
4369cfc83b6cSPedro Giffuni      try {
4370cfc83b6cSPedro Giffuni        TransformerFactory tfactory = TransformerFactory.newInstance();
4371cfc83b6cSPedro Giffuni    // some external saxons (Debian, Ubuntu, ...) have this disabled
4372cfc83b6cSPedro Giffuni    // per default
4373cfc83b6cSPedro Giffuni    tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
4374cfc83b6cSPedro Giffuni        System.out.println("TransformerFactory is" +
4375cfc83b6cSPedro Giffuni          tfactory.getClass().getName());
4376cfc83b6cSPedro Giffuni        Transformer transformer = tfactory.newTransformer(
4377cfc83b6cSPedro Giffuni          new StreamSource(new File(args[0])));
4378cfc83b6cSPedro Giffuni      } catch(Exception e){
4379cfc83b6cSPedro Giffuni        e.printStackTrace(System.err);
4380cfc83b6cSPedro Giffuni        System.exit(-1);
4381cfc83b6cSPedro Giffuni      }
4382cfc83b6cSPedro Giffuni      System.exit(0);
4383cfc83b6cSPedro Giffuni    }
4384cfc83b6cSPedro Giffuni}
4385cfc83b6cSPedro Giffuni]
4386cfc83b6cSPedro Giffuni_ACEOF
4387cfc83b6cSPedro Giffuni        cat > saxontest.xsl<<_ACEOF
4388cfc83b6cSPedro Giffuni[<?xml version="1.0" encoding="UTF-8"?>
4389cfc83b6cSPedro Giffuni<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4390cfc83b6cSPedro Giffuni <xsl:template match="/">
4391cfc83b6cSPedro Giffuni  <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
4392cfc83b6cSPedro Giffuni </xsl:template>
4393cfc83b6cSPedro Giffuni</xsl:stylesheet>
4394cfc83b6cSPedro Giffuni]
4395cfc83b6cSPedro Giffuni_ACEOF
4396cfc83b6cSPedro Giffuni        javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
4397cfc83b6cSPedro Giffuni        AC_TRY_EVAL(javac_cmd)
4398cfc83b6cSPedro Giffuni        if test $? = 0 && test -f ./saxontest.class ; then
4399cfc83b6cSPedro Giffuni            java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
4400cfc83b6cSPedro Giffuni            AC_TRY_EVAL(java_cmd)
4401cfc83b6cSPedro Giffuni            if test $? = 0; then
4402cfc83b6cSPedro Giffuni              AC_MSG_RESULT([yes])
4403cfc83b6cSPedro Giffuni            else
4404cfc83b6cSPedro Giffuni              cat saxontest.java >&5
4405cfc83b6cSPedro Giffuni              AC_MSG_RESULT([no])
4406cfc83b6cSPedro Giffuni              AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
4407cfc83b6cSPedro Giffuni            fi
4408cfc83b6cSPedro Giffuni        else
4409cfc83b6cSPedro Giffuni          AC_MSG_RESULT([no])
4410cfc83b6cSPedro Giffuni          cat saxontest.java >&5
4411cfc83b6cSPedro Giffuni          AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
4412cfc83b6cSPedro Giffuni        fi
4413cfc83b6cSPedro Giffunielif test "x$enable_saxon" = "xyes"; then
4414cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4415cfc83b6cSPedro Giffuni    SYSTEM_SAXON=NO
4416cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE SAXON"
4417cfc83b6cSPedro Giffunielse
4418cfc83b6cSPedro Giffuni    AC_MSG_RESULT([none (disabled)])
4419cfc83b6cSPedro Giffuni    SYSTEM_SAXON=NO
4420cfc83b6cSPedro Giffuni    DISABLE_SAXON=YES
4421cfc83b6cSPedro Giffunifi
4422cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_SAXON)
4423cfc83b6cSPedro GiffuniAC_SUBST(SAXON_JAR)
4424cfc83b6cSPedro GiffuniAC_SUBST(DISABLE_SAXON)
4425cfc83b6cSPedro Giffuni
4426cfc83b6cSPedro Giffuni
4427cfc83b6cSPedro Giffunidnl ===================================================================
4428cfc83b6cSPedro Giffunidnl Check for rhino
4429cfc83b6cSPedro Giffunidnl ===================================================================
4430cfc83b6cSPedro GiffuniENABLE_JAVASCRIPT=
4431cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable support for JavaScript])
4432cfc83b6cSPedro Giffuniif test "x$enable_javascript" = "xyes"; then
4433cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE RHINO"
4434cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
4435cfc83b6cSPedro Giffuni   ENABLE_JAVASCRIPT=YES
4436cfc83b6cSPedro Giffunielse
4437cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
4438cfc83b6cSPedro Giffuni   ENABLE_JAVASCRIPT=NO
4439cfc83b6cSPedro Giffunifi
4440cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_JAVASCRIPT)
4441cfc83b6cSPedro Giffuni
4442cfc83b6cSPedro Giffuni
4443cfc83b6cSPedro Giffunidnl ===================================================================
4444cfc83b6cSPedro Giffunidnl Check for system apr
4445cfc83b6cSPedro Giffunidnl ===================================================================
4446cfc83b6cSPedro GiffuniSYSTEM_APR=NO
4447cfc83b6cSPedro GiffuniAPR_CFLAGS=
4448cfc83b6cSPedro GiffuniAPR_LIBS=
4449cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libapr to use])
4450cfc83b6cSPedro Giffuniif test "x$with_system_apr" = "xyes" -o -n "$with_system_libs"; then
4451cfc83b6cSPedro Giffuni    AC_MSG_RESULT([system])
4452cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES([APR], [apr-1 >= 1.0])
4453cfc83b6cSPedro Giffuni    SYSTEM_APR=YES
4454cfc83b6cSPedro Giffunielse
4455cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4456cfc83b6cSPedro Giffuni    SYSTEM_APR=NO
4457cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE APR"
4458cfc83b6cSPedro Giffunifi
4459cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_APR)
4460cfc83b6cSPedro GiffuniAC_SUBST(APR_CFLAGS)
4461cfc83b6cSPedro GiffuniAC_SUBST(APR_LIBS)
4462cfc83b6cSPedro Giffuni
4463cfc83b6cSPedro Giffuni
4464cfc83b6cSPedro Giffunidnl ===================================================================
4465cfc83b6cSPedro Giffunidnl Check for system apr-util
4466cfc83b6cSPedro Giffunidnl ===================================================================
4467cfc83b6cSPedro GiffuniSYSTEM_APR_UTIL=NO
4468cfc83b6cSPedro GiffuniAPR_UTIL_CFLAGS=
4469cfc83b6cSPedro GiffuniAPR_UTIL_LIBS=
4470cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libapr-util to use])
4471cfc83b6cSPedro Giffuniif test "x$with_system_apr_util" = "xyes" -o -n "$with_system_libs"; then
4472cfc83b6cSPedro Giffuni    AC_MSG_RESULT([system])
4473cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES([APR_UTIL], [apr-util-1 >= 1.0])
4474cfc83b6cSPedro Giffuni    SYSTEM_APR_UTIL=YES
4475cfc83b6cSPedro Giffunielse
4476cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4477cfc83b6cSPedro Giffuni    SYSTEM_APR_UTIL=NO
4478cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE APR_UTIL"
4479cfc83b6cSPedro Giffunifi
4480cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_APR_UTIL)
4481cfc83b6cSPedro GiffuniAC_SUBST(APR_UTIL_CFLAGS)
4482cfc83b6cSPedro GiffuniAC_SUBST(APR_UTIL_LIBS)
4483cfc83b6cSPedro Giffuni
4484cfc83b6cSPedro Giffuni
4485cfc83b6cSPedro Giffunidnl ===================================================================
4486cfc83b6cSPedro Giffunidnl Check for system serf
4487cfc83b6cSPedro Giffunidnl ===================================================================
4488cfc83b6cSPedro GiffuniSYSTEM_SERF=NO
4489cfc83b6cSPedro GiffuniSERF_CFLAGS=
4490cfc83b6cSPedro GiffuniSERF_LIBS=
4491cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libserf to use])
4492cfc83b6cSPedro Giffuniif test -n "$with_system_serf" -o -n "$with_system_libs" && \
4493cfc83b6cSPedro Giffuni  test "$with_system_serf" != "no"; then
4494cfc83b6cSPedro Giffuni    AC_MSG_RESULT([system])
4495cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES([SERF], [serf-1 >= 1.1])
4496cfc83b6cSPedro Giffuni    SYSTEM_SERF=YES
4497cfc83b6cSPedro Giffunielse
4498cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4499cfc83b6cSPedro Giffuni    SYSTEM_SERF=NO
4500cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE SERF"
4501cfc83b6cSPedro Giffunifi
4502cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_SERF)
4503cfc83b6cSPedro GiffuniAC_SUBST(SERF_CFLAGS)
4504cfc83b6cSPedro GiffuniAC_SUBST(SERF_LIBS)
4505cfc83b6cSPedro Giffuni
4506cfc83b6cSPedro Giffuni
4507cfc83b6cSPedro Giffunidnl ===================================================================
4508cfc83b6cSPedro Giffunidnl Check for CoinMP
4509cfc83b6cSPedro Giffunidnl ===================================================================
4510cfc83b6cSPedro GiffuniENABLE_COINMP=
4511cfc83b6cSPedro GiffuniSYSTEM_COINMP=NO
4512cfc83b6cSPedro GiffuniCOINMP_CFLAGS=
4513cfc83b6cSPedro GiffuniCOINMP_LIBS=
4514cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable support for CoinMP])
4515cfc83b6cSPedro Giffuniif test "x$enable_coinmp" = "xyes"; then
4516cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE COINMP"
4517cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
4518cfc83b6cSPedro Giffuni    ENABLE_COINMP=YES
4519cfc83b6cSPedro Giffuni
4520cfc83b6cSPedro Giffuni    dnl Check wether to use system or internal CoinMP
4521cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([which coinmp to use])
4522cfc83b6cSPedro Giffuni    if test "x$with_system_coinmp" = "xyes" -o -n "$with_system_libs"; then
4523cfc83b6cSPedro Giffuni        AC_MSG_RESULT([system])
4524cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES([COINMP], [coinmp])
4525cfc83b6cSPedro Giffuni        SYSTEM_COINMP=YES
4526cfc83b6cSPedro Giffuni        # some systems need this. Like Ubuntu....
4527cfc83b6cSPedro Giffuni        AC_CHECK_LIB(m, floor)
4528cfc83b6cSPedro Giffuni        AC_CHECK_LIB(dl, dlopen)
4529cfc83b6cSPedro Giffuni    else
4530cfc83b6cSPedro Giffuni        AC_MSG_RESULT([internal])
4531cfc83b6cSPedro Giffuni        SYSTEM_COINMP=NO
4532cfc83b6cSPedro Giffuni        BUILD_TYPE="$BUILD_TYPE COINMP"
4533cfc83b6cSPedro Giffuni    fi
4534cfc83b6cSPedro Giffunielse
4535cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
4536cfc83b6cSPedro Giffuni    ENABLE_COINMP=NO
4537cfc83b6cSPedro Giffunifi
4538cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_COINMP)
4539cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_COINMP)
4540cfc83b6cSPedro GiffuniAC_SUBST(COINMP_CFLAGS)
4541cfc83b6cSPedro GiffuniAC_SUBST(COINMP_LIBS)
4542cfc83b6cSPedro Giffuni
4543cfc83b6cSPedro Giffuni
4544cfc83b6cSPedro Giffunidnl ===================================================================
4545cfc83b6cSPedro Giffunidnl Check for system curl
4546cfc83b6cSPedro Giffunidnl ===================================================================
4547cfc83b6cSPedro Giffuniif test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then
4548cfc83b6cSPedro Giffuni   with_system_curl=yes
4549cfc83b6cSPedro Giffunifi
4550cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which curl to use])
4551cfc83b6cSPedro Giffuniif test -n "$with_system_curl" -o -n "$with_system_libs" && \
4552cfc83b6cSPedro Giffuni    test "$with_system_curl" != "no"; then
4553cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4554cfc83b6cSPedro Giffuni   SYSTEM_CURL=YES
4555cfc83b6cSPedro Giffuni
4556cfc83b6cSPedro Giffuni   AC_PATH_PROG( CURLCONFIG, curl-config)
4557cfc83b6cSPedro Giffuni   if test -z "$CURLCONFIG"; then
4558cfc83b6cSPedro Giffuni      AC_MSG_ERROR([install curl to run this script])
4559cfc83b6cSPedro Giffuni   fi
4560cfc83b6cSPedro Giffuni
4561cfc83b6cSPedro Giffuni   # check curl version
4562cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether curl is >= 7.13.1])
4563cfc83b6cSPedro Giffuni   if test "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $1 }'`" -gt "7" -a \
4564cfc83b6cSPedro Giffuni    "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $2 }'`" -gt "13" -a \
4565cfc83b6cSPedro Giffuni    "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $3 }'`" -gt "1"; then
4566cfc83b6cSPedro Giffuni      AC_MSG_ERROR([no, you need at least curl 7.13,1])
4567cfc83b6cSPedro Giffuni   else
4568cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
4569cfc83b6cSPedro Giffuni   fi
4570cfc83b6cSPedro Giffuni   CURL_LIBS=`$CURLCONFIG --libs`
4571cfc83b6cSPedro Giffuni   CURL_CFLAGS=`$CURLCONFIG --cflags`
4572cfc83b6cSPedro Giffunielse
4573cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4574cfc83b6cSPedro Giffuni   SYSTEM_CURL=NO
4575cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE CURL"
4576cfc83b6cSPedro Giffunifi
4577cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_CURL)
4578cfc83b6cSPedro GiffuniAC_SUBST(CURL_CFLAGS)
4579cfc83b6cSPedro GiffuniAC_SUBST(CURL_LIBS)
4580cfc83b6cSPedro Giffuni
4581cfc83b6cSPedro Giffunidnl ===================================================================
4582cfc83b6cSPedro Giffunidnl Check for system mdds
4583cfc83b6cSPedro Giffunidnl ===================================================================
4584cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which mdds to use])
4585cfc83b6cSPedro Giffuniif test -n "$with_system_mdds" -o -n "$with_system_headers" && \
4586cfc83b6cSPedro Giffuni    test "$with_system_mdds" != "no"; then
4587cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
4588cfc83b6cSPedro Giffuni    SYSTEM_MDDS=YES
4589cfc83b6cSPedro Giffuni    AC_LANG_PUSH([C++])
4590cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
4591cfc83b6cSPedro Giffuni        [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
4592cfc83b6cSPedro Giffuni    AC_LANG_POP([C++])
4593cfc83b6cSPedro Giffunielse
4594cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4595cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE MDDS"
4596cfc83b6cSPedro Giffuni   SYSTEM_MDDS=NO
4597cfc83b6cSPedro Giffunifi
4598cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_MDDS)
4599cfc83b6cSPedro Giffuni
4600cfc83b6cSPedro Giffunidnl ===================================================================
4601cfc83b6cSPedro Giffunidnl Check for system boost
4602cfc83b6cSPedro Giffunidnl ===================================================================
4603cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which boost to use])
4604cfc83b6cSPedro Giffuniif test -n "$with_system_boost" -o -n "$with_system_headers" && \
4605cfc83b6cSPedro Giffuni    test "$with_system_boost" != "no"; then
4606cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4607cfc83b6cSPedro Giffuni   SYSTEM_BOOST=YES
4608cfc83b6cSPedro Giffuni   AC_LANG_PUSH([C++])
4609cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
4610cfc83b6cSPedro Giffuni       [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
4611cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
4612cfc83b6cSPedro Giffuni       [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
4613cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(boost/function.hpp, [],
4614cfc83b6cSPedro Giffuni       [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
4615cfc83b6cSPedro Giffuni
4616cfc83b6cSPedro Giffuni   save_CXXFLAGS=$CXXFLAGS
4617cfc83b6cSPedro Giffuni   CXXFLAGS="$CXXFLAGS -fno-exceptions"
4618cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
4619cfc83b6cSPedro Giffuni   AC_TRY_COMPILE([#include <boost/function.hpp>
4620cfc83b6cSPedro Giffuni], [],
4621cfc83b6cSPedro Giffuni   ac_cv_cxx_boost_no_exceptons_broken=no, ac_cv_cxx_boost_no_exceptons_broken=yes)
4622cfc83b6cSPedro Giffuni
4623cfc83b6cSPedro Giffuni   if test "$ac_cv_cxx_boost_no_exceptons_broken" = "yes"; then
4624cfc83b6cSPedro Giffuni    AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
4625cfc83b6cSPedro Giffuni   else
4626cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
4627cfc83b6cSPedro Giffuni   fi
4628cfc83b6cSPedro Giffuni   CXXFLAGS=$save_CXXFLAGS
4629cfc83b6cSPedro Giffuni   AC_LANG_POP([C++])
4630cfc83b6cSPedro Giffunielse
4631cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4632cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE BOOST"
4633cfc83b6cSPedro Giffuni   SYSTEM_BOOST=NO
4634cfc83b6cSPedro Giffunifi
4635cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_BOOST)
4636cfc83b6cSPedro Giffuni
4637cfc83b6cSPedro Giffunidnl ===================================================================
4638cfc83b6cSPedro Giffunidnl Check for system vigra
4639cfc83b6cSPedro Giffunidnl ===================================================================
4640cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which vigra to use])
4641cfc83b6cSPedro Giffuniif test -n "$with_system_vigra" -o -n "$with_system_headers" && \
4642cfc83b6cSPedro Giffuni    test "$with_system_vigra" != "no"; then
4643cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4644cfc83b6cSPedro Giffuni   SYSTEM_VIGRA=YES
4645cfc83b6cSPedro Giffuni   AC_LANG_PUSH([C++])
4646cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(vigra/copyimage.hxx, [],
4647cfc83b6cSPedro Giffuni       [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
4648cfc83b6cSPedro Giffuni   AC_LANG_POP([C++])
4649cfc83b6cSPedro Giffunielse
4650cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4651cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE VIGRA"
4652cfc83b6cSPedro Giffuni   SYSTEM_VIGRA=NO
4653cfc83b6cSPedro Giffunifi
4654cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_VIGRA)
4655cfc83b6cSPedro Giffuni
4656cfc83b6cSPedro Giffunidnl ===================================================================
4657cfc83b6cSPedro Giffunidnl Check for system odbc
4658cfc83b6cSPedro Giffunidnl ===================================================================
4659cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which odbc headers to use])
4660cfc83b6cSPedro Giffuniif test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \
4661cfc83b6cSPedro Giffuni    test "$with_system_odbc_headers" != "no"; then
4662cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4663cfc83b6cSPedro Giffuni   SYSTEM_ODBC_HEADERS=YES
4664cfc83b6cSPedro Giffuni
4665cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(sqlext.h, [],
4666cfc83b6cSPedro Giffuni      [AC_MSG_ERROR(odbc not found. install odbc)], [])
4667cfc83b6cSPedro Giffunielse
4668cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4669cfc83b6cSPedro Giffuni   SYSTEM_ODBC_HEADERS=NO
4670cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE UNIXODBC"
4671cfc83b6cSPedro Giffunifi
4672cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_ODBC_HEADERS)
4673cfc83b6cSPedro Giffuni
4674cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build XML Security support])
4675cfc83b6cSPedro Giffuniif test "$enable_nss_module" = "no"; then
4676cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no, since NSS disabled but needed])
4677cfc83b6cSPedro Giffunielse
4678cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
4679cfc83b6cSPedro Giffunifi
4680cfc83b6cSPedro Giffuni
4681cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build LDAP configuration backend])
4682cfc83b6cSPedro Giffuniif test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then
4683cfc83b6cSPedro Giffuni   if test "$with_openldap" = "yes"; then
4684cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
4685cfc83b6cSPedro Giffuni      WITH_LDAP=YES
4686cfc83b6cSPedro Giffuni   else
4687cfc83b6cSPedro Giffuni      WITH_LDAP=NO
4688cfc83b6cSPedro Giffuni   fi
4689cfc83b6cSPedro Giffunielse
4690cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
4691cfc83b6cSPedro Giffuni   WITH_LDAP=NO
4692cfc83b6cSPedro Giffunifi
4693cfc83b6cSPedro Giffuni
4694cfc83b6cSPedro Giffuniif test "$WITH_LDAP" = "YES"; then
4695cfc83b6cSPedro Giffuni   dnl ===================================================================
4696cfc83b6cSPedro Giffuni   dnl Test whether we want to use the OpenLDAP LDAP SDK
4697cfc83b6cSPedro Giffuni   dnl ===================================================================
4698cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([which LDAP SDK to use])
4699cfc83b6cSPedro Giffuni   if test -n "$with_openldap" && test "$with_openldap" != "no"; then
4700cfc83b6cSPedro Giffuni       AC_MSG_RESULT([OpenLDAP])
4701cfc83b6cSPedro Giffuni       WITH_OPENLDAP=YES
4702cfc83b6cSPedro Giffuni       AC_CHECK_HEADERS(ldap.h, [],
4703cfc83b6cSPedro Giffuni           [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
4704cfc83b6cSPedro Giffuni       AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
4705cfc83b6cSPedro Giffuni           [AC_MSG_ERROR(openldap lib not found or functional)], [])
4706cfc83b6cSPedro Giffuni       # rumours say that OpenLDAP doesn't have that function. I looked and
4707cfc83b6cSPedro Giffuni       # it has it. Test for it to be sure
4708cfc83b6cSPedro Giffuni         AC_CHECK_LIB(ldap, ldap_set_option, [],
4709cfc83b6cSPedro Giffuni                [AC_MSG_ERROR(openldap lib not found or functional)], [])
4710cfc83b6cSPedro Giffuni   fi
4711cfc83b6cSPedro Giffunifi
4712cfc83b6cSPedro GiffuniAC_SUBST(WITH_LDAP)
4713cfc83b6cSPedro GiffuniAC_SUBST(WITH_OPENLDAP)
4714cfc83b6cSPedro Giffuni
4715cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the internal NSS module])
4716cfc83b6cSPedro Giffuniif test "$enable_nss_module" != "no"; then
4717cfc83b6cSPedro Giffuni   ENABLE_NSS_MODULE="YES"
4718cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE NSS"
4719cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
4720cfc83b6cSPedro Giffuni   if test "$_os" = "WINNT"; then
4721cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([for Mozilla build tooling])
4722cfc83b6cSPedro Giffuni      if test -z "$MOZILLABUILD" ; then
4723cfc83b6cSPedro GiffuniAC_MSG_ERROR([
4724cfc83b6cSPedro GiffuniMozilla build tooling not found!
4725cfc83b6cSPedro Giffuni  It is required for NSS that is needed for AOO's security facilities.
4726cfc83b6cSPedro Giffuni  Either disable NSS using the option --disable-nss-module
4727cfc83b6cSPedro Giffuni  or use the --with-mozilla-build option after installing the tool obtained
47289d1669aeSMatthias Seidel  from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/])
4729cfc83b6cSPedro Giffuni      else
4730cfc83b6cSPedro Giffuni         if test \( "$WITH_MINGWIN" = "yes" \) ; then
4731cfc83b6cSPedro Giffuni            if test ! -d "$MOZILLABUILD" ; then
4732cfc83b6cSPedro GiffuniAC_MSG_ERROR([Mozilla build tooling incomplete!])
4733cfc83b6cSPedro Giffuni            else
4734cfc83b6cSPedro Giffuni               AC_MSG_RESULT([ok])
4735cfc83b6cSPedro Giffuni            fi
4736cfc83b6cSPedro Giffuni         else
4737c4e06ec6SMatthias Seidel            if test ! -d "$MOZILLABUILD/msys" ; then
4738cfc83b6cSPedro GiffuniAC_MSG_ERROR([Mozilla build tooling incomplete!])
4739cfc83b6cSPedro Giffuni            else
4740cfc83b6cSPedro Giffuni               AC_MSG_RESULT([ok])
4741cfc83b6cSPedro Giffuni            fi
4742cfc83b6cSPedro Giffuni         fi
4743cfc83b6cSPedro Giffuni      fi
4744cfc83b6cSPedro Giffuni   fi
4745cfc83b6cSPedro Giffunielse
4746cfc83b6cSPedro Giffuni   ENABLE_NSS_MODULE="NO"
4747cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
4748cfc83b6cSPedro Giffunifi
4749cfc83b6cSPedro Giffuni
4750cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_NSS_MODULE)
4751cfc83b6cSPedro GiffuniAC_SUBST(MOZILLABUILD)
4752cfc83b6cSPedro GiffuniAC_SUBST(MOZ_INC)
4753cfc83b6cSPedro Giffuni
4754cfc83b6cSPedro Giffunidnl ===================================================================
4755cfc83b6cSPedro Giffunidnl Check for system sane
4756cfc83b6cSPedro Giffunidnl ===================================================================
4757cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which sane header to use])
4758cfc83b6cSPedro Giffuniif test -n "$with_system_sane_header" -o -n "$with_system_headers" && \
4759cfc83b6cSPedro Giffuni    test "$with_system_sane_header" != "no"; then
4760cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4761cfc83b6cSPedro Giffuni   SYSTEM_SANE_HEADER=YES
4762cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(sane/sane.h, [],
4763cfc83b6cSPedro Giffuni      [AC_MSG_ERROR(sane not found. install sane)], [])
4764cfc83b6cSPedro Giffunielse
4765cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4766cfc83b6cSPedro Giffuni   SYSTEM_SANE_HEADER=NO
4767cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE SANE"
4768cfc83b6cSPedro Giffunifi
4769cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_SANE_HEADER)
4770cfc83b6cSPedro Giffuni
4771cfc83b6cSPedro Giffunidnl ===================================================================
4772cfc83b6cSPedro Giffunidnl Check for system icu
4773cfc83b6cSPedro Giffunidnl ===================================================================
4774cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which icu to use])
4775cfc83b6cSPedro Giffuniif test -n "$with_system_icu" -o -n "$with_system_libs" && \
4776cfc83b6cSPedro Giffuni    test "$with_system_icu" != "no"; then
4777cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4778cfc83b6cSPedro Giffuni   SYSTEM_ICU=YES
4779cfc83b6cSPedro Giffuni   AC_LANG_PUSH([C++])
4780cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for unicode/rbbi.h])
4781cfc83b6cSPedro Giffuni   AC_TRY_CPP(unicode/rbbi.h, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([icu headers not found.]))
4782cfc83b6cSPedro Giffuni   AC_LANG_POP([C++])
4783cfc83b6cSPedro Giffuni   AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
4784cfc83b6cSPedro Giffuni   if test -z "$SYSTEM_GENBRK"; then
4785cfc83b6cSPedro Giffuni      AC_MSG_ERROR([\"genbrk\" not found in \$PATH, install the icu development tool \"genbrk"\])
4786cfc83b6cSPedro Giffuni   fi
4787cfc83b6cSPedro Giffuni   AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin])
4788cfc83b6cSPedro Giffuni   if test -z "$SYSTEM_GENCCODE"; then
4789cfc83b6cSPedro Giffuni      AC_MSG_ERROR([\"genccode\" not found in \$PATH, install the icu development tool \"genccode"\])
4790cfc83b6cSPedro Giffuni   fi
4791cfc83b6cSPedro Giffuni   AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin])
4792cfc83b6cSPedro Giffuni   if test -z "$SYSTEM_GENCMN"; then
4793cfc83b6cSPedro Giffuni      AC_MSG_ERROR([\"gencmn\" not found in \$PATH, install the icu development tool \"gencmn"\])
4794cfc83b6cSPedro Giffuni   fi
4795cfc83b6cSPedro Giffuni
4796cfc83b6cSPedro Giffuni   AC_PATH_PROG( ICUCONFIG, icu-config)
4797cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([ICU version])
4798cfc83b6cSPedro Giffuni   if test "$_os" = "OS2"; then
4799cfc83b6cSPedro Giffuni      ICU_MAJOR=4
4800cfc83b6cSPedro Giffuni   else
4801cfc83b6cSPedro Giffuni      ICU_VERSION=`$ICUCONFIG --version`
4802cfc83b6cSPedro Giffuni      ICU_MAJOR=`$ICUCONFIG --version | cut -d"." -f1`
4803cfc83b6cSPedro Giffuni      ICU_MINOR=`$ICUCONFIG --version | cut -d"." -f2`
4804cfc83b6cSPedro Giffuni      ICU_MICRO=`$ICUCONFIG --version | cut -d"." -f3`
4805cfc83b6cSPedro Giffuni   fi
4806cfc83b6cSPedro Giffuni
4807cfc83b6cSPedro Giffuni   if test "$ICU_MAJOR" -ge "4"; then
4808cfc83b6cSPedro Giffuni      AC_MSG_RESULT([OK])
4809cfc83b6cSPedro Giffuni   else
4810cfc83b6cSPedro Giffuni      AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
4811cfc83b6cSPedro Giffuni   fi
4812cfc83b6cSPedro Giffuni
4813cfc83b6cSPedro Giffunielse
4814cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
4815cfc83b6cSPedro Giffuni    SYSTEM_ICU=NO
4816cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE ICU"
4817cfc83b6cSPedro Giffunifi
4818cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_ICU)
4819cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GENBRK)
4820cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GENCCODE)
4821cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GENCMN)
4822cfc83b6cSPedro GiffuniAC_SUBST(ICU_MAJOR)
4823cfc83b6cSPedro GiffuniAC_SUBST(ICU_MINOR)
4824cfc83b6cSPedro GiffuniAC_SUBST(ICU_MICRO)
4825cfc83b6cSPedro Giffuni
4826cfc83b6cSPedro Giffunidnl ===================================================================
4827cfc83b6cSPedro Giffunidnl Graphite
4828cfc83b6cSPedro Giffunidnl ===================================================================
4829cfc83b6cSPedro Giffuni
4830cfc83b6cSPedro GiffuniENABLE_GRAPHITE="FALSE"
4831cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable graphite support])
4832cfc83b6cSPedro Giffuniif test "x$enable_graphite" = "xyes" -a \( "$_os" = "WINNT" -o "$_os" = "Linux" -o "$_os" = "FreeBSD" \) ; then
4833cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
4834cfc83b6cSPedro Giffuni    ENABLE_GRAPHITE="TRUE"
4835cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([which graphite to use])
4836cfc83b6cSPedro Giffuni    if test -n "$with_system_graphite" -o -n "$with_system_libs" && \
4837cfc83b6cSPedro Giffuni        test "$with_system_graphite" != "no"; then
4838cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
4839cfc83b6cSPedro Giffuni        SYSTEM_GRAPHITE=YES
4840cfc83b6cSPedro Giffuni        PKG_CHECK_MODULES( GRAPHITE, silgraphite )
4841cfc83b6cSPedro Giffuni    else
4842cfc83b6cSPedro Giffuni        AC_MSG_RESULT([internal])
4843cfc83b6cSPedro Giffuni        SYSTEM_GRAPHITE=NO
4844cfc83b6cSPedro Giffuni        BUILD_TYPE="$BUILD_TYPE GRAPHITE"
4845cfc83b6cSPedro Giffuni    fi
4846cfc83b6cSPedro Giffunielse
4847cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
4848cfc83b6cSPedro Giffuni   ENABLE_GRAPHITE="FALSE"
4849cfc83b6cSPedro Giffunifi
4850cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_GRAPHITE)
4851cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GRAPHITE)
4852cfc83b6cSPedro GiffuniAC_SUBST(GRAPHITE_LIBS)
4853cfc83b6cSPedro GiffuniAC_SUBST(GRAPHITE_CFLAGS)
4854cfc83b6cSPedro Giffuni
4855cfc83b6cSPedro Giffuni
4856cfc83b6cSPedro Giffunidnl ===================================================================
4857cfc83b6cSPedro Giffunidnl Checks for libraries.
4858cfc83b6cSPedro Giffunidnl ===================================================================
4859cfc83b6cSPedro Giffunidnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
4860cfc83b6cSPedro Giffunidnl See if we have the AppKit framework for building with Quartz graphics.
4861cfc83b6cSPedro Giffuni
4862cfc83b6cSPedro Giffuniif test  "$_os" = "Darwin"; then
4863cfc83b6cSPedro Giffuni   if test "x$with_x" = "xyes"; then
4864cfc83b6cSPedro Giffuni      AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
4865cfc83b6cSPedro Giffuni   else
4866cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
4867cfc83b6cSPedro Giffuni      if test -d "/System/Library/Frameworks/AppKit.framework/"; then
4868cfc83b6cSPedro Giffuni         AC_MSG_RESULT([yes])
4869cfc83b6cSPedro Giffuni         x_includes="no_x_includes"
4870cfc83b6cSPedro Giffuni         x_libraries="no_x_libraries"
4871cfc83b6cSPedro Giffuni         dnl disable some things used on other Unix versions but not on the aqua build
4872cfc83b6cSPedro Giffuni         enable_gtk=no
4873cfc83b6cSPedro Giffuni         enable_cups=no
4874cfc83b6cSPedro Giffuni         ENABLE_CUPS=""
4875cfc83b6cSPedro Giffuni         AC_SUBST(ENABLE_CUPS)
4876cfc83b6cSPedro Giffuni      else
4877cfc83b6cSPedro Giffuni         AC_MSG_ERROR([No AppKit.framewrok found])
4878cfc83b6cSPedro Giffuni      fi
4879cfc83b6cSPedro Giffuni   fi
4880cfc83b6cSPedro Giffunifi
4881cfc83b6cSPedro Giffuni
4882cfc83b6cSPedro Giffunidnl ***************************************
4883cfc83b6cSPedro Giffunidnl testing for X libraries and includes...
4884cfc83b6cSPedro Giffunidnl ***************************************
4885cfc83b6cSPedro Giffuniif test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
4886cfc83b6cSPedro Giffuni   echo "Do Nothing for _os = Darwin"
4887cfc83b6cSPedro Giffuni   dnl Mac OS X using Aqua graphics. Don't check for X11.
4888cfc83b6cSPedro Giffuni   :
4889cfc83b6cSPedro Giffunielif test "$_os" = "OS2" ; then
4890cfc83b6cSPedro Giffuni   echo "Do Nothing for _os = OS2. Don't check for X11."
4891cfc83b6cSPedro Giffuni   dnl OS/2 uses native graphics. Don't check for X11.
4892cfc83b6cSPedro Giffuni   :
4893cfc83b6cSPedro Giffunielif test "$_os" != "WINNT" ; then
4894cfc83b6cSPedro Giffuni   AC_PATH_X
4895cfc83b6cSPedro Giffuni   AC_PATH_XTRA
4896cfc83b6cSPedro Giffuni   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4897cfc83b6cSPedro Giffuni
4898cfc83b6cSPedro Giffuni   if test "x$x_includes" = "x"; then
4899cfc83b6cSPedro Giffuni     x_includes="default_x_includes"
4900cfc83b6cSPedro Giffuni   fi
4901cfc83b6cSPedro Giffuni   if test "x$x_libraries" = "x"; then
4902cfc83b6cSPedro Giffuni     x_libraries="default_x_libraries"
4903cfc83b6cSPedro Giffuni   fi
4904cfc83b6cSPedro Giffuni   dnl The variables $x_libraries and $x_includes are set.
4905cfc83b6cSPedro Giffuni   if test -z "$x_libraries"; then
4906cfc83b6cSPedro Giffuni      AC_MSG_ERROR([No X libraries found]) # Exit
4907cfc83b6cSPedro Giffuni   fi
4908cfc83b6cSPedro Giffuni   if test -z "$x_includes"; then
4909cfc83b6cSPedro Giffuni      AC_MSG_ERROR([No X includes found]) # Exit
4910cfc83b6cSPedro Giffuni   fi
4911cfc83b6cSPedro Giffuni   CFLAGS=$X_CFLAGS
4912cfc83b6cSPedro Giffuni   LDFLAGS="$X_LDFLAGS $X_LIBS"
4913cfc83b6cSPedro Giffuni   AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
4914cfc83b6cSPedro Giffuni   dnl Check if the XauDisposeAuth symbol is provided by libXau.
4915cfc83b6cSPedro Giffuni   AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
4916cfc83b6cSPedro Giffunielse
4917cfc83b6cSPedro Giffuni   x_includes="no_x_includes"
4918cfc83b6cSPedro Giffuni   x_libraries="no_x_libraries"
4919cfc83b6cSPedro Giffunifi
4920cfc83b6cSPedro Giffuniif test -z "$x_includes"; then
4921cfc83b6cSPedro Giffuni   x_includes="no_x_includes"
4922cfc83b6cSPedro Giffunifi
4923cfc83b6cSPedro Giffuniif test -z "$x_libraries"; then
4924cfc83b6cSPedro Giffuni   x_libraries="no_x_libraries"
4925cfc83b6cSPedro Giffunifi
4926cfc83b6cSPedro Giffuniif test "$x_includes" = "default_x_includes"; then
4927cfc83b6cSPedro Giffuni   XINC="/usr/include"
4928cfc83b6cSPedro Giffunielse
4929cfc83b6cSPedro Giffuni   XINC="$x_includes"
4930cfc83b6cSPedro Giffunifi
4931cfc83b6cSPedro GiffuniAC_SUBST(XINC)
4932cfc83b6cSPedro Giffuniif test "$x_libraries" = "default_x_libraries"; then
4933cfc83b6cSPedro Giffuni   XLIB=`$PKG_CONFIG --variable=libdir x11`
4934cfc83b6cSPedro Giffuni   if test "x$XLIB" = x; then
4935cfc83b6cSPedro Giffuni         XLIB="/usr/lib"
4936cfc83b6cSPedro Giffuni   fi
4937cfc83b6cSPedro Giffunielse
4938cfc83b6cSPedro Giffuni   XLIB="$x_libraries"
4939cfc83b6cSPedro Giffunifi
4940cfc83b6cSPedro GiffuniAC_SUBST(XLIB)
4941cfc83b6cSPedro GiffuniAC_SUBST(XAU_LIBS)
4942cfc83b6cSPedro Giffuni
4943cfc83b6cSPedro Giffunidnl ===================================================================
4944cfc83b6cSPedro Giffunidnl Check if fontconfig/fontconfig.h is available
4945cfc83b6cSPedro Giffunidnl ===================================================================
4946cfc83b6cSPedro Giffuniif test "$ENABLE_FONTCONFIG" = "TRUE" ; then
4947cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(fontconfig/fontconfig.h, [],
4948cfc83b6cSPedro Giffuni                    [AC_MSG_ERROR([fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?])], [])
4949cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([whether fontconfig is >= 2.2.0])
4950cfc83b6cSPedro Giffuni    AC_TRY_RUN([
4951cfc83b6cSPedro Giffuni#include <fontconfig/fontconfig.h>
4952cfc83b6cSPedro Giffuni
4953cfc83b6cSPedro Giffuniint main(int argc, char **argv) {
4954cfc83b6cSPedro Giffuni    if(FC_MAJOR > 2 || (FC_MAJOR == 2 && FC_MINOR >= 2)) return 0;
4955cfc83b6cSPedro Giffuni    else return 1;
4956cfc83b6cSPedro Giffuni}
4957cfc83b6cSPedro Giffuni], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, fontconfig >= 2.2.0 needed])])
4958cfc83b6cSPedro Giffunifi
4959cfc83b6cSPedro Giffuni
4960cfc83b6cSPedro Giffunidnl ===================================================================
4961cfc83b6cSPedro Giffunidnl Check for system Xrender
4962cfc83b6cSPedro Giffunidnl ===================================================================
4963cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to link to Xrender])
4964cfc83b6cSPedro Giffuniif test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then
4965cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
4966cfc83b6cSPedro Giffuni   XRENDER_LINK=YES
4967cfc83b6cSPedro Giffuni   with_system_xrender_headers=yes
4968cfc83b6cSPedro Giffunielse
4969cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no, dynamically open it])
4970cfc83b6cSPedro Giffuni   XRENDER_LINK=NO
4971cfc83b6cSPedro Giffunifi
4972cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which Xrender headers to use])
4973cfc83b6cSPedro Giffuniif test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \
4974cfc83b6cSPedro Giffuni    test "$with_system_xrender_headers" != "no"; then
4975cfc83b6cSPedro Giffuni   AC_MSG_RESULT([external])
4976cfc83b6cSPedro Giffuni   SYSTEM_XRENDER_HEADERS=YES
4977cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
4978cfc83b6cSPedro Giffuni      [AC_MSG_ERROR(Xrender not found. install X)], [])
4979cfc83b6cSPedro Giffunielse
4980cfc83b6cSPedro Giffuni   AC_MSG_RESULT([internal])
4981cfc83b6cSPedro Giffuni   SYSTEM_XRENDER_HEADERS=NO
4982cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
4983cfc83b6cSPedro Giffunifi
4984cfc83b6cSPedro Giffuniif test "$XRENDER_LINK" = "YES"; then
4985cfc83b6cSPedro Giffuni   AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
4986cfc83b6cSPedro Giffuni      [AC_MSG_ERROR(libXrender not found or functional)], [])
4987cfc83b6cSPedro Giffunifi
4988cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_XRENDER_HEADERS)
4989cfc83b6cSPedro GiffuniAC_SUBST(XRENDER_LINK)
4990cfc83b6cSPedro Giffuni
4991cfc83b6cSPedro Giffunidnl ===================================================================
4992cfc83b6cSPedro Giffunidnl Check for XRandr
4993cfc83b6cSPedro Giffunidnl ===================================================================
4994cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable RandR support])
4995cfc83b6cSPedro Giffuniif test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
4996cfc83b6cSPedro Giffuni   if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
4997cfc83b6cSPedro Giffuni      XRANDR_DLOPEN="TRUE"
4998cfc83b6cSPedro Giffuni      AC_MSG_RESULT([resorting to dlopen libXrandr at runtime])
4999cfc83b6cSPedro Giffuni   else
5000cfc83b6cSPedro Giffuni      XRANDR_DLOPEN="FALSE"
5001cfc83b6cSPedro Giffuni      PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
5002cfc83b6cSPedro Giffuni      if test "$ENABLE_RANDR" != "TRUE"; then
5003cfc83b6cSPedro Giffuni         AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
5004cfc83b6cSPedro Giffuni                        [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
5005cfc83b6cSPedro Giffuni         XRANDR_CFLAGS=" "
5006cfc83b6cSPedro Giffuni         AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
5007cfc83b6cSPedro Giffuni              [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
5008cfc83b6cSPedro Giffuni         XRANDR_LIBS="-lXrandr "
5009cfc83b6cSPedro Giffuni         ENABLE_RANDR="TRUE"
5010cfc83b6cSPedro Giffuni         AC_MSG_RESULT([enabling RandR support])
5011cfc83b6cSPedro Giffuni      fi
5012cfc83b6cSPedro Giffuni   fi
5013cfc83b6cSPedro Giffunielse
5014cfc83b6cSPedro Giffuni   ENABLE_RANDR=""
5015cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
5016cfc83b6cSPedro Giffunifi
5017cfc83b6cSPedro GiffuniAC_SUBST(XRANDR_DLOPEN)
5018cfc83b6cSPedro GiffuniAC_SUBST(XRANDR_CFLAGS)
5019cfc83b6cSPedro GiffuniAC_SUBST(XRANDR_LIBS)
5020cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_RANDR)
5021cfc83b6cSPedro Giffuni
5022cfc83b6cSPedro Giffunidnl ===================================================================
5023cfc83b6cSPedro Giffunidnl Check for system nss
5024cfc83b6cSPedro Giffunidnl ===================================================================
5025cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libnss to use])
5026cfc83b6cSPedro Giffuniif test -n "$with_system_nss" -o -n "$with_system_libs" && test "$with_system_nss" != "no"; then
5027cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
5028cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES( NSS, nss )
5029cfc83b6cSPedro Giffuni    SYSTEM_NSS=YES
5030cfc83b6cSPedro Giffunielse
5031cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
5032cfc83b6cSPedro Giffuni    SYSTEM_NSS=NO
5033cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE NSS"
5034cfc83b6cSPedro Giffunifi
5035cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_NSS)
5036cfc83b6cSPedro GiffuniAC_SUBST(NSS_CFLAGS)
5037cfc83b6cSPedro GiffuniAC_SUBST(NSS_LIBS)
5038cfc83b6cSPedro Giffuni
5039cfc83b6cSPedro Giffunidnl ===================================================================
5040cfc83b6cSPedro Giffunidnl Check for system openssl
5041cfc83b6cSPedro Giffunidnl ===================================================================
5042cfc83b6cSPedro Giffuniif test "$_os" = "Darwin" && test "$with_system_openssl" != "no"; then
5043cfc83b6cSPedro Giffuni   with_system_openssl=yes
5044cfc83b6cSPedro Giffunifi
5045cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libssl to use])
5046cfc83b6cSPedro Giffuniif test -n "$with_system_openssl" -o -n "$with_system_libs" && \
5047cfc83b6cSPedro Giffuni        test "$with_system_openssl" != "no"; then
5048cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
5049cfc83b6cSPedro Giffuni    # Mac OS builds should get out without extra stuff is the Mac porters'
5050cfc83b6cSPedro Giffuni    # wish. And pkg-config is although Xcode ships a .pc for openssl
5051cfc83b6cSPedro Giffuni    if test "$_os" = "Darwin" -o "$_os" = "FreeBSD"; then
5052cfc83b6cSPedro Giffuni        OPENSSL_CFLAGS=
5053cfc83b6cSPedro Giffuni        OPENSSL_LIBS="-lssl -lcrypto"
5054cfc83b6cSPedro Giffuni    else
5055cfc83b6cSPedro Giffuni        PKG_CHECK_MODULES( OPENSSL, openssl )
5056cfc83b6cSPedro Giffuni    fi
5057cfc83b6cSPedro Giffuni    SYSTEM_OPENSSL=YES
5058cfc83b6cSPedro Giffunielse
5059cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
5060cfc83b6cSPedro Giffuni    SYSTEM_OPENSSL=NO
5061cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE OPENSSL"
5062cfc83b6cSPedro Giffunifi
5063cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_OPENSSL)
5064cfc83b6cSPedro GiffuniAC_SUBST(OPENSSL_CFLAGS)
5065cfc83b6cSPedro GiffuniAC_SUBST(OPENSSL_LIBS)
5066cfc83b6cSPedro Giffuni
5067cfc83b6cSPedro Giffunidnl ===================================================================
5068cfc83b6cSPedro Giffunidnl Check for system redland
5069cfc83b6cSPedro Giffunidnl ===================================================================
5070cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which redland library to use])
5071cfc83b6cSPedro Giffuniif test -n "$with_system_redland" -o -n "$with_system_libs" && \
5072cfc83b6cSPedro Giffuni    test "$with_system_redland" != "no"; then
5073cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
5074cfc83b6cSPedro Giffuni    SYSTEM_REDLAND=YES
5075cfc83b6cSPedro Giffuni   dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
5076cfc83b6cSPedro Giffuni   PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
5077cfc83b6cSPedro Giffunielse
5078cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
5079cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE REDLAND"
5080cfc83b6cSPedro Giffuni    SYSTEM_REDLAND=NO
5081cfc83b6cSPedro Giffunifi
5082cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_REDLAND)
5083cfc83b6cSPedro GiffuniAC_SUBST(REDLAND_CFLAGS)
5084cfc83b6cSPedro GiffuniAC_SUBST(REDLAND_LIBS)
5085cfc83b6cSPedro Giffuni
5086cfc83b6cSPedro Giffunidnl ===================================================================
5087cfc83b6cSPedro Giffunidnl Check for hunspell
5088cfc83b6cSPedro Giffunidnl ===================================================================
5089cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the Spell Checking component])
5090cfc83b6cSPedro GiffuniENABLE_HUNSPELL=
5091cfc83b6cSPedro Giffuni
5092cfc83b6cSPedro Giffuniif test "x$enable_hunspell" != "xno" ; then
5093cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([which libhunspell to use])
5094cfc83b6cSPedro Giffuni    if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \
5095cfc83b6cSPedro Giffuni        test "$with_system_hunspell" != "no"; then
5096cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
5097cfc83b6cSPedro Giffuni        SYSTEM_HUNSPELL=YES
5098cfc83b6cSPedro Giffuni        AC_LANG_PUSH([C++])
5099cfc83b6cSPedro Giffuni        PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
5100cfc83b6cSPedro Giffuni        if test "$HUNSPELL_PC" != "TRUE"; then
5101cfc83b6cSPedro Giffuni            AC_CHECK_HEADER(hunspell.hxx, [],
5102cfc83b6cSPedro Giffuni            [AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
5103cfc83b6cSPedro Giffuni                [AC_MSG_ERROR(hunspell headers not found.)], [])
5104cfc83b6cSPedro Giffuni             ], [])
5105cfc83b6cSPedro Giffuni            AC_CHECK_LIB(hunspell, main, [],
5106cfc83b6cSPedro Giffuni            [ AC_MSG_ERROR(hunspell library not found.) ], [])
5107cfc83b6cSPedro Giffuni            HUNSPELL_LIBS=-lhunspell
5108cfc83b6cSPedro Giffuni        fi
5109cfc83b6cSPedro Giffuni        AC_LANG_POP([C++])
5110cfc83b6cSPedro Giffuni    else
5111cfc83b6cSPedro Giffuni        AC_MSG_RESULT([internal])
5112cfc83b6cSPedro Giffuni        SYSTEM_HUNSPELL=NO
5113cfc83b6cSPedro Giffuni        BUILD_TYPE="$BUILD_TYPE HUNSPELL"
5114cfc83b6cSPedro Giffuni    fi
5115cfc83b6cSPedro Giffuni    ENABLE_HUNSPELL=YES
5116cfc83b6cSPedro Giffuni    AC_SUBST(SYSTEM_HUNSPELL)
5117cfc83b6cSPedro Giffuni    AC_SUBST(HUNSPELL_CFLAGS)
5118cfc83b6cSPedro Giffuni    AC_SUBST(HUNSPELL_LIBS)
5119cfc83b6cSPedro Giffunielse
5120cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
5121cfc83b6cSPedro Giffunifi
5122cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_HUNSPELL)
5123cfc83b6cSPedro Giffuni
5124cfc83b6cSPedro Giffunidnl ===================================================================
5125cfc83b6cSPedro Giffunidnl Checking for libhyphen
5126cfc83b6cSPedro Giffunidnl ===================================================================
5127cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the Hyphenator component])
5128cfc83b6cSPedro GiffuniENABLE_HYPHEN=
5129cfc83b6cSPedro Giffuni
5130cfc83b6cSPedro Giffuniif test "x$enable_hyphen" != "xno" ; then
5131cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([which libhyphen to use])
5132cfc83b6cSPedro Giffuni    if test -n "$with_system_hyphen" -o -n "$with_system_libs" && \
5133cfc83b6cSPedro Giffuni        test "$with_system_hyphen" != "no"; then
5134cfc83b6cSPedro Giffuni        AC_MSG_RESULT([external])
5135cfc83b6cSPedro Giffuni        SYSTEM_HYPH=YES
5136cfc83b6cSPedro Giffuni        AC_CHECK_HEADER(hyphen.h, [],
5137cfc83b6cSPedro Giffuni        [ AC_MSG_ERROR(libhyphen headers not found.)], [])
5138cfc83b6cSPedro Giffuni        AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
5139cfc83b6cSPedro Giffuni        [ AC_MSG_ERROR(no. You are sure you have libhyphen headers?)],
5140cfc83b6cSPedro Giffuni        [#include <hyphen.h>])
5141cfc83b6cSPedro Giffuni        AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
5142cfc83b6cSPedro Giffuni            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
5143cfc83b6cSPedro Giffuni        if test -z "$HYPHEN_LIB"; then
5144cfc83b6cSPedro Giffuni        AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
5145cfc83b6cSPedro Giffuni            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
5146cfc83b6cSPedro Giffuni        fi
5147cfc83b6cSPedro Giffuni        if test -z "$HYPHEN_LIB"; then
5148cfc83b6cSPedro Giffuni        AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
5149cfc83b6cSPedro Giffuni            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
5150cfc83b6cSPedro Giffuni        fi
5151cfc83b6cSPedro Giffuni    else
5152cfc83b6cSPedro Giffuni        AC_MSG_RESULT([internal])
5153cfc83b6cSPedro Giffuni        SYSTEM_HYPH=NO
5154cfc83b6cSPedro Giffuni        BUILD_TYPE="$BUILD_TYPE HYPHEN"
5155cfc83b6cSPedro Giffuni    fi
5156cfc83b6cSPedro Giffuni    ENABLE_HYPHEN=YES
5157cfc83b6cSPedro Giffuni    AC_SUBST(SYSTEM_HYPH)
5158cfc83b6cSPedro Giffuni    AC_SUBST(HYPHEN_LIB)
5159cfc83b6cSPedro Giffunielse
5160cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
5161cfc83b6cSPedro Giffunifi
5162cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_HYPHEN)
5163cfc83b6cSPedro Giffuni
5164cfc83b6cSPedro Giffuni
5165cfc83b6cSPedro Giffuni#dnl ===================================================================
5166cfc83b6cSPedro Giffuni#dnl Check whether we are allowed to bundle dictionaries and whether
5167cfc83b6cSPedro Giffuni#dnl hunspell is available.
5168cfc83b6cSPedro Giffuni#dnl ===================================================================
5169cfc83b6cSPedro GiffuniENABLE_BUNDLED_DICTIONARIES=
5170cfc83b6cSPedro Giffuniif test "x$enable_bundled_dictionaries" != "xno" -a "x$ENABLE_HUNSPELL" = "xYES"; then
5171cfc83b6cSPedro Giffuni   ENABLE_BUNDLED_DICTIONARIES=YES
5172cfc83b6cSPedro Giffunifi
5173cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_BUNDLED_DICTIONARIES)
5174cfc83b6cSPedro Giffuni
5175cfc83b6cSPedro Giffuni
5176cfc83b6cSPedro Giffuni
5177cfc83b6cSPedro Giffunidnl ===================================================================
5178cfc83b6cSPedro Giffunidnl Checking for mythes
5179cfc83b6cSPedro Giffunidnl ===================================================================
5180cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which mythes to use])
5181cfc83b6cSPedro Giffuniif test -n "$with_system_mythes" -o -n "$with_system_libs" && \
5182cfc83b6cSPedro Giffuni   test "$with_system_mythes" != "no"; then
5183cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
5184cfc83b6cSPedro Giffuni    SYSTEM_MYTHES=YES
5185cfc83b6cSPedro Giffuni    AC_LANG_PUSH([C++])
5186cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
5187cfc83b6cSPedro Giffuni    if test "$MYTHES_PKGCONFIG" = "no"; then
5188cfc83b6cSPedro Giffuni        AC_CHECK_HEADER(mythes.hxx, [],
5189cfc83b6cSPedro Giffuni            [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
5190cfc83b6cSPedro Giffuni        AC_CHECK_LIB(mythes-1.2, main, [],
5191cfc83b6cSPedro Giffuni            [ MYTHES_FOUND=no], [])
5192cfc83b6cSPedro Giffuni    if test "$MYTHES_FOUND" = "no"; then
5193cfc83b6cSPedro Giffuni            AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
5194cfc83b6cSPedro Giffuni                [ MYTHES_FOUND=no], [])
5195cfc83b6cSPedro Giffuni    fi
5196cfc83b6cSPedro Giffuni    if test "$MYTHES_FOUND" = "no"; then
5197cfc83b6cSPedro Giffuni        AC_MSG_ERROR([mythes library not found!.])
5198cfc83b6cSPedro Giffuni    fi
5199cfc83b6cSPedro Giffuni    fi
5200cfc83b6cSPedro Giffuni    AC_LANG_POP([C++])
5201cfc83b6cSPedro Giffunielse
5202cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
5203cfc83b6cSPedro Giffuni    SYSTEM_MYTHES=NO
5204cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE MYTHES"
5205cfc83b6cSPedro Giffunifi
5206cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_MYTHES)
5207cfc83b6cSPedro GiffuniAC_SUBST(MYTHES_CFLAGS)
5208cfc83b6cSPedro GiffuniAC_SUBST(MYTHES_LIBS)
5209cfc83b6cSPedro Giffuni
5210cfc83b6cSPedro Giffuni
5211cfc83b6cSPedro Giffunidnl ===================================================================
5212cfc83b6cSPedro Giffunidnl Checking for libtextcat
5213cfc83b6cSPedro Giffunidnl ===================================================================
5214cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libtextcat to use])
5215cfc83b6cSPedro Giffuniif test -n "$with_system_libtextcat" && test "$with_system_libtextcat" != "no"; then
5216cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
5217cfc83b6cSPedro Giffuni    SYSTEM_LIBTEXTCAT=YES
5218cfc83b6cSPedro Giffuni    AC_CHECK_HEADER(libtextcat/textcat.h, [],
5219cfc83b6cSPedro Giffuni       [ AC_MSG_ERROR(libtextcat headers not found.)], [])
5220cfc83b6cSPedro Giffuni    AC_CHECK_LIB(textcat, special_textcat_Init, ,
5221cfc83b6cSPedro Giffuni        [ AC_MSG_ERROR(libtextcat library not found or not suitable. libtextcat typically needs to be patched)], [])
5222cfc83b6cSPedro Giffunielse
5223cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
5224cfc83b6cSPedro Giffuni    SYSTEM_LIBTEXTCAT=NO
5225cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE LIBTEXTCAT"
5226cfc83b6cSPedro Giffunifi
5227cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBTEXTCAT)
5228cfc83b6cSPedro Giffuni
5229cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which libtextcat data directory to use])
5230cfc83b6cSPedro Giffuniif test -n "$with_system_libtextcat_data" && test "$with_system_libtextcat_data" != "no"; then
5231cfc83b6cSPedro Giffuni    if test "$with_system_libtextcat_data" = "yes"; then
5232cfc83b6cSPedro Giffuni        SYSTEM_LIBTEXTCAT_DATA=file:///usr/share/libtextcat
5233cfc83b6cSPedro Giffuni    else
5234cfc83b6cSPedro Giffuni        SYSTEM_LIBTEXTCAT_DATA=file://$with_system_libtextcat_data
5235cfc83b6cSPedro Giffuni    fi
5236cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$SYSTEM_LIBTEXTCAT_DATA])
5237cfc83b6cSPedro Giffunielse
5238cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
5239cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE LIBTEXTCATDATA"
5240cfc83b6cSPedro Giffunifi
5241cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBTEXTCAT_DATA)
5242cfc83b6cSPedro Giffuni
5243cfc83b6cSPedro Giffunidnl ***************************************
5244cfc83b6cSPedro Giffunidnl testing libc version for Linux...
5245cfc83b6cSPedro Giffunidnl ***************************************
5246cfc83b6cSPedro Giffuniif test "$_os" = "Linux"; then
5247cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether libc is >= 2.1.1])
5248cfc83b6cSPedro Giffuni   exec 6>/dev/null # no output
5249cfc83b6cSPedro Giffuni   AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
5250cfc83b6cSPedro Giffuni   exec 6>&1 # output on again
5251cfc83b6cSPedro Giffuni   if test "$HAVE_LIBC"; then
5252cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes])
5253cfc83b6cSPedro Giffuni   else
5254cfc83b6cSPedro Giffuni      AC_MSG_ERROR([no, upgrade libc])
5255cfc83b6cSPedro Giffuni   fi
5256cfc83b6cSPedro Giffunifi
5257cfc83b6cSPedro Giffuni
5258cfc83b6cSPedro Giffuniif test "$_os" != "WNT"; then
5259cfc83b6cSPedro Giffuni  AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
5260cfc83b6cSPedro Giffuni  AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
5261cfc83b6cSPedro Giffuni  if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
5262cfc83b6cSPedro Giffuni    SYSTEM_LIBC=YES
5263cfc83b6cSPedro Giffuni  fi
5264cfc83b6cSPedro Giffunielse
5265cfc83b6cSPedro Giffuni  HAVE_GETOPT=NO
5266cfc83b6cSPedro Giffuni  HAVE_READDIR_R=NO
5267cfc83b6cSPedro Giffuni  SYSTEM_LIBC=YES
5268cfc83b6cSPedro Giffunifi
5269cfc83b6cSPedro GiffuniAC_SUBST(HAVE_GETOPT)
5270cfc83b6cSPedro GiffuniAC_SUBST(HAVE_READDIR_R)
5271cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBC)
5272cfc83b6cSPedro Giffuni
5273cfc83b6cSPedro Giffunidnl =========================================
5274cfc83b6cSPedro Giffunidnl Check for the Microsoft Platform SDK.
5275cfc83b6cSPedro Giffunidnl =========================================
5276cfc83b6cSPedro Giffunidnl FIXME: I don't know yet if PSDK works with MinGW, keep it until I know better,
5277cfc83b6cSPedro Giffunidnl and add "-a \( "$WITH_MINGWIN" != "yes" \)" then
5278cfc83b6cSPedro Giffuniif test \( "$_os" = "WINNT" \) ; then
5279cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for PSDK files])
5280cfc83b6cSPedro Giffuni    if test -z "$with_psdk_home"; then
5281cfc83b6cSPedro Giffuni        # This first line will detect a February 2003 Microsoft Platform SDK
5282edd74ba5SDamjan Jovanovic        PSDK_HOME=`$OOWINTOOL --psdk-home`
5283cfc83b6cSPedro Giffuni        # But there might be also an April 2005 PSDK, unfortunately MS changed
5284cfc83b6cSPedro Giffuni        # the registry entry. (we prefer the old version!?)
5285cfc83b6cSPedro Giffuni        if test -z "$PSDK_HOME"; then
5286cfc83b6cSPedro Giffuni          PSDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
5287cfc83b6cSPedro Giffuni        fi
5288cfc83b6cSPedro Giffuni            # normalize if found
5289cfc83b6cSPedro Giffuni            if test -n "$PSDK_HOME"; then
5290cfc83b6cSPedro Giffuni              PSDK_HOME=`cygpath -d "$PSDK_HOME"`
5291cfc83b6cSPedro Giffuni              PSDK_HOME=`cygpath -u "$PSDK_HOME"`
5292cfc83b6cSPedro Giffuni           fi
5293cfc83b6cSPedro Giffuni    else
5294cfc83b6cSPedro Giffuni           PSDK_HOME=`cygpath -u "$with_psdk_home"`
5295cfc83b6cSPedro Giffuni    fi
5296cfc83b6cSPedro Giffuni        # Remove a possible trailing backslash
5297cfc83b6cSPedro Giffuni        PSDK_HOME=`echo $PSDK_HOME | $SED 's/\/$//'`
5298cfc83b6cSPedro Giffuni    # Problem with current PSDK (iz 49865)
5299cfc83b6cSPedro Giffuni    if test -f "$PSDK_HOME/Lib/libcp.lib"; then
5300cfc83b6cSPedro Giffuni        AC_MSG_ERROR([
5301cfc83b6cSPedro Giffuni
5302cfc83b6cSPedro GiffuniSome modules do not build correctly with MS Platform SDK - April 2005
5303cfc83b6cSPedro GiffuniEdition if the library ($PSDK_HOME/Lib/libcp.lib) is found.
5304cfc83b6cSPedro GiffuniRemove/rename/backup that file and restart configure. Details about this
5305cfc83b6cSPedro Giffuniproblem can be found in issue 49856.])
5306cfc83b6cSPedro Giffuni    fi
5307407bc2eeSMatthias Seidel# Windows SDK has different headers
5308cfc83b6cSPedro Giffuni    if test \( -f "$PSDK_HOME/Include/adoint.h" \) \
5309cfc83b6cSPedro Giffuni         -a \( -f "$PSDK_HOME/Include/SqlUcode.h" \) \
5310cfc83b6cSPedro Giffuni         -a \( -f "$PSDK_HOME/Include/usp10.h" \); then
5311cfc83b6cSPedro Giffuni        HAVE_PSDK_H="yes"
5312cfc83b6cSPedro Giffuni    else
5313cfc83b6cSPedro Giffuni        HAVE_PSDK_H="no"
5314cfc83b6cSPedro Giffuni    fi
5315cfc83b6cSPedro Giffuni    if test -f "$PSDK_HOME/lib/unicows.lib"; then
5316cfc83b6cSPedro Giffuni        HAVE_PSDK_LIB="yes"
5317cfc83b6cSPedro Giffuni    else
5318cfc83b6cSPedro Giffuni        HAVE_PSDK_LIB="no"
5319cfc83b6cSPedro Giffuni    fi
5320cfc83b6cSPedro Giffuni    if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
5321cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Some (all?) PSDK files not found, please check if all needed Platform SDKs
5322cfc83b6cSPedro Giffuniare installed or use --with-psdk-home .])
5323cfc83b6cSPedro Giffuni    fi
5324cfc83b6cSPedro Giffuni    if test ! -x "$PSDK_HOME/bin/msiinfo.exe" \
5325cfc83b6cSPedro Giffuni         -o ! -x "$PSDK_HOME/bin/msidb.exe" \
5326cfc83b6cSPedro Giffuni         -o ! -x "$PSDK_HOME/bin/uuidgen.exe" \
5327cfc83b6cSPedro Giffuni         -o ! -x "$PSDK_HOME/bin/msitran.exe" ; then
5328cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
5329cfc83b6cSPedro Giffuni    fi
5330cfc83b6cSPedro Giffuni    AC_MSG_RESULT([SDK files found ...)])
5331cfc83b6cSPedro Giffunidnl Check if this is the right SDK.
533228633775SPedro Giffuni    if echo $PSDK_HOME | $GREP "v6.1" >/dev/null 2>/dev/null; then
5333cfc83b6cSPedro Giffuni        AC_MSG_RESULT([Found Windows SDK 6.1 ($PSDK_HOME)])
5334cfc83b6cSPedro Giffuni        WINDOWS_VISTA_PSDK=TRUE
533528633775SPedro Giffuni    elif echo $PSDK_HOME | $GREP "v6.0" >/dev/null 2>/dev/null; then
5336cfc83b6cSPedro Giffuni        AC_MSG_RESULT([Found Windows SDK 6.0 ($PSDK_HOME)])
5337cfc83b6cSPedro Giffuni        WINDOWS_VISTA_PSDK=TRUE
533828633775SPedro Giffuni    elif echo $PSDK_HOME | $GREP "v7.0" >/dev/null 2>/dev/null; then
5339cfc83b6cSPedro Giffuni        AC_MSG_RESULT([Found Windows SDK 7.0 ($PSDK_HOME)])
5340cfc83b6cSPedro Giffuni        WINDOWS_VISTA_PSDK=TRUE
5341cfc83b6cSPedro Giffuni    else
5342cfc83b6cSPedro Giffuni        AC_MSG_RESULT([Found Legacy Windows Platform SDK ($PSDK_HOME)])
5343cfc83b6cSPedro Giffuni    fi
5344cfc83b6cSPedro Giffunifi
5345cfc83b6cSPedro GiffuniAC_SUBST(PSDK_HOME)
5346cfc83b6cSPedro GiffuniAC_SUBST(WINDOWS_VISTA_PSDK)
5347cfc83b6cSPedro Giffuni
5348cfc83b6cSPedro Giffunidnl =========================================
5349cfc83b6cSPedro Giffunidnl Check for the Microsoft DirectX SDK.
5350cfc83b6cSPedro Giffunidnl =========================================
5351cfc83b6cSPedro Giffuniif test \( "$_os" = "WINNT" \) ; then
5352cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for DirectX SDK files])
5353cfc83b6cSPedro Giffuni    if test -z "$with_directx_home"; then
5354cfc83b6cSPedro Giffuni        dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
5355cfc83b6cSPedro Giffuni        if test -n "$DXSDK_DIR"; then
5356cfc83b6cSPedro Giffuni            DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
5357cfc83b6cSPedro Giffuni            DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
5358cfc83b6cSPedro Giffuni        fi
5359cfc83b6cSPedro Giffuni        # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
5360cfc83b6cSPedro Giffuni        # the "DirectX SDK files not found" error later
5361cfc83b6cSPedro Giffuni    else
5362cfc83b6cSPedro Giffuni    DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
5363cfc83b6cSPedro Giffuni    fi
5364cfc83b6cSPedro Giffuni    # Remove a possible trailing backslash
5365cfc83b6cSPedro Giffuni    DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
5366cfc83b6cSPedro Giffuni
5367cfc83b6cSPedro Giffuni    if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" ; then
5368cfc83b6cSPedro Giffuni        HAVE_DIRECTDRAW_H="yes"
5369cfc83b6cSPedro Giffuni    else
5370cfc83b6cSPedro Giffuni        HAVE_DIRECTDRAW_H="no"
5371cfc83b6cSPedro Giffuni    fi
5372cfc83b6cSPedro Giffuni    if test -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
5373cfc83b6cSPedro Giffuni        HAVE_DIRECTXSDK_H="yes"
5374cfc83b6cSPedro Giffuni    else
5375cfc83b6cSPedro Giffuni        HAVE_DIRECTXSDK_H="no"
5376cfc83b6cSPedro Giffuni    fi
5377cfc83b6cSPedro Giffuni
5378cfc83b6cSPedro Giffuni    # MS changed the location of the libraries with dec 2004 directx sdk
5379cfc83b6cSPedro Giffuni    if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
5380cfc83b6cSPedro Giffuni        DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
5381cfc83b6cSPedro Giffuni    else
5382cfc83b6cSPedro Giffuni        DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
5383cfc83b6cSPedro Giffuni    fi
5384cfc83b6cSPedro Giffuni    if test -f "$DIRECTXSDK_LIB/ddraw.lib" ; then
5385cfc83b6cSPedro Giffuni        HAVE_DIRECTDRAW_LIB="yes"
5386cfc83b6cSPedro Giffuni    else
5387cfc83b6cSPedro Giffuni        HAVE_DIRECTDRAW_LIB="no"
5388cfc83b6cSPedro Giffuni    fi
5389cfc83b6cSPedro Giffuni    if test -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
5390cfc83b6cSPedro Giffuni        HAVE_DIRECTXSDK_LIB="yes"
5391cfc83b6cSPedro Giffuni    else
5392cfc83b6cSPedro Giffuni        HAVE_DIRECTXSDK_LIB="no"
5393cfc83b6cSPedro Giffuni    fi
5394cfc83b6cSPedro Giffuni
5395cfc83b6cSPedro Giffuni    if test "$HAVE_DIRECTDRAW_H" = "yes" -a "$HAVE_DIRECTDRAW_LIB" = "yes" ; then
5396cfc83b6cSPedro Giffuni       ENABLE_DIRECT_DRAW="TRUE"
5397cfc83b6cSPedro Giffuni    fi
5398cfc83b6cSPedro Giffuni    if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes" ; then
5399cfc83b6cSPedro Giffuni       HAVE_DIRECTXSDK="yes"
5400cfc83b6cSPedro Giffuni    else
5401cfc83b6cSPedro Giffuni       HAVE_DIRECTXSDK="no"
5402cfc83b6cSPedro Giffuni    fi
5403cfc83b6cSPedro Giffuni
5404cfc83b6cSPedro Giffuni    if test -n "$ENABLE_DIRECTX"; then
5405cfc83b6cSPedro Giffuni        if test "$HAVE_DIRECTDRAW" = "yes" -o "$HAVE_DIRECTXSDK" = "yes" ; then
5406cfc83b6cSPedro Giffuni            AC_MSG_RESULT([found])
5407cfc83b6cSPedro Giffuni        else
5408cfc83b6cSPedro Giffuni            AC_MSG_ERROR([DirectX SDK files not found, please use --with-directx-home or --disable-directx.])
5409cfc83b6cSPedro Giffuni        fi
5410cfc83b6cSPedro Giffuni    else
5411cfc83b6cSPedro Giffuni        DIRECTXSDK_HOME=""
5412cfc83b6cSPedro Giffuni        AC_MSG_RESULT([disabled])
5413cfc83b6cSPedro Giffuni    fi
5414cfc83b6cSPedro Giffunifi
5415cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_DIRECT_DRAW)
5416cfc83b6cSPedro GiffuniAC_SUBST(DIRECTXSDK_HOME)
5417cfc83b6cSPedro GiffuniAC_SUBST(DIRECTXSDK_LIB)
5418cfc83b6cSPedro Giffuni
5419cfc83b6cSPedro Giffuni
5420cfc83b6cSPedro Giffunidnl ============================================
5421cfc83b6cSPedro Giffunidnl Check for ATL and MFC
5422cfc83b6cSPedro Giffunidnl ============================================
5423cfc83b6cSPedro Giffuniif test \( "$_os" = "WINNT" \) ; then
5424cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for ATL and MFC])
5425cfc83b6cSPedro Giffuni    if test "$DISABLE_ATL" = "TRUE"; then
5426cfc83b6cSPedro Giffuni        AC_MSG_RESULT([ATL is disabled, nothing to check])
5427cfc83b6cSPedro Giffuni    else
5428cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([testing ATL/MFC libs and includes])
5429cfc83b6cSPedro Giffuni        if test -z "$with_atl_include_dir"; then
5430cfc83b6cSPedro Giffuni            ATL_INCLUDE=$COMPATH/atlmfc/include
5431cfc83b6cSPedro Giffuni        else
5432cfc83b6cSPedro Giffuni            ATL_INCLUDE=`cygpath -u "$with_atl_include_dir"`
5433cfc83b6cSPedro Giffuni        fi
5434cfc83b6cSPedro Giffuni        if test -z "$with_atl_lib_dir"; then
5435cfc83b6cSPedro Giffuni            ATL_LIB=$COMPATH/atlmfc/lib
5436cfc83b6cSPedro Giffuni        ATL_LIB_X64=$COMPATH/atlmfc/lib/amd64
5437cfc83b6cSPedro Giffuni        else
5438cfc83b6cSPedro Giffuni            ATL_LIB=`cygpath -u "$with_atl_lib_dir"`
5439cfc83b6cSPedro Giffuni            ATL_LIB_X64=$ATL_LIB/../amd64
5440cfc83b6cSPedro Giffuni        fi
5441cfc83b6cSPedro Giffuni        if test -z "$with_mfc_include_dir"; then
5442cfc83b6cSPedro Giffuni            MFC_INCLUDE=$COMPATH/atlmfc/include
5443cfc83b6cSPedro Giffuni        else
5444cfc83b6cSPedro Giffuni            MFC_INCLUDE=`cygpath -u "$with_mfc_include_dir"`
5445cfc83b6cSPedro Giffuni        fi
5446cfc83b6cSPedro Giffuni        if test -z "$with_mfc_lib_dir"; then
5447cfc83b6cSPedro Giffuni            MFC_LIB=$COMPATH/atlmfc/lib
5448cfc83b6cSPedro Giffuni        else
5449cfc83b6cSPedro Giffuni            MFC_LIB=`cygpath -u "$with_mfc_lib_dir"`
5450cfc83b6cSPedro Giffuni        fi
5451cfc83b6cSPedro Giffuni
5452cfc83b6cSPedro Giffuni        ATL_INCLUDE=`echo $ATL_INCLUDE | $SED 's/\/$//'`
5453cfc83b6cSPedro Giffuni        ATL_LIB=`echo $ATL_LIB | $SED 's/\/$//'`
5454cfc83b6cSPedro Giffuni        ATL_LIB_X64=`echo $ATL_LIB_X64 | $SED 's/\/$//'`
5455cfc83b6cSPedro Giffuni        MFC_INCLUDE=`echo $MFC_INCLUDE | $SED 's/\/$//'`
5456cfc83b6cSPedro Giffuni        MFC_LIB=`echo $MFC_LIB | $SED 's/\/$//'`
5457cfc83b6cSPedro Giffuni
5458cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([looking for atlbase.h in "$ATL_INCLUDE"])
5459cfc83b6cSPedro Giffuni        if test -f "$ATL_INCLUDE/atlbase.h"; then
5460cfc83b6cSPedro Giffuni            HAVE_ATL_H="yes"
5461cfc83b6cSPedro Giffuni        else
5462cfc83b6cSPedro Giffuni            HAVE_ATL_H="no"
5463cfc83b6cSPedro Giffuni        fi
5464cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([found atlbase.h in "$ATL_INCLUDE"? "$HAVE_ATL_H"])
5465cfc83b6cSPedro Giffuni
5466cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([looking for afx.h in "$MFC_INCLUDE"])
5467cfc83b6cSPedro Giffuni        if test -f "$MFC_INCLUDE/afx.h"; then
5468cfc83b6cSPedro Giffuni            HAVE_MFC_H="yes"
5469cfc83b6cSPedro Giffuni        else
5470cfc83b6cSPedro Giffuni            HAVE_MFC_H="no"
5471cfc83b6cSPedro Giffuni        fi
5472cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([found afx.h in "$MFC_INCLUDE"? "$HAVE_MFC_H"])
5473cfc83b6cSPedro Giffuni
5474cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([looking for atls.lib in "$ATL_LIB"])
5475cfc83b6cSPedro Giffuni        if test -f "$ATL_LIB/atls.lib"; then
5476cfc83b6cSPedro Giffuni            HAVE_ATL_LIB="yes"
5477cfc83b6cSPedro Giffuni            AC_MSG_NOTICE([looking for atlthunk.lib in "$ATL_LIB"])
5478cfc83b6cSPedro Giffuni            if test -f "$ATL_LIB/atlthunk.lib"; then
5479cfc83b6cSPedro Giffuni                HAVE_ATLTHUNK="YES"
5480cfc83b6cSPedro Giffuni            else
5481cfc83b6cSPedro Giffuni                HAVE_ATLTHUNK="NO"
5482cfc83b6cSPedro Giffuni            fi
5483cfc83b6cSPedro Giffuni            AC_MSG_NOTICE([found atlthunk.lib in "$ATL_LIB"? "$HAVE_ATLTHUNK"])
5484cfc83b6cSPedro Giffuni        else
5485cfc83b6cSPedro Giffuni            HAVE_ATL_LIB="no"
5486cfc83b6cSPedro Giffuni        fi
5487cfc83b6cSPedro Giffuni        AC_MSG_NOTICE([found atls.lib in "$ATL_LIB"? "$HAVE_ATL_LIB"])
5488cfc83b6cSPedro Giffuni
5489cfc83b6cSPedro Giffuni        dnl TODO check also MFC libraries, they seem to have different names
5490cfc83b6cSPedro Giffuni        dnl mfc42.lib mfc90.lib
5491cfc83b6cSPedro Giffuni        if test -d "$MFC_LIB"; then
5492cfc83b6cSPedro Giffuni            HAVE_MFC_LIB="yes"
5493cfc83b6cSPedro Giffuni        else
5494cfc83b6cSPedro Giffuni            HAVE_MFC_LIB="no"
5495cfc83b6cSPedro Giffuni        fi
5496cfc83b6cSPedro Giffuni
5497cfc83b6cSPedro Giffuni        if test "$HAVE_ATL_H" = "no" -o "$HAVE_MFC_H" = "no" -o "$HAVE_ATL_LIB" = "no" -o "$HAVE_MFC_LIB" = "no"; then
5498cfc83b6cSPedro Giffuni            ATL_INCLUDE=
5499cfc83b6cSPedro Giffuni            ATL_LIB=
5500cfc83b6cSPedro Giffuni            ATL_LIB_X64=
5501cfc83b6cSPedro Giffuni            MFC_INCLUDE=
5502cfc83b6cSPedro Giffuni            MFC_LIB=
5503cfc83b6cSPedro Giffuni            HAVE_ATL_LIB=
5504cfc83b6cSPedro Giffuni            dnl TODO shouldn't this be an error?
5505cfc83b6cSPedro Giffuni            DISABLE_ACTIVEX="TRUE"
5506cfc83b6cSPedro Giffuni            DISABLE_ATL="TRUE"
5507cfc83b6cSPedro Giffuni            AC_MSG_RESULT([ATL/MFC disabled])
5508cfc83b6cSPedro Giffuni        else
5509cfc83b6cSPedro Giffuni            ATL_INCLUDE=`cygpath -dm "$ATL_INCLUDE"`
5510cfc83b6cSPedro Giffuni            ATL_LIB=`cygpath -dm "$ATL_LIB"`
5511cfc83b6cSPedro Giffuni            ATL_LIB_X64=`cygpath -dm "$ATL_LIB_X64"`
5512cfc83b6cSPedro Giffuni            MFC_INCLUDE=`cygpath -dm "$MFC_INCLUDE"`
5513cfc83b6cSPedro Giffuni            MFC_LIB=`cygpath -dm "$MFC_LIB"`
5514cfc83b6cSPedro Giffuni            AC_MSG_RESULT([ATL/MFC enabled])
5515cfc83b6cSPedro Giffuni        fi
5516cfc83b6cSPedro Giffuni    fi
5517cfc83b6cSPedro Giffunifi
5518cfc83b6cSPedro GiffuniAC_SUBST(ATL_INCLUDE)
5519cfc83b6cSPedro GiffuniAC_SUBST(ATL_LIB)
5520cfc83b6cSPedro GiffuniAC_SUBST(ATL_LIB_X64)
5521cfc83b6cSPedro GiffuniAC_SUBST(HAVE_ATLTHUNK)
5522cfc83b6cSPedro GiffuniAC_SUBST(MFC_INCLUDE)
5523cfc83b6cSPedro GiffuniAC_SUBST(MFC_LIB)
5524cfc83b6cSPedro Giffuni
5525cfc83b6cSPedro Giffuni
5526cfc83b6cSPedro Giffunidnl ============================================
5527cfc83b6cSPedro Giffunidnl Check for Nullsoft Scriptable Install System
5528cfc83b6cSPedro Giffunidnl ============================================
5529cfc83b6cSPedro GiffuniNSIS_PATH=""
5530cfc83b6cSPedro Giffuniif test "$_os" = "WINNT" ; then
5531cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for NSIS])
5532cfc83b6cSPedro Giffuni    AC_PATH_PROG(NSIS_PATH, nsis.exe)
5533cfc83b6cSPedro Giffuni    if test -n "$NSIS_PATH"; then
5534cfc83b6cSPedro Giffuni        NSIS_PATH=`dirname "$NSIS_PATH"`
5535cfc83b6cSPedro Giffuni    fi
5536cfc83b6cSPedro Giffuni    if test -n "$with_nsis_path"; then
5537cfc83b6cSPedro Giffuni        with_nsis_path=`cygpath -u "$with_nsis_path"`
5538cfc83b6cSPedro Giffuni    fi
5539cfc83b6cSPedro Giffuni    if test -e "$with_nsis_path/nsis.exe"; then
5540cfc83b6cSPedro Giffuni        NSIS_PATH="$with_nsis_path"
5541cfc83b6cSPedro Giffuni    fi
5542edd74ba5SDamjan Jovanovic    nsistest=`$OOWINTOOL --nsis-dir`;
5543cfc83b6cSPedro Giffuni    if test -x "$nsistest/nsis.exe"; then
5544cfc83b6cSPedro Giffuni        NSIS_PATH="$nsistest"
5545cfc83b6cSPedro Giffuni    fi
5546cfc83b6cSPedro Giffuni    if test -z "$NSIS_PATH"; then
5547cfc83b6cSPedro Giffuni        AC_MSG_WARN([NSIS not found, no self contained installer will be build.])
5548cfc83b6cSPedro Giffuni        echo "NSIS not found, no self contained installer will be build." >> warn
5549cfc83b6cSPedro Giffuni    else
5550cfc83b6cSPedro Giffuni        NSIS_PATH=`cygpath -d "$NSIS_PATH"`
5551cfc83b6cSPedro Giffuni        NSIS_PATH=`cygpath -u "$NSIS_PATH"`
5552cfc83b6cSPedro Giffuni        AC_MSG_RESULT([found ($NSIS_PATH)])
5553b871de36Sarielch        AC_MSG_CHECKING([whether NSIS version is >= 3.*])
5554b871de36Sarielch        nsis_version_string=`"$NSIS_PATH/makensis.exe" /VERSION | $SED -e s/^v//i`
5555b871de36Sarielch        nsis_version_major=`echo $nsis_version_string | cut -d. -f1`
5556b871de36Sarielch        nsis_version_minor=`echo $nsis_version_string | cut -d. -f2`
5557b871de36Sarielch        if test "$nsis_version_major" -ge "3"; then
5558b871de36Sarielch            AC_MSG_RESULT([found NSIS $nsis_version_major.$nsis_version_minor >= 3.*])
5559b871de36Sarielch            AC_MSG_CHECKING([whether NSIS was compiled with Unicode support])
5560b871de36Sarielch            if echo `"$NSIS_PATH/makensis.exe" /HDRINFO` | $EGREP  "\bNSIS_UNICODE_MAKENSIS\b" 2>&1 >/dev/null; then
5561b871de36Sarielch                AC_MSG_RESULT([NSIS version compiled with Unicode support.])
5562b871de36Sarielch            else
5563b871de36Sarielch                NSIS_PATH=""
5564b871de36Sarielch                AC_MSG_WARN([NSIS version compiled without Unicode support, no self contained installer will be build.])
5565b871de36Sarielch            fi
5566b871de36Sarielch        else
5567b871de36Sarielch            NSIS_PATH=""
5568b871de36Sarielch            AC_MSG_WARN([NSIS version found is < 3.*, no self contained installer will be build.])
5569b871de36Sarielch        fi
5570cfc83b6cSPedro Giffuni    fi
5571cfc83b6cSPedro Giffunifi
5572cfc83b6cSPedro GiffuniAC_SUBST(NSIS_PATH)
5573cfc83b6cSPedro Giffuni
5574cfc83b6cSPedro Giffunidnl ***************************************
5575cfc83b6cSPedro Giffunidnl testing bison and flex exist
5576cfc83b6cSPedro Giffunidnl ***************************************
5577cfc83b6cSPedro GiffuniAC_PATH_PROG(BISON, bison)
5578cfc83b6cSPedro Giffuniif test -z "$BISON"; then
5579cfc83b6cSPedro Giffuni   AC_MSG_ERROR([no bison found in \$PATH, install bison])
5580cfc83b6cSPedro Giffunielse
5581cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([the bison version])
558228633775SPedro Giffuni   _bison_version=`$BISON --version | $GREP GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
5583cfc83b6cSPedro Giffuni    _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
5584cfc83b6cSPedro Giffuni    # Accept newer than 1.875 or older(equal) than 1.75
5585cfc83b6cSPedro Giffuni    if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
5586cfc83b6cSPedro Giffuni       if test "$_bison_version" = "1.875" ; then
5587cfc83b6cSPedro Giffuni          AC_MSG_WARN([suspect ($BISON $_bison_version)])
5588cfc83b6cSPedro Giffuni          echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
5589cfc83b6cSPedro Giffuni       else
5590cfc83b6cSPedro Giffuni          AC_MSG_RESULT([checked ($BISON $_bison_version)])
5591cfc83b6cSPedro Giffuni       fi
5592cfc83b6cSPedro Giffuni    else
5593cfc83b6cSPedro Giffuni       AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
5594cfc83b6cSPedro Giffuni    fi
5595cfc83b6cSPedro Giffunifi
5596cfc83b6cSPedro GiffuniAC_PATH_PROG(FLEX, flex)
5597cfc83b6cSPedro Giffuniif test -z "$FLEX"; then
5598cfc83b6cSPedro Giffuni   AC_MSG_ERROR([no flex found in \$PATH, install flex])
5599cfc83b6cSPedro Giffunifi
5600cfc83b6cSPedro Giffunidnl ***************************************
5601cfc83b6cSPedro Giffunidnl testing that patch exists
5602cfc83b6cSPedro Giffunidnl ***************************************
5603cfc83b6cSPedro GiffuniAC_PATH_PROG(PATCH, patch)
5604cfc83b6cSPedro Giffuniif test -z "$PATCH"; then
5605cfc83b6cSPedro Giffuni   AC_MSG_ERROR([\"patch\" not found in \$PATH, install the development tool named\"patch"\])
5606cfc83b6cSPedro Giffunifi
5607cfc83b6cSPedro Giffuni
5608cfc83b6cSPedro Giffunidnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
5609cfc83b6cSPedro Giffuniif test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
5610cfc83b6cSPedro Giffuni   if test -z "$with_gnu_patch"; then
5611cfc83b6cSPedro Giffuni      GNUPATCH=$PATCH
5612cfc83b6cSPedro Giffuni   else
5613cfc83b6cSPedro Giffuni      if test -x "$with_gnu_patch"; then
5614cfc83b6cSPedro Giffuni          GNUPATCH=$with_gnu_patch
5615cfc83b6cSPedro Giffuni      else
5616cfc83b6cSPedro Giffuni         AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
5617cfc83b6cSPedro Giffuni      fi
5618cfc83b6cSPedro Giffuni   fi
5619cfc83b6cSPedro Giffuni
5620cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
562128633775SPedro Giffuni   if $GNUPATCH --version | $GREP "Free Software Foundation" >/dev/null 2>/dev/null; then
5622cfc83b6cSPedro Giffuni       AC_MSG_RESULT([yes])
5623cfc83b6cSPedro Giffuni   else
5624cfc83b6cSPedro Giffuni      AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
5625cfc83b6cSPedro Giffuni   fi
5626cfc83b6cSPedro Giffunifi
5627cfc83b6cSPedro Giffuni
5628cfc83b6cSPedro Giffunidnl We also need to check for --with-gnu-cp
5629cfc83b6cSPedro Giffuni
5630cfc83b6cSPedro Giffuniif test -z "$with_gnu_cp"; then
5631cfc83b6cSPedro Giffuni   # check the place where the GNU stuff is hidden on Solaris...
5632cfc83b6cSPedro Giffuni   if test -x /usr/gnu/bin/cp; then
5633cfc83b6cSPedro Giffuni      GNUCP=/usr/gnu/bin/cp
5634cfc83b6cSPedro Giffuni   else
5635cfc83b6cSPedro Giffuni      AC_PATH_PROGS(GNUCP, gnucp cp)
5636cfc83b6cSPedro Giffuni   fi
5637cfc83b6cSPedro Giffuni   if test -z $GNUCP; then
5638cfc83b6cSPedro Giffuni      AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
5639cfc83b6cSPedro Giffuni   fi
5640cfc83b6cSPedro Giffunielse
5641cfc83b6cSPedro Giffuni   if test -x "$with_gnu_cp"; then
5642cfc83b6cSPedro Giffuni      GNUCP=$with_gnu_cp
5643cfc83b6cSPedro Giffuni   else
5644cfc83b6cSPedro Giffuni      AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
5645cfc83b6cSPedro Giffuni   fi
5646cfc83b6cSPedro Giffunifi
5647cfc83b6cSPedro Giffuni
5648cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
564928633775SPedro Giffuniif $GNUCP --version 2>/dev/null | $GREP "coreutils" >/dev/null 2>/dev/null; then
5650cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
5651cfc83b6cSPedro Giffunielse
5652cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
5653cfc83b6cSPedro Giffuni   GNUCP=''
5654cfc83b6cSPedro Giffunifi
5655cfc83b6cSPedro Giffuni
5656cfc83b6cSPedro Giffuniif test -z "$GNUCP"; then
5657cfc83b6cSPedro Giffuni   if test "$_os" = "SunOS"; then
5658cfc83b6cSPedro Giffuni      AC_MSG_ERROR([no, GNU cp from coreutils is needed. install or specify with --with-gnu-cp=/path/to/it])
5659cfc83b6cSPedro Giffuni   else
5660cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no GNU cp from coreutils found - using the system's cp command])
5661cfc83b6cSPedro Giffuni   fi
5662cfc83b6cSPedro Giffunifi
5663cfc83b6cSPedro Giffuni
5664cfc83b6cSPedro GiffuniAC_SUBST(GNUPATCH)
5665cfc83b6cSPedro GiffuniAC_SUBST(GNUCP)
5666cfc83b6cSPedro Giffuni
5667cfc83b6cSPedro Giffunidnl ***************************************
5668cfc83b6cSPedro Giffunidnl testing bash tools path on Windows
5669cfc83b6cSPedro Giffunidnl ***************************************
5670cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
5671cfc83b6cSPedro Giffuni    CYGWIN_PATH=""
5672cfc83b6cSPedro Giffuni    AC_PATH_PROG(CYGWIN_PATH, bash)
5673cfc83b6cSPedro Giffuni    CYGWIN_PATH=`dirname "$CYGWIN_PATH"`
5674cfc83b6cSPedro Giffunifi
5675cfc83b6cSPedro Giffuniif test -z "$CYGWIN_PATH"; then
5676cfc83b6cSPedro Giffuni   CYGWIN_PATH="NO_CYGWIN"
5677cfc83b6cSPedro Giffunifi
5678cfc83b6cSPedro GiffuniAC_SUBST(CYGWIN_PATH)
5679cfc83b6cSPedro Giffuni
5680cfc83b6cSPedro Giffunidnl ***************************************
5681cfc83b6cSPedro Giffunidnl testing ml.exe assembler path
5682cfc83b6cSPedro Giffunidnl ***************************************
5683cfc83b6cSPedro Giffuniif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
5684cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([ml.exe assembler path])
5685cfc83b6cSPedro Giffuni  if test -n "$with_asm_home"; then
5686cfc83b6cSPedro Giffuni    with_asm_home=`cygpath -u "$with_asm_home"`
5687cfc83b6cSPedro Giffuni  fi
5688cfc83b6cSPedro Giffuni  if test ! -x "$with_asm_home/ml.exe"; then
5689cfc83b6cSPedro Giffuni    AC_PATH_PROG(ML_EXE, ml.exe)
5690cfc83b6cSPedro Giffuni    if test -z "$ML_EXE"; then
5691cfc83b6cSPedro Giffuni      if test -x "$with_cl_home/bin/ml.exe"; then
5692cfc83b6cSPedro Giffuni        with_asm_home=$with_cl_home/bin
5693cfc83b6cSPedro Giffuni        AC_MSG_RESULT([found ($with_asm_home)])
5694cfc83b6cSPedro Giffuni      else
5695cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Configure did not find ml.exe assembler.])
5696cfc83b6cSPedro Giffuni      fi
5697cfc83b6cSPedro Giffuni    else
5698cfc83b6cSPedro Giffuni       with_asm_home="ASM_IN_PATH"
5699cfc83b6cSPedro Giffuni    fi
5700cfc83b6cSPedro Giffuni  fi
5701cfc83b6cSPedro Giffuni  AC_MSG_RESULT([$ASM_HOME])
5702cfc83b6cSPedro Giffunielse
5703cfc83b6cSPedro Giffuni  with_asm_home="NO_ASM_HOME"
5704cfc83b6cSPedro Giffunifi
5705cfc83b6cSPedro GiffuniASM_HOME="$with_asm_home"
5706cfc83b6cSPedro GiffuniAC_SUBST(ASM_HOME)
5707cfc83b6cSPedro Giffuni
5708ad35682bStruckmandnl ***************************************
5709ad35682bStruckmandnl testing nasm.exe assembler path
5710ad35682bStruckmandnl ***************************************
5711ad35682bStruckmanif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes" -a "$SYSTEM_OPENSSL" = "NO"; then
5712ad35682bStruckman  AC_MSG_CHECKING([nasm.exe assembler path])
5713ad35682bStruckman  if test -n "$with_nasm_home"; then
5714ad35682bStruckman    with_nasm_home=`cygpath -u "$with_nasm_home"`
5715ad35682bStruckman  fi
5716ad35682bStruckman  if test ! -x "$with_nasm_home/nasm.exe"; then
5717ad35682bStruckman    AC_PATH_PROG(NASM_EXE, nasm.exe)
5718ad35682bStruckman    if test -z "$NASM_EXE"; then
5719ad35682bStruckman      with_nasm_home="NO_NASM_HOME"
5720ad35682bStruckman    else
5721ad35682bStruckman      with_nasm_home="NASM_IN_PATH"
5722ad35682bStruckman    fi
5723ad35682bStruckman  fi
5724ad35682bStruckman  AC_MSG_RESULT([$NASM_HOME])
5725ad35682bStruckmanelse
5726ad35682bStruckman  with_nasm_home="NO_NASM_HOME"
5727ad35682bStruckmanfi
5728ad35682bStruckmanNASM_HOME="$with_nasm_home"
5729ad35682bStruckmanAC_SUBST(NASM_HOME)
5730ad35682bStruckman
5731cfc83b6cSPedro Giffunidnl ===================================================================
5732cfc83b6cSPedro Giffunidnl testing handle deprecated unzip switch
5733cfc83b6cSPedro Giffunidnl ===================================================================
5734cfc83b6cSPedro Giffuniif test -z "$with_zip_home"; then
5735cfc83b6cSPedro Giffuni    with_zip_home="$with_unzip_home"
5736cfc83b6cSPedro Giffunifi
5737cfc83b6cSPedro Giffunidnl ===================================================================
5738cfc83b6cSPedro Giffunidnl Zip will be found where you tell me to find it
5739cfc83b6cSPedro Giffunidnl ===================================================================
5740cfc83b6cSPedro Giffuniif test -n "$with_zip_home" ; then
5741cfc83b6cSPedro Giffuni    if test "$_os" = "WINNT"; then
5742cfc83b6cSPedro Giffuni        with_zip_home=`cygpath -u "$with_zip_home"`
5743cfc83b6cSPedro Giffuni    fi
5744cfc83b6cSPedro Giffuni    ZIP="$with_zip_home/zip"
5745cfc83b6cSPedro Giffuni    UNZIP="$with_zip_home/unzip"
5746cfc83b6cSPedro Giffuni    ZIP_HOME="$with_zip_home"
5747cfc83b6cSPedro Giffunielse
5748cfc83b6cSPedro Giffuni    AC_PATH_PROG(ZIP, zip)
5749cfc83b6cSPedro Giffuni    AC_PATH_PROG(UNZIP, unzip)
5750cfc83b6cSPedro Giffuni    ZIP_HOME=`dirname "$ZIP"`
5751cfc83b6cSPedro Giffunifi
5752cfc83b6cSPedro Giffunidnl ===================================================================
5753cfc83b6cSPedro Giffunidnl Zip must be available or else it is an error, all platforms
5754cfc83b6cSPedro Giffunidnl ===================================================================
5755cfc83b6cSPedro Giffuniif test -z "$ZIP" -o -z "$UNZIP"; then
5756cfc83b6cSPedro Giffuni    AC_MSG_ERROR([Zip/Unzip are required to build, please install or use --with-zip-home],,)
5757cfc83b6cSPedro Giffunifi
5758b63233d8Sdamjanif "$ZIP" -FS < /dev/null 2>&1 | $EGREP "no such option: S" > /dev/null; then
5759b63233d8Sdamjan    AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
5760b63233d8Sdamjanfi
5761cfc83b6cSPedro Giffuni
5762cfc83b6cSPedro Giffunidnl ===================================================================
5763cfc83b6cSPedro Giffunidnl Zip must be a specific type for different build types.
5764cfc83b6cSPedro Giffunidnl ===================================================================
5765cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
576628633775SPedro Giffuni    if test -n "`$ZIP -h | $GREP -i WinNT`" ; then
5767cfc83b6cSPedro GiffuniAC_MSG_ERROR([$ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe.])
5768cfc83b6cSPedro Giffuni    fi
5769cfc83b6cSPedro Giffunifi
5770cfc83b6cSPedro GiffuniAC_SUBST(ZIP_HOME)
5771cfc83b6cSPedro Giffuni
5772cfc83b6cSPedro Giffunidnl ===================================================================
5773cfc83b6cSPedro Giffunidnl Windows builds need dbghelp.dll in external/dbghelp/
5774cfc83b6cSPedro Giffunidnl ===================================================================
5775cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
5776cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for dbghelp.dll])
5777cfc83b6cSPedro Giffuni   if test -x ./external/dbghelp/dbghelp.dll; then
5778cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found and executable])
5779cfc83b6cSPedro Giffuni   else
5780cfc83b6cSPedro Giffuni      AC_MSG_ERROR([dbghelp.dll is missing in external/dbghelp/.
5781cfc83b6cSPedro GiffuniGet it from the Microsoft site and put it into external/dbghelp.
5782cfc83b6cSPedro Giffuni(Note: Microsoft seems to enjoy changing the exact location of this file. You
5783cfc83b6cSPedro Giffunimay have to search Microsoft's website.) Last time it was seen at:
5784cfc83b6cSPedro Giffuni<http://www.microsoft.com/downloads/release.asp?releaseid=30682>.])
5785cfc83b6cSPedro Giffuni   fi
5786cfc83b6cSPedro Giffunifi
5787cfc83b6cSPedro Giffuni
5788cfc83b6cSPedro Giffunidnl ===================================================================
5789cfc83b6cSPedro Giffunidnl Windows builds need vcredist_x*.exe in external/vcredist/
5790cfc83b6cSPedro Giffunidnl ===================================================================
5791cfc83b6cSPedro GiffuniWITH_VC_REDIST=""
5792cfc83b6cSPedro Giffuni
5793cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
5794cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for vcredist_x86.exe])
5795cfc83b6cSPedro Giffuni   if test -x ./external/vcredist/vcredist_x86.exe; then
5796cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found and executable])
5797cfc83b6cSPedro Giffuni   else
5798cfc83b6cSPedro Giffuni      AC_MSG_ERROR([ vcredist_x86.exe is missing in external/vcredist/.
5799cfc83b6cSPedro GiffuniGet it from the Microsoft site and put it into external/vcredist. You can try
5800cfc83b6cSPedro Giffunito download it from http://www.microsoft.com/download/en/search.aspx?q=redistributable%20package.])
5801cfc83b6cSPedro Giffuni   fi
5802cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for vcredist_x64.exe])
5803cfc83b6cSPedro Giffuni   if test -x ./external/vcredist/vcredist_x64.exe; then
5804cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found and executable])
5805cfc83b6cSPedro Giffuni   else
5806cfc83b6cSPedro Giffuni      AC_MSG_ERROR([ vcredist_x64.exe is missing in external/vcredist/.
5807cfc83b6cSPedro GiffuniGet it from the Microsoft site and put it into external/vcredist. You can try
5808cfc83b6cSPedro Giffunito download it from http://www.microsoft.com/download/en/search.aspx?q=redistributable%20package.])
5809cfc83b6cSPedro Giffuni   fi
5810cfc83b6cSPedro Giffuni   WITH_VC_REDIST=YES
5811cfc83b6cSPedro Giffuni   AC_SUBST(WITH_VC_REDIST)
5812cfc83b6cSPedro Giffunifi
5813cfc83b6cSPedro Giffuni
5814cfc83b6cSPedro Giffunidnl ===================================================================
5815cfc83b6cSPedro Giffunidnl Windows builds - use oowintool to copy CRT dlls and manifest
5816cfc83b6cSPedro Giffunidnl ===================================================================
5817cfc83b6cSPedro Giffuniif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
5818edd74ba5SDamjan Jovanovic       if $OOWINTOOL --msvc-copy-dlls ./external/msvcp ; then
5819cfc83b6cSPedro Giffuni          :
5820cfc83b6cSPedro Giffuni       else
5821cfc83b6cSPedro Giffuni          AC_MSG_ERROR([oowintool failed to copy CRT])
5822cfc83b6cSPedro Giffuni       fi
5823cfc83b6cSPedro Giffunifi
5824cfc83b6cSPedro Giffuni
5825cfc83b6cSPedro Giffunidnl ===================================================================
5826cfc83b6cSPedro Giffunidnl Windows builds need gdiplus.dll in external/gdiplus/
5827cfc83b6cSPedro Giffunidnl ===================================================================
5828cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
5829cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for gdiplus.dll])
5830cfc83b6cSPedro Giffuni   if test -x ./external/gdiplus/gdiplus.dll; then
5831cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found and executable])
5832cfc83b6cSPedro Giffuni   else
5833cfc83b6cSPedro Giffuni      AC_MSG_ERROR([gdiplus.dll is missing in external/gdiplus/.
5834cfc83b6cSPedro GiffuniGet it from the Microsoft site and put it into external/gdiplus.
5835cfc83b6cSPedro GiffuniYou may have to search Microsoft's website. Last time it was seen at:
5836cfc83b6cSPedro Giffuni<http://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en>.])
5837cfc83b6cSPedro Giffuni   fi
5838cfc83b6cSPedro Giffunifi
5839cfc83b6cSPedro Giffuni
5840cfc83b6cSPedro Giffunidnl ===================================================================
5841cfc83b6cSPedro Giffunidnl Windows builds need msvcr100.dll in external/msvcp100/
5842cfc83b6cSPedro Giffunidnl ===================================================================
5843cfc83b6cSPedro Giffuniif test "$_os" = "WINNT"; then
5844cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for msvcr100.dll])
5845cfc83b6cSPedro Giffuni   if test -x ./external/msvcp100/msvcr100.dll; then
5846cfc83b6cSPedro Giffuni      AC_MSG_RESULT([found and executable])
5847cfc83b6cSPedro Giffuni   else
5848cfc83b6cSPedro Giffuni      AC_MSG_ERROR([msvcr100.dll is missing in external/msvcp100/.
5849cfc83b6cSPedro GiffuniGet it from the Microsoft Visual C++ 2010 Redistributable Package (x86),
5850cfc83b6cSPedro Giffunifrom the Microsoft site and put it into external/msvcp100.
5851cfc83b6cSPedro GiffuniYou may have to search Microsoft's website. Last time it was seen at:
5852cfc83b6cSPedro Giffuni<http://www.microsoft.com/en-us/download/search.aspx?q=Microsoft+Visual+C%2b%2b+2010+Redistributable>.])
5853cfc83b6cSPedro Giffuni   fi
5854cfc83b6cSPedro Giffunifi
5855cfc83b6cSPedro Giffuni
5856cfc83b6cSPedro Giffunidnl ===================================================================
5857cfc83b6cSPedro Giffunidnl Test which vclplugs have to be built.
5858cfc83b6cSPedro Giffunidnl ===================================================================
5859cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which VCLplugs shall be built])
5860cfc83b6cSPedro GiffuniENABLE_GTK=""
5861cfc83b6cSPedro Giffuniif test "x$enable_gtk" = "xyes"; then
5862cfc83b6cSPedro Giffuni    ENABLE_GTK="TRUE"
5863cfc83b6cSPedro Giffuni    R="gtk"
5864cfc83b6cSPedro Giffunifi
5865cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_GTK)
5866cfc83b6cSPedro Giffuni
5867cfc83b6cSPedro GiffuniENABLE_KDE=""
5868cfc83b6cSPedro Giffuniif test "x$enable_kde" = "xyes"; then
5869cfc83b6cSPedro Giffuni    ENABLE_KDE="TRUE"
5870cfc83b6cSPedro Giffuni    R="$R kde"
5871cfc83b6cSPedro Giffunifi
5872cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_KDE)
5873cfc83b6cSPedro Giffuni
5874cfc83b6cSPedro GiffuniENABLE_KDE4=""
5875cfc83b6cSPedro Giffuniif test "x$enable_kde4" = "xyes"; then
5876cfc83b6cSPedro Giffuni    ENABLE_KDE4="TRUE"
5877cfc83b6cSPedro Giffuni    R="$R kde4"
5878cfc83b6cSPedro Giffunifi
5879cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_KDE4)
5880cfc83b6cSPedro Giffuni
5881cfc83b6cSPedro Giffuniif test -z "$R"; then
5882cfc83b6cSPedro Giffuni    AC_MSG_RESULT([none])
5883cfc83b6cSPedro Giffunielse
5884cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$R])
5885cfc83b6cSPedro Giffunifi
5886cfc83b6cSPedro Giffuni
5887cfc83b6cSPedro Giffunidnl ===================================================================
5888cfc83b6cSPedro Giffunidnl GCONF check
5889cfc83b6cSPedro Giffunidnl ===================================================================
5890cfc83b6cSPedro Giffuni
5891cfc83b6cSPedro GiffuniENABLE_GCONF=""
5892cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable GConf support])
5893cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then
5894cfc83b6cSPedro Giffuni    ENABLE_GCONF="TRUE"
5895cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
5896cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES( GCONF, gconf-2.0 )
5897cfc83b6cSPedro Giffunielse
5898cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
5899cfc83b6cSPedro Giffunifi
5900cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_GCONF)
5901cfc83b6cSPedro Giffuni
5902cfc83b6cSPedro Giffunidnl ===================================================================
5903cfc83b6cSPedro Giffunidnl Gnome VFS check
5904cfc83b6cSPedro Giffunidnl ===================================================================
5905cfc83b6cSPedro Giffuni
5906cfc83b6cSPedro GiffuniENABLE_GNOMEVFS=""
5907cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable GNOME VFS support])
5908cfc83b6cSPedro Giffuniif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then
5909cfc83b6cSPedro Giffuni    ENABLE_GNOMEVFS="TRUE"
5910cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
5911cfc83b6cSPedro Giffuni    PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
5912cfc83b6cSPedro Giffuni    if test "$ENABLE_GCONF" != "TRUE"; then
5913cfc83b6cSPedro Giffuni        PKG_CHECK_MODULES( GCONF, gconf-2.0 )
5914cfc83b6cSPedro Giffuni    fi
5915cfc83b6cSPedro Giffunielse
5916cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
5917cfc83b6cSPedro Giffunifi
5918cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_GNOMEVFS)
5919cfc83b6cSPedro Giffuni
5920cfc83b6cSPedro Giffunidnl ===================================================================
5921cfc83b6cSPedro Giffunidnl Check whether the gtk 2.0 libraries are available.
5922cfc83b6cSPedro Giffunidnl ===================================================================
5923cfc83b6cSPedro Giffuni
5924cfc83b6cSPedro GiffuniGTK_CFLAGS=""
5925cfc83b6cSPedro GiffuniGTK_LIBS=""
5926cfc83b6cSPedro GiffuniENABLE_SYSTRAY_GTK=""
5927cfc83b6cSPedro GiffuniENABLE_DBUS=""
5928cfc83b6cSPedro Giffuniif test  "$test_gtk" = "yes"; then
5929cfc83b6cSPedro Giffuni
5930cfc83b6cSPedro Giffuni   if test "$ENABLE_GTK" = "TRUE" ; then
5931cfc83b6cSPedro Giffuni      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]))
5932cfc83b6cSPedro Giffuni      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]))
5933cfc83b6cSPedro Giffuni      BUILD_TYPE="$BUILD_TYPE GTK"
5934cfc83b6cSPedro Giffuni
5935cfc83b6cSPedro Giffuni      if test "x$enable_systray" = "xyes"; then
5936cfc83b6cSPedro Giffuni         PKG_CHECK_MODULES(GTK_2_10,gtk+-2.0 >= 2.10.0,
5937cfc83b6cSPedro Giffuni                           [ENABLE_SYSTRAY_GTK="TRUE"
5938cfc83b6cSPedro Giffuni                            BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"],
5939cfc83b6cSPedro Giffuni                           [ENABLE_SYSTRAY_GTK=""])
5940cfc83b6cSPedro Giffuni      fi
5941cfc83b6cSPedro Giffuni
5942cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([whether to enable DBUS support])
5943cfc83b6cSPedro Giffuni      if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
5944cfc83b6cSPedro Giffuni          ENABLE_DBUS="TRUE"
5945cfc83b6cSPedro Giffuni          AC_MSG_RESULT([yes])
5946cfc83b6cSPedro Giffuni          PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
5947cfc83b6cSPedro Giffuni      else
5948cfc83b6cSPedro Giffuni          AC_MSG_RESULT([no])
5949cfc83b6cSPedro Giffuni      fi
5950cfc83b6cSPedro Giffuni
5951cfc83b6cSPedro Giffuni      AC_MSG_CHECKING([whether to enable GIO support])
5952cfc83b6cSPedro Giffuni      if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
5953cfc83b6cSPedro Giffuni          if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
5954cfc83b6cSPedro Giffuni             AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
5955cfc83b6cSPedro Giffuni          fi
5956cfc83b6cSPedro Giffuni          ENABLE_GIO="TRUE"
5957cfc83b6cSPedro Giffuni          AC_MSG_RESULT([yes])
5958cfc83b6cSPedro Giffuni          PKG_CHECK_MODULES( GIO, gio-2.0 )
5959cfc83b6cSPedro Giffuni      else
5960cfc83b6cSPedro Giffuni          AC_MSG_RESULT([no])
5961cfc83b6cSPedro Giffuni      fi
5962cfc83b6cSPedro Giffuni
5963cfc83b6cSPedro Giffuni   fi
5964cfc83b6cSPedro Giffuni
5965cfc83b6cSPedro Giffunifi
5966cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_GIO)
5967cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_DBUS)
5968cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_SYSTRAY_GTK)
5969cfc83b6cSPedro GiffuniAC_SUBST(GTK_CFLAGS)
5970cfc83b6cSPedro GiffuniAC_SUBST(GTK_LIBS)
5971cfc83b6cSPedro GiffuniAC_SUBST(GTHREAD_CFLAGS)
5972cfc83b6cSPedro GiffuniAC_SUBST(GTHREAD_LIBS)
5973cfc83b6cSPedro Giffuni
5974cfc83b6cSPedro Giffunidnl ===================================================================
5975cfc83b6cSPedro Giffunidnl Check whether the GStreamer libraries are available.
5976cfc83b6cSPedro Giffunidnl ===================================================================
5977cfc83b6cSPedro Giffuni
5978cfc83b6cSPedro GiffuniGSTREAMER_CFLAGS=""
5979cfc83b6cSPedro GiffuniGSTREAMER_LIBS=""
5980cfc83b6cSPedro GiffuniENABLE_GSTREAMER=""
5981cfc83b6cSPedro Giffuni
5982cfc83b6cSPedro Giffuniif test "$test_gstreamer" = "yes"; then
5983cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([whether to build the GStreamer media backend])
5984cfc83b6cSPedro Giffuni    if test "x$enable_gstreamer" != "xno" ; then
5985b6e71573SDamjan Jovanovic        PKG_CHECK_MODULES( GSTREAMER, gtk+-2.0 >= 2.4 gthread-2.0 gstreamer-1.0 gstreamer-video-1.0,,AC_MSG_ERROR([requirements to build the GStreamer media backend not met. Do not use --enable-gstreamer or install the missing packages]))
5986cfc83b6cSPedro Giffuni        ENABLE_GSTREAMER="TRUE"
5987cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes])
5988cfc83b6cSPedro Giffuni    else
5989cfc83b6cSPedro Giffuni        AC_MSG_RESULT([no])
5990cfc83b6cSPedro Giffuni    fi
5991cfc83b6cSPedro Giffunifi
5992cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_GSTREAMER)
5993cfc83b6cSPedro GiffuniAC_SUBST(GSTREAMER_CFLAGS)
5994cfc83b6cSPedro GiffuniAC_SUBST(GSTREAMER_LIBS)
5995cfc83b6cSPedro Giffuni
5996cfc83b6cSPedro Giffunidnl ===================================================================
5997cfc83b6cSPedro Giffunidnl Check the ARM target
5998cfc83b6cSPedro Giffunidnl ===================================================================
5999cfc83b6cSPedro Giffuni
6000a5232f55Spfgif echo "$build_cpu" | $GREP -q arm; then
6001cfc83b6cSPedro Giffuni    # default value
6002cfc83b6cSPedro Giffuni    ARM_TARGET=ARMV4T
6003cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([which ARM processor optimization to use])
6004cfc83b6cSPedro Giffuni    if test "$with_arm_target" -lt "6"; then
6005cfc83b6cSPedro Giffuni    ARM_TARGET=ARMV4T
6006cfc83b6cSPedro Giffuni    elif test "$with_arm_target" = "6"; then
6007cfc83b6cSPedro Giffuni    ARM_TARGET=ARMV6
6008cfc83b6cSPedro Giffuni    elif test "$with_arm_target" -gt "6"; then
6009cfc83b6cSPedro Giffuni    ARM_TARGET=ARMV7
6010cfc83b6cSPedro Giffuni    fi
6011cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$ARM_TARGET])
6012cfc83b6cSPedro Giffuni    AC_SUBST(ARM_TARGET)
6013cfc83b6cSPedro Giffunifi
6014cfc83b6cSPedro Giffuni
6015cfc83b6cSPedro Giffunidnl ===================================================================
6016cfc83b6cSPedro Giffunidnl Check whether the Cairo libraries are available.
6017cfc83b6cSPedro Giffunidnl ===================================================================
6018cfc83b6cSPedro Giffuni
6019cfc83b6cSPedro GiffuniENABLE_CAIRO=""
6020cfc83b6cSPedro GiffuniBUILD_PIXMAN=""
6021cfc83b6cSPedro GiffuniSYSTEM_CAIRO=""
6022cfc83b6cSPedro Giffuni
6023cfc83b6cSPedro Giffuniif test  "$test_cairo" = "yes"; then
6024cfc83b6cSPedro Giffuni
6025cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([whether to use cairo])
6026cfc83b6cSPedro Giffuni    if test "x$enable_cairo" != "xno" ; then
6027cfc83b6cSPedro Giffuni        ENABLE_CAIRO="TRUE"
6028cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
6029cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([which cairo to use])
6030cfc83b6cSPedro Giffuni        if test -n "$with_system_cairo" -o -n "$with_system_libs" && \
6031cfc83b6cSPedro Giffuni           test "$with_system_cairo" != "no"; then
6032cfc83b6cSPedro Giffuni           AC_MSG_RESULT([external])
6033cfc83b6cSPedro Giffuni           SYSTEM_CAIRO=YES
6034cfc83b6cSPedro Giffuni
6035cfc83b6cSPedro Giffuni           PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
6036cfc83b6cSPedro Giffuni       if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$ENABLE_FONTCONFIG" != "TRUE" ; then
6037cfc83b6cSPedro Giffuni          AC_MSG_ERROR([Cairo library requires fontconfig.])
6038cfc83b6cSPedro Giffuni       fi
6039cfc83b6cSPedro Giffuni           if test "$with_system_xrender_headers" = "yes"; then
6040cfc83b6cSPedro Giffuni              AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
6041cfc83b6cSPedro Giffuni              AC_TRY_RUN([
6042cfc83b6cSPedro Giffuni#include <X11/extensions/Xrender.h>
6043cfc83b6cSPedro Giffuni
6044cfc83b6cSPedro Giffuniint main(int argc, char **argv) {
6045cfc83b6cSPedro Giffuni#ifdef PictStandardA8
6046cfc83b6cSPedro Giffuni      return 0;
6047cfc83b6cSPedro Giffuni#else
6048cfc83b6cSPedro Giffuni      return 1;
6049cfc83b6cSPedro Giffuni#endif
6050cfc83b6cSPedro Giffuni}
6051cfc83b6cSPedro Giffuni               ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, X headers too old.])])
6052cfc83b6cSPedro Giffuni           fi
6053cfc83b6cSPedro Giffuni        else
6054cfc83b6cSPedro Giffuni           BUILD_TYPE="$BUILD_TYPE CAIRO"
6055cfc83b6cSPedro Giffuni       dnl === compiler fails on pixman with 64bit architectures...===
6056cfc83b6cSPedro Giffuni       if test "$build_cpu" != "x86_64"; then
6057cfc83b6cSPedro Giffuni          BUILD_PIXMAN=YES
6058cfc83b6cSPedro Giffuni       fi
6059cfc83b6cSPedro Giffuni           AC_MSG_RESULT([internal])
6060cfc83b6cSPedro Giffuni        fi
6061cfc83b6cSPedro Giffuni    else
6062cfc83b6cSPedro Giffuni       AC_MSG_RESULT([no])
6063cfc83b6cSPedro Giffuni    fi
6064cfc83b6cSPedro Giffunifi
6065cfc83b6cSPedro Giffuni
6066cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_CAIRO)
6067cfc83b6cSPedro GiffuniAC_SUBST(BUILD_PIXMAN)
6068cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_CAIRO)
6069cfc83b6cSPedro GiffuniAC_SUBST(CAIRO_CFLAGS)
6070cfc83b6cSPedro GiffuniAC_SUBST(CAIRO_LIBS)
6071cfc83b6cSPedro Giffuni
6072cfc83b6cSPedro GiffuniENABLE_CAIRO_CANVAS="FALSE"
6073cfc83b6cSPedro Giffuniif test "$enable_cairo_canvas" = "yes" -a "$ENABLE_CAIRO" = "TRUE" ; then
6074cfc83b6cSPedro Giffuni   ENABLE_CAIRO_CANVAS="TRUE"
6075cfc83b6cSPedro Giffunifi
6076cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_CAIRO_CANVAS)
6077cfc83b6cSPedro Giffuni
6078cfc83b6cSPedro Giffunidnl ===================================================================
6079cfc83b6cSPedro Giffunidnl Check whether the OpenGL libraries are available
6080cfc83b6cSPedro Giffunidnl ===================================================================
6081cfc83b6cSPedro Giffuni
6082cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the OpenGL Transitions component])
6083cfc83b6cSPedro GiffuniENABLE_OPENGL=
6084cfc83b6cSPedro Giffuni
6085cfc83b6cSPedro Giffuniif test "x$enable_opengl" != "xno" ; then
6086cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
6087cfc83b6cSPedro Giffuni   AC_CHECK_HEADER(GL/gl.h, [],
6088cfc83b6cSPedro Giffuni                   [AC_MSG_ERROR([OpenGL headers not found])], [])
6089cfc83b6cSPedro Giffuni   AC_CHECK_LIB(GL, main, [],
6090cfc83b6cSPedro Giffuni     [AC_MSG_ERROR(libGL not installed or functional)], [])
6091cfc83b6cSPedro Giffuni   AC_CHECK_LIB(GLU, main, [],
6092cfc83b6cSPedro Giffuni     [AC_MSG_ERROR(libGLU not installed or functional)], [])
6093cfc83b6cSPedro Giffuni   ENABLE_OPENGL=TRUE
6094cfc83b6cSPedro Giffunielse
6095cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6096cfc83b6cSPedro Giffunifi
6097cfc83b6cSPedro Giffuni
6098cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_OPENGL)
6099cfc83b6cSPedro Giffuni
6100cfc83b6cSPedro Giffuni
6101cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the PDF Import extension])
6102cfc83b6cSPedro Giffuniif test -n "$enable_pdfimport" -a "$enable_pdfimport" != "no"; then
6103cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6104cfc83b6cSPedro Giffuni  ENABLE_PDFIMPORT=YES
6105cfc83b6cSPedro Giffuni
6106cfc83b6cSPedro Giffuni  dnl ===================================================================
6107cfc83b6cSPedro Giffuni  dnl Check for system poppler
6108cfc83b6cSPedro Giffuni  dnl ===================================================================
6109cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([whether to use system pdf backend])
6110cfc83b6cSPedro Giffuni  if test -n "$with_system_poppler" -o -n "$with_system_libs" && \
6111cfc83b6cSPedro Giffuni       test "$with_system_poppler" != "no"; then
6112cfc83b6cSPedro Giffuni      AC_MSG_RESULT([external])
6113cfc83b6cSPedro Giffuni      SYSTEM_POPPLER=YES
6114cfc83b6cSPedro Giffuni      PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
6115cfc83b6cSPedro Giffuni  else
6116cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no])
6117cfc83b6cSPedro Giffuni      SYSTEM_POPPLER=NO
6118cfc83b6cSPedro Giffuni      ENABLE_PDFIMPORT=NO
6119cfc83b6cSPedro Giffuni  fi
6120cfc83b6cSPedro Giffunielse
6121cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6122cfc83b6cSPedro Giffuni   ENABLE_PDFIMPORT=NO
6123cfc83b6cSPedro Giffunifi
6124cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_PDFIMPORT)
6125cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_POPPLER)
6126cfc83b6cSPedro GiffuniAC_SUBST(POPPLER_CFLAGS)
6127cfc83b6cSPedro GiffuniAC_SUBST(POPPLER_LIBS)
6128cfc83b6cSPedro Giffuni
6129cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the Wiki Publisher extension])
6130cfc83b6cSPedro Giffuniif test -n "$enable_wiki_publisher" -a "$enable_wiki_publisher" != "no" && test  "$WITH_JAVA" != "no"; then
6131cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6132cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([for swext module])
6133cfc83b6cSPedro Giffuni  if test -d ./swext; then
6134cfc83b6cSPedro Giffuni   AC_MSG_RESULT([OK])
6135cfc83b6cSPedro Giffuni  else
6136cfc83b6cSPedro Giffuni   AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
6137cfc83b6cSPedro Giffuni  fi
6138cfc83b6cSPedro Giffuni  ENABLE_MEDIAWIKI=YES
6139cfc83b6cSPedro Giffuni  BUILD_TYPE="$BUILD_TYPE SWEXT"
6140cfc83b6cSPedro Giffunielse
6141cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6142cfc83b6cSPedro Giffuni  ENABLE_MEDIAWIKI=NO
6143cfc83b6cSPedro Giffunifi
6144cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_MEDIAWIKI)
6145cfc83b6cSPedro Giffuni
6146cfc83b6cSPedro Giffuniif test "$ENABLE_MEDIAWIKI" = "YES"; then
6147cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([which Servlet API Jar to use])
6148cfc83b6cSPedro Giffuni  if test -n "$with_system_servlet_api"; then
6149cfc83b6cSPedro Giffuni    AC_MSG_RESULT([external])
6150cfc83b6cSPedro Giffuni    SYSTEM_SERVLETAPI=YES
6151cfc83b6cSPedro Giffuni      if test -z "$SERVLETAPI_JAR"; then
6152cfc83b6cSPedro Giffuni    SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
6153cfc83b6cSPedro Giffuni      fi
6154cfc83b6cSPedro Giffuni      AC_CHECK_FILE($SERVLETAPI_JAR, [],
6155cfc83b6cSPedro Giffuni             [AC_MSG_ERROR(servlet-api.jar not found.)], [])
6156cfc83b6cSPedro Giffuni  else
6157cfc83b6cSPedro Giffuni    AC_MSG_RESULT([internal])
6158cfc83b6cSPedro Giffuni    SYSTEM_SERVLETAPI=NO
6159cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE TOMCAT"
6160cfc83b6cSPedro Giffuni  fi
6161cfc83b6cSPedro Giffunifi
6162cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_SERVLETAPI)
6163cfc83b6cSPedro GiffuniAC_SUBST(SERVLETAPI_JAR)
6164cfc83b6cSPedro Giffuni
6165cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build the Report Builder extension])
6166cfc83b6cSPedro Giffuniif test -n "$enable_report_builder" -a "$enable_report_builder" != "no" && test "$WITH_JAVA" != "no"; then
6167cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6168cfc83b6cSPedro Giffuni  ENABLE_REPORTBUILDER=YES
6169cfc83b6cSPedro Giffuni  SYSTEM_JFREEREPORT=YES
6170cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([for reportbuilder module])
6171cfc83b6cSPedro Giffuni  if test -d ./reportbuilder; then
6172cfc83b6cSPedro Giffuni    AC_MSG_RESULT([OK])
6173cfc83b6cSPedro Giffuni  else
6174cfc83b6cSPedro Giffuni    AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
6175cfc83b6cSPedro Giffuni  fi
6176cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([which jfreereport libs to use (for Report Builder extension)])
6177cfc83b6cSPedro Giffuni  AC_MSG_RESULT([external])
6178cfc83b6cSPedro Giffuni  if test -z $SAC_JAR; then
6179cfc83b6cSPedro Giffuni         SAC_JAR=/usr/share/java/sac.jar
6180cfc83b6cSPedro Giffuni  fi
6181cfc83b6cSPedro Giffuni  AC_CHECK_FILE($SAC_JAR, [],
6182cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(sac.jar not found.)], [])
6183cfc83b6cSPedro Giffuni
6184cfc83b6cSPedro Giffuni  if test -z $LIBXML_JAR; then
6185cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
6186cfc83b6cSPedro Giffuni      [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
6187cfc83b6cSPedro Giffuni      [
6188cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/libxml.jar,
6189cfc83b6cSPedro Giffuni          [ LIBXML_JAR=/usr/share/java/libxml.jar ],
6190cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libxml.jar replacement not found.)]
6191cfc83b6cSPedro Giffuni        )
6192cfc83b6cSPedro Giffuni      ]
6193cfc83b6cSPedro Giffuni    )
6194cfc83b6cSPedro Giffuni  else
6195cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBXML_JAR, [],
6196cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(libxml.jar not found.)], [])
6197cfc83b6cSPedro Giffuni  fi
6198cfc83b6cSPedro Giffuni
6199cfc83b6cSPedro Giffuni  if test -z $FLUTE_JAR; then
6200cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
6201cfc83b6cSPedro Giffuni      [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
6202cfc83b6cSPedro Giffuni      [
6203cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/flute.jar,
6204cfc83b6cSPedro Giffuni          [ FLUTE_JAR=/usr/share/java/flute.jar ],
6205cfc83b6cSPedro Giffuni          [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
6206cfc83b6cSPedro Giffuni        )
6207cfc83b6cSPedro Giffuni      ]
6208cfc83b6cSPedro Giffuni    )
6209cfc83b6cSPedro Giffuni  else
6210cfc83b6cSPedro Giffuni    AC_CHECK_FILE($FLUTE_JAR, [],
6211cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
6212cfc83b6cSPedro Giffuni  fi
6213cfc83b6cSPedro Giffuni
6214cfc83b6cSPedro Giffuni  if test -z $JFREEREPORT_JAR; then
6215cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
6216cfc83b6cSPedro Giffuni      [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
6217cfc83b6cSPedro Giffuni      [
6218cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
6219cfc83b6cSPedro Giffuni          [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
6220cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
6221cfc83b6cSPedro Giffuni        )
6222cfc83b6cSPedro Giffuni      ]
6223cfc83b6cSPedro Giffuni    )
6224cfc83b6cSPedro Giffuni  else
6225cfc83b6cSPedro Giffuni    AC_CHECK_FILE($JFREEREPORT_JAR, [],
6226cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(jfreereport.jar not found.)], [])
6227cfc83b6cSPedro Giffuni  fi
6228cfc83b6cSPedro Giffuni
6229cfc83b6cSPedro Giffuni  if test -z $LIBLAYOUT_JAR; then
6230cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
6231cfc83b6cSPedro Giffuni      [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
6232cfc83b6cSPedro Giffuni      [
6233cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/liblayout.jar,
6234cfc83b6cSPedro Giffuni          [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
6235cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(liblayout.jar replacement not found.)]
6236cfc83b6cSPedro Giffuni        )
6237cfc83b6cSPedro Giffuni      ]
6238cfc83b6cSPedro Giffuni    )
6239cfc83b6cSPedro Giffuni  else
6240cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBLAYOUT_JAR, [],
6241cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(liblayout.jar not found.)], [])
6242cfc83b6cSPedro Giffuni  fi
6243cfc83b6cSPedro Giffuni
6244cfc83b6cSPedro Giffuni  if test -z $LIBLOADER_JAR; then
6245cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
6246cfc83b6cSPedro Giffuni      [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
6247cfc83b6cSPedro Giffuni      [
6248cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/libloader.jar,
6249cfc83b6cSPedro Giffuni          [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
6250cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libloader.jar replacement not found.)]
6251cfc83b6cSPedro Giffuni        )
6252cfc83b6cSPedro Giffuni      ]
6253cfc83b6cSPedro Giffuni    )
6254cfc83b6cSPedro Giffuni  else
6255cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBLOADER_JAR, [],
6256cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(libloader.jar not found.)], [])
6257cfc83b6cSPedro Giffuni  fi
6258cfc83b6cSPedro Giffuni
6259cfc83b6cSPedro Giffuni  if test -z $LIBFORMULA_JAR; then
6260cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
6261cfc83b6cSPedro Giffuni      [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
6262cfc83b6cSPedro Giffuni      [
6263cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/libformula.jar,
6264cfc83b6cSPedro Giffuni          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
6265cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libformula.jar replacement not found.)]
6266cfc83b6cSPedro Giffuni        )
6267cfc83b6cSPedro Giffuni      ]
6268cfc83b6cSPedro Giffuni    )
6269cfc83b6cSPedro Giffuni  else
6270cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBFORMULA_JAR, [],
6271cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(libformula.jar not found.)], [])
6272cfc83b6cSPedro Giffuni  fi
6273cfc83b6cSPedro Giffuni
6274cfc83b6cSPedro Giffuni  if test -z $LIBREPOSITORY_JAR; then
6275cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
6276cfc83b6cSPedro Giffuni      [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
6277cfc83b6cSPedro Giffuni      [
6278cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/librepository.jar,
6279cfc83b6cSPedro Giffuni          [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
6280cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(librepository.jar replacement not found.)]
6281cfc83b6cSPedro Giffuni        )
6282cfc83b6cSPedro Giffuni      ]
6283cfc83b6cSPedro Giffuni    )
6284cfc83b6cSPedro Giffuni  else
6285cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
6286cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(librepository.jar not found.)], [])
6287cfc83b6cSPedro Giffuni  fi
6288cfc83b6cSPedro Giffuni
6289cfc83b6cSPedro Giffuni  if test -z $LIBFONTS_JAR; then
6290cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
6291cfc83b6cSPedro Giffuni      [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
6292cfc83b6cSPedro Giffuni      [
6293cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/libfonts.jar,
6294cfc83b6cSPedro Giffuni          [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
6295cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libfonts.jar replacement not found.)]
6296cfc83b6cSPedro Giffuni        )
6297cfc83b6cSPedro Giffuni      ]
6298cfc83b6cSPedro Giffuni    )
6299cfc83b6cSPedro Giffuni  else
6300cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBFONTS_JAR, [],
6301cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(libfonts.jar not found.)], [])
6302cfc83b6cSPedro Giffuni  fi
6303cfc83b6cSPedro Giffuni
6304cfc83b6cSPedro Giffuni  if test -z $LIBSERIALIZER_JAR; then
6305cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
6306cfc83b6cSPedro Giffuni      [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
6307cfc83b6cSPedro Giffuni      [
6308cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/libserializer.jar,
6309cfc83b6cSPedro Giffuni          [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
6310cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libserializer.jar replacement not found.)]
6311cfc83b6cSPedro Giffuni        )
6312cfc83b6cSPedro Giffuni      ]
6313cfc83b6cSPedro Giffuni    )
6314cfc83b6cSPedro Giffuni  else
6315cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
6316cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(libserializer.jar not found.)], [])
6317cfc83b6cSPedro Giffuni  fi
6318cfc83b6cSPedro Giffuni
6319cfc83b6cSPedro Giffuni
6320cfc83b6cSPedro Giffuni  if test -z $LIBBASE_JAR; then
6321cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
6322cfc83b6cSPedro Giffuni      [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
6323cfc83b6cSPedro Giffuni      [
6324cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/libbase.jar,
6325cfc83b6cSPedro Giffuni          [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
6326cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(libbase.jar replacement not found.)]
6327cfc83b6cSPedro Giffuni        )
6328cfc83b6cSPedro Giffuni      ]
6329cfc83b6cSPedro Giffuni    )
6330cfc83b6cSPedro Giffuni  else
6331cfc83b6cSPedro Giffuni    AC_CHECK_FILE($LIBBASE_JAR, [],
6332cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(libbase.jar not found.)], [])
6333cfc83b6cSPedro Giffuni  fi
6334cfc83b6cSPedro Giffuni  BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
6335cfc83b6cSPedro Giffunielse
6336cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6337cfc83b6cSPedro Giffuni  ENABLE_REPORTBUILDER=NO
6338cfc83b6cSPedro Giffunifi
6339cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_REPORTBUILDER)
6340cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_JFREEREPORT)
6341cfc83b6cSPedro GiffuniAC_SUBST(SAC_JAR)
6342cfc83b6cSPedro GiffuniAC_SUBST(LIBXML_JAR)
6343cfc83b6cSPedro GiffuniAC_SUBST(FLUTE_JAR)
6344cfc83b6cSPedro GiffuniAC_SUBST(JFREEREPORT_JAR)
6345cfc83b6cSPedro GiffuniAC_SUBST(LIBBASE_JAR)
6346cfc83b6cSPedro GiffuniAC_SUBST(LIBLAYOUT_JAR)
6347cfc83b6cSPedro GiffuniAC_SUBST(LIBLOADER_JAR)
6348cfc83b6cSPedro GiffuniAC_SUBST(LIBFORMULA_JAR)
6349cfc83b6cSPedro GiffuniAC_SUBST(LIBREPOSITORY_JAR)
6350cfc83b6cSPedro GiffuniAC_SUBST(LIBFONTS_JAR)
6351cfc83b6cSPedro GiffuniAC_SUBST(LIBSERIALIZER_JAR)
6352cfc83b6cSPedro Giffuni
6353cfc83b6cSPedro Giffuni# this has to be here because both the wiki publisher and the SRB use
63543c5114b8SDamjan Jovanovic# commons-logging, while the non-optional PostgreSQL connector uses
63553c5114b8SDamjan Jovanovic# commons-lang.
6356cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which Apache commons-* libs to use])
6357cfc83b6cSPedro Giffuniif test "$with_system_apache_commons" = "yes"; then
6358cfc83b6cSPedro Giffuni  SYSTEM_APACHE_COMMONS=YES
6359cfc83b6cSPedro Giffuni  AC_MSG_RESULT([external])
6360cfc83b6cSPedro Giffuni
6361cfc83b6cSPedro Giffuni  if test -z $COMMONS_LANG_JAR; then
6362cfc83b6cSPedro Giffuni    AC_CHECK_FILE(/usr/share/java/commons-lang3-3.3.jar,
6363cfc83b6cSPedro Giffuni      [ COMMONS_LANG_JAR=/usr/share/java/commons-lang3-3.3.jar ],
6364cfc83b6cSPedro Giffuni      [
6365cfc83b6cSPedro Giffuni        AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
6366cfc83b6cSPedro Giffuni          [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
6367cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
6368cfc83b6cSPedro Giffuni        )
6369cfc83b6cSPedro Giffuni      ]
6370cfc83b6cSPedro Giffuni    )
6371cfc83b6cSPedro Giffuni  else
6372cfc83b6cSPedro Giffuni    AC_CHECK_FILE($COMMONS_LANG_JAR, [],
6373cfc83b6cSPedro Giffuni         [AC_MSG_ERROR(commons-lang.jar not found.)], [])
6374cfc83b6cSPedro Giffuni  fi
6375160c442cSDamjan Jovanovic  AC_MSG_CHECKING([whether commons-lang is version 3.x])
6376160c442cSDamjan Jovanovic  export COMMONS_LANG_JAR
6377160c442cSDamjan Jovanovic  if $PERL -e 'use Archive::Zip;
6378160c442cSDamjan Jovanovic      my $file = "$ENV{'COMMONS_LANG_JAR'}";
6379160c442cSDamjan Jovanovic      my $zip = Archive::Zip->new( $file );
6380160c442cSDamjan Jovanovic      my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
6381160c442cSDamjan Jovanovic      if ( $mf =~ m/Specification-Version: 3.*/ ) {
6382160c442cSDamjan Jovanovic          exit 0;
6383160c442cSDamjan Jovanovic      } else {
6384160c442cSDamjan Jovanovic          exit 1;
6385160c442cSDamjan Jovanovic      }'; then
6386160c442cSDamjan Jovanovic      AC_MSG_RESULT([yes])
6387160c442cSDamjan Jovanovic  else
6388160c442cSDamjan Jovanovic      AC_MSG_ERROR([no, you need Apache Commons Lang 3.x])
6389160c442cSDamjan Jovanovic  fi
6390cfc83b6cSPedro Giffuni
63913c5114b8SDamjan Jovanovic  if test "$ENABLE_MEDIAWIKI" = "YES"; then
63923c5114b8SDamjan Jovanovic    if test -z $COMMONS_CODEC_JAR; then
63933c5114b8SDamjan Jovanovic      AC_CHECK_FILE(/usr/share/java/commons-codec-1.9.jar,
63943c5114b8SDamjan Jovanovic        [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.9.jar ],
63953c5114b8SDamjan Jovanovic        [
63963c5114b8SDamjan Jovanovic          AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
63973c5114b8SDamjan Jovanovic            [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
63983c5114b8SDamjan Jovanovic            [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
63993c5114b8SDamjan Jovanovic          )
64003c5114b8SDamjan Jovanovic        ]
64013c5114b8SDamjan Jovanovic      )
64023c5114b8SDamjan Jovanovic    else
64033c5114b8SDamjan Jovanovic      AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
64043c5114b8SDamjan Jovanovic           [AC_MSG_ERROR(commons-codec.jar not found.)], [])
64053c5114b8SDamjan Jovanovic    fi
64063c5114b8SDamjan Jovanovic
6407cfc83b6cSPedro Giffuni    if test -z $COMMONS_HTTPCLIENT_JAR; then
6408cfc83b6cSPedro Giffuni      AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
6409cfc83b6cSPedro Giffuni        [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
6410cfc83b6cSPedro Giffuni        [
6411cfc83b6cSPedro Giffuni          AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
6412cfc83b6cSPedro Giffuni            [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
6413cfc83b6cSPedro Giffuni            [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
6414cfc83b6cSPedro Giffuni          )
6415cfc83b6cSPedro Giffuni        ]
6416cfc83b6cSPedro Giffuni      )
6417cfc83b6cSPedro Giffuni    else
6418cfc83b6cSPedro Giffuni      AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
6419cfc83b6cSPedro Giffuni           [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
6420cfc83b6cSPedro Giffuni    fi
6421cfc83b6cSPedro Giffuni  fi
6422cfc83b6cSPedro Giffuni  if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
6423cfc83b6cSPedro Giffuni    if test -z $COMMONS_LOGGING_JAR; then
6424cfc83b6cSPedro Giffuni      AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.3.jar,
6425cfc83b6cSPedro Giffuni        [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.3.jar ],
6426cfc83b6cSPedro Giffuni        [
6427cfc83b6cSPedro Giffuni          AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
6428cfc83b6cSPedro Giffuni            [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
6429cfc83b6cSPedro Giffuni            [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
6430cfc83b6cSPedro Giffuni          )
6431cfc83b6cSPedro Giffuni        ]
6432cfc83b6cSPedro Giffuni      )
6433cfc83b6cSPedro Giffuni    else
6434cfc83b6cSPedro Giffuni      AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
6435cfc83b6cSPedro Giffuni           [AC_MSG_ERROR(commons-logging.jar not found.)], [])
6436cfc83b6cSPedro Giffuni    fi
6437cfc83b6cSPedro Giffuni  fi
6438cfc83b6cSPedro Giffunielse
6439cfc83b6cSPedro Giffuni  AC_MSG_RESULT([internal])
6440cfc83b6cSPedro Giffuni  SYSTEM_APACHE_COMMONS=NO
6441cfc83b6cSPedro Giffuni  BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
6442cfc83b6cSPedro Giffunifi
6443cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_APACHE_COMMONS)
6444cfc83b6cSPedro GiffuniAC_SUBST(COMMONS_CODEC_JAR)
6445cfc83b6cSPedro GiffuniAC_SUBST(COMMONS_LANG_JAR)
6446cfc83b6cSPedro GiffuniAC_SUBST(COMMONS_HTTPCLIENT_JAR)
6447cfc83b6cSPedro GiffuniAC_SUBST(COMMONS_LOGGING_JAR)
6448cfc83b6cSPedro Giffuni
6449cfc83b6cSPedro Giffunidnl ===================================================================
6450cfc83b6cSPedro Giffunidnl Check whether the Qt and KDE libraries are available.
6451cfc83b6cSPedro Giffunidnl ===================================================================
6452cfc83b6cSPedro Giffuni
6453cfc83b6cSPedro GiffuniKDE_CFLAGS=""
6454cfc83b6cSPedro GiffuniKDE_LIBS=""
6455cfc83b6cSPedro GiffuniMOC="moc"
6456cfc83b6cSPedro Giffuniif test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
6457cfc83b6cSPedro Giffuni    dnl Search paths for Qt and KDE
6458cfc83b6cSPedro Giffuni    if test "$build_cpu" != "x86_64" ; then
6459cfc83b6cSPedro Giffuni        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"
6460cfc83b6cSPedro Giffuni        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"
6461cfc83b6cSPedro Giffuni    else
6462cfc83b6cSPedro Giffuni        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"
6463cfc83b6cSPedro Giffuni        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"
6464cfc83b6cSPedro Giffuni    fi
6465cfc83b6cSPedro Giffuni    if test -n "$QTDIR" ; then
6466cfc83b6cSPedro Giffuni        qt_incdirs="$QTDIR/include $qt_incdirs"
6467cfc83b6cSPedro Giffuni        if test "$build_cpu" != "x86_64" ; then
6468cfc83b6cSPedro Giffuni            qt_libdirs="$QTDIR/lib $qt_libdirs"
6469cfc83b6cSPedro Giffuni        else
6470cfc83b6cSPedro Giffuni            qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
6471cfc83b6cSPedro Giffuni        fi
6472cfc83b6cSPedro Giffuni    fi
6473cfc83b6cSPedro Giffuni    if test "$build_cpu" != "x86_64" ; then
6474cfc83b6cSPedro Giffuni        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"
6475cfc83b6cSPedro Giffuni        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"
6476cfc83b6cSPedro Giffuni    else
6477cfc83b6cSPedro Giffuni        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"
6478cfc83b6cSPedro Giffuni        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"
6479cfc83b6cSPedro Giffuni    fi
6480cfc83b6cSPedro Giffuni    if test -n "$KDEDIR" ; then
6481cfc83b6cSPedro Giffuni        kde_incdirs="$KDEDIR/include $kde_incdirs"
6482cfc83b6cSPedro Giffuni        if test "$build_cpu" != "x86_64" ; then
6483cfc83b6cSPedro Giffuni            kde_libdirs="$KDEDIR/lib $kde_libdirs"
6484cfc83b6cSPedro Giffuni        else
6485cfc83b6cSPedro Giffuni            kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
6486cfc83b6cSPedro Giffuni        fi
6487cfc83b6cSPedro Giffuni    fi
6488cfc83b6cSPedro Giffuni
6489cfc83b6cSPedro Giffuni    dnl What to test
6490cfc83b6cSPedro Giffuni    qt_test_include="qstyle.h"
6491cfc83b6cSPedro Giffuni    qt_test_library="libqt-mt.so"
6492cfc83b6cSPedro Giffuni    kde_test_include="ksharedptr.h"
6493cfc83b6cSPedro Giffuni    kde_test_library="libkdeui.so"
6494cfc83b6cSPedro Giffuni
6495cfc83b6cSPedro Giffuni    dnl Check for Qt headers
6496cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for Qt headers])
6497cfc83b6cSPedro Giffuni    qt_incdir="no"
6498cfc83b6cSPedro Giffuni    for kde_check in $qt_incdirs ; do
6499cfc83b6cSPedro Giffuni        if test -r "$kde_check/$qt_test_include" ; then
6500cfc83b6cSPedro Giffuni            qt_incdir="$kde_check"
6501cfc83b6cSPedro Giffuni            break
6502cfc83b6cSPedro Giffuni        fi
6503cfc83b6cSPedro Giffuni    done
6504cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$qt_incdir])
6505cfc83b6cSPedro Giffuni    if test "x$qt_incdir" = "xno" ; then
6506cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Qt headers not found.  Please specify the root of
6507cfc83b6cSPedro Giffuniyour Qt installation by exporting QTDIR before running "configure".])
6508cfc83b6cSPedro Giffuni    fi
6509cfc83b6cSPedro Giffuni
6510cfc83b6cSPedro Giffuni    dnl Check for Qt libraries
6511cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for Qt libraries])
6512cfc83b6cSPedro Giffuni    qt_libdir="no"
6513cfc83b6cSPedro Giffuni    for qt_check in $qt_libdirs ; do
6514cfc83b6cSPedro Giffuni        if test -r "$qt_check/$qt_test_library" ; then
6515cfc83b6cSPedro Giffuni            qt_libdir="$qt_check"
6516cfc83b6cSPedro Giffuni            break
6517cfc83b6cSPedro Giffuni        fi
6518cfc83b6cSPedro Giffuni    done
6519cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$qt_libdir])
6520cfc83b6cSPedro Giffuni    if test "x$qt_libdir" = "xno" ; then
6521cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Qt libraries not found.  Please specify the root of
6522cfc83b6cSPedro Giffuniyour Qt installation by exporting QTDIR before running "configure".])
6523cfc83b6cSPedro Giffuni    fi
6524cfc83b6cSPedro Giffuni
6525cfc83b6cSPedro Giffuni    dnl Check for Meta Object Compiler
6526cfc83b6cSPedro Giffuni    AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
6527cfc83b6cSPedro Giffuni    if test "$MOC" = "no" ; then
6528cfc83b6cSPedro Giffuni        AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
6529cfc83b6cSPedro Giffunithe root of your Qt installation by exporting QTDIR before running "configure".])
6530cfc83b6cSPedro Giffuni    fi
6531cfc83b6cSPedro Giffuni
6532cfc83b6cSPedro Giffuni    dnl Check for KDE headers
6533cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for KDE headers])
6534cfc83b6cSPedro Giffuni    kde_incdir="no"
6535cfc83b6cSPedro Giffuni    for kde_check in $kde_incdirs ; do
6536cfc83b6cSPedro Giffuni        if test -r "$kde_check/$kde_test_include" ; then
6537cfc83b6cSPedro Giffuni            kde_incdir="$kde_check"
6538cfc83b6cSPedro Giffuni            break
6539cfc83b6cSPedro Giffuni        fi
6540cfc83b6cSPedro Giffuni    done
6541cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$kde_incdir])
6542cfc83b6cSPedro Giffuni    if test "x$kde_incdir" = "xno" ; then
6543cfc83b6cSPedro Giffuni        AC_MSG_ERROR([KDE headers not found.  Please specify the root of
6544cfc83b6cSPedro Giffuniyour KDE installation by exporting KDEDIR before running "configure".])
6545cfc83b6cSPedro Giffuni    fi
6546cfc83b6cSPedro Giffuni
6547cfc83b6cSPedro Giffuni    dnl Check for KDE libraries
6548cfc83b6cSPedro Giffuni    AC_MSG_CHECKING([for KDE libraries])
6549cfc83b6cSPedro Giffuni    kde_libdir="no"
6550cfc83b6cSPedro Giffuni    for kde_check in $kde_libdirs ; do
6551cfc83b6cSPedro Giffuni        if test -r "$kde_check/$kde_test_library" ; then
6552cfc83b6cSPedro Giffuni            kde_libdir="$kde_check"
6553cfc83b6cSPedro Giffuni            break
6554cfc83b6cSPedro Giffuni        fi
6555cfc83b6cSPedro Giffuni    done
6556cfc83b6cSPedro Giffuni    AC_MSG_RESULT([$kde_libdir])
6557cfc83b6cSPedro Giffuni    if test "x$kde_libdir" = "xno" ; then
6558cfc83b6cSPedro Giffuni        AC_MSG_ERROR([KDE libraries not found.  Please specify the root of
6559cfc83b6cSPedro Giffuniyour KDE installation by exporting KDEDIR before running "configure".])
6560cfc83b6cSPedro Giffuni    fi
6561cfc83b6cSPedro Giffuni
6562cfc83b6cSPedro Giffuni    dnl Set the variables
6563cfc83b6cSPedro Giffuni    KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
6564cfc83b6cSPedro Giffuni    KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
6565cfc83b6cSPedro Giffunifi
6566cfc83b6cSPedro GiffuniAC_SUBST(KDE_CFLAGS)
6567cfc83b6cSPedro GiffuniAC_SUBST(KDE_LIBS)
6568cfc83b6cSPedro GiffuniAC_SUBST(MOC)
6569cfc83b6cSPedro Giffuni
6570cfc83b6cSPedro Giffunidnl ===================================================================
6571cfc83b6cSPedro Giffunidnl KDE4 Integration
6572cfc83b6cSPedro Giffunidnl ===================================================================
6573cfc83b6cSPedro Giffuni
6574cfc83b6cSPedro GiffuniKDE4_CFLAGS=""
6575cfc83b6cSPedro GiffuniKDE4_LIBS=""
6576cfc83b6cSPedro GiffuniMOC4="moc"
6577cfc83b6cSPedro Giffuniif test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
6578cfc83b6cSPedro Giffuni   qt_incdirs="$QT4INC $QT4DIR /usr/include/qt4 /usr/include $x_includes"
6579cfc83b6cSPedro Giffuni   qt_libdirs="$QT4LIB /usr/lib $x_libraries"
6580cfc83b6cSPedro Giffuni
6581cfc83b6cSPedro Giffuni   kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
6582cfc83b6cSPedro Giffuni   kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
6583cfc83b6cSPedro Giffuni
6584cfc83b6cSPedro Giffuni   if test "$build_cpu" = "x86_64" ; then
6585cfc83b6cSPedro Giffuni      qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
6586cfc83b6cSPedro Giffuni      kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
6587cfc83b6cSPedro Giffuni   fi
6588cfc83b6cSPedro Giffuni
6589cfc83b6cSPedro Giffuni   if test -n "$KDE4DIR" ; then
6590cfc83b6cSPedro Giffuni      kde_incdirs="$KDE4DIR/include $kde_incdirs"
6591cfc83b6cSPedro Giffuni      if test "$build_cpu" != "x86_64" ; then
6592cfc83b6cSPedro Giffuni         kde_libdirs="$KDE4DIR/lib $kde_libdirs"
6593cfc83b6cSPedro Giffuni      else
6594cfc83b6cSPedro Giffuni         kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
6595cfc83b6cSPedro Giffuni      fi
6596cfc83b6cSPedro Giffuni   fi
6597cfc83b6cSPedro Giffuni
6598cfc83b6cSPedro Giffuni   qt_test_include="Qt/qobject.h"
6599cfc83b6cSPedro Giffuni   qt_test_library="libQtCore.so"
6600cfc83b6cSPedro Giffuni   kde_test_include="ksharedptr.h"
6601cfc83b6cSPedro Giffuni   kde_test_library="libkdeui.so"
6602cfc83b6cSPedro Giffuni
6603cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for Qt4 headers])
6604cfc83b6cSPedro Giffuni   qt_header_dir="no"
6605cfc83b6cSPedro Giffuni   for inc_dir in $qt_incdirs ; do
6606cfc83b6cSPedro Giffuni      if test -r "$inc_dir/$qt_test_include" ; then
6607cfc83b6cSPedro Giffuni         qt_header_dir="$inc_dir"
6608cfc83b6cSPedro Giffuni         break
6609cfc83b6cSPedro Giffuni      fi
6610cfc83b6cSPedro Giffuni   done
6611cfc83b6cSPedro Giffuni
6612cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$qt_header_dir])
6613cfc83b6cSPedro Giffuni   if test "x$qt_header_dir" = "xno" ; then
6614cfc83b6cSPedro Giffuni      AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
6615cfc83b6cSPedro Giffuni   fi
6616cfc83b6cSPedro Giffuni
6617cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for Qt4 libraries])
6618cfc83b6cSPedro Giffuni   qt_lib_dir="no"
6619cfc83b6cSPedro Giffuni   for lib_dir in $qt_libdirs ; do
6620cfc83b6cSPedro Giffuni      if test -r "$lib_dir/$qt_test_library" ; then
6621cfc83b6cSPedro Giffuni         qt_lib_dir="$lib_dir"
6622cfc83b6cSPedro Giffuni         break
6623cfc83b6cSPedro Giffuni      fi
6624cfc83b6cSPedro Giffuni   done
6625cfc83b6cSPedro Giffuni
6626cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$qt_lib_dir])
6627cfc83b6cSPedro Giffuni
6628cfc83b6cSPedro Giffuni   if test "x$qt_lib_dir" = "xno" ; then
6629cfc83b6cSPedro Giffuni      AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
6630cfc83b6cSPedro Giffuni   fi
6631cfc83b6cSPedro Giffuni
6632cfc83b6cSPedro Giffuni   dnl Check for Meta Object Compiler
6633cfc83b6cSPedro Giffuni   AC_PATH_PROG( MOCQT4, moc-qt4, no, [$QT4DIR/bin:$PATH] )
6634cfc83b6cSPedro Giffuni   MOC4="$MOCQT4"
6635cfc83b6cSPedro Giffuni   if test "$MOC4" = "no" ; then
6636cfc83b6cSPedro Giffuni      AC_PATH_PROG( MOC4, moc, no, [$PATH:$QT4DIR/bin] )
6637cfc83b6cSPedro Giffuni      if test "$MOC4" = "no" ; then
6638cfc83b6cSPedro Giffuni         AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
6639cfc83b6cSPedro Giffuni      fi
6640cfc83b6cSPedro Giffuni   fi
6641cfc83b6cSPedro Giffuni
6642cfc83b6cSPedro Giffuni   dnl Check for KDE4 headers
6643cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for KDE4 headers])
6644cfc83b6cSPedro Giffuni   kde_incdir="no"
6645cfc83b6cSPedro Giffuni   for kde_check in $kde_incdirs ; do
6646cfc83b6cSPedro Giffuni      if test -r "$kde_check/$kde_test_include" ; then
6647cfc83b6cSPedro Giffuni         kde_incdir="$kde_check"
6648cfc83b6cSPedro Giffuni         break
6649cfc83b6cSPedro Giffuni      fi
6650cfc83b6cSPedro Giffuni   done
6651cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$kde_incdir])
6652cfc83b6cSPedro Giffuni   if test "x$kde_incdir" = "xno" ; then
6653cfc83b6cSPedro Giffuni      AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
6654cfc83b6cSPedro Giffuni   fi
6655cfc83b6cSPedro Giffuni
6656cfc83b6cSPedro Giffuni   dnl Check for KDE4 libraries
6657cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([for KDE4 libraries])
6658cfc83b6cSPedro Giffuni   kde_libdir="no"
6659cfc83b6cSPedro Giffuni   for kde_check in $kde_libdirs ; do
6660cfc83b6cSPedro Giffuni      if test -r "$kde_check/$kde_test_library" ; then
6661cfc83b6cSPedro Giffuni         kde_libdir="$kde_check"
6662cfc83b6cSPedro Giffuni         break
6663cfc83b6cSPedro Giffuni      fi
6664cfc83b6cSPedro Giffuni   done
6665cfc83b6cSPedro Giffuni
6666cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$kde_libdir])
6667cfc83b6cSPedro Giffuni   if test "x$kde_libdir" = "xno" ; then
6668cfc83b6cSPedro Giffuni      AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
6669cfc83b6cSPedro Giffuni   fi
6670cfc83b6cSPedro Giffuni
6671cfc83b6cSPedro Giffuni   KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
6672cfc83b6cSPedro Giffuni   KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
6673cfc83b6cSPedro Giffunifi
6674cfc83b6cSPedro GiffuniAC_SUBST(KDE4_CFLAGS)
6675cfc83b6cSPedro GiffuniAC_SUBST(KDE4_LIBS)
6676cfc83b6cSPedro GiffuniAC_SUBST(MOC4)
6677cfc83b6cSPedro Giffuni
6678cfc83b6cSPedro Giffunidnl ===================================================================
6679cfc83b6cSPedro Giffunidnl Test for the enabling the lockdown pieces
6680cfc83b6cSPedro Giffunidnl ===================================================================
6681cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable the lockdown pieces])
6682cfc83b6cSPedro GiffuniENABLE_LOCKDOWN=""
6683cfc83b6cSPedro Giffuniif test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
6684cfc83b6cSPedro Giffuni  ENABLE_LOCKDOWN=YES
6685cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6686cfc83b6cSPedro Giffunielse
6687cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6688cfc83b6cSPedro Giffunifi
6689cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_LOCKDOWN)
6690cfc83b6cSPedro Giffuni
6691cfc83b6cSPedro Giffunidnl ===================================================================
6692cfc83b6cSPedro Giffunidnl Test whether to include Evolution 2 support
6693cfc83b6cSPedro Giffunidnl ===================================================================
6694cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable evolution 2 support])
6695cfc83b6cSPedro Giffuniif test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
6696cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
6697cfc83b6cSPedro Giffuni   PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
6698cfc83b6cSPedro Giffuni   ENABLE_EVOAB2="TRUE"
6699cfc83b6cSPedro Giffunielse
6700cfc83b6cSPedro Giffuni   ENABLE_EVOAB2=""
6701cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6702cfc83b6cSPedro Giffunifi
6703cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_EVOAB2)
6704cfc83b6cSPedro GiffuniAC_SUBST(GOBJECT_CFLAGS)
6705cfc83b6cSPedro GiffuniAC_SUBST(GOBJECT_LIBS)
6706cfc83b6cSPedro Giffuni
6707cfc83b6cSPedro Giffunidnl ===================================================================
6708cfc83b6cSPedro Giffunidnl Test whether to include MathMLDTD
6709cfc83b6cSPedro Giffunidnl ===================================================================
6710cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to include MathMLDTD])
6711cfc83b6cSPedro Giffuniif test -n "$enable_mathmldtd"; then
6712cfc83b6cSPedro Giffuni  if test "$enable_mathmldtd" = "no"; then
6713cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
6714cfc83b6cSPedro Giffuni    SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
6715cfc83b6cSPedro Giffuni  else
6716cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
6717cfc83b6cSPedro Giffuni    BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
6718cfc83b6cSPedro Giffuni  fi
6719cfc83b6cSPedro Giffunielse
6720cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6721cfc83b6cSPedro Giffuni  SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
6722cfc83b6cSPedro Giffunifi
6723cfc83b6cSPedro Giffuni
6724cfc83b6cSPedro Giffunidnl ===================================================================
6725cfc83b6cSPedro Giffunidnl Test whether to include category-B fonts
6726cfc83b6cSPedro Giffunidnl ===================================================================
6727cfc83b6cSPedro GiffuniWITH_CATB_FONTS=
6728cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to include category B fonts])
6729cfc83b6cSPedro Giffuniif test "x$enable_category_b_fonts" = "xyes" && test "x$with_fonts" != "xno"; then
6730cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
6731cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE CATB_FONTS"
6732cfc83b6cSPedro Giffuni   WITH_CATB_FONTS=YES
6733cfc83b6cSPedro Giffuni   SCPDEFS="$SCPDEFS -DWITH_CATB_FONTS"
6734cfc83b6cSPedro Giffunielse
6735cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6736cfc83b6cSPedro Giffuni   WITH_CATB_FONTS=NO
6737cfc83b6cSPedro Giffunifi
6738cfc83b6cSPedro Giffuni
6739cfc83b6cSPedro Giffunidnl ===================================================================
6740cfc83b6cSPedro Giffunidnl Test whether to include category-A fonts
6741cfc83b6cSPedro Giffunidnl ===================================================================
6742cfc83b6cSPedro GiffuniWITH_CATA_FONTS=
6743cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to include category A fonts])
6744cfc83b6cSPedro Giffuniif test "x$with_fonts" != "xno" ; then
6745cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6746cfc83b6cSPedro Giffuni  WITH_CATA_FONTS=YES
6747cfc83b6cSPedro Giffuni  SCPDEFS="$SCPDEFS -DWITH_CATA_FONTS"
6748cfc83b6cSPedro Giffunielse
6749cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6750cfc83b6cSPedro Giffuni  WITH_CATA_FONTS=NO
6751cfc83b6cSPedro Giffuni  WITH_CATB_FONTS=NO
6752cfc83b6cSPedro Giffunifi
6753cfc83b6cSPedro Giffuni
6754cfc83b6cSPedro GiffuniWITH_FONTS=NO
6755cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether any fonts are included])
6756cfc83b6cSPedro Giffuniif test "x$WITH_CATA_FONTS" = "xYES" -o "x$WITH_CATB_FONTS" = "xYES"; then
6757cfc83b6cSPedro Giffuni  BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
6758cfc83b6cSPedro Giffuni  WITH_FONTS=YES
6759cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6760cfc83b6cSPedro Giffunielse
6761cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6762cfc83b6cSPedro Giffunifi
6763cfc83b6cSPedro Giffuni
6764cfc83b6cSPedro GiffuniAC_SUBST(WITH_CATA_FONTS)
6765cfc83b6cSPedro GiffuniAC_SUBST(WITH_CATB_FONTS)
6766cfc83b6cSPedro GiffuniAC_SUBST(WITH_FONTS)
6767cfc83b6cSPedro Giffuni
6768cfc83b6cSPedro Giffunidnl ===================================================================
6769cfc83b6cSPedro Giffunidnl Test whether to include ppds
6770cfc83b6cSPedro Giffunidnl ===================================================================
6771cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to include PPDs])
6772cfc83b6cSPedro Giffuniif test "$with_ppds" != "no"; then
6773cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6774cfc83b6cSPedro Giffunielse
6775cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6776cfc83b6cSPedro Giffuni  WITHOUT_PPDS=YES
6777cfc83b6cSPedro Giffuni  SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
6778cfc83b6cSPedro Giffunifi
6779cfc83b6cSPedro GiffuniAC_SUBST(WITHOUT_PPDS)
6780cfc83b6cSPedro Giffuni
6781cfc83b6cSPedro Giffunidnl ===================================================================
6782cfc83b6cSPedro Giffunidnl Test whether to include afms
6783cfc83b6cSPedro Giffunidnl ===================================================================
6784cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to include AFMs])
6785cfc83b6cSPedro Giffuniif test "$with_afms" != "no"; then
6786cfc83b6cSPedro Giffuni  AC_MSG_RESULT([yes])
6787cfc83b6cSPedro Giffuni  BUILD_TYPE="$BUILD_TYPE AFMS"
6788cfc83b6cSPedro Giffunielse
6789cfc83b6cSPedro Giffuni  AC_MSG_RESULT([no])
6790cfc83b6cSPedro Giffuni  WITHOUT_AFMS=YES
6791cfc83b6cSPedro Giffuni  SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
6792cfc83b6cSPedro Giffunifi
6793cfc83b6cSPedro GiffuniAC_SUBST(WITHOUT_AFMS)
6794cfc83b6cSPedro Giffuni
6795cfc83b6cSPedro GiffuniAC_SUBST(SCPDEFS)
6796cfc83b6cSPedro Giffuni
6797cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether and how to use Xinerama])
6798cfc83b6cSPedro Giffuniif test "$_os" = "Darwin"; then
6799cfc83b6cSPedro Giffuni   USE_XINERAMA=YES
6800cfc83b6cSPedro Giffuni   XINERAMA_LINK=dynamic
6801cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
6802cfc83b6cSPedro Giffunielif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
6803cfc83b6cSPedro Giffuni   if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then
6804cfc83b6cSPedro Giffuni      # we have both versions, let the user decide but use the dynamic one
6805cfc83b6cSPedro Giffuni      # per default
6806cfc83b6cSPedro Giffuni      USE_XINERAMA=YES
6807cfc83b6cSPedro Giffuni      if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
6808cfc83b6cSPedro Giffuni         XINERAMA_LINK=dynamic
6809cfc83b6cSPedro Giffuni      else
6810cfc83b6cSPedro Giffuni         XINERAMA_LINK=static
6811cfc83b6cSPedro Giffuni      fi
6812cfc83b6cSPedro Giffuni   elif test -e "$XLIB/libXinerama.so" -a ! -e "$XLIB/libXinerama.a"; then
6813cfc83b6cSPedro Giffuni      # we have only the dynamic version
6814cfc83b6cSPedro Giffuni      USE_XINERAMA=YES
6815cfc83b6cSPedro Giffuni      XINERAMA_LINK=dynamic
6816cfc83b6cSPedro Giffuni   elif test -e "$XLIB/libXinerama.a"; then
6817cfc83b6cSPedro Giffuni      # static version
681828633775SPedro Giffuni      if echo $build_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
6819cfc83b6cSPedro Giffuni         USE_XINERAMA=YES
6820cfc83b6cSPedro Giffuni         XINERAMA_LINK=static
6821cfc83b6cSPedro Giffuni      else
6822cfc83b6cSPedro Giffuni         USE_XINERAMA=NO
6823cfc83b6cSPedro Giffuni         XINERAMA_LINK=none
6824cfc83b6cSPedro Giffuni      fi
6825cfc83b6cSPedro Giffuni   else
6826cfc83b6cSPedro Giffuni      # no Xinerama
6827cfc83b6cSPedro Giffuni      USE_XINERAMA=NO
6828cfc83b6cSPedro Giffuni      XINERAMA_LINK=none
6829cfc83b6cSPedro Giffuni   fi
6830cfc83b6cSPedro Giffuni   if test "$USE_XINERAMA" = "YES"; then
6831cfc83b6cSPedro Giffuni      AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
6832cfc83b6cSPedro Giffuni      AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
6833cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(Xinerama header not found.)], [])
6834cfc83b6cSPedro Giffuni      XINERAMA_EXTRA_LIBS="-L$XLIB -lXext"
6835cfc83b6cSPedro Giffuni      if test "$_os" = "FreeBSD"; then
6836cfc83b6cSPedro Giffuni          XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
6837cfc83b6cSPedro Giffuni      fi
6838cfc83b6cSPedro Giffuni      if test "$_os" = "Linux"; then
6839cfc83b6cSPedro Giffuni          XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
6840cfc83b6cSPedro Giffuni      fi
6841cfc83b6cSPedro Giffuni      AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
6842cfc83b6cSPedro Giffuni          [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
6843cfc83b6cSPedro Giffuni   else
6844cfc83b6cSPedro Giffuni      AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
6845cfc83b6cSPedro Giffuni   fi
6846cfc83b6cSPedro Giffunielse
6847cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6848cfc83b6cSPedro Giffunifi
6849cfc83b6cSPedro GiffuniAC_SUBST(USE_XINERAMA)
6850cfc83b6cSPedro GiffuniAC_SUBST(XINERAMA_LINK)
6851cfc83b6cSPedro Giffuni
6852cfc83b6cSPedro Giffunidnl ===================================================================
6853cfc83b6cSPedro Giffunidnl always rely on the system version of gdk-pixbuf
6854cfc83b6cSPedro Giffunidnl ===================================================================
6855cfc83b6cSPedro Giffuni
6856cfc83b6cSPedro GiffuniSYSTEM_GDKPIXBUF=YES
6857cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GDKPIXBUF)
6858cfc83b6cSPedro Giffuni
6859cfc83b6cSPedro Giffunidnl ===================================================================
6860cfc83b6cSPedro Giffunidnl always rely on the system version of glib
6861cfc83b6cSPedro Giffunidnl ===================================================================
6862cfc83b6cSPedro Giffuni
6863cfc83b6cSPedro GiffuniSYSTEM_GLIB=YES
6864cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GLIB)
6865cfc83b6cSPedro Giffuni
6866cfc83b6cSPedro Giffunidnl ===================================================================
6867cfc83b6cSPedro Giffunidnl always rely on the system version of gettext
6868cfc83b6cSPedro Giffunidnl ===================================================================
6869cfc83b6cSPedro Giffuni
6870cfc83b6cSPedro GiffuniSYSTEM_GETTEXT=YES
6871cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_GETTEXT)
6872cfc83b6cSPedro Giffuni
6873cfc83b6cSPedro Giffuniif test "$_os" = "FreeBSD"; then
6874cfc83b6cSPedro Giffuni    LIBINTL_PREFIX=
6875cfc83b6cSPedro Giffuni    for dir in $CPPFLAGS; do
6876cfc83b6cSPedro Giffuni      if dir=`expr -- $dir : '-I\(.*\)'`; then
6877cfc83b6cSPedro Giffuni        if test -f "$dir/libintl.h" ; then
6878cfc83b6cSPedro Giffuni          LIBINTL_PREFIX=`dirname $dir`
6879cfc83b6cSPedro Giffuni        fi
6880cfc83b6cSPedro Giffuni      fi
6881cfc83b6cSPedro Giffuni    done
6882cfc83b6cSPedro Giffuni    AC_SUBST(LIBINTL_PREFIX)
6883cfc83b6cSPedro Giffunifi
6884cfc83b6cSPedro Giffuni
6885cfc83b6cSPedro Giffunidnl ===================================================================
6886cfc83b6cSPedro Giffunidnl always rely on the system version of pango
6887cfc83b6cSPedro Giffunidnl ===================================================================
6888cfc83b6cSPedro Giffuni
6889cfc83b6cSPedro GiffuniSYSTEM_PANGO=YES
6890cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_PANGO)
6891cfc83b6cSPedro Giffuni
6892cfc83b6cSPedro Giffunidnl ===================================================================
6893cfc83b6cSPedro Giffunidnl Test whether to build libpng or rely on the system version
6894cfc83b6cSPedro Giffunidnl ===================================================================
6895cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build own version of libpng])
6896cfc83b6cSPedro Giffuni
6897cfc83b6cSPedro Giffunicase "$_os" in
6898cfc83b6cSPedro Giffuni    WINNT*) # Windows
6899cfc83b6cSPedro Giffuni        SYSTEM_LIBPNG=NO
6900cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes])
6901cfc83b6cSPedro Giffuni        ;;
6902cfc83b6cSPedro Giffuni    Darwin*)
6903cfc83b6cSPedro Giffuni        SYSTEM_LIBPNG=NO
6904cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes])
6905cfc83b6cSPedro Giffuni        ;;
6906cfc83b6cSPedro Giffuni   *)
6907cfc83b6cSPedro Giffuni   SYSTEM_LIBPNG=YES
6908cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6909cfc83b6cSPedro Giffuni   ;;
6910cfc83b6cSPedro Giffuniesac
6911cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBPNG)
6912cfc83b6cSPedro Giffuni
6913cfc83b6cSPedro Giffunidnl ===================================================================
6914cfc83b6cSPedro Giffunidnl Test whether to build libjpeg or rely on the system version
6915cfc83b6cSPedro Giffunidnl ===================================================================
6916cfc83b6cSPedro Giffunidnl FIXME: this is currently because we have jpeg-6b for our filters
6917cfc83b6cSPedro Giffunidnl        and jpeg-8 as dependency for librsvg
6918cfc83b6cSPedro Giffunidnl        this should be unified into using only one version for both
6919cfc83b6cSPedro Giffuni
6920cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to build own version of libjpeg])
6921cfc83b6cSPedro Giffuni
6922cfc83b6cSPedro Giffuniif test "$SYSTEM_JPEG" = "YES"; then
6923cfc83b6cSPedro GiffuniSYSTEM_LIBJPEG=YES
6924cfc83b6cSPedro Giffunielse
6925cfc83b6cSPedro Giffunicase "$_os" in
6926cfc83b6cSPedro Giffuni    WINNT*) # Windows
6927cfc83b6cSPedro Giffuni        SYSTEM_LIBJPEG=NO
6928cfc83b6cSPedro Giffuni        ;;
6929cfc83b6cSPedro Giffuni    Darwin*)
6930cfc83b6cSPedro Giffuni        SYSTEM_LIBJPEG=NO
6931cfc83b6cSPedro Giffuni        ;;
6932cfc83b6cSPedro Giffuni   *)
6933cfc83b6cSPedro Giffuni        SYSTEM_LIBJPEG=YES
6934cfc83b6cSPedro Giffuni        ;;
6935cfc83b6cSPedro Giffuniesac
6936cfc83b6cSPedro Giffunifi
6937cfc83b6cSPedro Giffuni
6938cfc83b6cSPedro Giffuniif test "$SYSTEM_LIBJPEG" = "YES"; then
6939cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
6940cfc83b6cSPedro Giffunielse
6941cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
6942cfc83b6cSPedro Giffunifi
6943cfc83b6cSPedro GiffuniAC_SUBST(SYSTEM_LIBJPEG)
6944cfc83b6cSPedro Giffuni
6945cfc83b6cSPedro Giffunidnl ===================================================================
6946cfc83b6cSPedro Giffunidnl Test whether rat scan was requested and whether apache-rat is available
6947cfc83b6cSPedro Giffunidnl ===================================================================
6948cfc83b6cSPedro GiffuniRAT_JAR=
6949cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to trigger rat scan])
6950cfc83b6cSPedro Giffuniif test -z "$with_rat_scan" -o "$with_rat_scan" = "no"; then
6951cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
6952cfc83b6cSPedro Giffunielse
6953cfc83b6cSPedro Giffuni    if test "$WITH_JAVA" = "no"; then
6954cfc83b6cSPedro Giffuni        AC_MSG_ERROR([no, java disabled, enable with --with-java])
6955cfc83b6cSPedro Giffuni    elif test "$enable_saxon" = "no"; then
6956cfc83b6cSPedro Giffuni        AC_MSG_ERROR([no, saxon disabled, enable with --enable-category-b])
6957cfc83b6cSPedro Giffuni    elif test "$with_rat_scan" = "yes"; then
6958cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes, use pre-built library])
6959cfc83b6cSPedro Giffuni        RAT_JAR_HOME="BUILD"
6960cfc83b6cSPedro Giffuni        BUILD_TYPE="$BUILD_TYPE RAT"
6961cfc83b6cSPedro Giffuni    else
6962cfc83b6cSPedro Giffuni        AC_MSG_RESULT([yes, use pre-installed library])
6963cfc83b6cSPedro Giffuni        AC_MSG_CHECKING([whether apache-rat is available])
6964cfc83b6cSPedro Giffuni        if test -d "$with_rat_scan"; then
6965cfc83b6cSPedro Giffuni            RAT_JAR_HOME=$with_rat_scan
6966cfc83b6cSPedro Giffuni        else
6967cfc83b6cSPedro Giffuni            AC_MSG_ERROR([$with_rat_scan is not a directory])
6968cfc83b6cSPedro Giffuni        fi
6969cfc83b6cSPedro Giffuni    fi
6970cfc83b6cSPedro Giffunifi
6971cfc83b6cSPedro GiffuniAC_SUBST(RAT_JAR_HOME)
6972cfc83b6cSPedro Giffuni
6973cfc83b6cSPedro Giffuni
6974cfc83b6cSPedro Giffunidnl ===================================================================
6975cfc83b6cSPedro Giffunidnl Test for the presence of Ant and that it works
6976cfc83b6cSPedro Giffunidnl ===================================================================
6977cfc83b6cSPedro Giffuni
6978cfc83b6cSPedro Giffuniif test "$SOLAR_JAVA" != ""; then
6979cfc83b6cSPedro GiffuniANT_HOME=; export ANT_HOME
6980cfc83b6cSPedro GiffuniWITH_ANT_HOME=; export WITH_ANT_HOME
6981cfc83b6cSPedro Giffuniif test -z "$with_ant_home"; then
6982cfc83b6cSPedro Giffuni   if test "$_os" = "OS2"; then
6983cfc83b6cSPedro Giffuni     AC_PATH_PROGS(ANT, ant.cmd)
6984cfc83b6cSPedro Giffuni   else
698537cc8903SMatthias Seidel     AC_PATH_PROGS(ANT, [apache-ant ant ant.sh ant.bat ant.cmd])
6986cfc83b6cSPedro Giffuni   fi
6987cfc83b6cSPedro Giffunielse
6988cfc83b6cSPedro Giffuni   if test "$_os" = "WINNT"; then
6989cfc83b6cSPedro Giffuni      with_ant_home=`cygpath -u "$with_ant_home"`
6990cfc83b6cSPedro Giffuni   fi
6991cfc83b6cSPedro Giffuni   if test "$_os" = "OS2"; then
6992cfc83b6cSPedro Giffuni     AC_PATH_PROGS(ANT, ant.cmd,,$with_ant_home/bin:$PATH)
6993cfc83b6cSPedro Giffuni   else
699437cc8903SMatthias Seidel     AC_PATH_PROGS(ANT, [apache-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
6995cfc83b6cSPedro Giffuni   fi
6996cfc83b6cSPedro Giffuni   WITH_ANT_HOME=$with_ant_home
6997cfc83b6cSPedro Giffuni   ANT_HOME=$with_ant_home
6998cfc83b6cSPedro Giffunifi
6999cfc83b6cSPedro Giffuni
7000cfc83b6cSPedro Giffuniif test -z "$ANT"; then
7001cfc83b6cSPedro Giffuni  AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
7002cfc83b6cSPedro Giffunielse
7003cfc83b6cSPedro Giffuni  # resolve relative or absolute symlink
7004cfc83b6cSPedro Giffuni  while test -h "$ANT"; do
7005cfc83b6cSPedro Giffuni     a_cwd=`pwd`
7006cfc83b6cSPedro Giffuni     a_basename=`basename "$ANT"`
7007cfc83b6cSPedro Giffuni     a_script=`ls -l "$ANT" | sed "s/.*${a_basename} -> //g"`
7008cfc83b6cSPedro Giffuni     cd "`dirname "$ANT"`"
7009cfc83b6cSPedro Giffuni     cd "`dirname "$a_script"`"
7010cfc83b6cSPedro Giffuni     ANT="`pwd`"/"`basename "$a_script"`"
7011cfc83b6cSPedro Giffuni     cd "$a_cwd"
7012cfc83b6cSPedro Giffuni  done
7013cfc83b6cSPedro Giffuni
7014cfc83b6cSPedro Giffuni  if test "$_os" = "OS2"; then
7015cfc83b6cSPedro Giffuni    ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
7016cfc83b6cSPedro Giffuni    export ANT_HOME
7017cfc83b6cSPedro Giffuni  fi
7018cfc83b6cSPedro Giffuni
7019cfc83b6cSPedro Giffuni  AC_MSG_CHECKING([if $ANT works])
7020cfc83b6cSPedro Giffunicat > conftest.java << EOF
7021cfc83b6cSPedro Giffuni    public class conftest {
7022cfc83b6cSPedro Giffuni    int testmethod(int a, int b) {
7023cfc83b6cSPedro Giffuni            return a + b;
7024cfc83b6cSPedro Giffuni    }
7025cfc83b6cSPedro Giffuni    }
7026cfc83b6cSPedro GiffuniEOF
7027cfc83b6cSPedro Giffuni
7028cfc83b6cSPedro Giffunicat > conftest.xml << EOF
7029cfc83b6cSPedro Giffuni    <project name="conftest" default="conftest">
7030cfc83b6cSPedro Giffuni    <target name="conftest">
7031cfc83b6cSPedro Giffuni            <javac srcdir="." includes="conftest.java">
7032cfc83b6cSPedro Giffuni        </javac>
7033cfc83b6cSPedro Giffuni    </target>
7034cfc83b6cSPedro Giffuni    </project>
7035cfc83b6cSPedro GiffuniEOF
7036cfc83b6cSPedro Giffuni  oldJAVA_HOME=$JAVA_HOME
7037cfc83b6cSPedro Giffuni  if test "$JAVACISGCJ" = "yes"; then
7038cfc83b6cSPedro Giffuni    JAVA_HOME=; export JAVA_HOME
7039cfc83b6cSPedro Giffuni    ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
7040cfc83b6cSPedro Giffuni  else
7041cfc83b6cSPedro Giffuni    ant_cmd="$ANT -buildfile conftest.xml 1>&2"
7042cfc83b6cSPedro Giffuni  fi
7043cfc83b6cSPedro Giffuni  AC_TRY_EVAL(ant_cmd)
7044cfc83b6cSPedro Giffuni  if test $? = 0 && test -f ./conftest.class ; then
7045cfc83b6cSPedro Giffuni    AC_MSG_RESULT([Ant works])
7046cfc83b6cSPedro Giffuni    if test -z "$WITH_ANT_HOME"; then
7047cfc83b6cSPedro Giffuni        ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
7048cfc83b6cSPedro Giffuni        if test -z "$ANT_HOME"; then
7049cfc83b6cSPedro Giffuni            ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
7050cfc83b6cSPedro Giffuni        fi
7051cfc83b6cSPedro Giffuni    else
7052cfc83b6cSPedro Giffuni        ANT_HOME="$WITH_ANT_HOME"
7053cfc83b6cSPedro Giffuni    fi
7054cfc83b6cSPedro Giffuni  else
7055cfc83b6cSPedro Giffuni    echo "configure: Ant test failed" >&5
7056cfc83b6cSPedro Giffuni    cat conftest.java >&5
7057cfc83b6cSPedro Giffuni    cat conftest.xml >&5
7058cfc83b6cSPedro Giffuni    AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
7059cfc83b6cSPedro Giffuni    ANT_HOME=""
7060cfc83b6cSPedro Giffuni    echo "Ant does not work - Some Java projects will not build!" >>warn
7061cfc83b6cSPedro Giffuni  fi
7062cfc83b6cSPedro Giffuni  JAVA_HOME=$oldJAVA_HOME
7063cfc83b6cSPedro Giffuni  rm -f conftest* core core.* *.core
7064cfc83b6cSPedro Giffunifi
7065cfc83b6cSPedro Giffuniif test -z "$ANT_HOME"; then
7066cfc83b6cSPedro Giffuni   ANT_HOME="NO_ANT_HOME"
7067cfc83b6cSPedro Giffunifi
7068cfc83b6cSPedro GiffuniAC_SUBST(ANT_HOME)
7069cfc83b6cSPedro Giffuni
7070cfc83b6cSPedro Giffunidnl Checking for ant.jar
7071cfc83b6cSPedro Giffuniif test "$ANT_HOME" != "NO_ANT_HOME"; then
7072cfc83b6cSPedro Giffuni   AC_MSG_CHECKING([Ant lib directory])
7073cfc83b6cSPedro Giffuni   if test -f $ANT_HOME/lib/ant.jar; then
7074cfc83b6cSPedro Giffuni      ANT_LIB="$ANT_HOME/lib"
7075cfc83b6cSPedro Giffuni   else
7076cfc83b6cSPedro Giffuni      if test -f $ANT_HOME/ant.jar; then
7077cfc83b6cSPedro Giffuni         ANT_LIB="$ANT_HOME"
7078cfc83b6cSPedro Giffuni      else
7079cfc83b6cSPedro Giffuni          if test -f /usr/share/java/ant.jar; then
7080cfc83b6cSPedro Giffuni              ANT_LIB=/usr/share/java
7081cfc83b6cSPedro Giffuni          else
7082cfc83b6cSPedro Giffuni             if test -f /usr/share/ant-core/lib/ant.jar; then
7083cfc83b6cSPedro Giffuni                 ANT_LIB=/usr/share/ant-core/lib
7084cfc83b6cSPedro Giffuni             else
7085cfc83b6cSPedro Giffuni                if test -f $ANT_HOME/lib/ant/ant.jar; then
7086cfc83b6cSPedro Giffuni                    ANT_LIB="$ANT_HOME/lib/ant"
7087cfc83b6cSPedro Giffuni                else
7088cfc83b6cSPedro Giffuni                   if test -f /usr/share/lib/ant/ant.jar; then
7089cfc83b6cSPedro Giffuni                       ANT_LIB=/usr/share/lib/ant
7090cfc83b6cSPedro Giffuni                   else
7091cfc83b6cSPedro Giffuni                       AC_MSG_ERROR([Ant libraries not found!])
7092cfc83b6cSPedro Giffuni                   fi
7093cfc83b6cSPedro Giffuni                fi
7094cfc83b6cSPedro Giffuni             fi
7095cfc83b6cSPedro Giffuni          fi
7096cfc83b6cSPedro Giffuni      fi
7097cfc83b6cSPedro Giffuni   fi
7098cfc83b6cSPedro Giffuni   AC_MSG_RESULT([Ant lib directory found.])
7099cfc83b6cSPedro Giffunifi
7100cfc83b6cSPedro GiffuniAC_SUBST(ANT_LIB)
7101cfc83b6cSPedro Giffunifi
7102cfc83b6cSPedro Giffuni
710337cc8903SMatthias Seidelant_minver=1.9.1
7104cfc83b6cSPedro Giffuni# update for more extensions...
7105cfc83b6cSPedro Giffuniif test "$ENABLE_MEDIAWIKI" = "YES"; then
710637cc8903SMatthias Seidel  ant_minver=1.9.1
7107cfc83b6cSPedro Giffunifi
7108cfc83b6cSPedro Giffuniant_minminor1=`echo $ant_minver | cut -d"." -f2`
7109cfc83b6cSPedro Giffuni
7110cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether ant is >= $ant_minver])
7111cfc83b6cSPedro Giffuniant_version=`$ANT -version | $AWK '{ print $4; }'`
7112cfc83b6cSPedro Giffuniant_version_major=`echo $ant_version | cut -d. -f1`
7113cfc83b6cSPedro Giffuniant_version_minor=`echo $ant_version | cut -d. -f2`
7114cfc83b6cSPedro Giffuniecho "configure: ant_version $ant_version " >&5
7115cfc83b6cSPedro Giffuniecho "configure: ant_version_major $ant_version_major " >&5
7116cfc83b6cSPedro Giffuniecho "configure: ant_version_minor $ant_version_minor " >&5
7117cfc83b6cSPedro Giffuniif test "$ant_version_major" -ge "2"; then
7118cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes, $ant_version])
7119cfc83b6cSPedro Giffunielif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
7120cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes, $ant_version])
7121cfc83b6cSPedro Giffunielse
7122cfc83b6cSPedro Giffuni   AC_MSG_ERROR([no, you need at least ant >= $ant_minver])
7123cfc83b6cSPedro Giffunifi
7124cfc83b6cSPedro Giffuni
7125cfc83b6cSPedro Giffuniif test "$ENABLE_MEDIAWIKI" = "YES"; then
7126cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether ant supports mapper type="regexp"])
7127cfc83b6cSPedro Giffunirm -rf confdir
7128cfc83b6cSPedro Giffunimkdir confdir
7129cfc83b6cSPedro Giffunicat > conftest.java << EOF
7130cfc83b6cSPedro Giffuni    public class conftest {
7131cfc83b6cSPedro Giffuni        int testmethod(int a, int b) {
7132cfc83b6cSPedro Giffuni            return a + b;
7133cfc83b6cSPedro Giffuni        }
7134cfc83b6cSPedro Giffuni    }
7135cfc83b6cSPedro GiffuniEOF
7136cfc83b6cSPedro Giffuni
7137cfc83b6cSPedro Giffunicat > conftest.xml << EOF
7138cfc83b6cSPedro Giffuni    <project name="conftest" default="conftest">
7139cfc83b6cSPedro Giffuni        <target name="conftest" depends="copytest">
7140cfc83b6cSPedro Giffuni            <javac srcdir="." includes="conftest.java">
7141cfc83b6cSPedro Giffuni            </javac>
7142cfc83b6cSPedro Giffuni        </target>
7143cfc83b6cSPedro Giffuni        <target name="copytest">
7144cfc83b6cSPedro Giffuni             <copy todir="confdir">
7145cfc83b6cSPedro Giffuni                 <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
7146cfc83b6cSPedro Giffuni                 <filterset/>
7147cfc83b6cSPedro Giffuni                 <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
7148cfc83b6cSPedro Giffuni             </copy>
7149cfc83b6cSPedro Giffuni        </target>
7150cfc83b6cSPedro Giffuni    </project>
7151cfc83b6cSPedro GiffuniEOF
7152cfc83b6cSPedro Giffuni  if test "$JAVACISGCJ" = "yes"; then
7153cfc83b6cSPedro Giffuni    JAVA_HOME=; export JAVA_HOME
7154cfc83b6cSPedro Giffuni    ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
7155cfc83b6cSPedro Giffuni  else
7156cfc83b6cSPedro Giffuni    ant_cmd="$ANT -buildfile conftest.xml 1>&2"
7157cfc83b6cSPedro Giffuni  fi
7158cfc83b6cSPedro Giffuni  AC_TRY_EVAL(ant_cmd)
7159cfc83b6cSPedro Giffuni  if test $? = 0 && test -f ./conftest.class ; then
7160cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
7161cfc83b6cSPedro Giffuni    rm -rf confdir
7162cfc83b6cSPedro Giffuni  else
7163cfc83b6cSPedro Giffuni    echo "configure: Ant test failed" >&5
7164cfc83b6cSPedro Giffuni    cat conftest.java >&5
7165cfc83b6cSPedro Giffuni    cat conftest.xml >&5
7166cfc83b6cSPedro Giffuni    rm -rf confdir
7167cfc83b6cSPedro Giffuni    AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
7168cfc83b6cSPedro Giffuni  fi
7169cfc83b6cSPedro Giffunifi
7170cfc83b6cSPedro Giffunirm -f conftest* core core.* *.core
7171cfc83b6cSPedro Giffuni
7172cfc83b6cSPedro GiffuniOOO_JUNIT_JAR=
717311e97782SDamjan JovanovicJUNIT_NEEDS_HAMCREST=
7174f0157b90Skschenkif test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
717511e97782SDamjan Jovanovic    AC_MSG_CHECKING([for JUnit])
7176cfc83b6cSPedro Giffuni    if test "$with_junit" = "yes"; then
7177cfc83b6cSPedro Giffuni        if test -e /usr/share/java/junit4.jar; then
7178cfc83b6cSPedro Giffuni           OOO_JUNIT_JAR=/usr/share/java/junit4.jar
7179cfc83b6cSPedro Giffuni        else
718011e97782SDamjan Jovanovic           if test -e /usr/local/share/java/classes/junit4.jar; then
718111e97782SDamjan Jovanovic              OOO_JUNIT_JAR=/usr/local/share/java/classes/junit4.jar
718211e97782SDamjan Jovanovic           else
7183cfc83b6cSPedro Giffuni              if test -e /usr/share/lib/java/junit.jar; then
7184cfc83b6cSPedro Giffuni                 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
7185cfc83b6cSPedro Giffuni              else
718611e97782SDamjan Jovanovic                 if test -e /usr/share/local/lib/java/junit.jar; then
718711e97782SDamjan Jovanovic                    OOO_JUNIT_JAR=/usr/share/local/lib/java/junit.jar
718811e97782SDamjan Jovanovic                 else
718911e97782SDamjan Jovanovic                    if test -e /usr/share/java/junit.jar; then
7190cfc83b6cSPedro Giffuni                       OOO_JUNIT_JAR=/usr/share/java/junit.jar
719111e97782SDamjan Jovanovic                    else
719211e97782SDamjan Jovanovic                       if test -e /usr/local/share/java/classes/junit.jar; then
719311e97782SDamjan Jovanovic                          OOO_JUNIT_JAR=/usr/local/share/java/classes/junit.jar
719411e97782SDamjan Jovanovic                       fi
719511e97782SDamjan Jovanovic                    fi
719611e97782SDamjan Jovanovic                 fi
719711e97782SDamjan Jovanovic              fi
7198cfc83b6cSPedro Giffuni           fi
7199cfc83b6cSPedro Giffuni        fi
7200cfc83b6cSPedro Giffuni    else
7201cfc83b6cSPedro Giffuni        OOO_JUNIT_JAR=$with_junit
7202cfc83b6cSPedro Giffuni    fi
720311e97782SDamjan Jovanovic    if test -e "$OOO_JUNIT_JAR"; then
720411e97782SDamjan Jovanovic        AC_MSG_RESULT([yes])
720511e97782SDamjan Jovanovic    else
720611e97782SDamjan Jovanovic        AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
720711e97782SDamjan Jovanoviclocations (/usr/share/java or /usr/local/share/java/classes), specify its pathname via
720811e97782SDamjan Jovanovic--with-junit=..., or disable it via --without-junit.])
720911e97782SDamjan Jovanovic    fi
7210cfc83b6cSPedro Giffuni    if test "$_os" = "WINNT"; then
7211cfc83b6cSPedro Giffuni        OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
7212cfc83b6cSPedro Giffuni    fi
721311e97782SDamjan Jovanovic    AC_MSG_CHECKING([whether JUnit is version 4.x])
721411e97782SDamjan Jovanovic    export OOO_JUNIT_JAR
721511e97782SDamjan Jovanovic    if $PERL -e 'use Archive::Zip;
721611e97782SDamjan Jovanovic        my $file = "$ENV{'OOO_JUNIT_JAR'}";
721711e97782SDamjan Jovanovic        my $zip = Archive::Zip->new( $file );
721811e97782SDamjan Jovanovic        my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
721911e97782SDamjan Jovanovic        if ( $mf =~ m/Implementation-Version: 4.12*/ ) {
722011e97782SDamjan Jovanovic            exit 0;
722111e97782SDamjan Jovanovic        } elsif ( $mf =~ m/Implementation-Version: 4.11*/ ) {
722211e97782SDamjan Jovanovic            exit 0;
72235b85db3eSDamjan Jovanovic        } elsif ( $mf =~ m/Bundle-Version: 4.12*/ ) {
72245b85db3eSDamjan Jovanovic            exit 0;
72255b85db3eSDamjan Jovanovic        } elsif ( $mf =~ m/Bundle-Version: 4.11*/ ) {
72265b85db3eSDamjan Jovanovic            exit 0;
722711e97782SDamjan Jovanovic        } else {
722811e97782SDamjan Jovanovic            exit 1;
722911e97782SDamjan Jovanovic        }'; then
723011e97782SDamjan Jovanovic        AC_MSG_RESULT([yes, but Hamcrest Core is mandatory with this JUnit version (>= 4.11)])
723111e97782SDamjan Jovanovic        JUNIT_NEEDS_HAMCREST=yes
723211e97782SDamjan Jovanovic    elif $PERL -e 'use Archive::Zip;
723311e97782SDamjan Jovanovic        my $file = "$ENV{'OOO_JUNIT_JAR'}";
723411e97782SDamjan Jovanovic        my $zip = Archive::Zip->new( $file );
723511e97782SDamjan Jovanovic        my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
723611e97782SDamjan Jovanovic        if ( $mf =~ m/Implementation-Version: 4.*/ ) {
723711e97782SDamjan Jovanovic            exit 0;
72385b85db3eSDamjan Jovanovic        } elsif ( $mf =~ m/Bundle-Version: 4.*/ ) {
723911e97782SDamjan Jovanovic        } else {
724011e97782SDamjan Jovanovic            exit 1;
724111e97782SDamjan Jovanovic        }'; then
724211e97782SDamjan Jovanovic        AC_MSG_RESULT([yes])
7243cfc83b6cSPedro Giffuni    else
724411e97782SDamjan Jovanovic        AC_MSG_ERROR([no, your JUnit version is too old, you need JUnit 4.x])
7245cfc83b6cSPedro Giffuni    fi
7246cfc83b6cSPedro Giffunifi
7247cfc83b6cSPedro GiffuniAC_SUBST(OOO_JUNIT_JAR)
7248cfc83b6cSPedro Giffuni
7249947c15fcSDamjan JovanovicHAMCREST_CORE_JAR=
725011e97782SDamjan Jovanovicif test "$SOLAR_JAVA" != "" && test "$with_hamcrest_core" != "no"; then
7251947c15fcSDamjan Jovanovic    AC_MSG_CHECKING([for hamcrest-core])
7252947c15fcSDamjan Jovanovic    if test "$with_hamcrest_core" = "yes"; then
725311e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest-core-1.3.jar; then
7254947c15fcSDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest-core-1.3.jar
725511e97782SDamjan Jovanovic        fi
725611e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest-core-1.3.jar; then
725711e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest-core-1.3.jar
725811e97782SDamjan Jovanovic        fi
725911e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/lib/java/hamcrest-core.jar; then
7260947c15fcSDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/lib/java/hamcrest-core.jar
726111e97782SDamjan Jovanovic        fi
726211e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/lib/java/hamcrest-core.jar; then
726311e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/lib/java/hamcrest-core.jar
726411e97782SDamjan Jovanovic        fi
726511e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest-core.jar; then
7266947c15fcSDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest-core.jar
7267947c15fcSDamjan Jovanovic        fi
726811e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest-core.jar; then
726911e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest-core.jar
727011e97782SDamjan Jovanovic        fi
727111e97782SDamjan Jovanovic        # Sometimes the "-core-" part is missing...
727211e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest1.3.jar; then
727311e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest1.3.jar
727411e97782SDamjan Jovanovic        fi
727511e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest1.3.jar; then
727611e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest1.3.jar
727711e97782SDamjan Jovanovic        fi
727811e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/lib/java/hamcrest.jar; then
727911e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/lib/java/hamcrest.jar
728011e97782SDamjan Jovanovic        fi
728111e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/lib/java/hamcrest.jar; then
728211e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/lib/java/hamcrest.jar
728311e97782SDamjan Jovanovic        fi
728411e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest.jar; then
728511e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest.jar
728611e97782SDamjan Jovanovic        fi
728711e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest.jar; then
728811e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest.jar
7289947c15fcSDamjan Jovanovic        fi
7290947c15fcSDamjan Jovanovic    else
7291947c15fcSDamjan Jovanovic        HAMCREST_CORE_JAR=$with_hamcrest_core
7292947c15fcSDamjan Jovanovic    fi
729311e97782SDamjan Jovanovic    if test -e "$HAMCREST_CORE_JAR"; then
729411e97782SDamjan Jovanovic        AC_MSG_RESULT([yes])
7295947c15fcSDamjan Jovanovic        if test "$_os" = "WINNT"; then
7296947c15fcSDamjan Jovanovic            HAMCREST_CORE_JAR=`cygpath -m "$HAMCREST_CORE_JAR"`
7297947c15fcSDamjan Jovanovic        fi
7298947c15fcSDamjan Jovanovic    else
729911e97782SDamjan Jovanovic        if test "$JUNIT_NEEDS_HAMCREST" = "yes"; then
7300947c15fcSDamjan Jovanovic            AC_MSG_ERROR([cannot find hamcrest-core jar; please install one in the
730111e97782SDamjan Jovanovicdefault locations (/usr/share/java or /usr/local/share/java/classes), specify its
7302947c15fcSDamjan Jovanovicpathname via --with-hamcrest-core=..., or disable
730311e97782SDamjan Jovanovicit via --without-hamcrest-core or --without-junit])
730411e97782SDamjan Jovanovic        else
730511e97782SDamjan Jovanovic            AC_MSG_RESULT([no, skipping])
730611e97782SDamjan Jovanovic        fi
730711e97782SDamjan Jovanovic    fi
730811e97782SDamjan Jovanovicelse
730911e97782SDamjan Jovanovic    if test "$JUNIT_NEEDS_HAMCREST" = "yes"; then
731011e97782SDamjan Jovanovic        AC_MSG_ERROR([JUnit needs Hamcrest but Hamcrest disabled.])
7311947c15fcSDamjan Jovanovic    fi
7312947c15fcSDamjan Jovanovicfi
7313947c15fcSDamjan JovanovicAC_SUBST(HAMCREST_CORE_JAR)
7314947c15fcSDamjan Jovanovic
7315cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which languages to be built])
7316cfc83b6cSPedro GiffuniWITH_LANG="$with_lang"
7317cfc83b6cSPedro Giffuniif test -z "$WITH_LANG"; then
7318cfc83b6cSPedro Giffuni   AC_MSG_RESULT([en-US])
7319cfc83b6cSPedro Giffunielse
7320cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$WITH_LANG])
7321cfc83b6cSPedro Giffuni   ADDITIONAL_REPOSITORIES="$ADDITIONAL_REPOSITORIES ../extras"
7322cfc83b6cSPedro Giffuni   BUILD_TYPE="$BUILD_TYPE L10N"
7323cfc83b6cSPedro Giffunifi
7324cfc83b6cSPedro GiffuniAC_SUBST(WITH_LANG)
7325cfc83b6cSPedro Giffuni
7326cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which languages have poor help localizations])
7327cfc83b6cSPedro GiffuniWITH_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations"
7328cfc83b6cSPedro Giffuniif test -z "$WITH_POOR_HELP_LOCALIZATIONS"; then
7329cfc83b6cSPedro Giffuni   AC_MSG_RESULT([none])
7330cfc83b6cSPedro Giffunielse
7331cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$WITH_POOR_HELP_LOCALIZATIONS])
7332cfc83b6cSPedro Giffunifi
7333cfc83b6cSPedro GiffuniAC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
7334cfc83b6cSPedro Giffuni
7335cfc83b6cSPedro GiffuniAC_MSG_CHECKING([which dictionaries to include])
7336cfc83b6cSPedro Giffuniif test -z "$with_dict"; then
7337cfc83b6cSPedro Giffuni   WITH_DICT=,ALL,
7338cfc83b6cSPedro Giffuni   AC_MSG_RESULT([ALL])
7339cfc83b6cSPedro Giffunielse
7340cfc83b6cSPedro Giffuni   WITH_DICT=","$with_dict","
7341cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$with_dict])
7342cfc83b6cSPedro Giffunifi
7343cfc83b6cSPedro GiffuniAC_SUBST(WITH_DICT)
7344cfc83b6cSPedro Giffuni
7345cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for additional 'intro' bitmaps])
7346cfc83b6cSPedro GiffuniINTRO_BITMAPS=
7347cfc83b6cSPedro Giffuniif test -z "$with_intro_bitmaps" -o "$with_intro_bitmaps" = "no" ; then
7348cfc83b6cSPedro Giffuni   INTRO_BITMAPS=
7349cfc83b6cSPedro Giffuni   AC_MSG_RESULT([none])
7350cfc83b6cSPedro Giffunielse
7351cfc83b6cSPedro Giffuni   for bitmap in `echo $with_intro_bitmaps | tr ',' ' '` ; do
7352cfc83b6cSPedro Giffuni      case "$bitmap" in
7353cfc83b6cSPedro Giffuni         *.bmp) ;;
7354cfc83b6cSPedro Giffuni         *)     bitmap= ; AC_MSG_WARN([Intro bitmaps should be .bmp files!]) ;;
7355cfc83b6cSPedro Giffuni      esac
7356cfc83b6cSPedro Giffuni      if test -n "$bitmap" ; then
7357cfc83b6cSPedro Giffuni         INTRO_BITMAPS="$INTRO_BITMAPS $bitmap"
7358cfc83b6cSPedro Giffuni      fi
7359cfc83b6cSPedro Giffuni   done
7360cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$INTRO_BITMAPS])
7361cfc83b6cSPedro Giffunifi
7362cfc83b6cSPedro GiffuniAC_SUBST(INTRO_BITMAPS)
7363cfc83b6cSPedro Giffuni
7364cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for additional 'about' bitmaps])
7365cfc83b6cSPedro GiffuniABOUT_BITMAPS=
7366cfc83b6cSPedro Giffuniif test -z "$with_about_bitmaps" -o "$with_about_bitmaps" = "no" ; then
7367cfc83b6cSPedro Giffuni   ABOUT_BITMAPS=
7368cfc83b6cSPedro Giffuni   AC_MSG_RESULT([none])
7369cfc83b6cSPedro Giffunielse
7370cfc83b6cSPedro Giffuni   for bitmap in `echo $with_about_bitmaps | tr ',' ' '` ; do
7371cfc83b6cSPedro Giffuni      case "$bitmap" in
7372cfc83b6cSPedro Giffuni         *.bmp) ;;
7373cfc83b6cSPedro Giffuni         *)     bitmap= ; AC_MSG_WARN([About bitmaps should be .bmp files!]) ;;
7374cfc83b6cSPedro Giffuni      esac
7375cfc83b6cSPedro Giffuni      if test -n "$bitmap" ; then
7376cfc83b6cSPedro Giffuni         ABOUT_BITMAPS="$ABOUT_BITMAPS $bitmap"
7377cfc83b6cSPedro Giffuni      fi
7378cfc83b6cSPedro Giffuni   done
7379cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$ABOUT_BITMAPS])
7380cfc83b6cSPedro Giffunifi
7381cfc83b6cSPedro GiffuniAC_SUBST(ABOUT_BITMAPS)
7382cfc83b6cSPedro Giffuni
7383cfc83b6cSPedro GiffuniOOO_VENDOR=
7384cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for vendor])
7385cfc83b6cSPedro Giffuniif test -z "$with_vendor" -o "$with_vendor" = "no" ; then
7386cfc83b6cSPedro Giffuni   AC_MSG_RESULT([not set])
7387cfc83b6cSPedro Giffunielse
7388cfc83b6cSPedro Giffuni   OOO_VENDOR="$with_vendor"
7389cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$OOO_VENDOR])
7390cfc83b6cSPedro Giffunifi
7391cfc83b6cSPedro GiffuniAC_SUBST(OOO_VENDOR)
7392cfc83b6cSPedro Giffuni
7393cfc83b6cSPedro GiffuniUNIXWRAPPERNAME=
7394cfc83b6cSPedro GiffuniAC_MSG_CHECKING([for UNIX wrapper name])
7395cfc83b6cSPedro Giffuniif test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes" ; then
7396cfc83b6cSPedro Giffuni   AC_MSG_RESULT([not set])
7397cfc83b6cSPedro Giffunielse
7398cfc83b6cSPedro Giffuni   UNIXWRAPPERNAME="$with_unix_wrapper"
7399cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$UNIXWRAPPERNAME])
7400cfc83b6cSPedro Giffunifi
7401cfc83b6cSPedro GiffuniAC_SUBST(UNIXWRAPPERNAME)
7402cfc83b6cSPedro Giffuni
7403cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to statically link to Gtk])
7404cfc83b6cSPedro Giffuniif test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
7405cfc83b6cSPedro Giffuni   ENABLE_STATIC_GTK="TRUE"
7406cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
7407cfc83b6cSPedro Giffunielse
7408cfc83b6cSPedro Giffuni   ENABLE_STATIC_GTK="FALSE"
7409cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
7410cfc83b6cSPedro Giffunifi
7411cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_STATIC_GTK)
7412cfc83b6cSPedro Giffuni
7413cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to use layout dialogs])
7414cfc83b6cSPedro Giffuniif test -n "$enable_layout" && test "$enable_layout" != "no"; then
7415cfc83b6cSPedro Giffuni   ENABLE_LAYOUT="TRUE"
7416cfc83b6cSPedro Giffuni   AC_MSG_RESULT([yes])
7417cfc83b6cSPedro Giffunielse
7418cfc83b6cSPedro Giffuni   ENABLE_LAYOUT="FALSE"
7419cfc83b6cSPedro Giffuni   AC_MSG_RESULT([no])
7420cfc83b6cSPedro Giffunifi
7421cfc83b6cSPedro GiffuniAC_SUBST(ENABLE_LAYOUT)
7422cfc83b6cSPedro Giffuni
7423cfc83b6cSPedro Giffuni# ===================================================================
7424cfc83b6cSPedro Giffuni# De- or increase default verbosity of build process
7425cfc83b6cSPedro Giffuni# ===================================================================
7426cfc83b6cSPedro GiffuniAC_MSG_CHECKING([build verbosity])
7427cfc83b6cSPedro Giffuniif test -n "$enable_verbose"; then
7428cfc83b6cSPedro Giffuni   if test "$enable_verbose" = "yes"; then
7429cfc83b6cSPedro Giffuni      VERBOSE="TRUE"
7430cfc83b6cSPedro Giffuni      AC_MSG_RESULT([high])
7431cfc83b6cSPedro Giffuni   fi
7432cfc83b6cSPedro Giffuni   if test "$enable_verbose" = "no"; then
7433cfc83b6cSPedro Giffuni      VERBOSE="FALSE"
7434cfc83b6cSPedro Giffuni      AC_MSG_RESULT([low])
7435cfc83b6cSPedro Giffuni   fi
7436cfc83b6cSPedro Giffunielse
7437cfc83b6cSPedro Giffuni   AC_MSG_RESULT([not set])
7438cfc83b6cSPedro Giffunifi
7439cfc83b6cSPedro GiffuniAC_SUBST(VERBOSE)
7440cfc83b6cSPedro Giffuni
7441cfc83b6cSPedro Giffunidnl ===================================================================
7442e986c8d8SMatthias Seideldnl Hook up AOOs nodep environmental variable to automake's equivalent
7443cfc83b6cSPedro Giffunidnl --enable-dependency-tracking configure option
7444cfc83b6cSPedro Giffunidnl ===================================================================
7445cfc83b6cSPedro GiffuniAC_MSG_CHECKING([whether to enable dependency tracking])
7446cfc83b6cSPedro Giffuniif test "$enable_dependency_tracking" = "no"; then
7447cfc83b6cSPedro Giffuni    nodep=TRUE
7448cfc83b6cSPedro Giffuni    AC_MSG_RESULT([no])
7449cfc83b6cSPedro Giffunielse
7450cfc83b6cSPedro Giffuni    AC_MSG_RESULT([yes])
7451cfc83b6cSPedro Giffunifi
7452cfc83b6cSPedro GiffuniAC_SUBST(nodep)
7453cfc83b6cSPedro Giffuni
7454cfc83b6cSPedro Giffunidnl ===================================================================
7455cfc83b6cSPedro Giffunidnl Setting up the environment.
7456cfc83b6cSPedro Giffunidnl ===================================================================
7457cfc83b6cSPedro Giffuniecho "********************************************************************"
7458cfc83b6cSPedro Giffuniecho "*                                                                  *"
7459cfc83b6cSPedro Giffuniecho "*   Setting up the build environment variables.                    *"
7460cfc83b6cSPedro Giffuniecho "*                                                                  *"
7461cfc83b6cSPedro Giffuniecho "********************************************************************"
7462cfc83b6cSPedro Giffuni
7463cfc83b6cSPedro Giffuniif test -z "$COMPATH"; then
7464cfc83b6cSPedro Giffuni   AC_MSG_ERROR([No compiler found.])
7465cfc83b6cSPedro Giffunifi
7466cfc83b6cSPedro GiffuniAC_SUBST(COMPATH)
7467cfc83b6cSPedro GiffuniAC_SUBST(CC_PATH)
7468cfc83b6cSPedro Giffuni
7469cfc83b6cSPedro GiffuniAC_MSG_CHECKING([solver path])
7470cfc83b6cSPedro Giffuniif test -z "$with_local_solver"; then
7471cfc83b6cSPedro Giffuni   LOCAL_SOLVER="DEFAULT"
7472cfc83b6cSPedro Giffuni   AC_MSG_RESULT([default])
7473cfc83b6cSPedro Giffunielse
7474cfc83b6cSPedro Giffuni   LOCAL_SOLVER=$with_local_solver
7475cfc83b6cSPedro Giffuni   AC_MSG_RESULT([$with_local_solver])
7476cfc83b6cSPedro Giffunifi
7477cfc83b6cSPedro GiffuniAC_SUBST(LOCAL_SOLVER)
7478cfc83b6cSPedro Giffuni
7479cfc83b6cSPedro GiffuniAC_SUBST(BUILD_TYPE)
7480cfc83b6cSPedro GiffuniAC_SUBST(ADDITIONAL_REPOSITORIES)
7481cfc83b6cSPedro Giffuni
7482cfc83b6cSPedro Giffuni# make sure config.guess is +x; we execute config.guess, so it has to be so;
7483cfc83b6cSPedro Giffunichmod +x ./config.guess
7484cfc83b6cSPedro Giffuni
7485cfc83b6cSPedro Giffuni# Create files from their *.in templates.
7486cfc83b6cSPedro GiffuniAC_CONFIG_FILES([set_soenv Makefile])
7487cfc83b6cSPedro Giffuni
7488cfc83b6cSPedro GiffuniAC_MSG_NOTICE([writing config.status])
7489cfc83b6cSPedro GiffuniAC_OUTPUT
7490cfc83b6cSPedro Giffuni
7491cfc83b6cSPedro Giffunidnl Executing the set_soenv script to setup the environment variables.
7492cfc83b6cSPedro Giffunichmod a+x set_soenv
7493cfc83b6cSPedro Giffuniif test -z "$enable_check_only"; then
7494cfc83b6cSPedro Giffuni   './set_soenv'
7495cfc83b6cSPedro Giffunielse
7496cfc83b6cSPedro Giffuni   echo
7497cfc83b6cSPedro Giffuni   echo Test Complete
7498cfc83b6cSPedro Giffuni   echo No environment file will be generated
7499cfc83b6cSPedro Giffuni   echo
7500cfc83b6cSPedro Giffuni   num_warnings=`wc -l warn`
7501cfc83b6cSPedro Giffuni   _num=`echo $num_warnings | $AWK '{ print $1 }'`
7502cfc83b6cSPedro Giffuni   if test $_num -gt 0; then
7503cfc83b6cSPedro Giffuni      echo The following warning\(s\) were generated by configure
7504cfc83b6cSPedro Giffuni      echo ----------------------------------------------------
7505cfc83b6cSPedro Giffuni      echo
7506cfc83b6cSPedro Giffuni      cat warn
7507cfc83b6cSPedro Giffuni      echo
7508cfc83b6cSPedro Giffuni   else
7509cfc83b6cSPedro Giffuni      echo There were no warnings
7510cfc83b6cSPedro Giffuni   fi
7511cfc83b6cSPedro Giffuni   echo
7512cfc83b6cSPedro Giffunifi
7513f0157b90Skschenk
7514