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