xref: /aoo42x/main/configure.ac (revision 3187fb04)
1184e05d2SAndrew Ristdnl * *************************************************************
2da2e13d4SMatthias Seideldnl *
3184e05d2SAndrew Ristdnl *  Licensed to the Apache Software Foundation (ASF) under one
4184e05d2SAndrew Ristdnl *  or more contributor license agreements.  See the NOTICE file
5184e05d2SAndrew Ristdnl *  distributed with this work for additional information
6184e05d2SAndrew Ristdnl *  regarding copyright ownership.  The ASF licenses this file
7184e05d2SAndrew Ristdnl *  to you under the Apache License, Version 2.0 (the
8184e05d2SAndrew Ristdnl *  "License"); you may not use this file except in compliance
9184e05d2SAndrew Ristdnl *  with the License.  You may obtain a copy of the License at
10da2e13d4SMatthias Seideldnl *
11184e05d2SAndrew Ristdnl *    http://www.apache.org/licenses/LICENSE-2.0
12da2e13d4SMatthias Seideldnl *
13184e05d2SAndrew Ristdnl *  Unless required by applicable law or agreed to in writing,
14184e05d2SAndrew Ristdnl *  software distributed under the License is distributed on an
15184e05d2SAndrew Ristdnl *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16184e05d2SAndrew Ristdnl *  KIND, either express or implied.  See the License for the
17184e05d2SAndrew Ristdnl *  specific language governing permissions and limitations
18184e05d2SAndrew Ristdnl *  under the License.
19da2e13d4SMatthias Seideldnl *
20184e05d2SAndrew Ristdnl * *************************************************************
210495d53eSpfgAC_REVISION( $Revision$ )
22cdf0e10cSrcweirAC_PREREQ(2.50)
23cdf0e10cSrcweirAC_INIT()
24cdf0e10cSrcweirecho "$@" >config.parms
25fb6b49d1SJürgen SchmidtAC_ARG_WITH(dmake-path,
26fb6b49d1SJürgen Schmidt[  --with-dmake-path=<PATH TO EXECUTABLE>   Specify the location of dmake ],
27fb6b49d1SJürgen Schmidt[  DMAKE_PATH="$withval"
28fb6b49d1SJürgen Schmidt])
29fb6b49d1SJürgen SchmidtAC_ARG_WITH(dmake-url,
30fb6b49d1SJürgen Schmidt[  --with-dmake-url=<URL>   Specify the location of downloadable dmake source code. For example:
315b4e3b0fSJim Jagielski                          https://github.com/jimjag/dmake/archive/v4.13.1/dmake-4.13.1.tar.gz
32fb6b49d1SJürgen Schmidt                          Note that dmake is under GPL license.],
33fb6b49d1SJürgen Schmidt[  DMAKE_URL="$withval"
34fb6b49d1SJürgen Schmidt])
3572bd2d34SAriel Constenla-HaileAC_ARG_WITH(packager-list,
3672bd2d34SAriel Constenla-Haile[  --with-packager-list=<PATH TO PACK LIST>   Specify a file to drive the packaging process.
3772bd2d34SAriel Constenla-Haile                          The file must follow the format explained in
3872bd2d34SAriel Constenla-Haile                          instsetoo_native/util/pack.lst
3972bd2d34SAriel Constenla-Haile],,)
40cdf0e10cSrcweirAC_ARG_WITH(gnu-patch,
41cdf0e10cSrcweir[  --with-gnu-patch        Specify location of GNU patch on Solaris or FreeBSD
42cdf0e10cSrcweir],,)
43cdf0e10cSrcweirAC_ARG_WITH(gnu-cp,
4462840caaSPedro Giffuni[  --with-gnu-cp           Specify location of GNU cp on Solaris
45cdf0e10cSrcweir],,)
4610e8ff58SPedro GiffuniAC_ARG_WITH(gperf,
4710e8ff58SPedro Giffuni[  --with-gperf           Specify location of gperf on Solaris or FreeBSD
4810e8ff58SPedro Giffuni],,)
49cdf0e10cSrcweirAC_ARG_ENABLE(graphite,
50cdf0e10cSrcweir[  --enable-graphite       Enables the compilation of Graphite smart font rendering
51cdf0e10cSrcweir],,)
52cdf0e10cSrcweirAC_ARG_WITH(system-graphite,
53cdf0e10cSrcweir[  --with-system-graphite    use graphite library already installed on system
54cdf0e10cSrcweir],,)
55e9b3fa8aSMaho NAKATAAC_ARG_WITH(system-apache-commons,
56e9b3fa8aSMaho NAKATA[  --with-system-apache-commons    use apache-commons jar files already installed on system
57e9b3fa8aSMaho NAKATA],,)
5835779863SAriel Constenla-HaileAC_ARG_ENABLE(online-update,
5935779863SAriel Constenla-Haile[  --disable-online-update Disables the Online Update feature.
6035779863SAriel Constenla-Haile],,enable_online_update=yes)
6143feee13SJuergen SchmidtAC_ARG_ENABLE(unit-tests,
62da2e13d4SMatthias Seidel[  --disable-unit-tests    Disables default unit tests (eg. unit tests using Google test, ...).
6343feee13SJuergen Schmidt],,enable_unit_tests=yes)
64cdf0e10cSrcweirAC_ARG_ENABLE(ldap,
65ffd43a0aSHerbert Dürr[  --disable-ldap          Disables the use of LDAP backend via OpenLDAP
66cdf0e10cSrcweir],,)
67cdf0e10cSrcweirAC_ARG_ENABLE(fetch-external,
68cdf0e10cSrcweir[  --disable-fetch-external Disables fetching external tarballs from web sources.
69cdf0e10cSrcweir],,)
70cdf0e10cSrcweirAC_ARG_WITH(external-tar,
71cdf0e10cSrcweir[  --with-external-tar=<TARFILE PATH>   Specify path to tarfiles manually ],
72cdf0e10cSrcweir[ TARFILE_LOCATION="$withval"
73cdf0e10cSrcweir])
74cdf0e10cSrcweirAC_ARG_WITH(openldap,
75ffd43a0aSHerbert Dürr[  --with-openldap         Enables the use of the OpenLDAP
76cdf0e10cSrcweir],,)
77cdf0e10cSrcweirAC_ARG_ENABLE(lockdown,
78e986c8d8SMatthias Seidel[  --enable-lockdown       Enables the gconf integration work in AOO
79cdf0e10cSrcweir],,)
80cdf0e10cSrcweirAC_ARG_ENABLE(vba,
81cdf0e10cSrcweir[  --disable-vba           disables the vba compatibility feature
82cdf0e10cSrcweir],,)
83cdf0e10cSrcweirAC_ARG_WITH(vba-package-format,
84cdf0e10cSrcweir[  --with-vba-package-format   specify package format for vba compatibility api.
85e986c8d8SMatthias Seidel                          Specifying "builtin" means the api component and
86e986c8d8SMatthias Seidel                          associated type library are part of the installation set.
87cdf0e10cSrcweir                          Specifying "extn" creates an uno extension that is
88e986c8d8SMatthias Seidel                          part of the installation set ( located in the program
89cdf0e10cSrcweir                          directory ) that MUST be optionly registered using
90cdf0e10cSrcweir                          either the unopkg executeable or the extension manager
91cdf0e10cSrcweir                          gui.
92e986c8d8SMatthias Seidel
93cdf0e10cSrcweir                          Note: "builtin" is the default, "extn" can cause
94cdf0e10cSrcweir                          problems.
95cdf0e10cSrcweir                          Usage: --with-vba-package-format="builtin" or
96cdf0e10cSrcweir                                 --with-vba-package-format="extn"
97e986c8d8SMatthias Seidel],,)
98cdf0e10cSrcweirAC_ARG_ENABLE(pch,
99cdf0e10cSrcweir[  --enable-pch            EXPERIMENTAL: Enables precompiled header support for C++.
100cdf0e10cSrcweir],,)
101cdf0e10cSrcweirAC_ARG_WITH(fonts,
102e986c8d8SMatthias Seidel[  --without-fonts         AOO includes some third-party fonts to provide a reliable
103cdf0e10cSrcweir                          basis for help content, templates, samples, etc.
104cdf0e10cSrcweir                          When these fonts are already known to be available on the
105cdf0e10cSrcweir                          system then you should use this option.
106cdf0e10cSrcweir],,)
107cdf0e10cSrcweirAC_ARG_WITH(ppds,
108cdf0e10cSrcweir[  --without-ppds          Removes Postscript Printer definition files from
109c4266413SHerbert Dürr                          Apache Openoffice installation set, for people building
110cdf0e10cSrcweir                          for specific distributions where PPDs are known to be
111cdf0e10cSrcweir                          already available (every recent distro with CUPS
112cdf0e10cSrcweir                          backend)
113cdf0e10cSrcweir],,)
114cdf0e10cSrcweirAC_ARG_WITH(afms,
115c4266413SHerbert Dürr[  --without-afms          Removes bitmap font files from Apache Openoffice
116cdf0e10cSrcweir                          installation set, for people building for specific
117cdf0e10cSrcweir                          distributions where AFM files or TrueType Fonts
118cdf0e10cSrcweir                          are known to be available.
119cdf0e10cSrcweir],,)
120cdf0e10cSrcweirAC_ARG_ENABLE(epm,
12105ab2edcSJim Jagielski[  --disable-epm           AOO includes self-packaging code, that requires EPM.
122cdf0e10cSrcweir],,enable_epm="yes")
123cdf0e10cSrcweirAC_ARG_WITH(epm,
12405ab2edcSJim Jagielski[  --with-epm		  Decides which EPM to use. Default is to use
12505ab2edcSJim Jagielski			  the one installed on the system if one is there. When
126cdf0e10cSrcweir			  either this is not there or you say =internal
12705ab2edcSJim Jagielski			  EPM will be built.
128cdf0e10cSrcweir],,)
12944a214f4SJürgen SchmidtAC_ARG_WITH(epm-url,
130b48104e3Sjim[  --with-epm-url=<URL>    Specify the location of downloadable epm source code. For example:
1319499803eSJim Jagielski                            https://github.com/jimjag/epm/archive/v5.0.0/epm-5.0.0.tar.gz
13205ab2edcSJim Jagielski                          Version 5.0.0 or later is required.
1337734da27SHerbert Dürr],[  EPM_URL="$withval"
13444a214f4SJürgen Schmidt])
135cdf0e10cSrcweirAC_ARG_WITH(package-format,
136e986c8d8SMatthias Seidel[  --with-package-format   specify package format(s) for AOO installsets.
137cdf0e10cSrcweir                          Default is "normal" one of the OS/Distribution.
138cdf0e10cSrcweir
139cdf0e10cSrcweir                          Usage: --with-package-format="foo bar"
140da2e13d4SMatthias Seidel],,)
141cdf0e10cSrcweirAC_ARG_ENABLE(odk,
142c4211d71SMatthias Seidel[  --disable-odk           AOO includes an ODK, office development kit
143c4211d71SMatthias Seidel                          which some packagers may want to build without
144cdf0e10cSrcweir],,enable_odk="yes")
145cdf0e10cSrcweirAC_ARG_ENABLE(mathmldtd,
146cdf0e10cSrcweir[  --disable-mathmldtd     disable mathmldtd
147cdf0e10cSrcweir                          (useful for distributions that want to avoid packaging
148cdf0e10cSrcweir                          it)
149cdf0e10cSrcweir],,enable_mathmldtd="yes")
150cdf0e10cSrcweirAC_ARG_ENABLE(evolution2,
151cdf0e10cSrcweir[  --enable-evolution2     Allows the built-in evolution 2 addressbook
152cdf0e10cSrcweir                          connectivity build to be enabled.
153cdf0e10cSrcweir],,)
154cdf0e10cSrcweirAC_ARG_WITH(system-stdlibs,
155cdf0e10cSrcweir[  --with-system-stdlibs   use libstdc++/libgcc_s already on system
156cdf0e10cSrcweir],,)
157cdf0e10cSrcweirAC_ARG_ENABLE(cups,
1587f413237SHerbert Dürr[  --disable-cups          disable CUPS support (for printing on UNIX)
159cdf0e10cSrcweir],,enable_cups=yes)
160cdf0e10cSrcweirAC_ARG_ENABLE(fontconfig,
161cdf0e10cSrcweir[  --disable-fontconfig    disable support for the fontconfig library
162cdf0e10cSrcweir],,enable_fontconfig=yes)
163cdf0e10cSrcweirAC_ARG_ENABLE(directx,
164cdf0e10cSrcweir[  --disable-directx       Remove DirectX implementation for the new XCanvas
165cdf0e10cSrcweir                          interface. The DirectX support requires more stuff
166cdf0e10cSrcweir                          installed on Windows to compile.
167cdf0e10cSrcweir                          (DirectX SDK, GDI+ libs)
168cdf0e10cSrcweir],,enable_directx=yes)
169cdf0e10cSrcweirAC_ARG_ENABLE(activex,
170407bc2eeSMatthias Seidel[  --disable-activex       Disable the use of ActiveX for Windows build.
171cdf0e10cSrcweir                          This switch is mandatory when using VC++ 2005/2008 Express.
1728e8da03fSAriel Constenla-Haile                          Alternatively you can use the Windows Driver Kit (WDK) and
1738e8da03fSAriel Constenla-Haile                          configure with the following switches:
1748e8da03fSAriel Constenla-Haile                          --with-atl-include-dir=$WDK_HOME\inc\atl71
1758e8da03fSAriel Constenla-Haile                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
1768e8da03fSAriel Constenla-Haile                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
1778e8da03fSAriel Constenla-Haile                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
178cdf0e10cSrcweir],,)
179cdf0e10cSrcweir
180cdf0e10cSrcweirAC_ARG_ENABLE(atl,
181407bc2eeSMatthias Seidel[  --disable-atl          Disable the use of ATL for Windows build.
182cdf0e10cSrcweir                          This switch is mandatory when using VC++ 2005/2008 Express.
1838e8da03fSAriel Constenla-Haile                          Alternatively you can use the Windows Driver Kit (WDK) and
1848e8da03fSAriel Constenla-Haile                          configure with the following switches:
1858e8da03fSAriel Constenla-Haile                          --with-atl-include-dir=$WDK_HOME\inc\atl71
1868e8da03fSAriel Constenla-Haile                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
1878e8da03fSAriel Constenla-Haile                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
1888e8da03fSAriel Constenla-Haile                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
189cdf0e10cSrcweir],,)
190cdf0e10cSrcweir
1918e8da03fSAriel Constenla-HaileAC_ARG_WITH(atl-include-dir,
192407bc2eeSMatthias Seidel[  --with-atl-include-dir      Path to ATL include directory for Windows build.
1938e8da03fSAriel Constenla-Haile                          This switch is mandatory when using VC++ 2008 Express
1948e8da03fSAriel Constenla-Haile                          and configuring with ATL/ActiveX enabled.
1958e8da03fSAriel Constenla-Haile                          You can use the Windows Driver Kit (WDK) and
1968e8da03fSAriel Constenla-Haile                          configure with the following switch:
1978e8da03fSAriel Constenla-Haile                          --with-atl-include-dir=$WDK_HOME\inc\atl71
1988e8da03fSAriel Constenla-Haile],,)
1998e8da03fSAriel Constenla-Haile
2008e8da03fSAriel Constenla-HaileAC_ARG_WITH(atl-lib-dir,
201407bc2eeSMatthias Seidel[  --with-atl-lib-dir          Path to ATL libraries directory for Windows build.
2028e8da03fSAriel Constenla-Haile                          This switch is mandatory when using VC++ 2008 Express
2038e8da03fSAriel Constenla-Haile                          and configuring with ATL/ActiveX enabled.
2048e8da03fSAriel Constenla-Haile                          You can use the Windows Driver Kit (WDK) and
2058e8da03fSAriel Constenla-Haile                          configure with the following switch:
2068e8da03fSAriel Constenla-Haile                          --with-atl-lib-dir=$WDK_HOME\lib\ATL\i386
2078e8da03fSAriel Constenla-Haile],,)
2088e8da03fSAriel Constenla-Haile
2098e8da03fSAriel Constenla-HaileAC_ARG_WITH(mfc-include-dir,
210407bc2eeSMatthias Seidel[  --with-mfc-include-dir       Path to MFC include directory for Windows build.
2118e8da03fSAriel Constenla-Haile                          This switch is mandatory when using VC++ 2008 Express
2128e8da03fSAriel Constenla-Haile                          and configuring with ATL/ActiveX enabled.
2138e8da03fSAriel Constenla-Haile                          You can use the Windows Driver Kit (WDK) and
2148e8da03fSAriel Constenla-Haile                          configure with the following switch:
2158e8da03fSAriel Constenla-Haile                          --with-mfc-include-dir=$WDK_HOME\inc\mfc42
2168e8da03fSAriel Constenla-Haile],,)
2178e8da03fSAriel Constenla-Haile
2188e8da03fSAriel Constenla-HaileAC_ARG_WITH(mfc-lib-dir,
219407bc2eeSMatthias Seidel[  --with-mfc-lib-dir          Path to MFC libraries directory for Windows build.
2208e8da03fSAriel Constenla-Haile                          This switch is mandatory when using VC++ 2008 Express
2218e8da03fSAriel Constenla-Haile                          and configuring with ATL/ActiveX enabled.
2228e8da03fSAriel Constenla-Haile                          You can use the Windows Driver Kit (WDK) and
2238e8da03fSAriel Constenla-Haile                          configure with the following switch:
2248e8da03fSAriel Constenla-Haile                          --with-mfc-lib-dir=$WDK_HOME\lib\Mfc\i386
2258e8da03fSAriel Constenla-Haile],,)
2268e8da03fSAriel Constenla-Haile
2278e8da03fSAriel Constenla-Haile
228cdf0e10cSrcweirAC_ARG_ENABLE(symbols,
229cdf0e10cSrcweir[  --enable-symbols        Include debugging symbols in output.
230cdf0e10cSrcweir                          WARNING - a complete build needs 8 Gb of space and
231cdf0e10cSrcweir                          takes much longer. (enables -g compiler flag)
232cdf0e10cSrcweir
233cdf0e10cSrcweir                          --enable-symbols=SMALL sets the gcc -g1 setting
234cdf0e10cSrcweir                          which is smaller.
235cdf0e10cSrcweir
236cdf0e10cSrcweir                          Enabling symbols disables the stripping of the solver
237cdf0e10cSrcweir                          (--disable-strip-solver).
238cdf0e10cSrcweir],,)
239cdf0e10cSrcweirAC_ARG_ENABLE(strip-solver,
240cdf0e10cSrcweir[  --disable-strip-solver  Disable the stripping of the solver.
241cdf0e10cSrcweir                          By default the solver is stripped unless a build with
242cdf0e10cSrcweir                          debugging symbols (--enable-symbols) is requested.
243cdf0e10cSrcweir
244cdf0e10cSrcweir                          This switch allows to override this setting.
245cdf0e10cSrcweir],,)
246cdf0e10cSrcweirAC_ARG_ENABLE(werror,
247cdf0e10cSrcweir[  --enable-werror         Turn warnings to errors. (Has no effect in modules
248cdf0e10cSrcweir                          where the treating of warnings as errors is disabled
2498a62b599SPavel Janík                          explicitly)
250cdf0e10cSrcweir],,)
251cdf0e10cSrcweirAC_ARG_ENABLE(debug,
252cdf0e10cSrcweir[  --enable-debug          Include debugging symbols from --enable-symbols
253e986c8d8SMatthias Seidel                          plus extra debugging code. Extra large build!
254cdf0e10cSrcweir                          (enables -g compiler flag and dmake debug=true)
255cdf0e10cSrcweir],,)
256cdf0e10cSrcweirAC_ARG_ENABLE(dbgutil,
257cdf0e10cSrcweir[  --enable-dbgutil        Include additional debugging utilities, such as
258cdf0e10cSrcweir                          assertions, object counting, etc. Larger build.
259cdf0e10cSrcweir                          Independent from --enable-debug
260cdf0e10cSrcweir],,)
261cdf0e10cSrcweirAC_ARG_ENABLE(crashdump,
262cdf0e10cSrcweir[  --enable-crashdump      Enable the crashdump feature code.
263cdf0e10cSrcweir],,)
264cdf0e10cSrcweirAC_ARG_ENABLE(cl-standard,
265cdf0e10cSrcweir[  --enable-cl-standard    For Microsoft C/C++ compiler users, use non-optimizing
266a46fe8a8SPavel Janík                          standard compiler. ( This just disables optimization
267cdf0e10cSrcweir                          options and therefore removes a lot of warnings when
268cdf0e10cSrcweir                          using the cheaper standard compiler. )
269cdf0e10cSrcweir],,)
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)
27633605542SJürgen SchmidtAC_ARG_ENABLE(win-x64-shellext,
27733605542SJürgen Schmidt[  --enable-win-x64-shellext    Enable the build/usage of Windows 64bit shell extensions.
278d507b48eSMatthias Seidel                          These extensions are used for the system integration on
279d507b48eSMatthias Seidel			  Windows 64bit systems. For example supporting the search
28033605542SJürgen Schmidt			  in ODF files with the standard Windows search feature.
28133605542SJürgen Schmidt],,)
282cdf0e10cSrcweirAC_ARG_ENABLE(gtk,
283cdf0e10cSrcweir[  --disable-gtk           Determines whether to use Gtk+ vclplug on platforms
284cdf0e10cSrcweir                          where Gtk+ is available.
285cdf0e10cSrcweir],,enable_gtk=yes)
286cdf0e10cSrcweirAC_ARG_ENABLE(gstreamer,
287e1a336b3SAriel Constenla-Haile[  --enable-gstreamer      Determines whether to use the GStreamer media
288cdf0e10cSrcweir                          backend on platforms where GStreamer is available.
289e1a336b3SAriel Constenla-Haile],,enable_gstreamer=no)
290cdf0e10cSrcweirAC_ARG_ENABLE(systray,
291cdf0e10cSrcweir[  --disable-systray       Determines whether to build the systray quickstarter.
292cdf0e10cSrcweir],,enable_systray=yes)
293cdf0e10cSrcweirAC_ARG_ENABLE(cairo,
294cdf0e10cSrcweir[  --enable-cairo          Determines whether to use Cairo library on
295cdf0e10cSrcweir                          platforms where Cairo is available.
296cdf0e10cSrcweir],,enable_cairo=no)
297cdf0e10cSrcweirAC_ARG_WITH(system-cairo,
298cdf0e10cSrcweir[  --with-system-cairo      Use Cairo libraries already on system
299cdf0e10cSrcweir],,)
30046dacce6SMichael StahlAC_ARG_ENABLE(cairo-canvas,
30146dacce6SMichael Stahl[  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
30246dacce6SMichael Stahl                          platforms where Cairo is available.
30346dacce6SMichael Stahl],,enable_cairo_canvas=yes)
304cdf0e10cSrcweirAC_ARG_ENABLE(opengl,
305407bc2eeSMatthias Seidel[  --enable-opengl         Determines whether to build the OpenGL 3D slide
306cdf0e10cSrcweir                          transitions component
307cdf0e10cSrcweir],,enable_opengl=no)
308cdf0e10cSrcweirAC_ARG_ENABLE(dbus,
309407bc2eeSMatthias Seidel[  --enable-dbus           Determines whether to enable presentation mode
310da2e13d4SMatthias Seidel                          screensaver control under GNOME via DBUS
311cdf0e10cSrcweir],,enable_dbus=no)
312cdf0e10cSrcweirAC_ARG_ENABLE(gconf,
313cdf0e10cSrcweir[  --disable-gconf         Determines whether to use the GConf support
314cdf0e10cSrcweir],,enable_gconf=yes)
315cdf0e10cSrcweirAC_ARG_ENABLE(gnome-vfs,
316cdf0e10cSrcweir[  --disable-gnome-vfs     Determines whether to use the Gnome Virtual Filing
317cdf0e10cSrcweir                          System on platforms where that VFS is available
318ca91c472SDamjan Jovanovic],,enable_gnome_vfs=no)
319cdf0e10cSrcweirAC_ARG_ENABLE(gio,
320cdf0e10cSrcweir[  --enable-gio            Determines whether to use the GIO support
321ca91c472SDamjan Jovanovic],,enable_gio=yes)
322cdf0e10cSrcweirAC_ARG_ENABLE(static-gtk,
323cdf0e10cSrcweir[  --enable-static-gtk     Modules that are linked against gtk libraries use
324407bc2eeSMatthias Seidel                          the static libraries instead of the dynamic ones.
325cdf0e10cSrcweir                          (enables -Bstatic linker flag for gtk libraries)
326cdf0e10cSrcweir],,)
327cdf0e10cSrcweirAC_ARG_ENABLE(layout,
328cdf0e10cSrcweir[  --enable-layout         Enable the compilation and use of layout dialogs
329cdf0e10cSrcweir],,)
330e3bd0393SPavel JaníkAC_ARG_ENABLE(nss-module,
331407bc2eeSMatthias Seidel[  --disable-nss-module    Whether to use the NSS module that is used for xml-security
332cdf0e10cSrcweir],,enable_nss_module=yes)
333cdf0e10cSrcweirAC_ARG_ENABLE(kde,
334cdf0e10cSrcweir[  --enable-kde            Determines whether to use Qt/KDE vclplug on platforms
335cdf0e10cSrcweir                          where Qt and KDE are available.
336cdf0e10cSrcweir],,)
337cdf0e10cSrcweirAC_ARG_ENABLE(kde4,
338cdf0e10cSrcweir[  --enable-kde4            Determines whether to use Qt4/KDE4 vclplug on platforms
339407bc2eeSMatthias Seidel                          where Qt4 and KDE4 are available. May be used with --enable-kde
340cdf0e10cSrcweir                          if you want to support both KDE3 and KDE4.
341cdf0e10cSrcweir],,)
342cdf0e10cSrcweirAC_ARG_ENABLE(rpath,
343cdf0e10cSrcweir[  --disable-rpath         Disable the use of relative paths in shared libraries
344cdf0e10cSrcweir],,)
345cdf0e10cSrcweirAC_ARG_ENABLE(pam,
346cdf0e10cSrcweir[  --disable-pam           Disable pam support.
347cdf0e10cSrcweir],,)
348cdf0e10cSrcweirAC_ARG_ENABLE(pam-link,
349cdf0e10cSrcweir[  --enable-pam-link       link with libpam instead of dynamically open it
350cdf0e10cSrcweir],,)
351cdf0e10cSrcweirAC_ARG_ENABLE(crypt-link,
352cdf0e10cSrcweir[  --disable-crypt-link    disable linking with libcrypt instead of dynamically
353cdf0e10cSrcweir                          open it (needed for ancient GNU/Linux distributions
354cdf0e10cSrcweir                          without crypt()/libcrypt)
355cdf0e10cSrcweir],,enable_crypt_link=yes)
356cdf0e10cSrcweirAC_ARG_ENABLE(xrender-link,
357cdf0e10cSrcweir[  --enable-xrender-link   link with libXrender instead of dynamically open it
358cdf0e10cSrcweir],,)
359cdf0e10cSrcweirAC_ARG_ENABLE(randr,
360cdf0e10cSrcweir[  --disable-randr         disable RandR support in the vcl project
361cdf0e10cSrcweir],,enable_randr=yes)
362cdf0e10cSrcweirAC_ARG_ENABLE(randr-link,
363407bc2eeSMatthias Seidel[  --disable-randr-link    disable linking with libXrandr, instead dynamically
364cdf0e10cSrcweir                           open it at runtime
365cdf0e10cSrcweir],,enable_randr_link=yes)
366010ec03aSHerbert DürrAC_ARG_WITH(bundled-extension-blobs,
36707a3d7f1SPedro Giffuni[  --with-bundled-extension-blobs Whitespace separated list of files in the tarball directory
368010ec03aSHerbert Dürr                          that are to be bundled as-is for installation as extensions
369010ec03aSHerbert Dürr                          at the first program start. Make sure to only bundle extensions
370010ec03aSHerbert Dürr                          which can be installed without requiring a license dialog
371416de96fSHerbert Dürr                          and comply with their distribution requirements by updating the
372416de96fSHerbert Dürr                          files LICENSE_aggregated and NOTICE_aggregated accordingly
373010ec03aSHerbert Dürr],,)
374010ec03aSHerbert Dürr#AC_ARG_WITH(bundled-prereg-extensions,
37507a3d7f1SPedro Giffuni#[  --with-bundled-prereg-extensions Whitespace separated list of files in the tarball directory that
376010ec03aSHerbert Dürr#                          are to be bundled as pre-registered extensions. Make sure to only bundle
377010ec03aSHerbert Dürr#                          extensions which can be installed without requiring a license dialog
378010ec03aSHerbert Dürr#],,)
379764319a5SAndre FischerAC_ARG_ENABLE(bundled-dictionaries,
380764319a5SAndre Fischer[  --enable-bundled-dictionaries  Download dictionaries (spelling, hyphenation, thesaurus)
381416de96fSHerbert Dürr                           according to main/extensions.lst and bundle them. Make sure to
382416de96fSHerbert Dürr                           comply with their distribution requirements and update the
383416de96fSHerbert Dürr                           files LICENSE_aggregated and NOTICE_aggregated accordingly
3841b01b3b8SOliver-Rainer Wittmann],,enable_bundled_dictionaries=no)
385764319a5SAndre Fischer
386764319a5SAndre Fischer# Remove the following switches when not in release mode.
387cdf0e10cSrcweirAC_ARG_WITH(system-dicts,
388cdf0e10cSrcweir[  --with-system-dicts    Use dictionaries from system paths- Specify
389cdf0e10cSrcweir                         them via --with-{dict,hyph,thes}-path=/path
3909ef65f0eSAndre Fischer                        if you want to override the default ones
391cdf0e10cSrcweir],,)
392cdf0e10cSrcweirAC_ARG_WITH(external-dict-dir,
393cdf0e10cSrcweir[  --with-external-dict-dir Specify external dictionary dir
394cdf0e10cSrcweir],,)
395cdf0e10cSrcweirAC_ARG_WITH(external-hyph-dir,
396cdf0e10cSrcweir[  --with-external-hyph-dir Specify external hyphenation pattern dir
397cdf0e10cSrcweir],,)
398cdf0e10cSrcweirAC_ARG_WITH(external-thes-dir,
399cdf0e10cSrcweir[  --with-external-thes-dir Specify external thesaurus dir
400cdf0e10cSrcweir],,)
401764319a5SAndre Fischer# End of remove.
402764319a5SAndre Fischer
403764319a5SAndre Fischer
404cdf0e10cSrcweirAC_ARG_WITH(system-libs,
405cdf0e10cSrcweir[  --with-system-libs      Use libs already on system -- enables all
406da2e13d4SMatthias Seidel                          --with-system-* flags except
407cdf0e10cSrcweir                          odbc/sane/xrender-header(s)
408cdf0e10cSrcweir],,)
409cdf0e10cSrcweirAC_ARG_WITH(system-headers,
410cdf0e10cSrcweir[  --with-system-headers   Use headers already on system -- enables all
411cdf0e10cSrcweir                          --with-system-* flags for external packages
412cdf0e10cSrcweir                          whose headers are the only entities used i.e.
413cdf0e10cSrcweir                          boost/vigra/odbc/sane/xrender-header(s)
414cdf0e10cSrcweir],,)
415cdf0e10cSrcweirAC_ARG_WITH(system-jars,
416cdf0e10cSrcweir[  --without-system-jars   When building with --with-system-libs, also the
417cdf0e10cSrcweir                          needed jars are expected on the system. Use this to
418da2e13d4SMatthias Seidel                          disable that.
419cdf0e10cSrcweir                          (except for the db case where --with-system-db
420cdf0e10cSrcweir                          *has to* imply using the db.jar from there, too)
421cdf0e10cSrcweir],,)
422cdf0e10cSrcweirAC_ARG_WITH(system-zlib,
423cdf0e10cSrcweir[  --with-system-zlib      Use zlib already on system
424cdf0e10cSrcweir],,)
4250021cf80SHerbert DürrAC_ARG_WITH(system-nss,
4260021cf80SHerbert Dürr[  --with-system-nss       Use NSS already on system
4270021cf80SHerbert Dürr],,)
428cdf0e10cSrcweirAC_ARG_WITH(system-openssl,
429cdf0e10cSrcweir[  --with-system-openssl   Use OpenSSL already on system
430cdf0e10cSrcweir],,)
431cdf0e10cSrcweirAC_ARG_WITH(system-jpeg,
432cdf0e10cSrcweir[  --with-system-jpeg      Use jpeg already on system
433cdf0e10cSrcweir],,)
434cdf0e10cSrcweirAC_ARG_WITH(system-expat,
435cdf0e10cSrcweir[  --with-system-expat     Use expat already on system
436cdf0e10cSrcweir],,)
437cdf0e10cSrcweirAC_ARG_WITH(system-libxml,
438cdf0e10cSrcweir[  --with-system-libxml    Use libxml already on system
439cdf0e10cSrcweir],,)
440cdf0e10cSrcweirAC_ARG_WITH(system-python,
441cdf0e10cSrcweir[  --with-system-python    Use python already on system
442cdf0e10cSrcweir],,)
443cdf0e10cSrcweirAC_ARG_WITH(system-icu,
444cdf0e10cSrcweir[  --with-system-icu       Use icu already on system
445cdf0e10cSrcweir],,)
446cdf0e10cSrcweirAC_ARG_WITH(system-poppler,
447cdf0e10cSrcweir[  --with-system-poppler   Use poppler already on system
448cdf0e10cSrcweir],,)
449cdf0e10cSrcweirAC_ARG_WITH(system-lucene,
450cdf0e10cSrcweir[  --with-system-lucene    Use lucene already on system
451cdf0e10cSrcweir],,)
452cdf0e10cSrcweirAC_ARG_WITH(lucene-core-jar,
453cdf0e10cSrcweir[  --with-lucene-core-jar=JARFILE   Specify path to jarfile manually ],
454cdf0e10cSrcweir[ LUCENE_CORE_JAR="$withval"
455cdf0e10cSrcweir])
456cdf0e10cSrcweirAC_ARG_WITH(lucene-analyzers-jar,
457cdf0e10cSrcweir[  --with-lucene-analyzers-jar=JARFILE   Specify path to jarfile manually ],
458cdf0e10cSrcweir[ LUCENE_ANALYZERS_JAR="$withval"
459cdf0e10cSrcweir])
460cdf0e10cSrcweirAC_ARG_ENABLE(mysql-connector,
461cdf0e10cSrcweir[  --enable-mysql-connector     enables the build of the MySQL Connector/OOo extension.
462cdf0e10cSrcweir                                This requires access to the MySQL Connector/C (aka libmysql) to be given, too, with
463cdf0e10cSrcweir                                either the --with-system-mysql or --with-libmysql-path option.
464cdf0e10cSrcweir],,)
465cdf0e10cSrcweirAC_ARG_WITH(system-mysql,
466cdf0e10cSrcweir[  --with-system-mysql          Use MySQL libraries already on system, for building the MySQL Connector/OOo extension.
467cdf0e10cSrcweir                                Requires MYSQLCONFIG to point to the mysql_config executable.
468cdf0e10cSrcweir],,)
469cdf0e10cSrcweirAC_ARG_WITH(libmysql-path,
470cdf0e10cSrcweir[  --with-libmysql-path         Use Connector/C (libmysql) installation for building the MySQL Connector/OOo extension.
471cdf0e10cSrcweir
472cdf0e10cSrcweir                                Usage: --with-libmysql-path=<absolute path to your Connector/C installation>
473cdf0e10cSrcweir],,)
474cdf0e10cSrcweirAC_ARG_WITH(system-mysql-cppconn,
475cdf0e10cSrcweir[  --with-system-mysql-cppconn  Use MySQL C++ Connector libraries already on system
476cdf0e10cSrcweir],,)
477cdf0e10cSrcweirAC_ARG_WITH(system-hsqldb,
478cdf0e10cSrcweir[  --with-system-hsqldb    Use hsqldb already on system
479cdf0e10cSrcweir],,)
480cdf0e10cSrcweirAC_ARG_WITH(hsqldb-jar,
481cdf0e10cSrcweir[  --with-hsqldb-jar=JARFILE   Specify path to jarfile manually ],
482cdf0e10cSrcweir[ HSQLDB_JAR="$withval"
483cdf0e10cSrcweir])
484cdf0e10cSrcweirAC_ARG_WITH(system-beanshell,
4859ef65f0eSAndre Fischer[  --with-system-beanshell Use beanshell already on system (default)
4869ef65f0eSAndre Fischer],,)
4879ef65f0eSAndre FischerAC_ARG_ENABLE(beanshell,
488b1c00883SJim Jagielski[  --enable-beanshell     Enable the use of beanshell.
489cdf0e10cSrcweir],,)
490cdf0e10cSrcweirAC_ARG_WITH(beanshell-jar,
491cdf0e10cSrcweir[  --with-beanshell-jar=JARFILE   Specify path to jarfile manually ],
492cdf0e10cSrcweir[ BSH_JAR="$withval"
493cdf0e10cSrcweir])
494cdf0e10cSrcweirAC_ARG_ENABLE(pdfimport,
4957afab28fSJürgen Schmidt[  --enable-pdfimport          enables the build of the PDF Import extension
496cdf0e10cSrcweir],,)
497cdf0e10cSrcweirAC_ARG_ENABLE(wiki-publisher,
498cdf0e10cSrcweir[  --enable-wiki-publisher      enables the build of the Wiki Publisher extension
499cdf0e10cSrcweir],,)
500cdf0e10cSrcweirAC_ARG_WITH(commons-codec-jar,
501cdf0e10cSrcweir[  --with-commons-codec-jar=JARFILE   Specify path to jarfile manually ],
502cdf0e10cSrcweir[ COMMONS_CODEC_JAR="$withval"
503cdf0e10cSrcweir])
504cdf0e10cSrcweirAC_ARG_WITH(commons-lang-jar,
505cdf0e10cSrcweir[  --with-commons-lang-jar=JARFILE   Specify path to jarfile manually ],
506cdf0e10cSrcweir[ COMMONS_LANG_JAR="$withval"
507cdf0e10cSrcweir])
508cdf0e10cSrcweirAC_ARG_WITH(commons-httpclient-jar,
509cdf0e10cSrcweir[  --with-commons-httpclient-jar=JARFILE   Specify path to jarfile manually ],
510cdf0e10cSrcweir[ COMMONS_HTTPCLIENT_JAR="$withval"
511cdf0e10cSrcweir])
512cdf0e10cSrcweirAC_ARG_WITH(commons-logging-jar,
513cdf0e10cSrcweir[  --with-commons-logging-jar=JARFILE   Specify path to jarfile manually ],
514cdf0e10cSrcweir[ COMMONS_LOGGING_JAR="$withval"
515cdf0e10cSrcweir])
516cdf0e10cSrcweirAC_ARG_WITH(servlet-api-jar,
517cdf0e10cSrcweir[  --servlet-api-jar=JARFILE   Specify path to jarfile manually ],
518cdf0e10cSrcweir[ SERVLETAPI_JAR="$withval"
519cdf0e10cSrcweir])
520cdf0e10cSrcweirAC_ARG_ENABLE(report-builder,
521cdf0e10cSrcweir[  --enable-report-builder  enables the build of the Report Builder extension
522cdf0e10cSrcweir],,)
523cdf0e10cSrcweirAC_ARG_WITH(sac-jar,
52424fe865aSOliver-Rainer Wittmann[  --with-sac-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
525cdf0e10cSrcweir[ SAC_JAR="$withval"
526cdf0e10cSrcweir])
527cdf0e10cSrcweirAC_ARG_WITH(libxml-jar,
52824fe865aSOliver-Rainer Wittmann[  --with-libxml-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
529cdf0e10cSrcweir[ LIBXML_JAR="$withval"
530cdf0e10cSrcweir])
531cdf0e10cSrcweirAC_ARG_WITH(flute-jar,
53224fe865aSOliver-Rainer Wittmann[  --with-flute-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
533cdf0e10cSrcweir[ FLUTE_JAR="$withval"
534cdf0e10cSrcweir])
535cdf0e10cSrcweirAC_ARG_WITH(jfreereport-jar,
53624fe865aSOliver-Rainer Wittmann[  --with-jfreereport-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
537cdf0e10cSrcweir[ JFREEREPORT_JAR="$withval"
538cdf0e10cSrcweir])
539cdf0e10cSrcweirAC_ARG_WITH(liblayout-jar,
54024fe865aSOliver-Rainer Wittmann[  --with-liblayout-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
541cdf0e10cSrcweir[ LIBLAYOUT_JAR="$withval"
542cdf0e10cSrcweir])
543cdf0e10cSrcweirAC_ARG_WITH(libloader-jar,
54424fe865aSOliver-Rainer Wittmann[  --with-libloader-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
545cdf0e10cSrcweir[ LIBLOADER_JAR="$withval"
546cdf0e10cSrcweir])
547cdf0e10cSrcweirAC_ARG_WITH(libformula-jar,
54824fe865aSOliver-Rainer Wittmann[  --with-libformula-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
549cdf0e10cSrcweir[ LIBFORMULA_JAR="$withval"
550cdf0e10cSrcweir])
551cdf0e10cSrcweirAC_ARG_WITH(librepository-jar,
55224fe865aSOliver-Rainer Wittmann[  --with-librepository-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
553cdf0e10cSrcweir[ LIBREPOSITORY_JAR="$withval"
554cdf0e10cSrcweir])
555cdf0e10cSrcweirAC_ARG_WITH(libfonts-jar,
55624fe865aSOliver-Rainer Wittmann[  --with-libfonts-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
557cdf0e10cSrcweir[ LIBFONTS_JAR="$withval"
558cdf0e10cSrcweir])
559cdf0e10cSrcweirAC_ARG_WITH(libserializer-jar,
56024fe865aSOliver-Rainer Wittmann[  --with-libserializer-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
561cdf0e10cSrcweir[ LIBSERIALIZER_JAR="$withval"
562cdf0e10cSrcweir])
563cdf0e10cSrcweirAC_ARG_WITH(libbase-jar,
56424fe865aSOliver-Rainer Wittmann[  --with-libbase-jar=JARFILE   Specify path to jarfile manually (for Report Builder extension) ],
565cdf0e10cSrcweir[ LIBBASE_JAR="$withval"
566cdf0e10cSrcweir])
567cdf0e10cSrcweirAC_ARG_WITH(system-saxon,
5689ef65f0eSAndre Fischer[  --with-system-saxon     Use saxon already on system (default)
5699ef65f0eSAndre Fischer],,)
5709ef65f0eSAndre FischerAC_ARG_ENABLE(saxon,
5719ef65f0eSAndre Fischer[  --disable-saxon         Disable use of saxon
572cdf0e10cSrcweir],,)
573cdf0e10cSrcweirAC_ARG_WITH(saxon-jar,
5749ef65f0eSAndre Fischer[  --with-saxon-jar=JARFILE   Specify path to jarfile manually. This implies --with-system-saxon ],
575cdf0e10cSrcweir[ SAXON_JAR="$withval"
576cdf0e10cSrcweir])
577cdf0e10cSrcweirAC_ARG_WITH(system-libxslt,
578cdf0e10cSrcweir[  --with-system-libxslt   Use libxslt already on system
579cdf0e10cSrcweir],,)
580cdf0e10cSrcweirAC_ARG_WITH(system-odbc,
581cdf0e10cSrcweir[  --with-system-odbc-headers     Use the odbc headers already on system
582cdf0e10cSrcweir],,)
583cdf0e10cSrcweirAC_ARG_WITH(system-sane,
584cdf0e10cSrcweir[  --with-system-sane-header      Use sane.h already on system
585cdf0e10cSrcweir],,)
586cdf0e10cSrcweirAC_ARG_WITH(system-xrender,
587cdf0e10cSrcweir[  --with-system-xrender-headers  Use XRender headers already on system
588cdf0e10cSrcweir],,)
589cdf0e10cSrcweirAC_ARG_WITH(system-curl,
590cdf0e10cSrcweir[  --with-system-curl      Use curl already on system
591cdf0e10cSrcweir],,)
592cdf0e10cSrcweirAC_ARG_WITH(system-boost,
593cdf0e10cSrcweir[  --with-system-boost     Use boost already on system
594cdf0e10cSrcweir],,)
595cdf0e10cSrcweirAC_ARG_WITH(system-mdds,
596cdf0e10cSrcweir[  --with-system-mdds      Use mdds already on system
597cdf0e10cSrcweir],,)
598cdf0e10cSrcweirAC_ARG_WITH(system-vigra,
599cdf0e10cSrcweir[  --with-system-vigra     Use vigra already on system
600cdf0e10cSrcweir],,)
601a44fea77SAriel Constenla-HaileAC_ARG_ENABLE(hunspell,
602a44fea77SAriel Constenla-Haile[  --enable-hunspell       Determines whether to enable the Hunspell library.
603a44fea77SAriel Constenla-Haile                          If enabled, the library will be built unless you
604a44fea77SAriel Constenla-Haile                          specify --with-system-hunspell to use the library
605a44fea77SAriel Constenla-Haile                          already present on your system.
606a44fea77SAriel Constenla-Haile                          If disabled, the Spell Checking component will also
607a44fea77SAriel Constenla-Haile                          be disabled.
608a44fea77SAriel Constenla-Haile                          (Default: hunspell disabled)
609a44fea77SAriel Constenla-Haile],,enable_hunspell=no)
610cdf0e10cSrcweirAC_ARG_WITH(system-hunspell,
611a44fea77SAriel Constenla-Haile[  --with-system-hunspell  Use libhunspell already on system
612cdf0e10cSrcweir],,)
613cdf0e10cSrcweirAC_ARG_WITH(system-mythes,
614cdf0e10cSrcweir[  --with-system-mythes    Use mythes already on system
615cdf0e10cSrcweir],,)
616a44fea77SAriel Constenla-HaileAC_ARG_ENABLE(hyphen,
617a44fea77SAriel Constenla-Haile[  --enable-hyphen         Determines whether to enable the Hyphen library.
618a44fea77SAriel Constenla-Haile                          If enabled, the library will be built unless you
619a44fea77SAriel Constenla-Haile                          specify --with-system-hyphen to use the library
620a44fea77SAriel Constenla-Haile                          already present on your system.
621a44fea77SAriel Constenla-Haile                          If disabled, the Hyphenator component will also
622a44fea77SAriel Constenla-Haile                          be disabled.
623a44fea77SAriel Constenla-Haile                          (Default: hyphen disabled)
624a44fea77SAriel Constenla-Haile],,enable_hyphen=no)
625a44fea77SAriel Constenla-HaileAC_ARG_WITH(system-hyphen,
626a44fea77SAriel Constenla-Haile[  --with-system-hyphen    Use libhypeh already on system
627cdf0e10cSrcweir],,)
628cdf0e10cSrcweirAC_ARG_WITH(system-libtextcat,
629cdf0e10cSrcweir[  --with-system-libtextcat      Use libtextcat already on system
630cdf0e10cSrcweir],,)
631cdf0e10cSrcweirAC_ARG_WITH(external-libtextcat-data,
632cdf0e10cSrcweir[  --with-system-libtextcat-data Use libtextcat data already on system
633cdf0e10cSrcweir],,)
634cdf0e10cSrcweirAC_ARG_WITH(system-redland,
635cdf0e10cSrcweir[  --with-system-redland   Use redland library already on system
636cdf0e10cSrcweir],,)
637cdf0e10cSrcweirAC_ARG_WITH(stlport,
638b597708bSHerbert Dürr[  --with-stlport         Only building --without-stlport is supported.
639212f9143SJan Iversen], WITH_STLPORT=$withval , WITH_STLPORT=no)
640cdf0e10cSrcweirAC_ARG_WITH(jdk-home,
641cdf0e10cSrcweir[  --with-jdk-home         if you have installed JDK 1.3 or later on your system
642cdf0e10cSrcweir                          please supply the path here.
643cdf0e10cSrcweir                          Note that this is not the location of the Java binary
644cdf0e10cSrcweir                          but the location of the entire distribution.
645e986c8d8SMatthias Seidel
646cdf0e10cSrcweir                          Usage: --with-jdk-home=<absolute path to JDK home>
647cdf0e10cSrcweir],,)
648cdf0e10cSrcweirAC_ARG_WITH(java,
649e986c8d8SMatthias Seidel[  --with-java             Build with[[out]] Java support. If you use
650cdf0e10cSrcweir                          --without-java/--with-java=no then the build will have
651cdf0e10cSrcweir                          no support for Java components, applets, accessibility
652da2e13d4SMatthias Seidel                          or XML filters.
653cdf0e10cSrcweir], if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi, WITH_JAVA=java)
654cdf0e10cSrcweirAC_ARG_ENABLE(gcjaot,
655cdf0e10cSrcweir[  --enable-gcjaot         Build with[[out]] using Ahead of Time java compilation
656cdf0e10cSrcweir                          support to speed up buildsi by compiling the jars also
657cdf0e10cSrcweir                          to native code..
658cdf0e10cSrcweir                          --enable-gcjaot is only known to work with bytecode
659cdf0e10cSrcweir                          created with gcj or ecj
660cdf0e10cSrcweir],,)
661cdf0e10cSrcweirAC_ARG_WITH(ant-home,
66237cc8903SMatthias Seidel[  --with-ant-home         If you have installed Apache Ant on your system,
663cdf0e10cSrcweir                          please supply the path here.
664cdf0e10cSrcweir                          Note that this is not the location of the Ant binary
665cdf0e10cSrcweir                          but the location of the entire distribution.
666e986c8d8SMatthias Seidel
667cdf0e10cSrcweir                          Usage: --with-ant-home=<absolute path to Ant home>
668cdf0e10cSrcweir],,)
669cdf0e10cSrcweirAC_ARG_WITH(junit,
670cdf0e10cSrcweir[  --with-junit            Specifies the JUnit 4 jar file to use for JUnit-based
671cdf0e10cSrcweir                          tests.  --without-junit disables those tests.  Not
672f0157b90Skschenk                          relevant in the --without-java case.
673cdf0e10cSrcweir
674cdf0e10cSrcweir                          Usage: --with-junit=<absolute path to JUnit 4 jar>
675cdf0e10cSrcweir],,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)
683cdf0e10cSrcweirAC_ARG_WITH(perl-home,
684cdf0e10cSrcweir[  --with-perl-home        If you have installed the Perl 5 Distribution, on your
685cdf0e10cSrcweir                          system, please supply the path here.
686cdf0e10cSrcweir                          Note that this is not the location of the Perl binary
687cdf0e10cSrcweir                          but the location of the entire distribution.
688e986c8d8SMatthias Seidel
689cdf0e10cSrcweir                          Usage: --with-perl-home=<absolute path to Perl 5 home>
690cdf0e10cSrcweir],,)
691cdf0e10cSrcweirAC_ARG_WITH(cl-home,
692cdf0e10cSrcweir[  --with-cl-home          For Windows NT users, please supply the path
693da2e13d4SMatthias Seidel                          for the Microsoft C/C++ compiler.
694cdf0e10cSrcweir                          Note that this is not the location of the compiler
695cdf0e10cSrcweir                          binary but the location of the entire distribution.
696e986c8d8SMatthias Seidel
697cdf0e10cSrcweir                          Usage: --with-cl-home=<absolute path to Microsoft C/C++ compiler home>
698cdf0e10cSrcweir],,)
699cdf0e10cSrcweirAC_ARG_WITH(mspdb-path,
700cdf0e10cSrcweir[  --with-mspdb-path       For Microsoft C/C++ compiler users, please supply the
701cdf0e10cSrcweir                          path pointing to the mspdb71.dll (.NET 2003).
702e986c8d8SMatthias Seidel
703cdf0e10cSrcweir                          Usage: --with-mspdb-path=<absolute path to mspdb71.dll>
704cdf0e10cSrcweir],,)
705cdf0e10cSrcweirAC_ARG_WITH(midl-path,
706cdf0e10cSrcweir[  --with-midl-path        For Microsoft C/C++ .NET compiler users, please supply
707cdf0e10cSrcweir                          the path pointing to the midl.exe.
708e986c8d8SMatthias Seidel
709cdf0e10cSrcweir                          Usage: --with-midl-path=<absolute path to midl.exe>
710cdf0e10cSrcweir],,)
711cdf0e10cSrcweirAC_ARG_WITH(csc-path,
712cdf0e10cSrcweir[  --with-csc-path         For Microsoft C/C++ .NET compiler users, please supply
713cdf0e10cSrcweir                          the path pointing to the csc.exe.
714e986c8d8SMatthias Seidel
715cdf0e10cSrcweir                          Usage: --with-csc-path=<absolute path to csc.exe>
716cdf0e10cSrcweir],,)
717cdf0e10cSrcweirAC_ARG_WITH(nsis-path,
718cdf0e10cSrcweir[  --with-nsis-path        For Windows users, please supply the path to the
719cdf0e10cSrcweir                          "Nullsoft Scriptable Install System" (NSIS). If NSIS
720cdf0e10cSrcweir                          is found in the path or this option is supplied a self
721c4266413SHerbert Dürr                          contained executable installer for Apache OpenOffice
722c4266413SHerbert Dürr                          will be created.
723cdf0e10cSrcweir
724cdf0e10cSrcweir                          Usage: --with-nsis-path=<absolute path to nsis.exe>
725cdf0e10cSrcweir],,)
726cdf0e10cSrcweirAC_ARG_WITH(frame-home,
727cdf0e10cSrcweir[  --with-frame-home       For Microsoft C/C++ .NET compiler users, please supply
728cdf0e10cSrcweir                          the path pointing to lib/mscoree.lib, usually
729cdf0e10cSrcweir                          something like:
730cdf0e10cSrcweir                          "/cygdrive/c/Program Files/Microsoft Visual Studio .NET/FrameworkSDK"
731cdf0e10cSrcweir
732cdf0e10cSrcweir                          MS Visual Toolkit compiler users, please supply the
733cdf0e10cSrcweir                          path pointing to lib/msvcrt.lib, usually something
734cdf0e10cSrcweir                          like:
735cdf0e10cSrcweir                          "/cygdrive/c/Program Files/Microsoft Visual Studio .NET 2003/Vc7"
736cdf0e10cSrcweir
737cdf0e10cSrcweir                          Usage: --with-frame-home=<absolute path to Framework SDK [[home]]>
738cdf0e10cSrcweir],,)
739cdf0e10cSrcweirAC_ARG_WITH(psdk-home,
740cdf0e10cSrcweir[  --with-psdk-home        For Windows users, please supply the path to the
741cdf0e10cSrcweir                          Microsoft Platform SDK.
742e986c8d8SMatthias Seidel
743cdf0e10cSrcweir                          Usage: --with-psdk-home=<absolute path to Microsoft Platform SDK>
744cdf0e10cSrcweir],,)
745cdf0e10cSrcweirAC_ARG_WITH(directx-home,
746cdf0e10cSrcweir[  --with-directx-home     For Windows users, please supply the path to the
747cdf0e10cSrcweir                          Microsoft DirectX SDK.
748e986c8d8SMatthias Seidel
749cdf0e10cSrcweir                          Usage: --with-directx-home=<absolute path to Microsoft DirectX SDK>
750cdf0e10cSrcweir],,)
751cdf0e10cSrcweirAC_ARG_WITH(mozilla-build,
752cdf0e10cSrcweir[  --with-mozilla-build    For Windows users, please supply the path to the
753cdf0e10cSrcweir                          mozilla build tools.
754e986c8d8SMatthias Seidel
755cdf0e10cSrcweir                          Usage: --with-mozilla-build=<absolute path to mozilla build tools>
756cdf0e10cSrcweir
757cdf0e10cSrcweir						  At the moment of this writing, an installer for the mozilla build tools
758da2e13d4SMatthias Seidel						  can be obtained from https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/.
759cdf0e10cSrcweir],[MOZILLABUILD=$withval],)
760cdf0e10cSrcweirAC_ARG_WITH(local-solenv,
761cdf0e10cSrcweir[  --with-local-solenv     If you have solenv in a location other than ./solenv,
762cdf0e10cSrcweir                          please supply the path here.
763e986c8d8SMatthias Seidel
764cdf0e10cSrcweir                          Usage: --with-local-solenv=<absolute path to solenv>
765cdf0e10cSrcweir],,)
766cdf0e10cSrcweirAC_ARG_WITH(local-solver,
767cdf0e10cSrcweir[  --with-local-solver     if you have solver in a location other than ./solver,
768cdf0e10cSrcweir                          please supply the path here.
769e986c8d8SMatthias Seidel
770cdf0e10cSrcweir                          Usage: --with-local-solver=<absolute path to solver>
771cdf0e10cSrcweir],,)
7729ef65f0eSAndre FischerAC_ARG_ENABLE(javascript,
7739ef65f0eSAndre Fischer[  --disable-javascript    Disables support for JavaScript macros.
7749ef65f0eSAndre Fischer],,)
775fdf35928SAndre FischerAC_ARG_WITH(system-apr,
776fdf35928SAndre Fischer[  --with-system-apr       Use apr library already installed on the system
777fdf35928SAndre Fischer],,)
778fdf35928SAndre FischerAC_ARG_WITH(system-apr-util,
779fdf35928SAndre Fischer[  --with-system-apr-util  Use apr-util library already installed on the system
780fdf35928SAndre Fischer],,)
781fdf35928SAndre FischerAC_ARG_WITH(system-serf,
782fdf35928SAndre Fischer[  --with-system-serf      Use serf library already installed on the system
783fdf35928SAndre Fischer],,)
784fdf35928SAndre FischerAC_ARG_WITH(system-coinmp,
785fdf35928SAndre Fischer[  --with-system-coinmp    Use CoinMP library already installed on the system
786fdf35928SAndre Fischer],,)
78727b2fc91SAndre FischerAC_ARG_ENABLE(coinmp,
78827b2fc91SAndre Fischer[  --disable-coinmp        Do not use CoinMP as the Calc solver.
78927b2fc91SAndre Fischer],,)
790cdf0e10cSrcweirAC_ARG_ENABLE(check-only,
791cdf0e10cSrcweir[  --enable-check-only     Use this option option if you just want to check your
792da2e13d4SMatthias Seidel                          environment. This option stops the generation of an
793cdf0e10cSrcweir                          ????env.set
794e986c8d8SMatthias Seidel
795cdf0e10cSrcweir                          Usage: --enable-check-only=yes
796cdf0e10cSrcweir],,)
797cdf0e10cSrcweirAC_ARG_ENABLE(ccache-skip,
798407bc2eeSMatthias Seidel[[  --enable-ccache-skip    [default=auto] allow the use of --ccache-skip to
799407bc2eeSMatthias Seidel                          escape compiler flags that would otherwise prevent
800cdf0e10cSrcweir                          caching of the result (currently used on Mac only)
801cdf0e10cSrcweir                          NOTE: requires patched version because of a bug in
802da2e13d4SMatthias Seidel                          ccache (see issue 104567 for details and patch)
803407bc2eeSMatthias Seidel                          explicitly enable if your version of ccache does not
804cdf0e10cSrcweir                          identify as version 2.4_OOo
805cdf0e10cSrcweir]],,enable_ccache_skip=auto)
806cdf0e10cSrcweirAC_ARG_WITH(lang,
807c4266413SHerbert Dürr[  --with-lang             Use this option to build Apache OpenOffice with
808cdf0e10cSrcweir                          additional language support. English (US) is always
809cdf0e10cSrcweir                          included by default. Separate multiple languages with
810cdf0e10cSrcweir                          space. For all languages, use --with-lang=ALL.
811cdf0e10cSrcweir
812cdf0e10cSrcweir                          Usage: --with-lang="es sw tu cs sk"
813cdf0e10cSrcweir],,)
814cdf0e10cSrcweirAC_ARG_WITH(poor-help-localizations,
815cdf0e10cSrcweir[  --with-poor-help-localizations
816cdf0e10cSrcweir                           Use this option to specify which languages have
817cdf0e10cSrcweir                          unusable help localizations. Separate multiple
818cdf0e10cSrcweir                          languages with space.
819cdf0e10cSrcweir
820cdf0e10cSrcweir                          Usage: --with-poor-help-localizations="af ar be-BY ca"
821cdf0e10cSrcweir],,)
822cdf0e10cSrcweirAC_ARG_WITH(dict,
823c4266413SHerbert Dürr[  --with-dict             Use this option to build Apache OpenOffice with
824cdf0e10cSrcweir                          dictionary support. ALL dictionaries are always
825cdf0e10cSrcweir                          included by default unless overridden with
826cdf0e10cSrcweir                          this option. Separate multiple dictionaries with
827cdf0e10cSrcweir                          commas. For all dictionaries, use --with-dict=ALL.
828cdf0e10cSrcweir
829cdf0e10cSrcweir                          Usage: --with-dict=ENGB,ENUS,ITIT
830cdf0e10cSrcweir],,)
831cdf0e10cSrcweirAC_ARG_WITH(intro-bitmaps,
832cdf0e10cSrcweir[  --with-intro-bitmaps    Prefer the specified intro bitmaps over the
833da2e13d4SMatthias Seidel                          the default one. Can be more than one (separated by
834cdf0e10cSrcweir                          commas), the order means priority of fallback if the
835cdf0e10cSrcweir                          first does not exist (in the installed tree).
836cdf0e10cSrcweir
837073e6ddbSmseidel                          Usage: --with-intro-bitmaps=/path/my_ooo_intro.png
838cdf0e10cSrcweir],,)
839cdf0e10cSrcweirAC_ARG_WITH(about-bitmaps,
840cdf0e10cSrcweir[  --with-about-bitmaps    Similarly to --with-intro-bitmaps, this allows
841cdf0e10cSrcweir                          specification of bitmaps for the About box.
842cdf0e10cSrcweir
843073e6ddbSmseidel                          Usage: --with-about-bitmaps=/path/my_ooo_about.png
844cdf0e10cSrcweir],,)
845cdf0e10cSrcweirAC_ARG_WITH(vendor,
846cdf0e10cSrcweir[  --with-vendor           Set vendor of the build.
847cdf0e10cSrcweir
848cdf0e10cSrcweir                          Usage: --with-vendor="John the Builder"
849cdf0e10cSrcweir],,)
850cdf0e10cSrcweirAC_ARG_WITH(unix-wrapper,
851cdf0e10cSrcweir[  --with-unix-wrapper    Redefines the name of the UNIX wrapper that will be used
852cdf0e10cSrcweir                          in the desktop files and in the desktop-integration RPMs.
853cdf0e10cSrcweir
854cdf0e10cSrcweir                          Usage: --with-unix-wrapper=ooffice
855cdf0e10cSrcweir],,)
856cdf0e10cSrcweirAC_ARG_WITH(asm-home,
857cdf0e10cSrcweir[  --with-asm-home         For Windows users, please supply the path for the
858cdf0e10cSrcweir                          ml.exe assembler.
859cdf0e10cSrcweir
860cdf0e10cSrcweir                          Usage: --with-asm-home=<path to ml.exe directory>
861cdf0e10cSrcweir],,)
862ad35682bStruckmanAC_ARG_WITH(nasm-home,
863ad35682bStruckman[  --with-nasm-home        For Windows users, please supply the path for the
864ad35682bStruckman                          nasm.exe assembler.
865ad35682bStruckman
866ad35682bStruckman                          Usage: --with-nasm-home=<path to nasm.exe directory>
867ad35682bStruckman],,)
868cdf0e10cSrcweirAC_ARG_WITH(os-version,
869cdf0e10cSrcweir[  --with-os-version       For FreeBSD users, use this option option to override
870cdf0e10cSrcweir                          the detected OSVERSION.
871cdf0e10cSrcweir
872cdf0e10cSrcweir                          Usage: --with-os-version=<OSVERSION>
873cdf0e10cSrcweir],,)
874cdf0e10cSrcweirAC_ARG_WITH(unzip-home,
875cdf0e10cSrcweir[  --with-unzip-home       Deprecated: use --with-zip-home instead],,)
876cdf0e10cSrcweirAC_ARG_WITH(zip-home,
877407bc2eeSMatthias Seidel[  --with-zip-home         If you use a non standard zip, for example Windows
878cdf0e10cSrcweir                          please supply the path for zip
879cdf0e10cSrcweir
880cdf0e10cSrcweir                          Usage: --with-zip-home=<path to zip executable>
881cdf0e10cSrcweir],,)
882cdf0e10cSrcweirAC_ARG_WITH(mingwin,
883cdf0e10cSrcweir[  --with-mingwin          For Windows users, use the mingwin32 compiler within
884cdf0e10cSrcweir                          cygwin environment
885cdf0e10cSrcweir
886cdf0e10cSrcweir                          Usage: --with-mingwin=yes
887cdf0e10cSrcweir
888cdf0e10cSrcweir                          For !Windows use, use the mingw32 C++ compiler to
889cdf0e10cSrcweir                          (re-) build unowinreg.dll. Specify the MinGW C++
890cdf0e10cSrcweir                          Compilers name.
891cdf0e10cSrcweir
892cdf0e10cSrcweir                          Usage: --with-mingwin=i586-mingw32msvc-g++
893cdf0e10cSrcweir],WITH_MINGWIN=$withval,WITH_MINGWIN=0)
894cdf0e10cSrcweirAC_ARG_WITH(build-version,
895cdf0e10cSrcweir[  --with-build-version    Allows the builder to add a custom version tag
896cdf0e10cSrcweir                          that will appear in the Help/About box for QA
897cdf0e10cSrcweir                          purposes.
898cdf0e10cSrcweir
899cdf0e10cSrcweir                          Usage: --with-build-version="Built by Jim"
900cdf0e10cSrcweir],with_build_version=$withval)
901cdf0e10cSrcweirAC_ARG_WITH(alloc,
902cdf0e10cSrcweir[  --with-alloc            Define which allocator to build with
903cdf0e10cSrcweir                          (choices are oo, system, tcmalloc, jemalloc)
904cdf0e10cSrcweir
905cdf0e10cSrcweir                          Note that on FreeBSD/NetBSD system==jemalloc
906cdf0e10cSrcweir],,)
907cdf0e10cSrcweirAC_ARG_ENABLE(verbose,
908cdf0e10cSrcweir[  --enable-verbose        Increase build verbosity.
909cdf0e10cSrcweir  --disable-verbose       Decrease build verbosity.
910cdf0e10cSrcweir],,)
911cdf0e10cSrcweirAC_ARG_ENABLE(dependency-tracking,
912cdf0e10cSrcweir[  --disable-dependency-tracking  Disables generation of dependency information.
913cdf0e10cSrcweir],,)
9149ef65f0eSAndre FischerAC_ARG_ENABLE(category-b,
915e986c8d8SMatthias Seidel[  --enable-category-b     Activate components under a category B license
916da2e13d4SMatthias Seidel                          (see https://www.apache.org/legal/3party.html#category-b):
9174c76cf94Spfg                          MPL (hunspell, hyphen, nss, saxon, rhino),
9188bebafa9SPedro Giffuni                          CPL (silgraphite), CPL/EPL (CoinMP), OFL (fonts).
9199ef65f0eSAndre Fischer                          Flags for individual libraries override this one.
9200ea1a209SEike Rathke],,)
9211309f2c9SPedro GiffuniAC_ARG_WITH(arm-target,
9223d781bd6SAndre Fischer[  --arm-target            The minimal targeted arm processor
9233d781bd6SAndre Fischer                              used for the build environment.
9243d781bd6SAndre Fischer                              Cases :
9253d781bd6SAndre Fischer                                arm-target < 6 : armv4t compatibility
9263d781bd6SAndre Fischer                                arm-target = 6 : exact armv6 compatibility
9273d781bd6SAndre Fischer                                arm-target > 6 : armv7-a compatibility
9283d781bd6SAndre Fischer
9293d781bd6SAndre Fischer                              Usage: --with-arm-target=7
9301309f2c9SPedro Giffuni],with_arm_target=$withval,with_arm_target=4)
9310d16e2e7SJim JagielskiAC_ARG_WITH(macosx-target,
9320d16e2e7SJim Jagielski[  --macosx-target            The minimal macOS/OSX deployment and build target
9330d16e2e7SJim Jagielski
9345fa6f516SJim Jagielski                              Usage: --with-macosx-target=10.9
9355fa6f516SJim Jagielski],with_macosx_target=$withval,with_macosx_target=10.9)
936a835cb2eSJim JagielskiAC_ARG_WITH(macosx-sdk,
937a835cb2eSJim Jagielski[  --macosx-sdk            The macOS SDK to build against
938a835cb2eSJim Jagielski
939a835cb2eSJim Jagielski                              Usage: --with-macosx-sdk=10.11
940a835cb2eSJim Jagielski                              (or full path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk)
941a835cb2eSJim Jagielski],with_macosx_sdk=$withval,)
9423d781bd6SAndre FischerAC_ARG_WITH(rat-scan,
9433d781bd6SAndre Fischer[  --with-rat-scan         Scan source code for license headers.
9443d781bd6SAndre Fischer                          Use as --with-rat-scan to automatically download pre-built Rat binaries.
9453d781bd6SAndre Fischer                          Alternatively use as --with-rat-scan=<path-to-rat-direcetory> to use
9463d781bd6SAndre Fischer                          a separately installed library.
9473d781bd6SAndre Fischer],with_rat_scan=$withval,)
948cdf0e10cSrcweir
949cdf0e10cSrcweirBUILD_TYPE="OOo"
95027b2fc91SAndre FischerADDITIONAL_REPOSITORIES="../ext_libraries"
95157c1b8dfSAndre FischerSCPDEFS=""
952cdf0e10cSrcweir
953a3f0327cSHerbert Dürrdnl ===================================================================
95431353920Spfgdnl Check configure script vs. configure.ac
955a3f0327cSHerbert Dürrdnl ===================================================================
956a3f0327cSHerbert DürrAC_MSG_CHECKING([whether configure is up-to-date])
95731353920Spfgif test "configure" -ot "configure.ac"; then
958a3f0327cSHerbert Dürr   AC_MSG_RESULT([no])
959a3f0327cSHerbert Dürr   AC_MSG_ERROR([configure is not up-to-date, run autoconf first!])
960a3f0327cSHerbert Dürrelse
961a3f0327cSHerbert Dürr   AC_MSG_RESULT([yes])
962a3f0327cSHerbert Dürrfi
963cdf0e10cSrcweirdnl ===================================================================
964cdf0e10cSrcweirdnl Message.
965cdf0e10cSrcweirdnl ===================================================================
966cdf0e10cSrcweirecho "********************************************************************"
967cdf0e10cSrcweirecho "*                                                                  *"
968c4266413SHerbert Dürrecho "*   Apache OpenOffice build configuration.                         *"
969cdf0e10cSrcweirecho "*                                                                  *"
970cdf0e10cSrcweirecho "*   The configure process checks your platform to see whether      *"
971c4266413SHerbert Dürrecho "*   you can build Apache OpenOffice on it.                         *"
972cdf0e10cSrcweirecho "*   This process checks all pre-requisites and generates a file    *"
973cdf0e10cSrcweirecho "*   containing the necessary environment variables.                *"
974cdf0e10cSrcweirecho "*   Source this file after configure has ended successfully.       *"
975cdf0e10cSrcweirecho "*                                                                  *"
976a5542d65SHerbert Dürrecho "*   Warnings that are generated during the configure process       *"
977cdf0e10cSrcweirecho "*   must be taken into account since it can be a reason for        *"
978c4266413SHerbert Dürrecho "*   an unsuccessful build of Apache OpenOffice.                    *"
979cdf0e10cSrcweirecho "*                                                                  *"
980cdf0e10cSrcweirecho "********************************************************************"
981cdf0e10cSrcweirecho ""
982cdf0e10cSrcweirecho "********************************************************************"
983cdf0e10cSrcweirecho "*                                                                  *"
984cdf0e10cSrcweirecho "*   Checking the platform pre-requisites.                          *"
985cdf0e10cSrcweirecho "*                                                                  *"
986cdf0e10cSrcweirecho "********************************************************************"
987cdf0e10cSrcweirecho ""
988cdf0e10cSrcweirdnl ===================================================================
989cdf0e10cSrcweirdnl Configure pre-requisites.
990cdf0e10cSrcweirdnl ===================================================================
991cdf0e10cSrcweircat /dev/null > warn
9922a718e4fSJürgen Schmidt
993cdf0e10cSrcweirAC_PROG_EGREP
994308295dbSJim Jagielskiif test -z "$GREP"; then
995308295dbSJim JagielskiGREP=$EGREP
996308295dbSJim Jagielskifi
997cdf0e10cSrcweirAC_PROG_AWK
998cdf0e10cSrcweirAC_PATH_PROG( AWK, $AWK)
999cdf0e10cSrcweirif test -z "$AWK"; then
1000cdf0e10cSrcweir   AC_MSG_ERROR([install awk to run this script])
1001cdf0e10cSrcweirfi
1002cdf0e10cSrcweir
1003cdf0e10cSrcweirAC_PATH_PROGS(SED, sed )
1004cdf0e10cSrcweirif test -z "$SED"; then
1005cdf0e10cSrcweir   AC_MSG_ERROR([install sed to run this script])
1006cdf0e10cSrcweirfi
1007cdf0e10cSrcweir
1008cdf0e10cSrcweirAC_MSG_CHECKING([for solenv environment])
1009cdf0e10cSrcweirif test -z "$with_local_solenv"; then
1010cdf0e10cSrcweir   LOCAL_SOLENV="DEFAULT"
1011cdf0e10cSrcweir   AC_MSG_RESULT([default])
1012cdf0e10cSrcweirelse
1013cdf0e10cSrcweir   LOCAL_SOLENV=$with_local_solenv
1014cdf0e10cSrcweir   AC_MSG_RESULT([$with_local_solenv])
1015cdf0e10cSrcweirfi
1016cdf0e10cSrcweirAC_SUBST(LOCAL_SOLENV)
1017cdf0e10cSrcweir
1018407bc2eeSMatthias Seidelif test "$LOCAL_SOLENV" = "DEFAULT"; then
1019cdf0e10cSrcweir  _solenv="./solenv"
1020cdf0e10cSrcweirelse
1021cdf0e10cSrcweir  _solenv="$LOCAL_SOLENV"
1022cdf0e10cSrcweirfi
1023cdf0e10cSrcweirAC_SUBST(_solenv)
1024cdf0e10cSrcweir
1025cdf0e10cSrcweirif test -e $_solenv/inc/minor.mk; then
1026cdf0e10cSrcweir   # Get UPD number from ./solenv/inc/minor.mk
102728633775SPedro Giffuni   UPD="`$GREP RSCVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`"
1028cdf0e10cSrcweir   AC_SUBST(UPD)
102928633775SPedro Giffuni   SOURCEVERSION="`$GREP SOURCEVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`"
1030cdf0e10cSrcweir   AC_SUBST(SOURCEVERSION)
1031cdf0e10cSrcweirelse
1032cdf0e10cSrcweir   AC_MSG_ERROR([$_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation...])
1033cdf0e10cSrcweirfi
1034cdf0e10cSrcweir
103572bd2d34SAriel Constenla-Haile
103672bd2d34SAriel Constenla-Hailednl ==================================================================
103772bd2d34SAriel Constenla-Hailednl Checks for custom pack.lst
103872bd2d34SAriel Constenla-Hailednl ==================================================================
103972bd2d34SAriel Constenla-HaileAC_MSG_CHECKING([for custom pack.lst])
104072bd2d34SAriel Constenla-HaileCUSTOM_PACK_LIST=
104172bd2d34SAriel Constenla-HaileUSE_PACKAGER=
104272bd2d34SAriel Constenla-Haileif test -n "$with_packager_list" ; then
104372bd2d34SAriel Constenla-Haile    if test -e $with_packager_list; then
104472bd2d34SAriel Constenla-Haile      CUSTOM_PACK_LIST=$with_packager_list
104572bd2d34SAriel Constenla-Haile      USE_PACKAGER=YES
104672bd2d34SAriel Constenla-Haile    fi
104772bd2d34SAriel Constenla-Hailefi
104872bd2d34SAriel Constenla-Haileif test -n "$CUSTOM_PACK_LIST"; then
104972bd2d34SAriel Constenla-Haile   AC_MSG_RESULT([$CUSTOM_PACK_LIST])
105072bd2d34SAriel Constenla-Haileelse
105172bd2d34SAriel Constenla-Haile   AC_MSG_RESULT([no])
105272bd2d34SAriel Constenla-Hailefi
105372bd2d34SAriel Constenla-HaileAC_SUBST(CUSTOM_PACK_LIST)
105472bd2d34SAriel Constenla-HaileAC_SUBST(USE_PACKAGER)
105572bd2d34SAriel Constenla-Haile
105672bd2d34SAriel Constenla-Haile
1057cdf0e10cSrcweirdnl ===================================================================
1058cdf0e10cSrcweirdnl Checks for the operating system and processor.
1059cdf0e10cSrcweirdnl ===================================================================
1060cdf0e10cSrcweirAC_CANONICAL_SYSTEM
1061cdf0e10cSrcweirif test "$build" != "$host" -o "$build" != "$target" \
1062cdf0e10cSrcweir  -o "$host" != "$target"; then
1063cdf0e10cSrcweir	AC_MSG_WARN([cross-compiling by any means is not supported (yet)!])
1064cdf0e10cSrcweir	echo "cross-compiling by any means is not supported (yet)!" >> warn
1065cdf0e10cSrcweirfi
1066cdf0e10cSrcweir
106728633775SPedro Giffuniif echo "$build_os" | $GREP cygwin; then
1068cdf0e10cSrcweir   AC_MSG_CHECKING([Cygwin version])
1069cdf0e10cSrcweir   CygwinVer=`uname -r`
1070cdf0e10cSrcweir   AC_MSG_RESULT([$CygwinVer])
1071cdf0e10cSrcweir   if test "`echo $CygwinVer | $AWK -F . '{ print $1$2 }'`" -lt "15"; then
1072cdf0e10cSrcweir      AC_MSG_ERROR([You need at least Cygwin V1.5.x])
1073cdf0e10cSrcweir   fi
1074cdf0e10cSrcweirelse
1075cdf0e10cSrcweir   CygwinVer="false"
1076cdf0e10cSrcweirfi
1077cdf0e10cSrcweir
10787ab687f7SHerbert Dürr# get info about the system provided release/version details
10797ab687f7SHerbert Dürrhead /etc/*-release
10807ab687f7SHerbert Dürruname -a
10817ab687f7SHerbert Dürr
1082cdf0e10cSrcweirdnl ===================================================================
1083cdf0e10cSrcweirdnl The following is a list of supported systems.
1084cdf0e10cSrcweirdnl Sequential to keep the logic very simple
1085cdf0e10cSrcweirdnl These values may be checked and reset later.
1086cdf0e10cSrcweirdnl ===================================================================
1087cdf0e10cSrcweircase "$build_os" in
1088cdf0e10cSrcweir	solaris*)
1089cdf0e10cSrcweir		test_gtk=yes
1090cdf0e10cSrcweir		test_cairo=yes
1091cdf0e10cSrcweir		test_kde=yes
1092cdf0e10cSrcweir		test_cups=yes
10931439c24fSJürgen Schmidt        	test_randr=yes
1094cdf0e10cSrcweir		test_freetype=yes
10951439c24fSJürgen Schmidt        	test_gstreamer=yes
1096cdf0e10cSrcweir		_os=SunOS
1097cdf0e10cSrcweir		AC_PATH_PROG( GNUTAR, gtar,,$PATH:/usr/sfw/bin)
1098cdf0e10cSrcweir		if test -z "$GNUTAR"; then
1099cdf0e10cSrcweir			AC_MSG_ERROR([gtar (gnu tar) not found but needed. Install it (SUN Freeware package).])
1100cdf0e10cSrcweir		fi
1101cdf0e10cSrcweir		AC_SUBST(GNUTAR)
1102cdf0e10cSrcweir
1103cdf0e10cSrcweir		dnl ===========================================================
1104cdf0e10cSrcweir		dnl check whether we're using solaris 6,7,8 - sparc or intel.
1105cdf0e10cSrcweir		dnl ===========================================================
1106cdf0e10cSrcweir   		AC_MSG_CHECKING([the Solaris operating system release])
1107cdf0e10cSrcweir   		_os_release=`echo $build_os | $SED -e s/solaris2\.//`
1108cdf0e10cSrcweir		if test "$_os_release" -lt "6"; then
1109c4266413SHerbert Dürr      			AC_MSG_ERROR([use solaris >= 6 to build Apache OpenOffice])
1110cdf0e10cSrcweir   		else
1111cdf0e10cSrcweir      			AC_MSG_RESULT([ok ($_os_release)])
1112cdf0e10cSrcweir   		fi
1113cdf0e10cSrcweir
1114cdf0e10cSrcweir   		dnl check whether we're using a sparc or i386 processor
1115cdf0e10cSrcweir   		AC_MSG_CHECKING([the processor type])
1116cdf0e10cSrcweir   		if test "$build_cpu" = "sparc" -o "$build_cpu" = "i386"; then
1117cdf0e10cSrcweir      			AC_MSG_RESULT([ok ($build_cpu)])
1118cdf0e10cSrcweir   		else
1119cdf0e10cSrcweir      			AC_MSG_ERROR([only sparc and i386 processors are supported])
1120cdf0e10cSrcweir   		fi
1121cdf0e10cSrcweir		;;
1122cdf0e10cSrcweir	linux-gnu*|k*bsd*-gnu*)
1123cdf0e10cSrcweir		test_gtk=yes
1124cdf0e10cSrcweir		test_cairo=yes
1125cdf0e10cSrcweir		test_kde=yes
1126cdf0e10cSrcweir		test_kde4=yes
1127cdf0e10cSrcweir		test_cups=yes
11281439c24fSJürgen Schmidt        	test_randr=yes
1129cdf0e10cSrcweir		test_freetype=yes
11301439c24fSJürgen Schmidt        	test_gstreamer=yes
1131da2e13d4SMatthias Seidel        	_os=Linux
1132cdf0e10cSrcweir		;;
1133cdf0e10cSrcweir	gnu)
1134cdf0e10cSrcweir		test_cups=no
1135cdf0e10cSrcweir		_os=GNU
1136cdf0e10cSrcweir		;;
1137cdf0e10cSrcweir	cygwin*) # Windows
1138cdf0e10cSrcweir		test_cups=no
1139cdf0e10cSrcweir		test_cairo=yes
1140cdf0e10cSrcweir		test_freetype=no
11411439c24fSJürgen Schmidt        	test_gstreamer=no
1142cdf0e10cSrcweir		_os=WINNT
1143cdf0e10cSrcweir		;;
1144cdf0e10cSrcweir	darwin*) # Mac OS X
1145cdf0e10cSrcweir		test_cups=yes
1146cdf0e10cSrcweir		test_gtk=yes
1147cdf0e10cSrcweir		test_cairo=yes
11481439c24fSJürgen Schmidt        	test_randr=no
1149cdf0e10cSrcweir		test_freetype=no
11501439c24fSJürgen Schmidt        	test_gstreamer=no
1151cdf0e10cSrcweir		_os=Darwin
11521439c24fSJürgen Schmidt      		if test "$enable_systray" = "yes" && test "$enable_gtk" != "no"; then
11531439c24fSJürgen Schmidt         	   AC_MSG_WARN([Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray])
11541439c24fSJürgen Schmidt         	   echo "Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >>warn
11551439c24fSJürgen Schmidt         	   enable_systray=no
11561439c24fSJürgen Schmidt      		fi
11573f8266eeSJim Jagielski		SDKROOT="`xcrun --sdk macosx --show-sdk-path`"
115861a3a0ffSHerbert Dürr		if test ! -n "$CC"; then
115961a3a0ffSHerbert Dürr		   CC="`xcrun -f clang` -arch x86_64"
116061a3a0ffSHerbert Dürr		fi
116161a3a0ffSHerbert Dürr		if test ! -n "$CXX"; then
11623d8a7236SJim Jagielski		   CXX="`xcrun -f clang++` -std=c++11 -stdlib=libc++ -arch x86_64"
116361a3a0ffSHerbert Dürr		fi
1164221de5adSjim		# Don't use OSVERSION until we know no conflicts result from it
1165221de5adSjim		_darwin_version="`uname -r | $AWK -F . '{ print $1 }'`"
1166*3187fb04SJim Jagielski		# FIXME: Assumes 10.x, breaks w/ Big Sur
1167221de5adSjim		_osx_version="10.`expr $_darwin_version - 4`"
1168221de5adSjim		AC_MSG_NOTICE([Detected Darwin version: $_darwin_version ($_osx_version)])
1169cdf0e10cSrcweir		;;
1170cdf0e10cSrcweir	os2*)
1171cdf0e10cSrcweir		test_x=no
1172cdf0e10cSrcweir		test_cups=no
11731439c24fSJürgen Schmidt        	test_randr=no
1174cdf0e10cSrcweir		test_gtk=no
1175cdf0e10cSrcweir		test_freetype=no
11761439c24fSJürgen Schmidt        	test_gstreamer=no
1177906a4e93SYuri Dario		test_cairo=yes
1178cdf0e10cSrcweir		_os=OS2
1179cdf0e10cSrcweir		;;
1180cdf0e10cSrcweir	freebsd*)
1181cdf0e10cSrcweir		test_gtk=yes
1182cdf0e10cSrcweir		test_cairo=yes
1183cdf0e10cSrcweir		test_kde=yes
1184cdf0e10cSrcweir		test_kde4=yes
1185cdf0e10cSrcweir		test_cups=yes
11861439c24fSJürgen Schmidt        	test_randr=yes
1187cdf0e10cSrcweir		test_freetype=yes
11881439c24fSJürgen Schmidt        	test_gstreamer=yes
1189cdf0e10cSrcweir		AC_MSG_CHECKING([the FreeBSD operating system release])
1190cdf0e10cSrcweir		if test -n "$with_os_version"; then
1191cdf0e10cSrcweir			OSVERSION="$with_os_version"
1192cdf0e10cSrcweir		else
1193cdf0e10cSrcweir			OSVERSION=`/sbin/sysctl -n kern.osreldate`
1194cdf0e10cSrcweir		fi
1195cdf0e10cSrcweir		AC_MSG_RESULT([found OSVERSION=$OSVERSION])
1196cdf0e10cSrcweir		AC_MSG_CHECKING([which thread library to use])
1197cdf0e10cSrcweir		if test "$OSVERSION" -lt "500016"; then
1198cdf0e10cSrcweir			PTHREAD_CFLAGS="-D_THREAD_SAFE"
1199cdf0e10cSrcweir			PTHREAD_LIBS="-pthread"
1200cdf0e10cSrcweir		elif test "$OSVERSION" -lt "502102"; then
1201cdf0e10cSrcweir			PTHREAD_CFLAGS="-D_THREAD_SAFE"
1202cdf0e10cSrcweir			PTHREAD_LIBS="-lc_r"
1203da2e13d4SMatthias Seidel		else
1204cdf0e10cSrcweir			PTHREAD_CFLAGS=""
1205cdf0e10cSrcweir			PTHREAD_LIBS="-pthread"
1206cdf0e10cSrcweir		fi
1207cdf0e10cSrcweir		AC_MSG_RESULT([$PTHREAD_LIBS])
1208cdf0e10cSrcweir		_os=FreeBSD
1209cdf0e10cSrcweir		;;
1210cdf0e10cSrcweir	osf)
1211cdf0e10cSrcweir		test_cups=no
12121439c24fSJürgen Schmidt        	test_randr=no
1213cdf0e10cSrcweir		_os=OSF1
1214cdf0e10cSrcweir		;;
1215cdf0e10cSrcweir	netbsd)
1216cdf0e10cSrcweir		test_gtk=yes
1217cdf0e10cSrcweir		test_cairo=yes
1218cdf0e10cSrcweir		test_kde=yes
1219cdf0e10cSrcweir		test_kde4=yes
1220cdf0e10cSrcweir		test_cups=no
12211439c24fSJürgen Schmidt        	test_randr=yes
1222cdf0e10cSrcweir		test_freetype=yes
12231439c24fSJürgen Schmidt        	test_gstreamer=yes
1224cdf0e10cSrcweir		PTHREAD_CFLAGS="-pthread"
1225cdf0e10cSrcweir		PTHREAD_LIBS="-pthread -lpthread"
1226cdf0e10cSrcweir		_os=NetBSD
1227cdf0e10cSrcweir		;;
1228cdf0e10cSrcweir	aix*)
1229cdf0e10cSrcweir		test_cups=no
12301439c24fSJürgen Schmidt        	test_randr=no
1231cdf0e10cSrcweir		test_freetype=yes
12321439c24fSJürgen Schmidt        	test_gstreamer=yes
12331439c24fSJürgen Schmidt	   	PTHREAD_LIBS=-pthread
1234cdf0e10cSrcweir		echo "AIX is an alpha port --- Use at own risk" >> warn
1235cdf0e10cSrcweir		_os=AIX
1236cdf0e10cSrcweir		;;
1237cdf0e10cSrcweir   *)
1238c4266413SHerbert Dürr   AC_MSG_ERROR([$_os operating system is not suitable to build Apache OpenOffice!])
1239cdf0e10cSrcweir   ;;
1240cdf0e10cSrcweiresac
1241cdf0e10cSrcweir
1242cdf0e10cSrcweirAC_SUBST(OSVERSION)
1243cdf0e10cSrcweirAC_SUBST(PTHREAD_CFLAGS)
1244cdf0e10cSrcweirAC_SUBST(PTHREAD_LIBS)
1245cdf0e10cSrcweir
12463f10de8fSEike Rathke
12473f10de8fSEike Rathkednl Ensure pkg-config is initialized before any possible use
12483f10de8fSEike RathkePKG_PROG_PKG_CONFIG
12493f10de8fSEike Rathke
12503f10de8fSEike Rathke
1251cdf0e10cSrcweirdnl ===================================================================
1252cdf0e10cSrcweirdnl Set the ENABLE_CRASHDUMP variable.
1253cdf0e10cSrcweirdnl ===================================================================
1254cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable crashdump feature])
1255cdf0e10cSrcweirif test "$enable_crashdump" = "yes"; then
1256cdf0e10cSrcweir   ENABLE_CRASHDUMP="TRUE"
1257cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE CRASHREP"
1258cdf0e10cSrcweir   AC_MSG_RESULT([yes])
1259cdf0e10cSrcweirelse
1260cdf0e10cSrcweir   ENABLE_CRASHDUMP=""
1261cdf0e10cSrcweir   AC_MSG_RESULT([no])
1262cdf0e10cSrcweirfi
1263cdf0e10cSrcweirAC_SUBST(ENABLE_CRASHDUMP)
1264cdf0e10cSrcweir
1265cdf0e10cSrcweirif test "$_os" = "WINNT"; then
1266cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE TWAIN"
1267cdf0e10cSrcweirfi
1268cdf0e10cSrcweir
1269cdf0e10cSrcweirif test "$_os" = "WINNT"; then
1270cdf0e10cSrcweir   dnl ===================================================================
1271cdf0e10cSrcweir   dnl Set the VC_STANDARD variable.
1272cdf0e10cSrcweir   dnl ===================================================================
1273cdf0e10cSrcweir   AC_MSG_CHECKING([whether to use the standard non-optimizing compiler])
1274cdf0e10cSrcweir   if test "$enable_cl_standard" = "" -o "$enable_cl_standard" = "no"; then
1275cdf0e10cSrcweir      VC_STANDARD=""
1276cdf0e10cSrcweir      AC_MSG_RESULT([no])
1277cdf0e10cSrcweir   else
1278cdf0e10cSrcweir      VC_STANDARD="TRUE"
1279cdf0e10cSrcweir      AC_MSG_RESULT([yes])
1280cdf0e10cSrcweir   fi
1281cdf0e10cSrcweir   AC_SUBST(VC_STANDARD)
1282cdf0e10cSrcweirfi
1283cdf0e10cSrcweir
128433605542SJürgen Schmidtif test "$_os" = "WINNT"; then
128533605542SJürgen Schmidt   dnl ===================================================================
1286e986c8d8SMatthias Seidel   dnl Set the BUILD_X64 variable.
128733605542SJürgen Schmidt   dnl ===================================================================
128833605542SJürgen Schmidt   AC_MSG_CHECKING([whether to build/use the Windows 64bit shell extensions])
128933605542SJürgen Schmidt   if test "$enable_win_x64_shellext" = "" -o "$enable_win_x64_shellext" = "no"; then
129033605542SJürgen Schmidt      BUILD_X64=""
129133605542SJürgen Schmidt      AC_MSG_RESULT([no])
129233605542SJürgen Schmidt   else
129333605542SJürgen Schmidt      BUILD_X64="TRUE"
129433605542SJürgen Schmidt      AC_MSG_RESULT([yes])
129533605542SJürgen Schmidt   fi
129633605542SJürgen Schmidt   AC_SUBST(BUILD_X64)
1297edd74ba5SDamjan Jovanovic
1298edd74ba5SDamjan Jovanovic   dnl ===================================================================
1299e986c8d8SMatthias Seidel   dnl Set the BUILD_WIN64 variable.
1300edd74ba5SDamjan Jovanovic   dnl ===================================================================
1301edd74ba5SDamjan Jovanovic   AC_MSG_CHECKING([whether to build 64 bit OpenOffice on 64 bit Windows])
1302edd74ba5SDamjan Jovanovic   if test "$build_cpu" = "x86_64" ; then
1303edd74ba5SDamjan Jovanovic      if test "x$enable_win64" != "xno" ; then
1304edd74ba5SDamjan Jovanovic         BUILD_WIN64="TRUE"
1305edd74ba5SDamjan Jovanovic         AC_MSG_RESULT([yes])
1306edd74ba5SDamjan Jovanovic         OOWINTOOL="./oowintool"
1307edd74ba5SDamjan Jovanovic      else
1308edd74ba5SDamjan Jovanovic         BUILD_WIN64=""
1309edd74ba5SDamjan Jovanovic         AC_MSG_RESULT([no])
1310edd74ba5SDamjan Jovanovic         OOWINTOOL="./oowintool --aoo32-on-win64"
1311edd74ba5SDamjan Jovanovic      fi
1312edd74ba5SDamjan Jovanovic   else
1313edd74ba5SDamjan Jovanovic      if test "x$enable_win64" != "xno" ; then
1314edd74ba5SDamjan Jovanovic         AC_MSG_ERROR([the --enable-win64 option can only be used on an AMD64 CPU])
1315edd74ba5SDamjan Jovanovic      fi
1316edd74ba5SDamjan Jovanovic      BUILD_WIN64=""
1317edd74ba5SDamjan Jovanovic      AC_MSG_RESULT([no])
1318edd74ba5SDamjan Jovanovic      OOWINTOOL="./oowintool"
1319edd74ba5SDamjan Jovanovic   fi
1320edd74ba5SDamjan Jovanovic   AC_SUBST(BUILD_WIN64)
132133605542SJürgen Schmidtfi
132233605542SJürgen Schmidt
1323cdf0e10cSrcweirdnl ===================================================================
1324cdf0e10cSrcweirdnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
1325cdf0e10cSrcweirdnl ===================================================================
1326cdf0e10cSrcweirAC_MSG_CHECKING([whether to turn warnings to errors])
1327cdf0e10cSrcweirif test -n "$enable_werror" && test "$enable_werror" != "no"; then
1328cdf0e10cSrcweir   ENABLE_WERROR="TRUE"
1329cdf0e10cSrcweir   AC_MSG_RESULT([yes])
1330cdf0e10cSrcweir   AC_MSG_WARN([Turning warnings to errors has no effect in modules or])
13316d53c851Smseidel   AC_MSG_WARN([on platforms where it has been disabled explicitly])
1332da2e13d4SMatthias Seidel   echo "Turning warnings to errors has no effect in modules or on platforms where it has been disabled explicitly" >> warn
1333cdf0e10cSrcweirelse
1334cdf0e10cSrcweir   ENABLE_WERROR="FALSE"
1335cdf0e10cSrcweir   AC_MSG_RESULT([no])
1336cdf0e10cSrcweirfi
1337cdf0e10cSrcweirAC_SUBST(ENABLE_WERROR)
1338cdf0e10cSrcweir
1339cdf0e10cSrcweirdnl ===================================================================
1340cdf0e10cSrcweirdnl Set the ENABLE_DEBUG variable. (Activate --enable-symbols)
1341cdf0e10cSrcweirdnl ===================================================================
1342cdf0e10cSrcweirAC_MSG_CHECKING([whether to do a debug build])
1343cdf0e10cSrcweirif test -n "$enable_debug" && test "$enable_debug" != "no"; then
1344cdf0e10cSrcweir   ENABLE_DEBUG="TRUE"
1345cdf0e10cSrcweir   if test -z "$enable_symbols"; then
1346cdf0e10cSrcweir      enable_symbols="yes"
1347cdf0e10cSrcweir   fi
1348cdf0e10cSrcweir   AC_MSG_RESULT([yes])
1349cdf0e10cSrcweirelse
1350cdf0e10cSrcweir   ENABLE_DEBUG="FALSE"
1351cdf0e10cSrcweir   AC_MSG_RESULT([no])
1352cdf0e10cSrcweirfi
1353cdf0e10cSrcweirAC_SUBST(ENABLE_DEBUG)
1354cdf0e10cSrcweir
1355cdf0e10cSrcweirdnl ===================================================================
1356cdf0e10cSrcweirdnl Set the ENABLE_DBGUTIL variable
1357cdf0e10cSrcweirdnl ===================================================================
1358cdf0e10cSrcweirAC_MSG_CHECKING([whether to build with additional debug utilities])
1359cdf0e10cSrcweirif test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
1360cdf0e10cSrcweir   PROEXT=""
1361cdf0e10cSrcweir   PRODUCT=""
1362cdf0e10cSrcweir   PROFULLSWITCH=""
1363cdf0e10cSrcweir   AC_MSG_RESULT([yes])
1364cdf0e10cSrcweirelse
1365cdf0e10cSrcweir   PRODUCT="full"
1366cdf0e10cSrcweir   PROFULLSWITCH="product=full"
1367cdf0e10cSrcweir   PROEXT=".pro"
1368cdf0e10cSrcweir   AC_MSG_RESULT([no, full product build])
1369cdf0e10cSrcweirfi
1370cdf0e10cSrcweirAC_SUBST(PRODUCT)
1371cdf0e10cSrcweirAC_SUBST(PROFULLSWITCH)
1372cdf0e10cSrcweirAC_SUBST(PROEXT)
1373cdf0e10cSrcweir
1374cdf0e10cSrcweirdnl ===================================================================
1375cdf0e10cSrcweirdnl First setting is whether to include symbols into final build.
1376cdf0e10cSrcweirdnl ===================================================================
1377cdf0e10cSrcweirAC_MSG_CHECKING([whether to include symbols into final build])
1378cdf0e10cSrcweirif test -n "$enable_symbols" && test "$enable_symbols" != "no"; then
1379cdf0e10cSrcweir	if test "$enable_symbols" = "yes" -o "$enable_symbols" = "TRUE"; then
1380cdf0e10cSrcweir		ENABLE_SYMBOLS="TRUE"
1381cdf0e10cSrcweir		AC_MSG_RESULT([yes])
1382cdf0e10cSrcweir	else
1383cdf0e10cSrcweir		if test "$enable_symbols" = "SMALL" -o "$enable_symbols" = "small"; then
1384cdf0e10cSrcweir			ENABLE_SYMBOLS="SMALL"
1385cdf0e10cSrcweir			AC_MSG_RESULT([yes, small ones])
1386cdf0e10cSrcweir		else if test "$enable_symbols" != "no" ; then
1387cdf0e10cSrcweir			     echo enable symbols is: $enable_symbols
1388cdf0e10cSrcweir			     AC_MSG_ERROR([--enable-symbols only accepts yes, TRUE or SMALL as parameter.])
1389cdf0e10cSrcweir           	     else
1390cdf0e10cSrcweir              		     ENABLE_SYMBOLS=
1391cdf0e10cSrcweir		     fi
1392cdf0e10cSrcweir		fi
1393cdf0e10cSrcweir	fi
1394cdf0e10cSrcweirelse
1395cdf0e10cSrcweir   ENABLE_SYMBOLS=
1396cdf0e10cSrcweir   AC_MSG_RESULT([no])
1397cdf0e10cSrcweirfi
1398cdf0e10cSrcweirAC_SUBST(ENABLE_SYMBOLS)
1399cdf0e10cSrcweir
1400cdf0e10cSrcweirdnl ===================================================================
1401cdf0e10cSrcweirdnl Determine if the solver is to be stripped or not.
1402cdf0e10cSrcweirdnl ===================================================================
1403cdf0e10cSrcweirAC_MSG_CHECKING([whether to strip the solver or not.])
1404cdf0e10cSrcweirif test -n "$enable_strip_solver"; then
1405cdf0e10cSrcweir   if test "$enable_strip_solver" = "yes"; then
1406cdf0e10cSrcweir      DISABLE_STRIP=
1407cdf0e10cSrcweir   else if test "$enable_strip_solver" = "no"; then
1408cdf0e10cSrcweir           DISABLE_STRIP="TRUE"
1409cdf0e10cSrcweir        else
1410cdf0e10cSrcweir           AC_MSG_ERROR([--disable-strip-solver only accepts yes or no as parameter.])
1411cdf0e10cSrcweir        fi
1412cdf0e10cSrcweir   fi
1413cdf0e10cSrcweirelse
1414cdf0e10cSrcweir   if test -n "$ENABLE_SYMBOLS"; then
1415cdf0e10cSrcweir      DISABLE_STRIP="TRUE"
1416cdf0e10cSrcweir   else
1417cdf0e10cSrcweir      DISABLE_STRIP=
1418cdf0e10cSrcweir   fi
1419cdf0e10cSrcweirfi
14209ef65f0eSAndre Fischerif test -z "$DISABLE_STRIP"; then
14219ef65f0eSAndre Fischer   AC_MSG_RESULT([yes])
14229ef65f0eSAndre Fischerelse
14239ef65f0eSAndre Fischer   AC_MSG_RESULT([no])
14249ef65f0eSAndre Fischerfi
1425cdf0e10cSrcweirAC_SUBST(DISABLE_STRIP)
1426cdf0e10cSrcweir
1427cdf0e10cSrcweirdnl ===================================================================
1428cdf0e10cSrcweirdnl Build options
1429cdf0e10cSrcweirdnl ===================================================================
14300ea1a209SEike Rathke
1431da2e13d4SMatthias Seidel# Disable or enable category-B libraries: nss, hunspell, hyphen, saxon,
14328bebafa9SPedro Giffuni# rhino, silgraphite.
14339ef65f0eSAndre Fischer
14349ef65f0eSAndre Fischer# Note that further below they may be enabled or disabled again by
14359ef65f0eSAndre Fischer# more specific options.
14369ef65f0eSAndre Fischer
1437ae258647SHerbert DürrENABLE_CATEGORY_B=
1438ae258647SHerbert Dürr
14399ef65f0eSAndre FischerAC_MSG_CHECKING([whether to enable category B components])
14409ef65f0eSAndre Fischer# Category B modules (libraries):
14419ef65f0eSAndre Fischer#   nss (nss)
14429ef65f0eSAndre Fischer#   hunspell (hunspell)
14439ef65f0eSAndre Fischer#   hyphen (hyphen)
14449ef65f0eSAndre Fischer#   saxon (saxon)
14459ef65f0eSAndre Fischer#   rhino (rhino)
14469ef65f0eSAndre Fischer#   graphite (silgraphite)
1447f06c1a76SPedro Giffuniif test "$enable_category_b" = "yes"; then
1448ae258647SHerbert Dürr   ENABLE_CATEGORY_B=YES
14491aba9913SJim Jagielski   enable_nss_module="yes"
14509ef65f0eSAndre Fischer   enable_hunspell="yes"
14519ef65f0eSAndre Fischer   enable_hyphen="yes"
14529ef65f0eSAndre Fischer   enable_saxon="yes"
14539ef65f0eSAndre Fischer   enable_javascript="yes"
14549ef65f0eSAndre Fischer   enable_graphite="yes"
145527b2fc91SAndre Fischer   enable_coinmp="yes"
14563c6578e9SAndre Fischer   enable_category_b_fonts="yes"
14579ef65f0eSAndre Fischer
1458b1c00883SJim Jagielski   AC_MSG_RESULT([yes: allow modules nss, hunspell, hyphen, saxon, rhino, graphite, coinmp to be built])
14599ef65f0eSAndre Fischerelse
14609835bf0fSPedro Giffuni   # Disable libraries.
14610ea1a209SEike Rathke   enable_nss_module="no"
14629ef65f0eSAndre Fischer   enable_hunspell="no"
14639ef65f0eSAndre Fischer   enable_hyphen="no"
14649ef65f0eSAndre Fischer   enable_saxon="no"
14659ef65f0eSAndre Fischer   enable_javascript="no"
14669ef65f0eSAndre Fischer   enable_graphite="no"
146727b2fc91SAndre Fischer   enable_coinmp="no"
14683c6578e9SAndre Fischer   enable_category_b_fonts="no"
14690ea1a209SEike Rathke
14708bebafa9SPedro Giffuni   AC_MSG_RESULT([no: disabled modules nss, hunspell, hyphen, saxon, rhino, graphite, coinmp])
14710ea1a209SEike Rathkefi
1472ae258647SHerbert DürrAC_SUBST(ENABLE_CATEGORY_B)
14739ef65f0eSAndre Fischer
14749ef65f0eSAndre Fischer# gstreamer is used only via pre-installed libraries: not a problem
14750ea1a209SEike Rathke
147635779863SAriel Constenla-Hailednl ===================================================================
147735779863SAriel Constenla-Hailednl Online Update
147835779863SAriel Constenla-Hailednl ===================================================================
147935779863SAriel Constenla-HaileAC_MSG_CHECKING([whether to enable the Online Update support])
148035779863SAriel Constenla-Haileif test "$enable_online_update" = "yes" -o "$enable_online_update" = "TRUE"; then
148135779863SAriel Constenla-Haile   ENABLE_ONLINE_UPDATE="YES"
148235779863SAriel Constenla-Haile   SCPDEFS="$SCPDEFS -DENABLE_ONLINE_UPDATE"
148335779863SAriel Constenla-Haile   AC_MSG_RESULT([yes])
148435779863SAriel Constenla-Haileelse
148535779863SAriel Constenla-Haile   ENABLE_ONLINE_UPDATE=""
148635779863SAriel Constenla-Haile   AC_MSG_RESULT([no])
148735779863SAriel Constenla-Hailefi
148835779863SAriel Constenla-HaileAC_SUBST(ENABLE_ONLINE_UPDATE)
148935779863SAriel Constenla-Haile
149043feee13SJuergen Schmidtdnl ===================================================================
149143feee13SJuergen Schmidtdnl Unit Tests
149243feee13SJuergen Schmidtdnl ===================================================================
149343feee13SJuergen SchmidtAC_MSG_CHECKING([whether to enable unit tests])
149443feee13SJuergen Schmidtif test "$enable_unit_tests" = "yes" -o "$enable_unit_tests" = "TRUE"; then
149543feee13SJuergen Schmidt   ENABLE_UNIT_TESTS="YES"
1496da2e13d4SMatthias Seidel   BUILD_TYPE="$BUILD_TYPE GTEST"
149743feee13SJuergen Schmidt   AC_MSG_RESULT([yes])
149843feee13SJuergen Schmidtelse
149943feee13SJuergen Schmidt   ENABLE_UNIT_TESTS=""
150043feee13SJuergen Schmidt   AC_MSG_RESULT([no])
150143feee13SJuergen Schmidtfi
150243feee13SJuergen SchmidtAC_SUBST(ENABLE_UNIT_TESTS)
15030ea1a209SEike Rathke
1504cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable native CUPS support])
1505cdf0e10cSrcweirif test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then
1506cdf0e10cSrcweir   ENABLE_CUPS="TRUE"
1507cdf0e10cSrcweir   AC_MSG_RESULT([yes])
1508cdf0e10cSrcweirelse
1509cdf0e10cSrcweir   ENABLE_CUPS=""
1510cdf0e10cSrcweir   AC_MSG_RESULT([no])
1511cdf0e10cSrcweirfi
1512cdf0e10cSrcweirAC_SUBST(ENABLE_CUPS)
1513cdf0e10cSrcweir
1514cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable fontconfig support])
1515cdf0e10cSrcweirif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a \( "$enable_fontconfig" = "yes" -o "$enable_fontconfig" = "TRUE" \); then
1516cdf0e10cSrcweir   ENABLE_FONTCONFIG="TRUE"
1517cdf0e10cSrcweir   AC_MSG_RESULT([yes])
1518cdf0e10cSrcweirelse
1519cdf0e10cSrcweir   ENABLE_FONTCONFIG=""
1520cdf0e10cSrcweir   AC_MSG_RESULT([no])
1521cdf0e10cSrcweirfi
1522cdf0e10cSrcweirAC_SUBST(ENABLE_FONTCONFIG)
1523cdf0e10cSrcweir
1524cdf0e10cSrcweirdnl ===================================================================
1525cdf0e10cSrcweirdnl find external tarballs.
1526cdf0e10cSrcweirdnl ===================================================================
1527cdf0e10cSrcweirif test -z $TARFILE_LOCATION; then
1528cdf0e10cSrcweir   TARFILE_LOCATION="DEFAULT"
1529cdf0e10cSrcweirfi
1530cdf0e10cSrcweirAC_SUBST(TARFILE_LOCATION)
1531cdf0e10cSrcweir
1532cdf0e10cSrcweirif test -z "$enable_fetch_external" || test "$enable_fetch_external" = "yes" \
1533cdf0e10cSrcweir   && test -z "$with_system_libs" -a "$with_system_jars" != "no"; then
1534cdf0e10cSrcweir   DO_FETCH_TARBALLS="yes"
1535cdf0e10cSrcweirfi
1536cdf0e10cSrcweirAC_SUBST(DO_FETCH_TARBALLS)
1537cdf0e10cSrcweir
1538cdf0e10cSrcweirif test "$_os" = "WINNT"; then
1539cdf0e10cSrcweir   AC_MSG_CHECKING([whether to use DirectX])
1540549fe914SJürgen Schmidt   ENABLE_DIRECT_DRAW=""
1541cdf0e10cSrcweir   if test "$enable_directx" = "yes" -o "$enable_directx" = "TRUE" -o "$enable_directx" = ""; then
1542cdf0e10cSrcweir      ENABLE_DIRECTX="TRUE"
1543cdf0e10cSrcweir      AC_MSG_RESULT([yes])
1544cdf0e10cSrcweir   else
1545cdf0e10cSrcweir      ENABLE_DIRECTX=""
1546cdf0e10cSrcweir      AC_MSG_RESULT([no])
1547cdf0e10cSrcweir   fi
1548cdf0e10cSrcweir   AC_SUBST(ENABLE_DIRECTX)
1549cdf0e10cSrcweir
1550cdf0e10cSrcweir   AC_MSG_CHECKING([whether to use ActiveX])
1551cdf0e10cSrcweir   if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
1552cdf0e10cSrcweir      DISABLE_ACTIVEX=""
1553cdf0e10cSrcweir      AC_MSG_RESULT([yes])
1554cdf0e10cSrcweir   else
1555cdf0e10cSrcweir      DISABLE_ACTIVEX="TRUE"
1556cdf0e10cSrcweir      AC_MSG_RESULT([no])
1557cdf0e10cSrcweir   fi
1558cdf0e10cSrcweir
1559cdf0e10cSrcweir   AC_MSG_CHECKING([whether to use ATL])
1560cdf0e10cSrcweir   if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
1561cdf0e10cSrcweir      DISABLE_ATL=""
1562cdf0e10cSrcweir      AC_MSG_RESULT([yes])
1563cdf0e10cSrcweir   else
1564cdf0e10cSrcweir      DISABLE_ATL="TRUE"
15650fd36615SAriel Constenla-Haile      dnl ActiveX depends on ATL, it should be disabled
15660fd36615SAriel Constenla-Haile      DISABLE_ACTIVEX="TRUE"
1567cdf0e10cSrcweir      AC_MSG_RESULT([no])
1568cdf0e10cSrcweir   fi
15690fd36615SAriel Constenla-Haile
1570cdf0e10cSrcweir   AC_SUBST(DISABLE_ATL)
15710fd36615SAriel Constenla-Haile   AC_SUBST(DISABLE_ACTIVEX)
1572cdf0e10cSrcweir
1573cdf0e10cSrcweirfi
1574cdf0e10cSrcweir
1575cdf0e10cSrcweirdnl ===================================================================
1576cdf0e10cSrcweirdnl Disable rpath in shared libraries?
1577cdf0e10cSrcweirdnl ===================================================================
1578cdf0e10cSrcweirAC_MSG_CHECKING([whether to use RPATH in shared libraries])
1579cdf0e10cSrcweirif test "$enable_rpath" = "no"; then
1580cdf0e10cSrcweir   ENABLE_RPATH="no"
1581cdf0e10cSrcweirelse
1582cdf0e10cSrcweir   ENABLE_RPATH="yes"
1583cdf0e10cSrcweirfi
1584cdf0e10cSrcweirAC_MSG_RESULT([$ENABLE_RPATH])
1585cdf0e10cSrcweirAC_SUBST(ENABLE_RPATH)
1586cdf0e10cSrcweir
1587cdf0e10cSrcweirdnl ===================================================================
1588010ec03aSHerbert Dürrdnl Check extensions to be bundled as literal blobs
1589010ec03aSHerbert Dürrdnl ===================================================================
1590010ec03aSHerbert Dürrif test -n "$with_bundled_extension_blobs"; then
1591010ec03aSHerbert Dürr	BUNDLED_EXTENSION_BLOBS="$with_bundled_extension_blobs"
15926feea343SAndre Fischerelse
1593010ec03aSHerbert Dürr	BUNDLED_EXTENSION_BLOBS=
1594cdf0e10cSrcweirfi
1595010ec03aSHerbert DürrAC_SUBST(BUNDLED_EXTENSION_BLOBS)
1596010ec03aSHerbert Dürr
1597010ec03aSHerbert Dürr#dnl ===================================================================
1598407bc2eeSMatthias Seidel#dnl Check extensions that are to be bundled as pre-registered
1599010ec03aSHerbert Dürr#dnl ===================================================================
1600010ec03aSHerbert Dürrif test -n "$with_bundled_prereg_extensions"; then
1601010ec03aSHerbert Dürr	BUNDLED_PREREG_EXTENSIONS="$with_bundled_prereg_extensions"
1602010ec03aSHerbert Dürrelse
1603010ec03aSHerbert Dürr	BUNDLED_PREREG_EXTENSIONS=
1604010ec03aSHerbert Dürrfi
1605010ec03aSHerbert DürrAC_SUBST(BUNDLED_PREREG_EXTENSIONS)
1606010ec03aSHerbert Dürr
1607010ec03aSHerbert Dürrdnl ===================================================================
1608010ec03aSHerbert Dürrdnl Configure system provided dictionary/hyphenation/thesaurus
1609010ec03aSHerbert Dürrdnl ===================================================================
1610010ec03aSHerbert Dürr  AC_MSG_CHECKING([whether to use dicts from external paths])
1611010ec03aSHerbert Dürr  if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then
1612010ec03aSHerbert Dürr	AC_MSG_RESULT([yes])
1613010ec03aSHerbert Dürr	SYSTEM_DICTS=YES
1614010ec03aSHerbert Dürr	AC_MSG_CHECKING([for spelling dictionary directory])
1615010ec03aSHerbert Dürr	if test -n "$with_external_dict_dir"; then
1616010ec03aSHerbert Dürr		DICT_SYSTEM_DIR=file://$with_external_dict_dir
1617010ec03aSHerbert Dürr	else
1618010ec03aSHerbert Dürr		DICT_SYSTEM_DIR=file:///usr/share/hunspell
1619010ec03aSHerbert Dürr	fi
1620010ec03aSHerbert Dürr	AC_MSG_RESULT([$DICT_SYSTEM_DIR])
1621010ec03aSHerbert Dürr	AC_MSG_CHECKING([for hyphenation patterns directory])
1622010ec03aSHerbert Dürr	if test -n "$with_external_hyph_dir"; then
1623010ec03aSHerbert Dürr		HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
1624010ec03aSHerbert Dürr	else
1625010ec03aSHerbert Dürr		HYPH_SYSTEM_DIR=file:///usr/share/hyphen
1626010ec03aSHerbert Dürr	fi
1627010ec03aSHerbert Dürr	AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
1628010ec03aSHerbert Dürr	AC_MSG_CHECKING([for thesaurus directory])
1629010ec03aSHerbert Dürr	if test -n "$with_external_thes_dir"; then
1630010ec03aSHerbert Dürr		THES_SYSTEM_DIR=file://$with_external_thes_dir
1631010ec03aSHerbert Dürr	else
1632010ec03aSHerbert Dürr		THES_SYSTEM_DIR=file:///usr/share/mythes
1633010ec03aSHerbert Dürr	fi
1634010ec03aSHerbert Dürr	AC_MSG_RESULT([$THES_SYSTEM_DIR])
1635010ec03aSHerbert Dürr  else
1636010ec03aSHerbert Dürr  	AC_MSG_RESULT([no])
1637010ec03aSHerbert Dürr  	SYSTEM_DICTS=NO
1638010ec03aSHerbert Dürr  fi
1639cdf0e10cSrcweirAC_SUBST(SYSTEM_DICTS)
1640cdf0e10cSrcweirAC_SUBST(DICT_SYSTEM_DIR)
1641cdf0e10cSrcweirAC_SUBST(HYPH_SYSTEM_DIR)
1642cdf0e10cSrcweirAC_SUBST(THES_SYSTEM_DIR)
1643cdf0e10cSrcweir
1644cdf0e10cSrcweirif test $_os = "WINNT"; then
1645cdf0e10cSrcweir   AC_MSG_CHECKING([Windows build environment sanity])
1646cdf0e10cSrcweir   dnl ===================================================================
1647407bc2eeSMatthias Seidel   dnl Sanity check! Native Windows programs cannot use cygwin symlinks!
1648cdf0e10cSrcweir   dnl ===================================================================
1649cdf0e10cSrcweir   dnl As long as awk instead of $AWK is used somewhere in the sources,
1650cdf0e10cSrcweir   dnl check for $AWK and awk. $AWK is pointing to gawk in cygwin.
1651cdf0e10cSrcweir      if test -L $AWK -o -L `which awk` -o -L `which tar` -o -L `which gunzip` ; then
1652cdf0e10cSrcweir         AC_MSG_ERROR([$AWK, awk, tar or gunzip is a cygwin symlink!
1653407bc2eeSMatthias SeidelNative Windows programs cannot use cygwin symlinks. Remove the symbolic
1654cdf0e10cSrcweirlink, and copy the program to the name of the link.])
1655cdf0e10cSrcweir      fi
1656cdf0e10cSrcweir   dnl ===================================================================
1657cdf0e10cSrcweir   dnl Another sanity check! More a band-aid. winenv.* adds guw.exe to
1658cdf0e10cSrcweir   dnl CC and CXX but the configure checks here assume that guw.exe
1659cdf0e10cSrcweir   dnl (if needed at all) is not yet present.
1660cdf0e10cSrcweir   dnl ===================================================================
1661cdf0e10cSrcweir   CC=`echo $CC | $SED "s/^guw.exe //"`
1662cdf0e10cSrcweir   CXX=`echo $CXX | $SED "s/^guw.exe //"`
1663cdf0e10cSrcweir   dnl ===================================================================
1664cdf0e10cSrcweir   dnl If $CC is set to a MinGW compiler, e.g. "gcc -mno-cygwin" enable
1665cdf0e10cSrcweir   dnl $WITH_MINGWIN
1666cdf0e10cSrcweir   dnl ===================================================================
1667cdf0e10cSrcweir      if test -n "$CC";then
1668cdf0e10cSrcweir         if test "`$CC -dumpmachine 2>/dev/null | $SED -e 's/^.*-//'`" = "mingw32"; then
1669cdf0e10cSrcweir            WITH_MINGWIN="yes"
1670cdf0e10cSrcweir         fi
1671cdf0e10cSrcweir      fi
1672cdf0e10cSrcweir   dnl ===================================================================
1673cdf0e10cSrcweir   if test "$WITH_MINGWIN" = "yes" ; then
1674cdf0e10cSrcweir      if test -z "$CC"; then
1675cdf0e10cSrcweir         CC="gcc -mno-cygwin"
1676cdf0e10cSrcweir         CXX="g++ -mno-cygwin"
1677cdf0e10cSrcweir      fi
1678cdf0e10cSrcweir   fi
1679cdf0e10cSrcweir   AC_MSG_RESULT([ok])
1680cdf0e10cSrcweirfi
1681cdf0e10cSrcweirAC_SUBST(WITH_MINGWIN)
1682cdf0e10cSrcweir
1683cdf0e10cSrcweirdnl ===================================================================
1684cdf0e10cSrcweirdnl Extra check for Windows. cygwin builds need gcc to build dmake
1685cdf0e10cSrcweirdnl and g++ to build guw.exe although MS cl (or MinGW) is used to
1686e986c8d8SMatthias Seideldnl build AOO.
1687cdf0e10cSrcweirdnl ===================================================================
1688cdf0e10cSrcweirif test "$_os" = "WINNT" ; then
1689cdf0e10cSrcweir   AC_MSG_CHECKING([for cygwin gcc/g++])
1690cdf0e10cSrcweir   if which gcc > /dev/null && which g++ > /dev/null ; then
1691cdf0e10cSrcweir      AC_MSG_RESULT([found])
1692cdf0e10cSrcweir   else
1693cdf0e10cSrcweir      AC_MSG_ERROR([cygwin gcc and g++ are needed, please install them.])
1694cdf0e10cSrcweir   fi
1695cdf0e10cSrcweirfi
1696cdf0e10cSrcweir
1697cdf0e10cSrcweir
1698cdf0e10cSrcweirdnl ===================================================================
1699cdf0e10cSrcweirdnl Check whether the bash shell can be used.
1700cdf0e10cSrcweirdnl ===================================================================
1701cdf0e10cSrcweirAC_PATH_PROG(SHELLPATH, bash)
1702cdf0e10cSrcweirif test -z "$SHELLPATH"; then
1703cdf0e10cSrcweir   AC_MSG_ERROR([bash not found in \$PATH])
1704cdf0e10cSrcweirelse
1705cdf0e10cSrcweir   SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/bash$//p"`
1706cdf0e10cSrcweirfi
1707cdf0e10cSrcweirAC_SUBST(SHELLPATH)
1708cdf0e10cSrcweir
1709cdf0e10cSrcweirdnl ===================================================================
1710cdf0e10cSrcweirdnl  Checks for c compiler,
1711cdf0e10cSrcweirdnl  The check for the c++ compiler is later on.
1712cdf0e10cSrcweirdnl ===================================================================
1713cdf0e10cSrcweirAC_MSG_CHECKING([gcc home])
1714cdf0e10cSrcweirif test -z "$with_gcc_home"; then
1715cdf0e10cSrcweir	GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
1716da2e13d4SMatthias Seidelelse
1717cdf0e10cSrcweir	GCC_HOME="$with_gcc_home"
1718cdf0e10cSrcweirfi
1719cdf0e10cSrcweirAC_MSG_RESULT($GCC_HOME)
1720cdf0e10cSrcweirAC_SUBST(GCC_HOME)
1721cdf0e10cSrcweir
1722cdf0e10cSrcweirsave_CC=$CC
1723cdf0e10cSrcweirsave_CXX=$CXX
1724cdf0e10cSrcweir
1725cdf0e10cSrcweirif test -n "$with_gcc_home"; then
1726cdf0e10cSrcweir   if test -z "$CC"; then
1727cdf0e10cSrcweir      CC="$with_gcc_home/bin/gcc"
1728cdf0e10cSrcweir   fi
1729cdf0e10cSrcweirfi
1730cdf0e10cSrcweir
1731cdf0e10cSrcweirdnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1732cdf0e10cSrcweirif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
1733cdf0e10cSrcweir   AC_PROG_CC
1734cdf0e10cSrcweirfi
1735cdf0e10cSrcweir
1736cdf0e10cSrcweirCOMPATH=`dirname "$CC"`
1737cdf0e10cSrcweirif test "$COMPATH" = "." ; then
1738cdf0e10cSrcweir    AC_PATH_PROGS(COMPATH, $CC)
1739cdf0e10cSrcweir    dnl double square bracket to get single because of M4 quote...
1740cdf0e10cSrcweir    COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`;
1741cdf0e10cSrcweirfi
17421e1ac450SHerbert DürrCC_PATH="$COMPATH/"
1743cdf0e10cSrcweirCOMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`;
1744cdf0e10cSrcweir
1745cdf0e10cSrcweirdnl ===================================================================
1746e986c8d8SMatthias Seideldnl Test the gcc version, 3 is OK
1747cdf0e10cSrcweirdnl ===================================================================
1748cdf0e10cSrcweirGCCVER=20995
1749cdf0e10cSrcweirif test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then
1750cdf0e10cSrcweir    AC_MSG_CHECKING([the GNU gcc compiler version])
1751cdf0e10cSrcweir   _gcc_version=`$CC -dumpversion`
1752cdf0e10cSrcweir   _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
1753cdf0e10cSrcweir   GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
1754cdf0e10cSrcweir
1755cdf0e10cSrcweir   if test "$_gcc_major" -lt "3"; then
1756cdf0e10cSrcweir      AC_MSG_ERROR([found version "$_gcc_version", use version 3+ of the gcc compiler])
1757cdf0e10cSrcweir   else
1758cdf0e10cSrcweir      if test "$GCCVER" -eq "030203"; then
1759cdf0e10cSrcweir	    if test "$ENABLE_SYMBOLS" = "SMALL"; then
1760cdf0e10cSrcweir           AC_MSG_ERROR([version "$_gcc_version" gives internal error with small.])
1761cdf0e10cSrcweir	    fi
1762cdf0e10cSrcweir      fi
1763cdf0e10cSrcweir   fi
17641e1ac450SHerbert Dürr   if test "$_os" = "Darwin" ; then
1765cdf0e10cSrcweir         AC_MSG_RESULT([implicitly using CC=$CC])
1766cdf0e10cSrcweir   else
1767cdf0e10cSrcweir      AC_MSG_RESULT([checked (gcc $_gcc_version)])
1768cdf0e10cSrcweir   fi
1769cdf0e10cSrcweir   if test "$_os" = "SunOS"; then
1770cdf0e10cSrcweir      AC_MSG_CHECKING([gcc linker])
177128633775SPedro Giffuni      if $CC -Wl,--version 2>&1 |head -n 1| $GREP -v GNU > /dev/null;then
1772cdf0e10cSrcweir          AC_MSG_ERROR([failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris])
1773cdf0e10cSrcweir      fi
1774cdf0e10cSrcweir      AC_MSG_RESULT([ok (GNU ld)])
1775cdf0e10cSrcweir   fi
1776da2e13d4SMatthias Seidelfi
1777cdf0e10cSrcweirAC_SUBST(GCCVER)
1778cdf0e10cSrcweir
1779cdf0e10cSrcweirHAVE_LD_BSYMBOLIC_FUNCTIONS=
1780cdf0e10cSrcweirif test "$GCC" = "yes"; then
1781cdf0e10cSrcweir   AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
1782cdf0e10cSrcweir   bsymbolic_functions_ldflags_save=$LDFLAGS
1783cdf0e10cSrcweir   LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
1784cdf0e10cSrcweir   AC_LINK_IFELSE([AC_LANG_PROGRAM([
1785cdf0e10cSrcweir   #include <stdio.h>
1786cdf0e10cSrcweir   ],[
1787cdf0e10cSrcweir    printf ("hello world\n");
1788cdf0e10cSrcweir   ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
1789cdf0e10cSrcweir   if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then
1790cdf0e10cSrcweir     AC_MSG_RESULT( found )
1791cdf0e10cSrcweir   else
1792cdf0e10cSrcweir     AC_MSG_RESULT( not found )
1793cdf0e10cSrcweir   fi
1794cdf0e10cSrcweir   LDFLAGS=$bsymbolic_functions_ldflags_save
1795cdf0e10cSrcweirfi
1796cdf0e10cSrcweirAC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
1797cdf0e10cSrcweir
1798cdf0e10cSrcweirdnl ===================================================================
1799cdf0e10cSrcweirdnl Set the ENABLE_PCH variable. (Activate --enable-pch)
1800cdf0e10cSrcweirdnl ===================================================================
1801cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable pch feature])
1802cdf0e10cSrcweirif test -n "$enable_pch" && test "$enable_pch" != "no"; then
1803cdf0e10cSrcweir   if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
1804cdf0e10cSrcweir	   ENABLE_PCH="TRUE"
1805cdf0e10cSrcweir	   AC_MSG_RESULT([yes])
1806cdf0e10cSrcweirdnl There is no PCH support in GCC versions prior to this
1807cdf0e10cSrcweir   elif test "$GCC" = "yes" -a "$GCCVER" -gt "030400"; then
1808cdf0e10cSrcweir	   ENABLE_PCH="TRUE"
1809cdf0e10cSrcweir	   AC_MSG_RESULT([yes])
1810cdf0e10cSrcweir   else
1811cdf0e10cSrcweir	   ENABLE_PCH=""
1812cdf0e10cSrcweir	   AC_MSG_WARN([Precompiled header not yet supported for your platform/compiler])
1813cdf0e10cSrcweir   fi
1814cdf0e10cSrcweirelse
1815cdf0e10cSrcweir   ENABLE_PCH=""
1816cdf0e10cSrcweir   AC_MSG_RESULT([no])
1817cdf0e10cSrcweirfi
1818cdf0e10cSrcweirAC_SUBST(ENABLE_PCH)
1819cdf0e10cSrcweir
1820cdf0e10cSrcweirdnl ===================================================================
1821cdf0e10cSrcweirdnl Search all the common names for GNU make
1822cdf0e10cSrcweirdnl ===================================================================
1823cdf0e10cSrcweirAC_MSG_CHECKING([for GNU make])
1824308295dbSJim Jagielskifor a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
1825da2e13d4SMatthias Seidel      $a --version 2> /dev/null | $GREP GNU 2>&1 > /dev/null
1826da2e13d4SMatthias Seidel      if test $? -eq 0; then
1827cdf0e10cSrcweir           GNUMAKE=$a
1828cdf0e10cSrcweir           break
1829cdf0e10cSrcweir      fi
1830cdf0e10cSrcweirdone
1831cdf0e10cSrcweirAC_MSG_RESULT($GNUMAKE)
1832cdf0e10cSrcweirif test -z "$GNUMAKE"; then
1833cdf0e10cSrcweir    AC_MSG_ERROR([not found. install GNU make.])
1834cdf0e10cSrcweirfi
1835cdf0e10cSrcweir
1836cdf0e10cSrcweirAC_MSG_CHECKING([the GNU make version])
183728633775SPedro Giffuni_make_version=`$GNUMAKE --version | $GREP GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
1838cdf0e10cSrcweir_make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
183936a2d835Smseidelif test "$_make_longver" -ge "038100" ; then
1840cdf0e10cSrcweir   AC_MSG_RESULT([$GNUMAKE $_make_version])
1841cdf0e10cSrcweirelse
184236a2d835Smseidel   AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
1843cdf0e10cSrcweirfi
1844cdf0e10cSrcweirAC_SUBST(GNUMAKE)
1845cdf0e10cSrcweir
1846fb6b49d1SJürgen Schmidtdnl ===================================================================
1847fb6b49d1SJürgen Schmidtdnl Search for a pre-installed dmake
1848fb6b49d1SJürgen Schmidtdnl ===================================================================
1849fb6b49d1SJürgen SchmidtAC_MSG_CHECKING([for dmake])
185025c8c0abSAndrea PescettiDMAKE="no"
185125c8c0abSAndrea Pescetti# Override system dmake if --with-dmake-path or --with-dmake-url is used.
185225c8c0abSAndrea Pescettiif test -z "$with_dmake_path" && test -z "$with_dmake_url"; then
185325c8c0abSAndrea Pescetti   AC_PATH_PROG(DMAKE, dmake, no)
185425c8c0abSAndrea Pescetti   IS_SYSTEM_DMAKE=NO
185525c8c0abSAndrea Pescetti   if test "$DMAKE" != "no"; then
185625c8c0abSAndrea Pescetti      AC_MSG_RESULT([using system dmake])
185725c8c0abSAndrea Pescetti      DMAKE_PATH="$DMAKE"
185825c8c0abSAndrea Pescetti      IS_SYSTEM_DMAKE=YES
185925c8c0abSAndrea Pescetti   fi
1860aee29faaSAriel Constenla-Haileelif test -n "$with_dmake_path" ; then
1861fb6b49d1SJürgen Schmidt   # Did not find pre-installed dmake.
1862fb6b49d1SJürgen Schmidt   # Is it at a nonstandard location provided by --with-dmake-path ?
1863aee29faaSAriel Constenla-Haile   AC_MSG_NOTICE([looking for dmake at $DMAKE_PATH])
1864aee29faaSAriel Constenla-Haile   if test -x "$with_dmake_path" ; then
1865aee29faaSAriel Constenla-Haile      AC_MSG_RESULT([using user provided dmake])
1866aee29faaSAriel Constenla-Haile      DMAKE=$with_dmake_path
1867fb6b49d1SJürgen Schmidt   fi
1868fb6b49d1SJürgen Schmidtfi
1869fb6b49d1SJürgen Schmidt
1870fb6b49d1SJürgen SchmidtDMAKE_URL=
1871fb6b49d1SJürgen Schmidtif test "$DMAKE" = "no"; then
1872fb6b49d1SJürgen Schmidt    AC_MSG_NOTICE([no system or user-provided dmake found])
1873fb6b49d1SJürgen Schmidt    # Check if a URL was supplied from which we can download the source and compile it.
1874fb6b49d1SJürgen Schmidt    if test -n "$with_dmake_url" ; then
1875fb6b49d1SJürgen Schmidt       # At this moment we can not verify the URL or the content that we want to download.
1876fb6b49d1SJürgen Schmidt       # Neither can we apply the test below for ruling out that it is the SunStudio dmake.
1877fb6b49d1SJürgen Schmidt       DMAKE_URL=$with_dmake_url
1878fb6b49d1SJürgen Schmidt       AC_MSG_RESULT([dmake will be downloaded and compiled in bootstrap])
1879fb6b49d1SJürgen Schmidt       DMAKE=
1880fb6b49d1SJürgen Schmidt    else
1881063b5acfSAndrea Pescetti       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.])
1882fb6b49d1SJürgen Schmidt       BUILD_DMAKE=YES
1883fb6b49d1SJürgen Schmidt    fi
1884fb6b49d1SJürgen Schmidtelse
1885fb6b49d1SJürgen Schmidt    AC_MSG_CHECKING([whether the found dmake is the right dmake])
1886fb6b49d1SJürgen Schmidt    # we need to find out whether that dmake we found is "our" dmake
1887fb6b49d1SJürgen Schmidt    # or the dmake from Sun's SunStudio Compiler which is something
1888fb6b49d1SJürgen Schmidt    # different
1889fb6b49d1SJürgen Schmidt    # This test _should_ work because the one accepts -V (ours) and one
1890fb6b49d1SJürgen Schmidt    # (the other) not...
189128633775SPedro Giffuni    $DMAKE -V 2>/dev/null | $GREP -E 'dmake(.exe)? .* Version .*' >/dev/null
1892da2e13d4SMatthias Seidel    if test $? -eq 0; then
1893fb6b49d1SJürgen Schmidt       BUILD_DMAKE=NO
1894fb6b49d1SJürgen Schmidt       AC_MSG_RESULT([yes])
1895fb6b49d1SJürgen Schmidt       AC_MSG_CHECKING([the dmake version])
1896fb6b49d1SJürgen Schmidt       DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
1897fb6b49d1SJürgen Schmidt       if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
1898fb6b49d1SJürgen Schmidt          AC_MSG_RESULT([OK, >= 4.11])
1899fb6b49d1SJürgen Schmidt       elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
1900fb6b49d1SJürgen Schmidt	        test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
1901fb6b49d1SJürgen Schmidt          AC_MSG_RESULT([OK, >= 4.11])
1902fb6b49d1SJürgen Schmidt       else
1903fb6b49d1SJürgen Schmidt          AC_MSG_ERROR([too old. >= 4.11 is needed])
1904fb6b49d1SJürgen Schmidt          DMAKE=no
1905fb6b49d1SJürgen Schmidt       fi
1906fb6b49d1SJürgen Schmidt    else
1907fb6b49d1SJürgen Schmidt       AC_MSG_WARN([no])
1908fb6b49d1SJürgen Schmidt       DMAKE=no
1909fb6b49d1SJürgen Schmidt    fi
1910fb6b49d1SJürgen Schmidtfi
1911fb6b49d1SJürgen Schmidtif test "$DMAKE" = "no"; then
1912fb6b49d1SJürgen Schmidt   AC_MSG_ERROR([please use --with-dmake-path or --with-dmake-url to specify dmake executable or source])
1913fb6b49d1SJürgen Schmidtfi
1914fb6b49d1SJürgen SchmidtAC_SUBST(DMAKE_URL)
1915aee29faaSAriel Constenla-HaileAC_SUBST(DMAKE_PATH)
1916aee29faaSAriel Constenla-HaileAC_SUBST(IS_SYSTEM_DMAKE)
1917fb6b49d1SJürgen Schmidt
1918fb6b49d1SJürgen Schmidt
1919cdf0e10cSrcweirdnl ===================================================================
192081996412SPedro Giffunidnl Search all the common names for GNU or BSD tar
1921cdf0e10cSrcweirdnl ===================================================================
192246a19ddeSPedro GiffuniAC_MSG_CHECKING([for GNU or compatible BSD tar])
192381996412SPedro Giffunifor a in $GNUTAR gtar gnutar bsdtar tar; do
1924da2e13d4SMatthias Seidel      $a --version 2> /dev/null | $EGREP "GNU|libarchive" 2>&1 > /dev/null
1925da2e13d4SMatthias Seidel      if test $? -eq 0; then
1926cdf0e10cSrcweir           GNUTAR=$a
1927cdf0e10cSrcweir           break
1928cdf0e10cSrcweir      fi
1929cdf0e10cSrcweirdone
1930cdf0e10cSrcweirAC_MSG_RESULT($GNUTAR)
1931cdf0e10cSrcweirif test -z "$GNUTAR"; then
1932cdf0e10cSrcweir    AC_MSG_ERROR([not found. install GNU tar.])
1933cdf0e10cSrcweirfi
1934cdf0e10cSrcweir
1935cdf0e10cSrcweirAC_SUBST(GNUTAR)
1936cdf0e10cSrcweir
1937cdf0e10cSrcweirdnl ===================================================================
1938cdf0e10cSrcweirdnl  Test the solaris compiler version
1939cdf0e10cSrcweirdnl ===================================================================
1940cdf0e10cSrcweirif test "$_os" = "SunOS"; then
1941cdf0e10cSrcweir   if test "$CC" = "cc"; then
1942cdf0e10cSrcweir      AC_PATH_PROGS(_cc, cc)
1943cdf0e10cSrcweir      COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
1944cdf0e10cSrcweir      AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
1945cdf0e10cSrcweir      dnl cc -V outputs to standard error!!!!
194628633775SPedro Giffuni      _sunstudio_string=`$CC -V 2>&1 | $GREP '^cc' | sed -e 's/.* C //'`
1947cdf0e10cSrcweir      _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
1948da2e13d4SMatthias Seidel      _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
1949cdf0e10cSrcweir      if test "$_sunstudio_major" != "5"; then
1950cdf0e10cSrcweir         AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
1951cdf0e10cSrcweir      else
1952da2e13d4SMatthias Seidel         _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" }'`
1953cdf0e10cSrcweir         if test "$_sunstudio_minor" = "false"; then
1954cdf0e10cSrcweir            AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
1955cdf0e10cSrcweir         else
1956cdf0e10cSrcweir            dnl compiler will do
1957cdf0e10cSrcweir            AC_MSG_RESULT([checked])
1958cdf0e10cSrcweir         fi
1959cdf0e10cSrcweir      fi
1960cdf0e10cSrcweir   fi
1961cdf0e10cSrcweirfi
1962cdf0e10cSrcweir
1963cdf0e10cSrcweirif test "$GCC" = "yes"; then
1964cdf0e10cSrcweir   AC_MSG_CHECKING( for --hash-style=both linker support )
1965cdf0e10cSrcweir   hash_style_ldflags_save=$LDFLAGS
1966cdf0e10cSrcweir   LDFLAGS="$LDFLAGS -Wl,--hash-style=both"
1967cdf0e10cSrcweir   AC_LINK_IFELSE([AC_LANG_PROGRAM([
1968cdf0e10cSrcweir   #include <stdio.h>
1969cdf0e10cSrcweir   ],[
1970cdf0e10cSrcweir    printf ("hello world\n");
1971cdf0e10cSrcweir   ])], HAVE_LD_HASH_STYLE=TRUE, HAVE_LD_HASH_STYLE=FALSE)
1972cdf0e10cSrcweir   if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then
1973cdf0e10cSrcweir     AC_MSG_RESULT( found )
1974cdf0e10cSrcweir   else
1975cdf0e10cSrcweir     AC_MSG_RESULT( not found )
1976cdf0e10cSrcweir   fi
1977cdf0e10cSrcweir   LDFLAGS=$hash_style_ldflags_save
1978cdf0e10cSrcweirfi
1979cdf0e10cSrcweirAC_SUBST(HAVE_LD_HASH_STYLE)
1980cdf0e10cSrcweir
1981cdf0e10cSrcweirdnl ===================================================================
1982cdf0e10cSrcweirdnl  Test the Compaq compiler for OSF1
1983cdf0e10cSrcweirdnl ===================================================================
1984cdf0e10cSrcweirif test "$_os" = "OSF1"; then
1985cdf0e10cSrcweir   if test "$CC" = "cc"; then
1986cdf0e10cSrcweir      AC_PATH_PROGS(_cc, cc)
1987cdf0e10cSrcweir      COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
1988cdf0e10cSrcweir      AC_MSG_WARN([******* $_cc , $COMPATH])
1989cdf0e10cSrcweir      AC_MSG_CHECKING([the Compaq C compiler version])
1990cdf0e10cSrcweir      dnl cc -V outputs to standard error!!!!
1991cdf0e10cSrcweir      _compaqc_version=`$CC -V 2>&1 | $AWK '{ print $3 }'`
1992cdf0e10cSrcweir      _compaqc_major=`echo $_compaqc_version | $AWK -F. '{ print $1 }'`
1993cdf0e10cSrcweir      if test "$_compaqc_major" != "T6"; then
1994cdf0e10cSrcweir         AC_MSG_ERROR([found version "$_compaqc_version", use version 6 of the Compaq C compiler])
1995cdf0e10cSrcweir      else
1996cdf0e10cSrcweir         dnl compiler will do
1997cdf0e10cSrcweir         AC_MSG_RESULT([checked])
1998cdf0e10cSrcweir      fi
1999cdf0e10cSrcweir   fi
2000cdf0e10cSrcweirfi
2001cdf0e10cSrcweir
2002cdf0e10cSrcweirdnl ===================================================================
2003cdf0e10cSrcweirdnl Check whether there's a Perl version available.
2004cdf0e10cSrcweirdnl ===================================================================
2005cdf0e10cSrcweirif test -z "$with_perl_home"; then
2006cdf0e10cSrcweir   AC_PATH_PROG(PERL, perl)
2007cdf0e10cSrcweirelse
2008cdf0e10cSrcweir   if test "$_os" = "WINNT"; then
2009cdf0e10cSrcweir      with_perl_home=`cygpath -u "$with_perl_home"`
2010cdf0e10cSrcweir   fi
2011cdf0e10cSrcweir   _perl_path="$with_perl_home/bin/perl"
2012cdf0e10cSrcweir   if test -x "$_perl_path"; then
2013cdf0e10cSrcweir      PERL=$_perl_path
2014cdf0e10cSrcweir   else
2015cdf0e10cSrcweir      AC_MSG_ERROR([$_perl_path not found])
2016cdf0e10cSrcweir   fi
2017cdf0e10cSrcweirfi
2018cdf0e10cSrcweir
2019cdf0e10cSrcweirdnl ===================================================================
2020cdf0e10cSrcweirdnl Testing for Perl version 5 or greater.
2021cdf0e10cSrcweirdnl $] is the perl version variable, it is returned as an integer
2022cdf0e10cSrcweirdnl ===================================================================
2023cdf0e10cSrcweirif test "$PERL"; then
2024cdf0e10cSrcweir   AC_MSG_CHECKING([the Perl version])
2025cdf0e10cSrcweir   ${PERL} -e "exit($]);"
2026cdf0e10cSrcweir   _perl_version=$?
2027cdf0e10cSrcweir   if test "$_perl_version" -lt 5; then
2028cdf0e10cSrcweir      AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
2029da2e13d4SMatthias Seidel   fi
2030cdf0e10cSrcweir   AC_MSG_RESULT([checked (perl $_perl_version)])
2031cdf0e10cSrcweirelse
2032cdf0e10cSrcweir   AC_MSG_ERROR([Perl not found, install version 5 of Perl])
2033cdf0e10cSrcweirfi
2034cdf0e10cSrcweirAC_SUBST(PERL)
2035cdf0e10cSrcweir
2036cdf0e10cSrcweirdnl ===================================================================
2037cdf0e10cSrcweirdnl Testing for required Perl modules
2038e6e5b0b8SAndre Fischerdnl The list of required Perl modules is documented here:
2039da2e13d4SMatthias Seideldnl     https://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO#General_Build_Requirements
2040cdf0e10cSrcweirdnl ===================================================================
2041cdf0e10cSrcweirAC_MSG_CHECKING([for required Perl modules])
20429b3da915SDamjan Jovanovicif `$PERL -e 'use Archive::Zip;
20439b3da915SDamjan Jovanovic              use LWP::UserAgent;
20449b3da915SDamjan Jovanovic              use XML::Parser;
20459b3da915SDamjan Jovanovic              use Digest::SHA;
20469b3da915SDamjan Jovanovic              use Digest::MD5;
20479b3da915SDamjan Jovanovic              use LWP::Protocol::https;'>/dev/null 2>&1`; then
2048cdf0e10cSrcweir	AC_MSG_RESULT([all modules found])
2049cdf0e10cSrcweirelse
2050e6e5b0b8SAndre Fischer    # Find out which modules are missing.
2051e6e5b0b8SAndre Fischer    missing_perl_modules=
2052e6e5b0b8SAndre Fischer    if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
2053e6e5b0b8SAndre Fischer       missing_perl_modules=Archive::Zip
2054e6e5b0b8SAndre Fischer    fi
2055e6e5b0b8SAndre Fischer    if ! `$PERL -e 'use LWP::UserAgent;'>/dev/null 2>&1`; then
2056e6e5b0b8SAndre Fischer       missing_perl_modules="$missing_perl_modules LWP::UserAgent"
2057e6e5b0b8SAndre Fischer    fi
2058e6e5b0b8SAndre Fischer    if ! `$PERL -e 'use XML::Parser;'>/dev/null 2>&1`; then
2059e6e5b0b8SAndre Fischer       missing_perl_modules="$missing_perl_modules XML::Parser"
2060fec5e19eSarielch    fi
2061fec5e19eSarielch    if ! `$PERL -e 'use Digest::SHA;'>/dev/null 2>&1`; then
2062fec5e19eSarielch       missing_perl_modules="$missing_perl_modules Digest::SHA"
2063fec5e19eSarielch    fi
2064fec5e19eSarielch    if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
2065fec5e19eSarielch       missing_perl_modules="$missing_perl_modules Digest::MD5"
2066fec5e19eSarielch    fi
2067fec5e19eSarielch    if ! `$PERL -e 'use LWP::Protocol::https;'>/dev/null 2>&1`; then
2068fec5e19eSarielch       missing_perl_modules="$missing_perl_modules LWP::Protocol::https"
2069e6e5b0b8SAndre Fischer    fi
2070e6e5b0b8SAndre Fischer	AC_MSG_ERROR([
2071e6e5b0b8SAndre Fischer    The missing Perl modules are: $missing_perl_modules
2072e6e5b0b8SAndre Fischer    Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
2073cdf0e10cSrcweirfi
2074cdf0e10cSrcweir
2075cdf0e10cSrcweirdnl ===================================================================
2076cdf0e10cSrcweirdnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
2077cdf0e10cSrcweirdnl ===================================================================
2078cdf0e10cSrcweirif test "$_os" = "WINNT"; then
2079cdf0e10cSrcweir	if test "$WITH_MINGWIN" != "yes"; then
2080cdf0e10cSrcweir		AC_MSG_CHECKING([for friendly registry keys])
2081cdf0e10cSrcweir		# VS.Net 2003, VS.Net 2005
2082cdf0e10cSrcweir		if test -z "$with_cl_home"; then
2083edd74ba5SDamjan Jovanovic			vctest=`$OOWINTOOL --msvc-productdir`;
2084cdf0e10cSrcweir			if test -x "$vctest/bin/cl.exe"; then
2085cdf0e10cSrcweir				with_cl_home=$vctest;
2086cdf0e10cSrcweir			fi
2087cdf0e10cSrcweir		else
2088cdf0e10cSrcweir			with_cl_home=`cygpath -u "$with_cl_home"`
2089cdf0e10cSrcweir		fi
2090cdf0e10cSrcweir		AC_MSG_RESULT([done])
2091cdf0e10cSrcweir
2092cdf0e10cSrcweir		dnl ===========================================================
2093cdf0e10cSrcweir		dnl  Check for mspdb71.dll/mspdb80.dll
2094cdf0e10cSrcweir		dnl ===========================================================
2095cdf0e10cSrcweir		dnl  .NET 2003/5/8 Compiler
2096cdf0e10cSrcweir		if test -n "$with_mspdb_path";then
2097cdf0e10cSrcweir			with_mspdb_path=`cygpath -u "$with_mspdb_path"`
2098cdf0e10cSrcweir		fi
2099cdf0e10cSrcweir		if test -e "$with_mspdb_path/mspdb71.dll" -o -e "$with_mspdb_path/mspdb80.dll"; then
2100cdf0e10cSrcweir			MSPDB_PATH="$with_mspdb_path"
2101cdf0e10cSrcweir		fi
2102cdf0e10cSrcweir		dnl .NET 2003 case
2103cdf0e10cSrcweir		if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb71.dll"; then
2104cdf0e10cSrcweir			MSPDB_PATH="$with_cl_home/../Common7/IDE"
2105cdf0e10cSrcweir		fi
2106cdf0e10cSrcweir		dnl .NET 2005/2008 case
2107cdf0e10cSrcweir		if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
2108cdf0e10cSrcweir			MSPDB_PATH="$with_cl_home/../Common7/IDE"
2109cdf0e10cSrcweir		fi
2110cdf0e10cSrcweir		dnl Windows SDK 6.0 case
2111cdf0e10cSrcweir		if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
2112cdf0e10cSrcweir			MSPDB_PATH="$with_cl_home/bin"
2113cdf0e10cSrcweir		fi
2114cdf0e10cSrcweir
2115cdf0e10cSrcweir		if test -z "$MSPDB_PATH";then
2116cdf0e10cSrcweir			dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
2117cdf0e10cSrcweir			AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
2118cdf0e10cSrcweir			AC_PATH_PROG(MSPDB_PATH, mspdb71.dll)
2119cdf0e10cSrcweir			MSPDB_PATH=`dirname "$MSPDB_PATH"`
2120cdf0e10cSrcweir		fi
2121cdf0e10cSrcweir
2122cdf0e10cSrcweir		if test -z "$MSPDB_PATH"; then
2123cdf0e10cSrcweir			AC_MSG_ERROR([You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path])
2124cdf0e10cSrcweir		fi
2125cdf0e10cSrcweir		MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
2126cdf0e10cSrcweir		MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
2127cdf0e10cSrcweir		dnl The path needs to be added before cl is called
2128cdf0e10cSrcweir		PATH="$MSPDB_PATH:$PATH"
2129cdf0e10cSrcweir
2130cdf0e10cSrcweir		AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
2131edd74ba5SDamjan Jovanovic		case "$build_cpu" in
2132edd74ba5SDamjan Jovanovic		  i?86)
2133edd74ba5SDamjan Jovanovic		    cl_subdirectory="bin"
2134edd74ba5SDamjan Jovanovic		    ;;
2135edd74ba5SDamjan Jovanovic		  x86_64)
2136edd74ba5SDamjan Jovanovic		    if test "$BUILD_WIN64" = "TRUE" ; then
2137edd74ba5SDamjan Jovanovic		      cl_subdirectory="bin/amd64"
2138edd74ba5SDamjan Jovanovic		    else
2139edd74ba5SDamjan Jovanovic		      cl_subdirectory="bin"
2140edd74ba5SDamjan Jovanovic		    fi
2141edd74ba5SDamjan Jovanovic		    ;;
2142edd74ba5SDamjan Jovanovic		  *)
2143edd74ba5SDamjan Jovanovic		    AC_MSG_ERROR([Unknown/unsupported Windows CPU $build_cpu.])
2144edd74ba5SDamjan Jovanovic		    ;;
2145edd74ba5SDamjan Jovanovic		esac
2146edd74ba5SDamjan Jovanovic   		if test -x "$with_cl_home/$cl_subdirectory/cl.exe"; then
2147edd74ba5SDamjan Jovanovic   			CC="$with_cl_home/$cl_subdirectory/cl.exe"
2148edd74ba5SDamjan Jovanovic			COMPATH="$with_cl_home"
2149cdf0e10cSrcweir			# This gives us a posix path with 8.3 filename restrictions
2150cdf0e10cSrcweir			CC=`cygpath -d "$CC"`
2151cdf0e10cSrcweir			CC=`cygpath -u "$CC"`
2152edd74ba5SDamjan Jovanovic			COMPATH=`cygpath -d "$COMPATH"`
2153edd74ba5SDamjan Jovanovic			COMPATH=`cygpath -u "$COMPATH"`
2154cdf0e10cSrcweir			# Remove /cl.exe from CC case insensitive
2155cdf0e10cSrcweir			AC_MSG_RESULT([found ($CC)])
2156cdf0e10cSrcweir			export INCLUDE=`cygpath -d "$COMPATH/Include"`
2157cdf0e10cSrcweir			dnl  Check which Microsoft C/C++ compiler is found
2158cdf0e10cSrcweir			AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
2159da2e13d4SMatthias Seideldnl      The following find microsoft, matches nn.nn.nnnn then pulls numbers out.
21602c2ad1e6SHerbert Dürr			CCTXTVER=`$CC 2>&1 | head -n1`
21612c2ad1e6SHerbert Dürr			CCNUMVER=`echo $CCTXTVER | $AWK "/Microsoft/ && /..\\...\\...../ {
2162cdf0e10cSrcweir							x = match( \\\$0, /..\\...\\...../ )
2163cdf0e10cSrcweir							CCversion = substr( \\\$0, RSTART, RLENGTH)
2164cdf0e10cSrcweir							tokencount = split (CCversion,vertoken,\".\")
2165cdf0e10cSrcweir							for ( i = 1 ; i <= tokencount ; i++ ) {
2166cdf0e10cSrcweir								printf (\"%04d\",vertoken[[i]] )
2167cdf0e10cSrcweir							}
2168cdf0e10cSrcweir							}"`
21692c2ad1e6SHerbert Dürr			AC_MSG_RESULT([found Compiler version $CCNUMVER in \"$CCTXTVER\"])
2170cdf0e10cSrcweir			if test "$CCNUMVER" -ge "001500000000"; then
2171cdf0e10cSrcweir				COMEX=12
2172cdf0e10cSrcweir				MSVSVER=2008
2173cdf0e10cSrcweir				AC_MSG_RESULT([found .NET 2008 / VS 9.0.])
2174cdf0e10cSrcweir			else
21752c2ad1e6SHerbert Dürr				AC_MSG_ERROR([Compiler too old. Use Microsoft C/C++ .NET 2008.])
2176cdf0e10cSrcweir			fi
2177cdf0e10cSrcweir		else
2178edd74ba5SDamjan Jovanovic			AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home.])
2179cdf0e10cSrcweir		fi
2180cdf0e10cSrcweir	else
2181cdf0e10cSrcweir		AC_MSG_CHECKING([the Mingwin32 C++ Compiler])
2182cdf0e10cSrcweir		if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then
2183cdf0e10cSrcweir			AC_MSG_RESULT([found.])
218428633775SPedro Giffuni			if $CC -dumpspecs | $GREP -q "mno-cygwin"; then
2185cdf0e10cSrcweir				USE_MINGW="cygwin"
2186cdf0e10cSrcweir			else
2187cdf0e10cSrcweir				USE_MINGW="pure-mingw"
2188cdf0e10cSrcweir			fi
2189cdf0e10cSrcweir		else
2190cdf0e10cSrcweir			AC_MSG_ERROR([Mingwin32 C++ Compiler not found.])
2191cdf0e10cSrcweir		fi
2192cdf0e10cSrcweir	fi
2193cdf0e10cSrcweirfi
2194cdf0e10cSrcweirAC_SUBST(COMEX)
2195cdf0e10cSrcweirAC_SUBST(MSPDB_PATH)
2196cdf0e10cSrcweirAC_SUBST(USE_MINGW)
2197cdf0e10cSrcweir
2198386ca866SDon Lewisdnl Compiler detection, logic from setsoenv.in
2199386ca866SDon Lewiscase "$build_os" in
2200386ca866SDon Lewis	*cygwin*)
2201386ca866SDon Lewis		if test "$WITH_MINGWIN" = "yes"; then
2202386ca866SDon Lewis			COM="GCC";
2203386ca866SDon Lewis		else
2204386ca866SDon Lewis			COM="MSC";
2205386ca866SDon Lewis		fi;;
2206386ca866SDon Lewis	os2*)
2207386ca866SDon Lewis		COM="GCC";;
2208386ca866SDon Lewis	netbsd | kfreebsd* | freebsd* | linux* | darwin* )
2209386ca866SDon Lewis		if $CC --version 2>&1 | $GREP clang > /dev/null ; then
2210386ca866SDon Lewis			COM="CLANG";
2211386ca866SDon Lewis		else
2212386ca866SDon Lewis			COM="GCC";
2213386ca866SDon Lewis		fi;;
2214386ca866SDon Lewis	solaris*)
2215386ca866SDon Lewis		case "$CC" in
2216386ca866SDon Lewis			*gcc*)	COM="GCC";;
2217386ca866SDon Lewis			*)	COM="C52";;
2218386ca866SDon Lewis		esac;;
2219386ca866SDon Lewis	osf | aix*)
2220386ca866SDon Lewis		COM="CXX";;
2221386ca866SDon Lewis	*) AC_MSG_ERROR([Unable to decipher compiler for $build_os]);;
2222386ca866SDon Lewisesac
2223386ca866SDon LewisAC_SUBST(COM)
2224386ca866SDon Lewis
2225da2e13d4SMatthias Seideldnl  Decode the compiler version. Logic from main/solenv/inc/tg_compv.mk.
2226386ca866SDon Lewiscase $COM in
2227386ca866SDon Lewis	GCC)
2228a0ec95a2SMatthias Seidel		CCVER=`${CC} -dumpfullversion -dumpversion 2>&1`;
2229386ca866SDon Lewis		CCNUMVER=`echo ${CCVER} | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2230386ca866SDon Lewis		if test "${CCNUMVER}" -ge 000300000001; then
2231386ca866SDon Lewis			COMID="gcc3";
2232386ca866SDon Lewis			COMNAME="gcc3";
2233386ca866SDon Lewis		elif test "${CCNUMVER}" -ge 000300000001; then
2234386ca866SDon Lewis			COMID="GCC";
2235386ca866SDon Lewis			COMNAME="gcc2";
2236386ca866SDon Lewis		else
2237386ca866SDon Lewis			AC_MSG_ERROR([gcc too old]);
2238386ca866SDon Lewis		fi
2239386ca866SDon Lewis		;;
2240386ca866SDon Lewis	CLANG)
2241386ca866SDon Lewis		CCVER=`${CC} --version 2>&1 | head -n1 | sed -e"s/.*version //" -e"s/ .*//"`;
2242386ca866SDon Lewis		CCNUMVER=`echo ${CCVER} | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2243386ca866SDon Lewis		# The version in tg_compv.mk for darwin does not look correct
2244386ca866SDon Lewis		# CCNUMVER = `echo ${CCVER} | sed -e"s/\.//";
2245809f4227SJim Jagielski		case "$build_os" in
2246809f4227SJim Jagielski 			darwin*) # Mac OS X
2247809f4227SJim Jagielski 				COMID="s5abi";
2248809f4227SJim Jagielski 				COMNAME="s5abi";
2249809f4227SJim Jagielski 				;;
2250809f4227SJim Jagielski 			*)
2251809f4227SJim Jagielski 				COMID="gcc3";
2252809f4227SJim Jagielski 				COMNAME="gcc3";
2253809f4227SJim Jagielski 				;;
2254809f4227SJim Jagielski 		esac
2255271f99acSDamjan Jovanovic		;;
2256386ca866SDon Lewis	MSC)
2257386ca866SDon Lewis		CCVER=`${CC} 2>&1 | $AWK -f ${_solenv}/bin/getcompver.awk`;
2258386ca866SDon Lewis		CCNUMVER=`${CC} 2>&1 | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2259386ca866SDon Lewis		if test "${CCNUMVER}" -ge 001200000000; then
2260386ca866SDon Lewis			COMID="MSC";
2261edd74ba5SDamjan Jovanovic			case "$build_cpu" in
2262edd74ba5SDamjan Jovanovic			  i?86)
2263edd74ba5SDamjan Jovanovic			    COMNAME="msci";
2264edd74ba5SDamjan Jovanovic			    ;;
2265edd74ba5SDamjan Jovanovic			  x86_64)
2266edd74ba5SDamjan Jovanovic			    if test "$BUILD_WIN64" = "TRUE" ; then
2267edd74ba5SDamjan Jovanovic			      COMNAME="mscx";
2268edd74ba5SDamjan Jovanovic			    else
2269edd74ba5SDamjan Jovanovic			      COMNAME="msci";
2270edd74ba5SDamjan Jovanovic			    fi
2271edd74ba5SDamjan Jovanovic			    ;;
2272edd74ba5SDamjan Jovanovic			  *)
2273edd74ba5SDamjan Jovanovic			    AC_MSG_ERROR([Unknown/unsupported Windows CPU $build_cpu.])
2274edd74ba5SDamjan Jovanovic			    ;;
2275edd74ba5SDamjan Jovanovic			esac
2276386ca866SDon Lewis		else
2277386ca866SDon Lewis			AC_MSG_ERROR([MSC compiler too old]);
2278386ca866SDon Lewis		fi
2279386ca866SDon Lewis		;;
2280386ca866SDon Lewis	C55 | C54 | C52 | C40 | sunpro)
2281386ca866SDon Lewis		CCVER=`${CC} -V 2>&1 | $AWK -f ${_solenv}/bin/getcompver.awk`;
2282386ca866SDon Lewis		CCNUMVER=`${CC} -V 2>&1 | $AWK -v num=true -f ${_solenv}/bin/getcompver.awk`;
2283386ca866SDon Lewis		if test "${CCNUMVER}" -ge 00050002; then
2284386ca866SDon Lewis			COMID="C52";
2285386ca866SDon Lewis			COMNAME="sunpro5";
2286386ca866SDon Lewis		else
2287386ca866SDon Lewis			AC_MSG_ERROR([Sun compiler too old]);
2288386ca866SDon Lewis		fi
2289386ca866SDon Lewis		;;
2290386ca866SDon Lewis	*)
2291386ca866SDon Lewis		AC_MSG_ERROR([Unable to detect compiler version]);;
2292386ca866SDon Lewisesac
2293386ca866SDon LewisAC_SUBST(CCVER)
2294386ca866SDon LewisAC_SUBST(CCNUMVER)
2295386ca866SDon LewisAC_SUBST(COMID)
2296386ca866SDon LewisAC_SUBST(COMNAME)
2297386ca866SDon Lewis
2298386ca866SDon Lewisif test "$_os" = "FreeBSD"; then
2299386ca866SDon Lewis    FBSD_GCC_RPATH=
2300eda2f9d6SDon Lewis    if test "$COM" = "GCC"; then
2301386ca866SDon Lewis        rpath=`$CC --print-file-name libstdc++.so`
2302386ca866SDon Lewis        rpath=`realpath $rpath`
2303386ca866SDon Lewis        rpath=`dirname $rpath`
2304386ca866SDon Lewis	if test "$rpath" != "/usr/lib" ; then
2305386ca866SDon Lewis            FBSD_GCC_RPATH="-Wl,-rpath=$rpath"
2306386ca866SDon Lewis	fi
2307386ca866SDon Lewis    fi
2308386ca866SDon Lewis    AC_SUBST(FBSD_GCC_RPATH)
2309386ca866SDon Lewisfi
2310386ca866SDon Lewis
2311cdf0e10cSrcweirdnl ===================================================================
2312cdf0e10cSrcweirdnl  .NET needs special treatment
2313cdf0e10cSrcweirdnl ===================================================================
2314cdf0e10cSrcweirif test "$_os" = "WINNT"; then
2315cdf0e10cSrcweirif test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then
2316cdf0e10cSrcweir	dnl Check midl.exe
2317cdf0e10cSrcweir	AC_PATH_PROG(MIDL_PATH, midl.exe)
2318cdf0e10cSrcweir	if test -n "$MIDL_PATH";then
2319cdf0e10cSrcweir		MIDL_PATH=`dirname "$MIDL_PATH"`
2320cdf0e10cSrcweir	fi
2321cdf0e10cSrcweir	if test -n "$with_midl_path";then
2322cdf0e10cSrcweir		with_midl_path=`cygpath -u "$with_midl_path"`
2323cdf0e10cSrcweir	fi
2324cdf0e10cSrcweir	if test -x "$with_midl_path/midl.exe"; then
2325cdf0e10cSrcweir		MIDL_PATH="$with_midl_path"
2326cdf0e10cSrcweir	fi
2327cdf0e10cSrcweir	if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
2328cdf0e10cSrcweir		MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
2329cdf0e10cSrcweir	fi
2330cdf0e10cSrcweir	if test -z "$MIDL_PATH" ; then
2331edd74ba5SDamjan Jovanovic      vstest=`$OOWINTOOL --msvs-productdir`;
2332cdf0e10cSrcweir      if test -x "$vstest/Common7/Tools/Bin/midl.exe" ; then
2333cdf0e10cSrcweir		  MIDL_PATH="$vstest/Common7/Tools/Bin"
2334cdf0e10cSrcweir      fi
2335cdf0e10cSrcweir	fi
2336cdf0e10cSrcweir	if test -z "$MIDL_PATH" ; then
2337edd74ba5SDamjan Jovanovic		psdktest=`$OOWINTOOL --psdk-home`
2338cdf0e10cSrcweir		if test -x "$psdktest/Bin/midl.exe" ; then
2339cdf0e10cSrcweir			MIDL_PATH="$psdktest/Bin"
2340cdf0e10cSrcweir		fi
2341cdf0e10cSrcweir	fi
2342cdf0e10cSrcweir	if test ! -x "$MIDL_PATH/midl.exe"; then
2343cdf0e10cSrcweir		AC_MSG_ERROR([midl.exe not found. Make sure it's in the path or use --with-midl-path])
2344cdf0e10cSrcweir	fi
2345cdf0e10cSrcweir	# Convert to posix path with 8.3 filename restrictions ( No spaces )
2346cdf0e10cSrcweir	MIDL_PATH=`cygpath -d "$MIDL_PATH"`
2347cdf0e10cSrcweir	MIDL_PATH=`cygpath -u "$MIDL_PATH"`
2348cdf0e10cSrcweir
2349cdf0e10cSrcweir	dnl Check csc.exe
2350cdf0e10cSrcweir	AC_PATH_PROG(CSC_PATH, csc.exe)
2351cdf0e10cSrcweir	if test -n "$CSC_PATH";then
2352cdf0e10cSrcweir		CSC_PATH=`dirname "$CSC_PATH"`
2353cdf0e10cSrcweir	fi
2354cdf0e10cSrcweir	if test -n "$with_csc_path";then
2355cdf0e10cSrcweir		with_csc_path=`cygpath -u "$with_csc_path"`
2356cdf0e10cSrcweir	fi
2357cdf0e10cSrcweir	if test -x "$with_csc_path/csc.exe"; then
2358cdf0e10cSrcweir		CSC_PATH="$with_csc_path"
2359cdf0e10cSrcweir	else
2360edd74ba5SDamjan Jovanovic	   csctest=`$OOWINTOOL --csc-compilerdir`;
2361cdf0e10cSrcweir	   if test -x "$csctest/csc.exe"; then
2362cdf0e10cSrcweir	      CSC_PATH="$csctest"
2363cdf0e10cSrcweir	   fi
2364cdf0e10cSrcweir	fi
2365cdf0e10cSrcweir	if test ! -x "$CSC_PATH/csc.exe"; then
2366cdf0e10cSrcweir		AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
2367cdf0e10cSrcweir	fi
2368cdf0e10cSrcweir	# Convert to posix path with 8.3 filename restrictions ( No spaces )
2369cdf0e10cSrcweir	CSC_PATH=`cygpath -d "$CSC_PATH"`
2370cdf0e10cSrcweir	CSC_PATH=`cygpath -u "$CSC_PATH"`
2371cdf0e10cSrcweir
2372cdf0e10cSrcweir    dnl Check mscoree.lib / .NET Frameworks dir
2373cdf0e10cSrcweir    dnl For VS2003/2005 $with_frame_home has to point to the directory with lib/mscoree.lib.
2374cdf0e10cSrcweir       AC_MSG_CHECKING(.NET Framework)
2375cdf0e10cSrcweir	    if test -n "$with_frame_home"; then
2376cdf0e10cSrcweir		with_frame_home=`cygpath -u "$with_frame_home"`
2377cdf0e10cSrcweir	    fi
2378cdf0e10cSrcweir	    if test -f "$with_frame_home/lib/mscoree.lib"; then
2379cdf0e10cSrcweir		    FRAME_HOME="$with_frame_home"
2380cdf0e10cSrcweir	    fi
2381cdf0e10cSrcweir	    if test -z "$FRAME_HOME" -a -e "$with_cl_home/../SDK/v1.1/lib/mscoree.lib"; then
2382cdf0e10cSrcweir		    FRAME_HOME="$with_cl_home/../SDK/v1.1"
2383cdf0e10cSrcweir	    fi
2384cdf0e10cSrcweir	    if test -z "$FRAME_HOME" ; then
2385edd74ba5SDamjan Jovanovic          frametest=`$OOWINTOOL --dotnetsdk-dir`
2386cdf0e10cSrcweir          if test -f "$frametest/lib/mscoree.lib"; then
2387cdf0e10cSrcweir             FRAME_HOME="$frametest"
2388cdf0e10cSrcweir          else
2389edd74ba5SDamjan Jovanovic             frametest=`$OOWINTOOL --psdk-home`
2390cdf0e10cSrcweir             if test -f "$frametest/lib/mscoree.lib"; then
2391cdf0e10cSrcweir                FRAME_HOME="$frametest"
2392cdf0e10cSrcweir             fi
2393cdf0e10cSrcweir          fi
2394cdf0e10cSrcweir	    fi
2395cdf0e10cSrcweir	    if test ! -f "$FRAME_HOME/lib/mscoree.lib"; then
2396cdf0e10cSrcweir		AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home])
2397cdf0e10cSrcweir	    fi
2398cdf0e10cSrcweir	    AC_MSG_RESULT(found)
2399cdf0e10cSrcweir	# Convert to posix path with 8.3 filename restrictions ( No spaces )
2400cdf0e10cSrcweir	FRAME_HOME=`cygpath -d "$FRAME_HOME"`
2401cdf0e10cSrcweir	FRAME_HOME=`cygpath -u "$FRAME_HOME"`
2402cdf0e10cSrcweirfi
2403cdf0e10cSrcweirAC_SUBST(MIDL_PATH)
2404cdf0e10cSrcweirAC_SUBST(CSC_PATH)
2405cdf0e10cSrcweirAC_SUBST(FRAME_HOME)
2406cdf0e10cSrcweirfi
2407cdf0e10cSrcweir
2408cdf0e10cSrcweirdnl ===================================================================
2409407bc2eeSMatthias Seideldnl Check if stdc headers are available excluding Windows.
2410cdf0e10cSrcweirdnl ===================================================================
2411cdf0e10cSrcweirif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
2412cdf0e10cSrcweir   AC_HEADER_STDC
2413cdf0e10cSrcweirfi
2414cdf0e10cSrcweir
2415cdf0e10cSrcweirdnl ===================================================================
2416cdf0e10cSrcweirdnl Find pre-processors.
2417cdf0e10cSrcweirdnl ===================================================================
2418cdf0e10cSrcweirif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
2419cdf0e10cSrcweir   AC_PROG_CXXCPP
2420cdf0e10cSrcweir
2421cdf0e10cSrcweirdnl Check whether there's a C pre-processor.
2422cdf0e10cSrcweirdnl ===================================================================
2423cdf0e10cSrcweirdnl When using SunStudio compiler, there is a bug with the cc
2424cdf0e10cSrcweirdnl preprocessor, so use CC preprocessor as the cc preprocessor
2425cdf0e10cSrcweirdnl See Issuezilla #445.
2426cdf0e10cSrcweirdnl ===================================================================
2427cdf0e10cSrcweir   if test "$_os" = "SunOS"; then
2428cdf0e10cSrcweir      CPP=$CXXCPP
2429cdf0e10cSrcweir   else
2430cdf0e10cSrcweir      AC_PROG_CPP
2431cdf0e10cSrcweir   fi
2432cdf0e10cSrcweirfi
2433cdf0e10cSrcweir
2434cdf0e10cSrcweirAC_CHECK_SIZEOF(long)
2435cdf0e10cSrcweirSIZEOF_LONG=$ac_cv_sizeof_long
2436cdf0e10cSrcweirAC_SUBST(SIZEOF_LONG)
2437cdf0e10cSrcweirAC_C_BIGENDIAN
2438cdf0e10cSrcweirWORDS_BIGENDIAN=$ac_cv_c_bigendian
2439cdf0e10cSrcweirAC_SUBST(WORDS_BIGENDIAN)
2440cdf0e10cSrcweir
2441cdf0e10cSrcweirdnl Check for large file support
2442cdf0e10cSrcweirAC_SYS_LARGEFILE
2443cdf0e10cSrcweirif test -n "$ac_cv_sys_file_offset_bits"; then
2444cdf0e10cSrcweir   LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
2445cdf0e10cSrcweirfi
2446cdf0e10cSrcweirif test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; then
2447cdf0e10cSrcweir   LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
2448cdf0e10cSrcweirfi
2449cdf0e10cSrcweirAC_SUBST(LFS_CFLAGS)
2450cdf0e10cSrcweir
2451cdf0e10cSrcweirdnl ===================================================================
2452e986c8d8SMatthias Seideldnl Check if valgrind.h is available
2453cdf0e10cSrcweirdnl ===================================================================
2454cdf0e10cSrcweirif test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
2455cdf0e10cSrcweir   dnl Test $prefix (currently only testing for /usr and /usr/local)
2456cdf0e10cSrcweir   dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
2457cdf0e10cSrcweir   VALGRIND_CFLAGS=""
2458cdf0e10cSrcweir   prev_cppflags=$CPPFLAGS
2459cdf0e10cSrcweir   if test -z "$VALGRIND_CFLAGS"; then
2460cdf0e10cSrcweir      CPPFLAGS="-I/usr/include/valgrind"
2461cdf0e10cSrcweir      AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
2462cdf0e10cSrcweir   fi
2463cdf0e10cSrcweir   if test -z "$VALGRIND_CFLAGS"; then
2464cdf0e10cSrcweir      CPPFLAGS="-I/usr/local/include/valgrind"
2465cdf0e10cSrcweir      AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
2466cdf0e10cSrcweir   fi
2467cdf0e10cSrcweir   if test -n "$VALGRIND_CFLAGS"; then
2468cdf0e10cSrcweir      CPPFLAGS=$VALGRIND_CFLAGS
2469cdf0e10cSrcweir      AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
2470cdf0e10cSrcweir   fi
2471cdf0e10cSrcweir   CPPFLAGS=$prev_cppflags
2472cdf0e10cSrcweirfi
2473cdf0e10cSrcweirAC_SUBST([VALGRIND_CFLAGS])
2474cdf0e10cSrcweir
2475cdf0e10cSrcweirdnl ===================================================================
2476e986c8d8SMatthias Seideldnl Check if cups/cups.h is available
2477cdf0e10cSrcweirdnl ===================================================================
2478cdf0e10cSrcweirif test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then
2479cdf0e10cSrcweir    AC_CHECK_HEADER(cups/cups.h, [],
2480cdf0e10cSrcweir                    [AC_MSG_ERROR([cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?])], [])
2481cdf0e10cSrcweirfi
2482cdf0e10cSrcweir
2483cdf0e10cSrcweirdnl ===================================================================
2484cdf0e10cSrcweirdnl Check if PAM/pam_appl.h is available on Linux or FreeBSD
2485cdf0e10cSrcweirdnl ===================================================================
2486cdf0e10cSrcweirif test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then
2487cdf0e10cSrcweir  AC_MSG_CHECKING([whether to enable pam support])
2488cdf0e10cSrcweir  if test -z "$enable_pam" || test "$enable_pam" != "no"; then
2489cdf0e10cSrcweir    AC_MSG_RESULT([yes])
2490cdf0e10cSrcweir    PAM=YES
2491cdf0e10cSrcweir    AC_CHECK_HEADER(security/pam_appl.h, [],
2492cdf0e10cSrcweir                    [AC_MSG_ERROR([pam_appl.h could not be found. libpam-dev or pam-devel missing?])], [])
2493cdf0e10cSrcweir    AC_MSG_CHECKING([whether to link to libpam])
2494cdf0e10cSrcweir    if test -n "$enable_pam_link" -a "$enable_pam_link" != "no"; then
2495cdf0e10cSrcweir      AC_MSG_RESULT([yes])
2496cdf0e10cSrcweir      PAM_LINK=YES
2497cdf0e10cSrcweir      AC_CHECK_LIB(pam, pam_start, [],
2498cdf0e10cSrcweir          [AC_MSG_ERROR(libpam not found or functional)], [])
2499cdf0e10cSrcweir    else
2500cdf0e10cSrcweir      AC_MSG_RESULT([no, dynamically open it])
2501cdf0e10cSrcweir      PAM_LINK=NO
2502cdf0e10cSrcweir    fi
2503cdf0e10cSrcweir  else
2504cdf0e10cSrcweir    AC_MSG_RESULT([no])
2505cdf0e10cSrcweir    PAM=NO
2506cdf0e10cSrcweir    PAM_LINK=NO
2507cdf0e10cSrcweir    dnl check getspnam_r for needed args (4 or 5)
2508cdf0e10cSrcweir    AX_FUNC_WHICH_GETSPNAM_R
2509cdf0e10cSrcweir  fi
2510cdf0e10cSrcweirfi
2511cdf0e10cSrcweirAC_SUBST(PAM)
2512cdf0e10cSrcweirAC_SUBST(NEW_SHADOW_API)
2513cdf0e10cSrcweirAC_SUBST(PAM_LINK)
2514cdf0e10cSrcweir
2515cdf0e10cSrcweirif test "$_os" = "Linux"; then
2516cdf0e10cSrcweir    AC_MSG_CHECKING([whether to link to libcrypt])
2517cdf0e10cSrcweir    if test -n "$enable_crypt_link" -a "$enable_crypt_link" != "no"; then
2518cdf0e10cSrcweir        AC_MSG_RESULT([yes])
2519cdf0e10cSrcweir        CRYPT_LINK=YES
2520cdf0e10cSrcweir        AC_CHECK_LIB(crypt, crypt, [],
2521cdf0e10cSrcweir            [AC_MSG_ERROR(libcrypt not found or functional)], [])
2522cdf0e10cSrcweir    else
2523cdf0e10cSrcweir        AC_MSG_RESULT([no, dynamically open it])
2524cdf0e10cSrcweir        CRYPT_LINK=NO
2525cdf0e10cSrcweir    fi
2526cdf0e10cSrcweirfi
2527cdf0e10cSrcweirAC_SUBST(CRYPT_LINK)
2528cdf0e10cSrcweir
2529cdf0e10cSrcweirdnl ===================================================================
2530cdf0e10cSrcweirdnl Testing for c++ compiler and version...
2531cdf0e10cSrcweirdnl ===================================================================
2532cdf0e10cSrcweirif test -n "$with_gcc_home"; then
2533cdf0e10cSrcweir   if test -z "$CXX"; then
2534cdf0e10cSrcweir      CXX="$with_gcc_home/bin/g++"
2535cdf0e10cSrcweir   fi
2536cdf0e10cSrcweirfi
2537cdf0e10cSrcweir
2538cdf0e10cSrcweirif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
2539cdf0e10cSrcweir   if test -e "$CC"; then
2540cdf0e10cSrcweir      CXX="$CC"
2541cdf0e10cSrcweir   fi
2542cdf0e10cSrcweirfi
2543cdf0e10cSrcweir
2544cdf0e10cSrcweirdnl Autoconf 2.53 can do this test for cl.exe, 2.13 can't!
2545cdf0e10cSrcweirif test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then
2546cdf0e10cSrcweir   AC_PROG_CXX
2547cdf0e10cSrcweirfi
2548cdf0e10cSrcweir
2549cdf0e10cSrcweirdnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
2550cdf0e10cSrcweirif test "$GXX" = "yes"; then
2551cdf0e10cSrcweir   AC_MSG_CHECKING([the GNU C++ compiler version])
2552cdf0e10cSrcweir
2553cdf0e10cSrcweir   _gpp_version=`$CXX -dumpversion`
2554cdf0e10cSrcweir   _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
2555cdf0e10cSrcweir
25561e1ac450SHerbert Dürr   AC_MSG_RESULT([checked (g++ $_gpp_version)])
2557cdf0e10cSrcweir
2558cdf0e10cSrcweir   if test "$_gpp_majmin" = "304"; then
2559cdf0e10cSrcweir      AC_MSG_CHECKING([whether $CXX has the enum bug])
2560cdf0e10cSrcweirAC_TRY_RUN([
2561cdf0e10cSrcweirextern "C" void abort (void);
2562cdf0e10cSrcweirextern "C" void exit (int status);
2563cdf0e10cSrcweir
2564cdf0e10cSrcweirenum E { E0, E1, E2, E3, E4, E5 };
2565cdf0e10cSrcweir
2566cdf0e10cSrcweirvoid
2567cdf0e10cSrcweirtest (enum E e)
2568cdf0e10cSrcweir{
2569cdf0e10cSrcweir  if (e == E2 || e == E3 || e == E1)
2570cdf0e10cSrcweir  exit (1);
2571cdf0e10cSrcweir}
2572cdf0e10cSrcweir
2573cdf0e10cSrcweirint
2574cdf0e10cSrcweirmain (void)
2575cdf0e10cSrcweir{
2576cdf0e10cSrcweir  test (E4);
2577cdf0e10cSrcweir  test (E5);
2578cdf0e10cSrcweir  test (E0);
2579cdf0e10cSrcweir  return 0;
2580cdf0e10cSrcweir}
2581da2e13d4SMatthias 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])])
2582cdf0e10cSrcweir   fi
2583cdf0e10cSrcweirfi
2584cdf0e10cSrcweir
2585cdf0e10cSrcweirdnl ===================================================================
2586cdf0e10cSrcweirdnl Set the mingw runtime library include directories
2587cdf0e10cSrcweirdnl ===================================================================
2588cdf0e10cSrcweirif test "$WITH_MINGWIN" = "yes"; then
2589cdf0e10cSrcweir   AC_MSG_CHECKING([for mingwin runtime include path])
2590cdf0e10cSrcweir   cat >conftest.$ac_ext <<_ACEOF
2591cdf0e10cSrcweir#include <stddef.h>
2592cdf0e10cSrcweir#include <bits/c++config.h>
2593cdf0e10cSrcweir_ACEOF
2594cdf0e10cSrcweir   _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`
2595cdf0e10cSrcweir   rm conftest.$ac_ext
2596cdf0e10cSrcweir   if test -n "$_mingw_lib_include_path"; then
2597cdf0e10cSrcweir      _temp=""
2598cdf0e10cSrcweir      for a in $_mingw_lib_include_path
2599cdf0e10cSrcweir         do
2600cdf0e10cSrcweir            a=`cygpath -d "$a"`
2601cdf0e10cSrcweir            _temp="$_temp "`cygpath -u "$a"`
2602cdf0e10cSrcweir         done
2603cdf0e10cSrcweir      _mingw_lib_include_path=$_temp
2604cdf0e10cSrcweir   fi
2605cdf0e10cSrcweir   if test -z "$_mingw_lib_include_path"; then
2606cdf0e10cSrcweir      _mingw_lib_include_path="NO_LIB_INCLUDE"
2607cdf0e10cSrcweir      AC_MSG_RESULT([no mingwin runtime includes])
2608cdf0e10cSrcweir   else
2609cdf0e10cSrcweir      AC_MSG_RESULT([$_mingw_lib_include_path])
2610cdf0e10cSrcweir   fi
2611cdf0e10cSrcweir  MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
2612cdf0e10cSrcweir  AC_SUBST(MINGW_LIB_INCLUDE_PATH)
2613cdf0e10cSrcweirdnl mingw gcc 4.4.0 needs backward in include path to use hash_set/hash_map
2614cdf0e10cSrcweir   AC_MSG_CHECKING([for mingwin c++ backward include path])
2615cdf0e10cSrcweir   cat >conftest.$ac_ext <<_ACEOF
2616cdf0e10cSrcweir#include <hash_set>
2617cdf0e10cSrcweir_ACEOF
2618cdf0e10cSrcweir   _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`
2619cdf0e10cSrcweir   rm conftest.$ac_ext
2620cdf0e10cSrcweir   if test -n "$_mingw_backward_include_path"; then
2621cdf0e10cSrcweir      _mingw_backward_include_path=`cygpath -d $_mingw_backward_include_path`
2622cdf0e10cSrcweir      _mingw_backward_include_path=`cygpath -u $_mingw_backward_include_path`
2623cdf0e10cSrcweir      AC_MSG_RESULT([$_mingw_backward_include_path])
2624cdf0e10cSrcweir   else
2625cdf0e10cSrcweir      _mingw_backward_include_path="NO_BACKWARD_INCLUDE"
2626cdf0e10cSrcweir      AC_MSG_RESULT([no mingwin c++ backward includes])
2627cdf0e10cSrcweir   fi
2628cdf0e10cSrcweir  MINGW_BACKWARD_INCLUDE_PATH="$_mingw_backward_include_path"
2629cdf0e10cSrcweir  AC_SUBST(MINGW_BACKWARD_INCLUDE_PATH)
2630cdf0e10cSrcweir  mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
2631cdf0e10cSrcweir  MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
2632cdf0e10cSrcweir  AC_MSG_CHECKING([whether to use dynamic libgcc])
2633cdf0e10cSrcweir  if test -e "$MINGW_CLIB_DIR/libgcc_s.a"; then
2634cdf0e10cSrcweir    AC_MSG_CHECKING([dynamic libgcc name])
2635cdf0e10cSrcweir    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'`
2636cdf0e10cSrcweir    MINGW_GCCDLL=`cd $COMPATH/bin && ls $MINGW_GCCDLL_pattern 2>/dev/null`
2637cdf0e10cSrcweir    if test -n "$MINGW_GCCDLL"; then
2638cdf0e10cSrcweir        MINGW_SHARED_GCCLIB=YES
2639cdf0e10cSrcweir        AC_MSG_RESULT([use $MINGW_GCCDLL])
2640cdf0e10cSrcweir    else
2641cdf0e10cSrcweir        AC_MSG_RESULT([no])
2642cdf0e10cSrcweir    fi
2643cdf0e10cSrcweir  else
2644cdf0e10cSrcweir    AC_MSG_RESULT([no])
2645cdf0e10cSrcweir  fi
2646cdf0e10cSrcweir  if test -e "$MINGW_CLIB_DIR/libgcc_eh.a"; then
2647cdf0e10cSrcweir      MINGW_GCCLIB_EH=YES
2648cdf0e10cSrcweir  fi
2649cdf0e10cSrcweir  AC_MSG_CHECKING([whether to use dynamic libstdc++])
2650cdf0e10cSrcweir  MINGW_SHARED_LIBSTDCPP=
2651cdf0e10cSrcweir  if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then
2652cdf0e10cSrcweir    MINGW_SHARED_LIBSTDCPP=stdc++_s
2653cdf0e10cSrcweir  fi
2654cdf0e10cSrcweir  if test -e "$MINGW_CLIB_DIR/libstdc++.dll.a" ; then
2655cdf0e10cSrcweir    MINGW_SHARED_LIBSTDCPP=stdc++.dll
2656cdf0e10cSrcweir  fi
2657cdf0e10cSrcweir  if test -n "$MINGW_SHARED_LIBSTDCPP" ; then
2658cdf0e10cSrcweir    AC_MSG_CHECKING([dynamic libstdc++ name])
2659cdf0e10cSrcweir    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'`
2660cdf0e10cSrcweir    MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null`
2661cdf0e10cSrcweir    if test -n "$MINGW_GXXDLL"; then
2662cdf0e10cSrcweir        MINGW_SHARED_LIBSTDCPP=-l$MINGW_SHARED_LIBSTDCPP
2663cdf0e10cSrcweir        MINGW_SHARED_GXXLIB=YES
2664cdf0e10cSrcweir        AC_MSG_RESULT([use $MINGW_GXXDLL])
2665cdf0e10cSrcweir    else
2666cdf0e10cSrcweir        MINGW_SHARED_LIBSTDCPP=
2667cdf0e10cSrcweir        AC_MSG_RESULT([no])
2668cdf0e10cSrcweir    fi
2669cdf0e10cSrcweir  else
2670cdf0e10cSrcweir    AC_MSG_RESULT([no])
2671cdf0e10cSrcweir  fi
2672cdf0e10cSrcweir  MINGW_CLIB_DIR=`cygpath $MINGW_CLIB_DIR`
2673cdf0e10cSrcweir  AC_SUBST(MINGW_CLIB_DIR)
2674cdf0e10cSrcweir  AC_SUBST(MINGW_SHARED_GCCLIB)
2675cdf0e10cSrcweir  AC_SUBST(MINGW_GCCLIB_EH)
2676cdf0e10cSrcweir  AC_SUBST(MINGW_SHARED_GXXLIB)
2677cdf0e10cSrcweir  AC_SUBST(MINGW_SHARED_LIBSTDCPP)
2678cdf0e10cSrcweir  AC_SUBST(MINGW_GCCDLL)
2679cdf0e10cSrcweir  AC_SUBST(MINGW_GXXDLL)
2680cdf0e10cSrcweirfi
2681cdf0e10cSrcweir
2682cdf0e10cSrcweirdnl ===================================================================
2683cdf0e10cSrcweirdnl Extra checking for the SUN OS compiler
2684cdf0e10cSrcweirdnl ===================================================================
2685cdf0e10cSrcweirif test "$_os" = "SunOS"; then
2686cdf0e10cSrcweir   dnl SunStudio C++ compiler packaged with SunStudio C compiler
2687cdf0e10cSrcweir   if test "$CC" = "cc"; then
2688cdf0e10cSrcweir   AC_MSG_CHECKING([SunStudio C++ Compiler])
2689cdf0e10cSrcweir      if test "$CXX" != "CC"; then
2690cdf0e10cSrcweir         AC_MSG_WARN([SunStudio C++ was not found])
2691cdf0e10cSrcweir         echo "SunStudio C++ was not found" >> warn
2692cdf0e10cSrcweir      else
2693da2e13d4SMatthias Seidel         AC_MSG_RESULT([checked])
2694cdf0e10cSrcweir      fi
2695da2e13d4SMatthias Seidel   fi
2696cdf0e10cSrcweirfi
2697cdf0e10cSrcweirdnl ===================================================================
2698cdf0e10cSrcweirdnl Extra checking for the OSF compiler
2699cdf0e10cSrcweirdnl ===================================================================
2700cdf0e10cSrcweirif test "$_os" = "OSF1"; then
2701cdf0e10cSrcweir   AC_MSG_CHECKING([Compaq C++ compiler version])
2702cdf0e10cSrcweir   dnl cxx -V outputs to standard error!!!!
2703cdf0e10cSrcweir   _compaqcxx_version=`$CXX -V 2>&1 | $AWK '{ print $3 }'`
2704cdf0e10cSrcweir   _compaqcxx_major=`echo $_compaqcxx_version | $AWK -F. '{ print $1 }'`
2705cdf0e10cSrcweir   if test "$_compaqcxx_major" != "V6"; then
2706cdf0e10cSrcweir      AC_MSG_WARN([found version "$_compaqc_version", use version 6 of the Compaq C++ compiler])
2707cdf0e10cSrcweir      echo "found version $_compaqc_version, use version 6 of the Compaq C++ compiler" >> warn
2708cdf0e10cSrcweir   else
2709cdf0e10cSrcweir      dnl compiler will do
2710cdf0e10cSrcweir      AC_MSG_RESULT([checked])
2711cdf0e10cSrcweir   fi
2712cdf0e10cSrcweirfi
2713cdf0e10cSrcweir
2714cdf0e10cSrcweirdnl *************************************************************
2715cdf0e10cSrcweirdnl Testing for exception handling - dwarf2 or sjlj exceptions...
2716cdf0e10cSrcweirdnl *************************************************************
2717cdf0e10cSrcweirAC_MSG_CHECKING([exception type])
2718cdf0e10cSrcweirAC_LANG_PUSH([C++])
2719cdf0e10cSrcweirif test "$WITH_MINGWIN" = "yes"; then
2720cdf0e10cSrcweir  AC_TRY_LINK(
2721cdf0e10cSrcweir	[#include <iostream>
2722cdf0e10cSrcweir
2723cdf0e10cSrcweirextern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
2724cdf0e10cSrcweir
2725cdf0e10cSrcweir	],
2726cdf0e10cSrcweir	[_Unwind_SjLj_RaiseException() ],
2727cdf0e10cSrcweir	[exceptions_type="sjlj"],
2728cdf0e10cSrcweir	[exceptions_type="dwarf2"]
2729cdf0e10cSrcweir  )
2730cdf0e10cSrcweirfi
2731cdf0e10cSrcweir
2732cdf0e10cSrcweirAC_MSG_RESULT($exceptions_type)
2733cdf0e10cSrcweirAC_LANG_POP([C++])
2734cdf0e10cSrcweirEXCEPTIONS="$exceptions_type"
2735cdf0e10cSrcweirAC_SUBST(EXCEPTIONS)
2736cdf0e10cSrcweir
2737cdf0e10cSrcweirdnl ===================================================================
2738cdf0e10cSrcweirdnl Checks for what the default STL should be
2739cdf0e10cSrcweirdnl ===================================================================
2740cdf0e10cSrcweir   AC_MSG_CHECKING([what the default STL should be])
2741212f9143SJan Iversen   DEFAULT_TO_STLPORT="no"
2742212f9143SJan Iversenif test "$WITH_STLPORT" != "no"; then
2743b597708bSHerbert Dürr   AC_MSG_ERROR([Option --with-stlport is no longer available.])
2744b597708bSHerbert Dürrelse
2745b597708bSHerbert Dürr   USE_SYSTEM_STL="YES"
2746cdf0e10cSrcweirfi
2747b597708bSHerbert Dürr
2748cdf0e10cSrcweirAC_SUBST(USE_SYSTEM_STL)
2749cdf0e10cSrcweir
2750cdf0e10cSrcweirdnl ===================================================================
2751cdf0e10cSrcweirdnl visibility feature
2752cdf0e10cSrcweirdnl ===================================================================
2753cdf0e10cSrcweirif test "$GCC" = "yes"; then
2754cdf0e10cSrcweir   AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
2755cdf0e10cSrcweir   save_CFLAGS=$CFLAGS
2756cdf0e10cSrcweir   CFLAGS="$CFLAGS -fvisibility=hidden"
2757cdf0e10cSrcweir   AC_TRY_LINK([], [ return 0; ], [ HAVE_GCC_VISIBILITY_FEATURE=TRUE ], [])
2758cdf0e10cSrcweir   CFLAGS=$save_CFLAGS
2759cdf0e10cSrcweir   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2760cdf0e10cSrcweir      AC_MSG_RESULT([yes])
2761cdf0e10cSrcweir   else
2762cdf0e10cSrcweir      AC_MSG_RESULT([no])
2763cdf0e10cSrcweir   fi
2764cdf0e10cSrcweirfi
2765cdf0e10cSrcweir
2766cdf0e10cSrcweir# ===================================================================
2767cdf0e10cSrcweir# use --ccache-skip?
2768cdf0e10cSrcweir# ===================================================================
2769da2e13d4SMatthias Seideldnl used to escape compiler options for ccache that otherwise prevent
2770cdf0e10cSrcweirdnl caching of the results (like "-x objective-c++" for Mac)
2771cdf0e10cSrcweirAC_MSG_CHECKING([whether we are allowed and able to use --ccache-skip])
2772cdf0e10cSrcweirif test "$_os" != "Darwin" ; then
2773cdf0e10cSrcweir   AC_MSG_RESULT([only used on Mac currently, skipping])
2774cdf0e10cSrcweirelif test "$enable_ccache_skip" = "no" ; then
2775cdf0e10cSrcweir   AC_MSG_RESULT([no - diabled explicitly])
2776cdf0e10cSrcweirelif test "$enable_ccache_skip" = "yes" ; then
2777cdf0e10cSrcweir   AC_MSG_RESULT([yes - enabled explicitly, skipping checks])
2778cdf0e10cSrcweir   AC_SUBST([USE_CCACHE], [YES])
2779cdf0e10cSrcweirelif test "$enable_ccache_skip" = "auto" ; then
2780cdf0e10cSrcweir   # checking for ccache presence/version
2781cdf0e10cSrcweir   AC_MSG_RESULT([probing...])
2782cdf0e10cSrcweir   AC_PATH_PROG([CCACHE],[ccache],[not_found])
2783cdf0e10cSrcweir   if test "$CCACHE" = "not_found" ; then
2784cdf0e10cSrcweir      AC_MSG_NOTICE([not enabling --ccache-skip (ccache not found)])
2785cdf0e10cSrcweir   else
2786da2e13d4SMatthias Seidel      # check ccache version
2787cdf0e10cSrcweir      AC_MSG_CHECKING([whether version of ccache is suitable])
2788cdf0e10cSrcweir      CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2789cdf0e10cSrcweir      if test "$CCACHE_VERSION" = "2.4_OOo"; then
2790cdf0e10cSrcweir         AC_MSG_RESULT([yes])
2791cdf0e10cSrcweir         AC_MSG_CHECKING([whether ccache is actually used for the build])
2792cdf0e10cSrcweir         AC_LANG_PUSH([C++])
2793cdf0e10cSrcweir         save_CXXFLAGS=$CXXFLAGS
2794cdf0e10cSrcweir         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
2795cdf0e10cSrcweir         dnl an empty program will do, we're checking the compiler flags
2796da2e13d4SMatthias Seidel         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
2797cdf0e10cSrcweir            [use_ccache=yes], [use_ccache=no])
2798cdf0e10cSrcweir         if test $use_ccache = yes ; then
2799cdf0e10cSrcweir            AC_MSG_RESULT([yes, will enable --ccache-skip])
2800cdf0e10cSrcweir            AC_SUBST([USE_CCACHE], [YES])
2801cdf0e10cSrcweir         else
2802cdf0e10cSrcweir            AC_MSG_RESULT([no, will not enable --ccache-skip])
2803cdf0e10cSrcweir         fi
2804cdf0e10cSrcweir         CXXFLAGS=$save_CXXFLAGS
2805cdf0e10cSrcweir         AC_LANG_POP([C++])
2806cdf0e10cSrcweir      else
2807cdf0e10cSrcweir         AC_MSG_RESULT([no])
2808cdf0e10cSrcweir         AC_MSG_NOTICE([ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip])
2809cdf0e10cSrcweir      fi
2810cdf0e10cSrcweir   fi
2811cdf0e10cSrcweirelse
2812cdf0e10cSrcweir   AC_MSG_ERROR([invalid option to --enable-ccache-skip. Valid values are "auto", "yes" and "no"])
2813cdf0e10cSrcweirfi
2814cdf0e10cSrcweir
2815cdf0e10cSrcweirdnl ===================================================================
2816cdf0e10cSrcweirdnl system stl sanity tests
2817cdf0e10cSrcweirdnl ===================================================================
2818b597708bSHerbert Dürrif false ; then # TODO: update TR1 compliant STLs
2819cdf0e10cSrcweirif test "$USE_SYSTEM_STL" = "YES"; then
2820d5aa83e5SHerbert Dürr   AC_MSG_CHECKING([system stl sanity])
2821cdf0e10cSrcweir   AC_LANG_PUSH([C++])
2822cdf0e10cSrcweir
2823cdf0e10cSrcweir   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2824cdf0e10cSrcweir      AC_MSG_CHECKING([if STL headers are visibility safe])
2825cdf0e10cSrcweir      AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
2826cdf0e10cSrcweir      AC_MSG_RESULT([$stlvisok])
2827cdf0e10cSrcweir      if test "$stlvisok" = "no"; then
2828cdf0e10cSrcweir         AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
2829cdf0e10cSrcweir         echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn
2830cdf0e10cSrcweir         unset HAVE_GCC_VISIBILITY_FEATURE
2831cdf0e10cSrcweir      fi
2832cdf0e10cSrcweir   fi
2833cdf0e10cSrcweir
2834cdf0e10cSrcweir   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2835cdf0e10cSrcweir      sharedlink_ldflags_save=$LDFLAGS
2836cdf0e10cSrcweir      LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared"
2837cdf0e10cSrcweir
2838cdf0e10cSrcweir      AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
2839cdf0e10cSrcweir      AC_TRY_LINK([#include <sstream>
2840cdf0e10cSrcweirusing namespace std;
2841cdf0e10cSrcweir],[istringstream strm( "test" ); return 0;],
2842cdf0e10cSrcweir      $EGREP -q  unresolvable conftest.err;
2843da2e13d4SMatthias Seidel      if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi,
2844cdf0e10cSrcweir      gccvisok=no)
2845cdf0e10cSrcweir      AC_MSG_RESULT([$gccvisok])
2846cdf0e10cSrcweir      if test "$gccvisok" = "no"; then
2847cdf0e10cSrcweir         AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility])
2848cdf0e10cSrcweir         echo "Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >> warn
2849cdf0e10cSrcweir         unset HAVE_GCC_VISIBILITY_FEATURE
2850cdf0e10cSrcweir      fi
2851cdf0e10cSrcweir
2852cdf0e10cSrcweir      LDFLAGS=$sharedlink_ldflags_save
2853cdf0e10cSrcweir   fi
2854cdf0e10cSrcweir
2855cdf0e10cSrcweir   if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
2856cdf0e10cSrcweir      AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
2857cdf0e10cSrcweir      cat >visibility.cxx <<_ACEOF
2858cdf0e10cSrcweir#pragma GCC visibility push(hidden)
2859cdf0e10cSrcweirstruct __attribute__ ((visibility ("default"))) TestStruct {
2860cdf0e10cSrcweir  static void Init();
2861cdf0e10cSrcweir};
2862cdf0e10cSrcweir__attribute__ ((visibility ("default"))) void TestFunc() {
2863cdf0e10cSrcweir  TestStruct::Init();
2864cdf0e10cSrcweir}
2865cdf0e10cSrcweir_ACEOF
2866cdf0e10cSrcweir      if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
2867cdf0e10cSrcweir         gccvisbroken=yes
2868cdf0e10cSrcweir      else
2869cdf0e10cSrcweir         case "$build_cpu" in
2870cdf0e10cSrcweir            i?86|x86_64)
2871cdf0e10cSrcweir               if $EGREP -q '@PLT' visibility.s; then
2872cdf0e10cSrcweir                  gccvisbroken=no
2873da2e13d4SMatthias Seidel               else
2874cdf0e10cSrcweir                  gccvisbroken=yes
2875cdf0e10cSrcweir               fi
2876cdf0e10cSrcweir               ;;
2877cdf0e10cSrcweir            *)
2878cdf0e10cSrcweir               gccvisbroken=no
2879cdf0e10cSrcweir               ;;
2880cdf0e10cSrcweir         esac
2881cdf0e10cSrcweir      fi
2882f07aa446SHerbert Dürr      rm -f visibility.s visibility.cxx
2883cdf0e10cSrcweir
2884cdf0e10cSrcweir      AC_MSG_RESULT([$gccvisbroken])
2885cdf0e10cSrcweir      if test "$gccvisbroken" = "yes"; then
2886cdf0e10cSrcweir         AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
2887cdf0e10cSrcweir         echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn
2888cdf0e10cSrcweir         unset HAVE_GCC_VISIBILITY_FEATURE
2889cdf0e10cSrcweir      fi
2890cdf0e10cSrcweir   fi
2891cdf0e10cSrcweir
2892cdf0e10cSrcweir   AC_LANG_POP([C++])
2893cdf0e10cSrcweirfi
2894b597708bSHerbert Dürrfi # endof TODO: update TR1 compliant STLs
2895cdf0e10cSrcweir
2896cdf0e10cSrcweirAC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
2897cdf0e10cSrcweir
2898cdf0e10cSrcweirdnl ===================================================================
2899cdf0e10cSrcweirdnl allocator
2900cdf0e10cSrcweirdnl ===================================================================
2901cdf0e10cSrcweirAC_MSG_CHECKING([which memory allocator to use])
2902cdf0e10cSrcweirif test "$with_alloc" = "system"; then
2903cdf0e10cSrcweir    AC_MSG_RESULT([system])
2904cdf0e10cSrcweir    ALLOC="SYS_ALLOC";
2905cdf0e10cSrcweir    AC_CHECK_FUNCS([malloc realloc calloc free])
2906cdf0e10cSrcweirfi
2907cdf0e10cSrcweirif test "$with_alloc" = "tcmalloc"; then
2908cdf0e10cSrcweir    AC_MSG_RESULT(tcmalloc)
290928633775SPedro Giffuni    if ! echo $build_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
2910cdf0e10cSrcweir        AC_MSG_ERROR([tcmalloc only available/usable on ix86])
2911cdf0e10cSrcweir    fi
2912cdf0e10cSrcweir    AC_CHECK_LIB(tcmalloc, malloc, [],
2913cdf0e10cSrcweir        [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
2914cdf0e10cSrcweir    ALLOC="TCMALLOC";
2915cdf0e10cSrcweirfi
2916cdf0e10cSrcweirif test "$with_alloc" = "jemalloc"; then
2917cdf0e10cSrcweir  if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
2918cdf0e10cSrcweir    AC_MSG_RESULT(jemalloc)
2919cdf0e10cSrcweir    save_CFLAGS=$CFLAGS
2920cdf0e10cSrcweir    CFLAGS="$CFLAGS -pthread"
2921cdf0e10cSrcweir    AC_CHECK_LIB(jemalloc, malloc, [],
2922cdf0e10cSrcweir        [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
2923cdf0e10cSrcweir    ALLOC="JEMALLOC";
2924cdf0e10cSrcweir    CFLAGS=$save_CFLAGS
2925cdf0e10cSrcweir  else
2926cdf0e10cSrcweir    AC_MSG_RESULT([system])
2927cdf0e10cSrcweir    ALLOC="SYS_ALLOC";
2928cdf0e10cSrcweir    AC_CHECK_FUNCS([malloc realloc calloc free])
2929cdf0e10cSrcweir  fi
2930cdf0e10cSrcweirfi
2931cdf0e10cSrcweirif test "$with_alloc" = "internal" -o -z "$with_alloc"; then
2932cdf0e10cSrcweir   AC_MSG_RESULT([internal])
2933cdf0e10cSrcweirfi
2934cdf0e10cSrcweirAC_SUBST(ALLOC)
2935cdf0e10cSrcweir
2936cdf0e10cSrcweirdnl ===================================================================
2937cdf0e10cSrcweirdnl Custom build version
2938cdf0e10cSrcweirdnl ===================================================================
2939cdf0e10cSrcweir
2940cdf0e10cSrcweirAC_MSG_CHECKING([whether to add custom build version])
2941cdf0e10cSrcweirif test "z$with_build_version" != "z"; then
2942cdf0e10cSrcweir   BUILD_VER_STRING=$with_build_version
2943cdf0e10cSrcweir   AC_MSG_RESULT([yes, $BUILD_VER_STRING])
2944cdf0e10cSrcweirelse
29453ee2ad5bSpfg   BUILD_VER_STRING=
2946cdf0e10cSrcweir   AC_MSG_RESULT([no])
2947cdf0e10cSrcweirfi
2948cdf0e10cSrcweirAC_SUBST(BUILD_VER_STRING)
2949cdf0e10cSrcweir
2950cdf0e10cSrcweirdnl ===================================================================
2951cdf0e10cSrcweirdnl Java support enable
2952cdf0e10cSrcweirdnl ===================================================================
2953cdf0e10cSrcweirAC_MSG_CHECKING([whether to build with Java support])
2954cdf0e10cSrcweirif test "$WITH_JAVA" != "no"; then
2955cdf0e10cSrcweir   AC_MSG_RESULT([yes])
2956cdf0e10cSrcweir   SOLAR_JAVA="TRUE"
2957cdf0e10cSrcweirelse
2958cdf0e10cSrcweir   AC_MSG_RESULT([no])
2959cdf0e10cSrcweir   SOLAR_JAVA=""
2960cdf0e10cSrcweir
2961cdf0e10cSrcweir   AC_MSG_WARN([building without java will mean some features will not be available])
2962cdf0e10cSrcweir   echo "building without java will mean some features will not be available" >>warn
2963cdf0e10cSrcweirfi
2964cdf0e10cSrcweirAC_SUBST(SOLAR_JAVA)
2965cdf0e10cSrcweir
2966cdf0e10cSrcweirif test "$_os" = "Linux" && test "$build_cpu" = "powerpc"; then
2967cdf0e10cSrcweir   # IBMs JDK needs this...
2968cdf0e10cSrcweir   JITC_PROCESSOR_TYPE=6
2969cdf0e10cSrcweir   export JITC_PROCESSOR_TYPE
2970cdf0e10cSrcweirfi
2971cdf0e10cSrcweir
2972cdf0e10cSrcweirif test "$_os" = "WINNT"; then
2973cdf0e10cSrcweir   if test -z "$with_jdk_home"; then
2974edd74ba5SDamjan Jovanovic      _jdk_home=`$OOWINTOOL --jdk-home`
2975cdf0e10cSrcweir       if test -d "$_jdk_home"; then
2976cdf0e10cSrcweir          with_jdk_home="$_jdk_home"
2977cdf0e10cSrcweir       fi
2978cdf0e10cSrcweir   else
2979cdf0e10cSrcweir      with_jdk_home=`cygpath -u "$with_jdk_home"`
2980cdf0e10cSrcweir   fi
2981cdf0e10cSrcweirfi
2982cdf0e10cSrcweir
2983cdf0e10cSrcweirdnl ===================================================================
2984cdf0e10cSrcweirdnl Checks for java
2985cdf0e10cSrcweirdnl ===================================================================
2986cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
2987cdf0e10cSrcweir   JAVA_HOME=; export JAVA_HOME
2988cdf0e10cSrcweir   if test -z "$with_jdk_home"; then
2989cdf0e10cSrcweir      AC_PATH_PROG(JAVAINTERPRETER, $WITH_JAVA)
2990cdf0e10cSrcweir   else
2991cdf0e10cSrcweir      _java_path="$with_jdk_home/bin/$WITH_JAVA"
2992cdf0e10cSrcweir      dnl Check if there is a java interpreter at all.
2993cdf0e10cSrcweir      if test -x "$_java_path"; then
2994cdf0e10cSrcweir         JAVAINTERPRETER=$_java_path
2995cdf0e10cSrcweir      else
2996897adb27SJürgen Schmidt         AC_MSG_ERROR([$_java_path not found, please use --with-jdk-home])
2997cdf0e10cSrcweir      fi
2998cdf0e10cSrcweir   fi
2999cdf0e10cSrcweir   if test "$_os" = "WINNT"; then
300028633775SPedro Giffuni      if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
3001cdf0e10cSrcweir          JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
3002cdf0e10cSrcweir      fi
3003cdf0e10cSrcweir      JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
3004cdf0e10cSrcweir      JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
3005cdf0e10cSrcweir   elif test "$_os" = "Darwin"; then
3006b12514e1SHerbert Dürr         JAVAIFLAGS=""
3007cdf0e10cSrcweir   fi
3008cdf0e10cSrcweirfi
3009cdf0e10cSrcweir
3010cdf0e10cSrcweirdnl ===================================================================
3011cdf0e10cSrcweirdnl Checks for JDK.
3012cdf0e10cSrcweirdnl ===================================================================
3013cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
3014cdf0e10cSrcweir   _gij_longver=0
3015cdf0e10cSrcweir   AC_MSG_CHECKING([the installed JDK])
3016cdf0e10cSrcweir   if test -n "$JAVAINTERPRETER"; then
3017cdf0e10cSrcweir      dnl java -version sends output to stderr!
301828633775SPedro Giffuni      if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
3019cdf0e10cSrcweir         AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3020cdf0e10cSrcweir#        dnl Kaffe specific tests
3021cdf0e10cSrcweir#        KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP "  Version:" | $SED -r "s/.*  Version: ([[0-9\.]]*).*/\1/"`
3022cdf0e10cSrcweir#        if test -z "$KAFFE_VER"; then
3023cdf0e10cSrcweir#          AC_MSG_ERROR([looks like Kaffe but version detection failed])
3024cdf0e10cSrcweir#        fi
3025cdf0e10cSrcweir#        _kaffe_ver=`echo "$KAFFE_VER" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3026cdf0e10cSrcweir#        if test "$_kaffe_ver" -lt 10100; then
3027cdf0e10cSrcweir#           AC_MSG_ERROR([Kaffe is too old ($KAFFE_VER - $_kaffe_ver), you need at least 1.1.0])
3028cdf0e10cSrcweir#        fi
3029cdf0e10cSrcweir#        JDK=kaffe
3030da2e13d4SMatthias Seidel#
3031cdf0e10cSrcweir#        dnl TODO: define some project exclusion variables
3032da2e13d4SMatthias Seidel#
3033cdf0e10cSrcweir#        AC_MSG_RESULT([checked (Kaffe $KAFFE_VER)])
3034cdf0e10cSrcweir#        AC_MSG_WARN([EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile])
3035cdf0e10cSrcweir#        echo "EXPERIMENTAL: Kaffe is not a full JDK replacement - some projects will fail to compile" >>warn
3036cdf0e10cSrcweir#        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
303728633775SPedro Giffuni      elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
3038cdf0e10cSrcweir        JDK=gcj
3039da2e13d4SMatthias Seidel        AC_MSG_RESULT([checked (gcj)])
304028633775SPedro Giffuni        _gij_version=`$JAVAINTERPRETER --version | $GREP GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
3041cdf0e10cSrcweir        _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3042cdf0e10cSrcweir
304328633775SPedro Giffuni      elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | $GREP -c "BEA"` -gt 0; then
3044cdf0e10cSrcweir         AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.in])
3045cdf0e10cSrcweir#        JDK=bea
3046cdf0e10cSrcweir#
3047cdf0e10cSrcweir#        dnl BEA JDK specific tests
3048cdf0e10cSrcweir#        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3049cdf0e10cSrcweir#        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3050cdf0e10cSrcweir#
3051cdf0e10cSrcweir#        if test "$_jdk_ver" -lt 10500; then
3052cdf0e10cSrcweir#          AC_MSG_ERROR([JDK is too old, you need at least BEA JDK 1.5.0])
3053cdf0e10cSrcweir#        fi
3054cdf0e10cSrcweir#
3055cdf0e10cSrcweir#        AC_MSG_RESULT([checked (BEA JDK $_jdk)])
3056cdf0e10cSrcweir#
3057cdf0e10cSrcweir#        if test "$with_jdk_home" = ""; then
3058c4266413SHerbert Dürr#             AC_MSG_ERROR([In order to successfully build Apache OpenOffice using the BEA JDK,
3059cdf0e10cSrcweir#you must use the "--with-jdk-home" configure option explicitly])
3060cdf0e10cSrcweir#        fi
3061cdf0e10cSrcweir#
3062cdf0e10cSrcweir#        AC_MSG_WARN([A bug in certain BEA JREs can prevent you from successfully compiling some modules])
3063cdf0e10cSrcweir#        echo "A bug in certain BEA JREs can prevent you from successfully compiling some modules" >>warn
3064cdf0e10cSrcweir#
3065cdf0e10cSrcweir#        JAVA_HOME=$with_jdk_home
3066cdf0e10cSrcweir#
306728633775SPedro Giffuni      elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | $GREP -c "IBM"` -gt 0; then
3068cdf0e10cSrcweir        JDK=ibm
3069cdf0e10cSrcweir
3070cdf0e10cSrcweir        dnl IBM JDK specific tests
3071cdf0e10cSrcweir        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3072cdf0e10cSrcweir        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3073da2e13d4SMatthias Seidel
3074cdf0e10cSrcweir        if test "$_jdk_ver" -lt 10500; then
3075cdf0e10cSrcweir             AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
3076cdf0e10cSrcweir        fi
3077cdf0e10cSrcweir
3078cdf0e10cSrcweir        AC_MSG_RESULT([checked (IBM JDK $_jdk)])
3079cdf0e10cSrcweir
3080cdf0e10cSrcweir        if test "$with_jdk_home" = ""; then
3081c4266413SHerbert Dürr             AC_MSG_ERROR([In order to successfully build Apache OpenOffice using the IBM JDK,
3082cdf0e10cSrcweiryou must use the "--with-jdk-home" configure option explicitly])
3083cdf0e10cSrcweir        fi
3084cdf0e10cSrcweir
3085cdf0e10cSrcweir        JAVA_HOME=$with_jdk_home
3086da2e13d4SMatthias Seidel
3087da2e13d4SMatthias Seidel      else
3088cdf0e10cSrcweir        JDK=sun
3089cdf0e10cSrcweir
3090cdf0e10cSrcweir        dnl SUN JDK specific tests
3091cdf0e10cSrcweir        _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
3092cdf0e10cSrcweir        _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
3093e986c8d8SMatthias Seidel
3094cdf0e10cSrcweir        if test "$_jdk_ver" -lt 10500; then
3095cdf0e10cSrcweir             AC_MSG_ERROR([JDK is too old, you need at least 1.5])
3096cdf0e10cSrcweir        fi
3097cdf0e10cSrcweir        AC_MSG_RESULT([checked (JDK $_jdk)])
3098cdf0e10cSrcweir        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
3099cdf0e10cSrcweir        if test "$_os" = "WINNT"; then
3100cdf0e10cSrcweir          JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
3101cdf0e10cSrcweir        fi
3102cdf0e10cSrcweir        if test "$_os" = "OS2"; then
3103cdf0e10cSrcweir          JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
3104cdf0e10cSrcweir        fi
3105cdf0e10cSrcweir      fi
3106cdf0e10cSrcweir   else
3107cdf0e10cSrcweir      AC_MSG_ERROR([JAVA not found. You need at least jdk-1.5, or gcj-4])
3108cdf0e10cSrcweir   fi
3109cdf0e10cSrcweirelse
3110cdf0e10cSrcweir   dnl Java disabled
3111cdf0e10cSrcweir   JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
3112cdf0e10cSrcweirfi
3113cdf0e10cSrcweir
3114cdf0e10cSrcweirdnl ===================================================================
3115cdf0e10cSrcweirdnl Checks for javac
3116cdf0e10cSrcweirdnl ===================================================================
3117cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
3118da2e13d4SMatthias Seidel    if test "$JDK" = "gcj"; then
3119cdf0e10cSrcweir        javacompiler=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
3120cdf0e10cSrcweir    else
3121cdf0e10cSrcweir        javacompiler="javac"
3122cdf0e10cSrcweir    fi
3123cdf0e10cSrcweir    if test "$_os" = "OS2"; then
312428633775SPedro Giffuni      if test x`echo "$javacompiler" | $GREP -i '\.exe$'` = x; then
3125cdf0e10cSrcweir          javacompiler="${javacompiler}.exe"
3126cdf0e10cSrcweir      fi
3127cdf0e10cSrcweir    fi
3128cdf0e10cSrcweir    if test -z "$with_jdk_home"; then
3129cdf0e10cSrcweir        AC_PATH_PROG(JAVACOMPILER, $javacompiler)
3130cdf0e10cSrcweir    else
3131cdf0e10cSrcweir        _javac_path="$with_jdk_home/bin/$javacompiler"
3132cdf0e10cSrcweir        dnl Check if there is a java compiler at all.
3133cdf0e10cSrcweir        if test -x "$_javac_path"; then
3134cdf0e10cSrcweir            JAVACOMPILER=$_javac_path
3135cdf0e10cSrcweir        fi
3136cdf0e10cSrcweir    fi
3137cdf0e10cSrcweir    if test -z "$JAVACOMPILER"; then
3138897adb27SJürgen Schmidt      AC_MSG_ERROR([$javacompiler not found, please use --with-jdk-home])
3139cdf0e10cSrcweir    fi
3140cdf0e10cSrcweir    if test "$_os" = "WINNT"; then
314128633775SPedro Giffuni       if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
3142cdf0e10cSrcweir          JAVACOMPILER="${JAVACOMPILER}.exe"
3143cdf0e10cSrcweir       fi
3144cdf0e10cSrcweir       JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
3145cdf0e10cSrcweir       JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
3146cdf0e10cSrcweir    fi
3147cdf0e10cSrcweir    if test "$_os" = "OS2"; then
314828633775SPedro Giffuni       if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
3149cdf0e10cSrcweir          JAVACOMPILER="${JAVACOMPILER}.exe"
3150cdf0e10cSrcweir       fi
3151cdf0e10cSrcweir    fi
3152cdf0e10cSrcweir
315328633775SPedro Giffuni    if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
3154cdf0e10cSrcweir        AC_MSG_CHECKING([re-checking JDK])
3155cdf0e10cSrcweir        JDK=gcj
3156cdf0e10cSrcweir        AC_MSG_RESULT([checked (ecj)])
3157cdf0e10cSrcweir        #TODO: what's to do here? some switch to do 1.5 compiling?
3158cdf0e10cSrcweir        JAVAFLAGS="-source 1.5 -target 1.5"
3159cdf0e10cSrcweir        _gij_longver="40200"
3160cdf0e10cSrcweir    fi
3161cdf0e10cSrcweirfi
3162cdf0e10cSrcweir
3163cdf0e10cSrcweirJAVACISGCJ=""
3164cdf0e10cSrcweirdnl ===================================================================
3165cdf0e10cSrcweirdnl Checks that javac is gcj
3166cdf0e10cSrcweirdnl ===================================================================
3167cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
316828633775SPedro Giffuni    if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
3169cdf0e10cSrcweir        JAVACISGCJ="yes"
3170cdf0e10cSrcweir    fi
3171cdf0e10cSrcweirfi
3172cdf0e10cSrcweirAC_SUBST(JAVACISGCJ)
3173cdf0e10cSrcweir
3174cdf0e10cSrcweirdnl ===================================================================
3175cdf0e10cSrcweirdnl Checks for javadoc
3176cdf0e10cSrcweirdnl ===================================================================
3177cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
3178cdf0e10cSrcweir    if test -z "$with_jdk_home"; then
3179cdf0e10cSrcweir        AC_PATH_PROG(JAVADOC, javadoc)
3180cdf0e10cSrcweir    else
3181cdf0e10cSrcweir        _javadoc_path="$with_jdk_home/bin/javadoc"
3182cdf0e10cSrcweir        if test "$_os" = "OS2"; then
318328633775SPedro Giffuni          if test x`echo "$_javadoc_path" | $GREP -i '\.exe$'` = x; then
3184cdf0e10cSrcweir              _javadoc_path="${_javadoc_path}.exe"
3185cdf0e10cSrcweir          fi
3186cdf0e10cSrcweir        fi
3187cdf0e10cSrcweir        dnl Check if there is a javadoc at all.
3188cdf0e10cSrcweir        if test -x "$_javadoc_path"; then
3189cdf0e10cSrcweir            JAVADOC=$_javadoc_path
3190cdf0e10cSrcweir        else
3191cdf0e10cSrcweir            AC_PATH_PROG(JAVADOC, javadoc)
3192cdf0e10cSrcweir        fi
3193cdf0e10cSrcweir    fi
3194cdf0e10cSrcweir    if test -z "$JAVADOC"; then
3195897adb27SJürgen Schmidt      AC_MSG_ERROR([$_javadoc_path not found, please use --with-jdk-home])
3196cdf0e10cSrcweir    fi
3197cdf0e10cSrcweir    if test "$_os" = "WINNT"; then
319828633775SPedro Giffuni        if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
3199cdf0e10cSrcweir            JAVADOC="${JAVADOC}.exe"
3200cdf0e10cSrcweir        fi
3201cdf0e10cSrcweir        JAVADOC=`cygpath -d "$JAVADOC"`
3202cdf0e10cSrcweir        JAVADOC=`cygpath -u "$JAVADOC"`
3203cdf0e10cSrcweir    fi
3204cdf0e10cSrcweir    if test "$_os" = "OS2"; then
320528633775SPedro Giffuni        if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
3206cdf0e10cSrcweir            JAVADOC="${JAVADOC}.exe"
3207cdf0e10cSrcweir        fi
3208cdf0e10cSrcweir    fi
3209cdf0e10cSrcweirfi
3210cdf0e10cSrcweir
3211cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
3212cdf0e10cSrcweir    dnl first check if we have been asked to autodetect JAVA_HOME with a recent gij
3213cdf0e10cSrcweir    if test "$JDK" = "gcj" -a -z "$JAVA_HOME"; then
3214cdf0e10cSrcweir      if test "x$with_jdk_home" = "x" -a "$_gij_longver" -ge "40200"; then
3215cdf0e10cSrcweir        cat > findhome.java <<_ACEOF
3216cdf0e10cSrcweir[import java.io.File;
3217cdf0e10cSrcweir
3218cdf0e10cSrcweirclass findhome
3219cdf0e10cSrcweir{
3220cdf0e10cSrcweir    public static void main(String args[])
3221cdf0e10cSrcweir    {
3222cdf0e10cSrcweir        String jrelocation = System.getProperty("java.home");
3223cdf0e10cSrcweir        File jre = new File(jrelocation);
3224cdf0e10cSrcweir        System.out.println(jre.getParent());
3225cdf0e10cSrcweir    }
3226cdf0e10cSrcweir}]
3227cdf0e10cSrcweir_ACEOF
3228cdf0e10cSrcweir        AC_MSG_CHECKING([if javac works])
3229cdf0e10cSrcweir        javac_cmd="$JAVACOMPILER findhome.java 1>&2"
3230cdf0e10cSrcweir        AC_TRY_EVAL(javac_cmd)
3231cdf0e10cSrcweir        if test $? = 0 && test -f ./findhome.class ; then
3232cdf0e10cSrcweir          AC_MSG_RESULT([javac works])
3233cdf0e10cSrcweir        else
3234cdf0e10cSrcweir          echo "configure: javac test failed" >&5
3235cdf0e10cSrcweir          cat findhome.java >&5
3236cdf0e10cSrcweir          AC_MSG_ERROR([javac does not work - java projects will not build!])
3237cdf0e10cSrcweir        fi
3238cdf0e10cSrcweir
3239cdf0e10cSrcweir        AC_MSG_CHECKING([if gij knows its java.home])
3240cdf0e10cSrcweir        JAVA_HOME=`$JAVAINTERPRETER findhome`
3241cdf0e10cSrcweir        if test $? = 0 && test "$JAVA_HOME" != "" ; then
3242cdf0e10cSrcweir          AC_MSG_RESULT([$JAVA_HOME])
3243cdf0e10cSrcweir        else
3244cdf0e10cSrcweir          echo "configure: java test failed" >&5
3245cdf0e10cSrcweir          cat findhome.java >&5
3246cdf0e10cSrcweir          AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
3247cdf0e10cSrcweir        fi
3248cdf0e10cSrcweir      else
3249cdf0e10cSrcweir        JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$WITH_JAVA,,p"`
3250cdf0e10cSrcweir      fi
3251cdf0e10cSrcweir    fi
3252cdf0e10cSrcweir
3253cdf0e10cSrcweir    dnl second sanity check JAVA_HOME if possible
3254cdf0e10cSrcweir    if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
3255cdf0e10cSrcweir      # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
3256cdf0e10cSrcweir      if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
3257cdf0e10cSrcweir         javac_link_f=`readlink -f "$JAVACOMPILER" 2>/dev/null`
3258cdf0e10cSrcweir         if test $? == 0 && test "$JAVACOMPILER" != "$javac_link_f"; then
3259da2e13d4SMatthias Seidel          # try to recover first by looking whether we have a alternatives
3260cdf0e10cSrcweir          # system as in Debian or newer SuSEs where following /usr/bin/javac
3261cdf0e10cSrcweir          # over /etc/alternatives/javac leads to the right bindir where we
3262cdf0e10cSrcweir          # just need to strip a bit away to get a valid JAVA_HOME
3263cdf0e10cSrcweir          # Solaris 11 is even worse, because target is relative, so use -f
3264cdf0e10cSrcweir            JAVA_HOME="$javac_link_f"
3265cdf0e10cSrcweir         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
3266cdf0e10cSrcweir          # Darwin readlink(1) is so primitive it doesn't even support -f
3267cdf0e10cSrcweir          # maybe only one level of symlink (e.g. on Mac)
3268cdf0e10cSrcweir            JAVA_HOME=`readlink $JAVACOMPILER`
3269cdf0e10cSrcweir         else
3270cdf0e10cSrcweir          # else warn
3271cdf0e10cSrcweir          AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
3272cdf0e10cSrcweir          AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
3273cdf0e10cSrcweir          echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn
3274cdf0e10cSrcweir          echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn
3275cdf0e10cSrcweir          fi
3276cdf0e10cSrcweir         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
3277cdf0e10cSrcweir         if test "$JAVA_HOME" != "/usr"; then
3278cdf0e10cSrcweir            if test "$_os" = "Darwin"; then
3279cdf0e10cSrcweir               dnl Leopard returns a non-suitable path with readlink - points to "Current" only
3280cdf0e10cSrcweir               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
3281cdf0e10cSrcweir               dnl Tiger already returns a JDK path..
3282cdf0e10cSrcweir               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
3283cdf0e10cSrcweir            else
3284cdf0e10cSrcweir               JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
3285cdf0e10cSrcweir            fi
3286cdf0e10cSrcweir         fi
3287cdf0e10cSrcweir      fi
3288cdf0e10cSrcweir      # now check if $JAVA_HOME is really valid
3289cdf0e10cSrcweir      if test "$_os" = "Darwin"; then
3290cdf0e10cSrcweir         if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
3291cdf0e10cSrcweir            JAVA_HOME_OK="NO"
3292cdf0e10cSrcweir         fi
3293cdf0e10cSrcweir      elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
3294cdf0e10cSrcweir         JAVA_HOME_OK="NO"
3295cdf0e10cSrcweir      fi
3296cdf0e10cSrcweir      if test "$JAVA_HOME_OK" = "NO"; then
3297cdf0e10cSrcweir         AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
3298cdf0e10cSrcweir         AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
3299cdf0e10cSrcweir         AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
3300cdf0e10cSrcweir         echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn
3301cdf0e10cSrcweir         echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn
3302cdf0e10cSrcweir         echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn
3303cdf0e10cSrcweir#         if test "$JDK" = "gcj"; then
3304cdf0e10cSrcweir#             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
3305cdf0e10cSrcweir#         fi
3306cdf0e10cSrcweir      fi
3307cdf0e10cSrcweir    fi
3308cdf0e10cSrcweirfi
3309cdf0e10cSrcweir
3310cdf0e10cSrcweirAWTLIB=
3311cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
3312cdf0e10cSrcweir   AC_MSG_CHECKING([for jawt lib name])
3313da2e13d4SMatthias Seidel   if test "$JDK" = "gcj"; then
3314cdf0e10cSrcweir      save_CFLAGS=$CFLAGS
3315cdf0e10cSrcweir      save_LDFLAGS=$LDFLAGS
3316cdf0e10cSrcweir      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
3317cdf0e10cSrcweir      LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
3318cdf0e10cSrcweir      exec 6>/dev/null # no output
3319cdf0e10cSrcweir      AC_CHECK_HEADER(jni.h, [],
3320cdf0e10cSrcweir                    [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
3321cdf0e10cSrcweir      AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
3322cdf0e10cSrcweir      exec 6>&1 # output on again
3323cdf0e10cSrcweir      CFLAGS=$save_CFLAGS
3324cdf0e10cSrcweir      LDFLAGS=$save_LDFLAGS
3325cdf0e10cSrcweir   fi
3326cdf0e10cSrcweir   # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
3327cdf0e10cSrcweir   # A workaround is to link also against libpmawt.so
3328cdf0e10cSrcweir   if test "$JDK" = "ibm" ; then
3329cdf0e10cSrcweir      save_CFLAGS=$CFLAGS
3330cdf0e10cSrcweir      save_LDFLAGS=$LDFLAGS
3331cdf0e10cSrcweir      save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
3332cdf0e10cSrcweir      CFLAGS="$CFLAGS -I$JAVA_HOME/include"
3333cdf0e10cSrcweir      LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
3334cdf0e10cSrcweir      LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
3335cdf0e10cSrcweir      export LD_LIBRARY_PATH
3336cdf0e10cSrcweir      exec 6>/dev/null # no output
3337cdf0e10cSrcweir      AC_CHECK_HEADER(jni.h, [],
3338cdf0e10cSrcweir                    [AC_MSG_ERROR([jni.h could not be found.])], [])
3339cdf0e10cSrcweir      AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
3340cdf0e10cSrcweir      if test -z "$AWTLIB"; then
3341cdf0e10cSrcweir         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
3342cdf0e10cSrcweir         AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
3343cdf0e10cSrcweir      fi
3344cdf0e10cSrcweir      exec 6>&1 # output on again
3345cdf0e10cSrcweir      CFLAGS=$save_CFLAGS
3346cdf0e10cSrcweir      LDFLAGS=$save_LDFLAGS
3347cdf0e10cSrcweir      LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
3348cdf0e10cSrcweir   fi
3349cdf0e10cSrcweir   if test -z "$AWTLIB"; then
3350cdf0e10cSrcweir      AWTLIB=-ljawt
3351cdf0e10cSrcweir   fi
3352cdf0e10cSrcweir   AC_MSG_RESULT([$AWTLIB])
3353cdf0e10cSrcweir   AC_SUBST(AWTLIB)
3354cdf0e10cSrcweirfi
3355cdf0e10cSrcweir
3356cdf0e10cSrcweirdnl ===================================================================
3357cdf0e10cSrcweirdnl Check for optional gcj for AOT
3358cdf0e10cSrcweirdnl ===================================================================
3359cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
3360cdf0e10cSrcweir  AC_MSG_CHECKING([whether to enable gcj aot compilation])
3361cdf0e10cSrcweir  if test -n "$enable_gcjaot" && test "$enable_gcjaot" != "no"; then
3362cdf0e10cSrcweir     AC_MSG_RESULT([yes])
336328633775SPedro Giffuni     if test `echo $WITH_JAVA | $GREP -c "gij"` -eq 0; then
3364cdf0e10cSrcweir        gcjaot="gcj"
3365cdf0e10cSrcweir     else
3366cdf0e10cSrcweir        gcjaot=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g"`
3367cdf0e10cSrcweir     fi
3368cdf0e10cSrcweir     AC_MSG_RESULT([$gcjaot])
3369cdf0e10cSrcweir     if test -n "$with_jdk_home"; then
3370cdf0e10cSrcweir        _javac_path="$with_jdk_home/bin/$gcjaot"
3371cdf0e10cSrcweir        dnl Check if there is a gcj at all.
3372cdf0e10cSrcweir        if test -x "$_javac_path"; then
3373cdf0e10cSrcweir           JAVAAOTCOMPILER=$_javac_path
3374cdf0e10cSrcweir        fi
3375cdf0e10cSrcweir     fi
3376cdf0e10cSrcweir     if test -z "$JAVAAOTCOMPILER"; then
3377cdf0e10cSrcweir        AC_PATH_PROG(JAVAAOTCOMPILER, $gcjaot)
3378cdf0e10cSrcweir     fi
3379cdf0e10cSrcweir     if test -z "$JAVAAOTCOMPILER"; then
3380897adb27SJürgen Schmidt        AC_MSG_WARN([$gcjaot not found, please use --with-jdk-home])
3381cdf0e10cSrcweir     fi
3382cdf0e10cSrcweir  else
3383cdf0e10cSrcweir     AC_MSG_RESULT([no])
3384cdf0e10cSrcweir  fi
3385cdf0e10cSrcweirfi
3386cdf0e10cSrcweir
3387cdf0e10cSrcweirAC_SUBST(JAVA_HOME)
3388cdf0e10cSrcweirAC_SUBST(JDK)
3389cdf0e10cSrcweirAC_SUBST(JAVAFLAGS)
3390cdf0e10cSrcweirAC_SUBST(JAVAINTERPRETER)
3391cdf0e10cSrcweirAC_SUBST(JAVAIFLAGS)
3392cdf0e10cSrcweirAC_SUBST(JAVACOMPILER)
3393cdf0e10cSrcweirAC_SUBST(JAVAAOTCOMPILER)
3394cdf0e10cSrcweirAC_SUBST(JAVADOC)
3395cdf0e10cSrcweir
3396cdf0e10cSrcweirdnl ===================================================================
3397cdf0e10cSrcweirdnl Checks for specific files.
3398cdf0e10cSrcweirdnl ===================================================================
3399cdf0e10cSrcweir
3400cdf0e10cSrcweirdnl ===================================================================
3401cdf0e10cSrcweirdnl Checks for programs.
3402cdf0e10cSrcweirdnl ===================================================================
3403cdf0e10cSrcweir
3404cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable EPM for packing])
3405cdf0e10cSrcweirif test "$enable_epm" = "yes"; then
3406cdf0e10cSrcweir   AC_MSG_RESULT([yes])
3407cdf0e10cSrcweir   dnl ===================================================================
3408407bc2eeSMatthias Seidel   dnl Check for epm - not needed for Windows
3409cdf0e10cSrcweir   dnl ===================================================================
3410cdf0e10cSrcweir   if test "$_os" != "WINNT"; then
3411cdf0e10cSrcweir      if test -n "$with_epm"; then
3412cdf0e10cSrcweir	      EPM=$with_epm
3413cdf0e10cSrcweir      else
3414cdf0e10cSrcweir         AC_PATH_PROG(EPM, epm, no)
3415cdf0e10cSrcweir      fi
341644a214f4SJürgen Schmidt
341719ce5e0bSAndrea Pescetti      # Override system epm and --with-epm if --with-epm-url is used.
341819ce5e0bSAndrea Pescetti      if test -n "$with_epm_url" ; then
341944a214f4SJürgen Schmidt         # At this moment we can not verify the URL or the content that we want to download.
342044a214f4SJürgen Schmidt       	 EPM_URL=$with_epm_url
342144a214f4SJürgen Schmidt       	 AC_MSG_RESULT([epm will be downloaded and compiled in bootstrap])
342244a214f4SJürgen Schmidt       	 EPM=
3423cdf0e10cSrcweir         echo "EPM will be built."
3424cdf0e10cSrcweir         BUILD_EPM=YES
3425cdf0e10cSrcweir         BUILD_TYPE="$BUILD_TYPE EPM"
3426cdf0e10cSrcweir      else
342744a214f4SJürgen Schmidt         if test "$EPM" = "no" ; then
342805ab2edcSJim 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.])
342905ab2edcSJim Jagielski	      else
343005ab2edcSJim Jagielski	         # Gentoo has some epm which is something different...
343105ab2edcSJim Jagielski            AC_MSG_CHECKING([whether the found EPM is the right EPM])
343205ab2edcSJim Jagielski            if $EPM --version | $GREP "ESP Package Manager" >/dev/null 2>/dev/null; then
343344a214f4SJürgen Schmidt               AC_MSG_RESULT([yes])
343444a214f4SJürgen Schmidt            else
343505ab2edcSJim 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.])
343644a214f4SJürgen Schmidt            fi
343705ab2edcSJim Jagielski            AC_MSG_CHECKING([EPM version])
343805ab2edcSJim Jagielski            EPM_VERSION=`$EPM --version | $GREP 'ESP Package Manager' | cut -d' ' -f5 | $SED -e s/v//`
343905ab2edcSJim Jagielski	         if test "`echo $EPM_VERSION | cut -d'.' -f1`" -ge "5"; then
344005ab2edcSJim Jagielski               AC_MSG_RESULT([OK, >= 5.0])
344144a214f4SJürgen Schmidt               BUILD_EPM=NO
344205ab2edcSJim Jagielski	         else
344305ab2edcSJim Jagielski               AC_MSG_ERROR([too old. EPM >= 5.0.0 is required.])
344405ab2edcSJim Jagielski	         fi
344505ab2edcSJim Jagielski      	fi
3446cdf0e10cSrcweir      fi
3447cdf0e10cSrcweir   fi
3448cdf0e10cSrcweir
3449cdf0e10cSrcweir   # test which package format to use
3450cdf0e10cSrcweir   AC_MSG_CHECKING([which package format to use])
3451cdf0e10cSrcweir
3452cdf0e10cSrcweir   # defaults
3453cdf0e10cSrcweir   case "$_os" in
3454cdf0e10cSrcweir	OS2)
3455cdf0e10cSrcweir		PKGFORMAT=native
3456cdf0e10cSrcweir		;;
3457cdf0e10cSrcweir	Darwin)
3458cdf0e10cSrcweir		PKGFORMAT=dmg
3459cdf0e10cSrcweir		;;
3460cdf0e10cSrcweir	SunOS)
3461cdf0e10cSrcweir		PKGFORMAT=pkg
3462cdf0e10cSrcweir		;;
3463cdf0e10cSrcweir	Linux)
3464cdf0e10cSrcweir      # if building on Debian, default should be deb...
3465cdf0e10cSrcweir      if test -e /etc/debian_version; then
3466cdf0e10cSrcweir         PKGFORMAT=deb
3467cdf0e10cSrcweir      else
3468cdf0e10cSrcweir         PKGFORMAT=rpm
3469cdf0e10cSrcweir      fi
3470cdf0e10cSrcweir		;;
3471cdf0e10cSrcweir	AIX)
3472cdf0e10cSrcweir		PKGFORMAT=aix
3473cdf0e10cSrcweir		;;
3474cdf0e10cSrcweir	*BSD)
3475cdf0e10cSrcweir		PKGFORMAT=bsd
3476cdf0e10cSrcweir		;;
3477cdf0e10cSrcweir	OSF1)
3478cdf0e10cSrcweir		PKGFORMAT=setld
3479cdf0e10cSrcweir		;;
3480cdf0e10cSrcweir    WINNT)
3481cdf0e10cSrcweir        PKGFORMAT=msi
3482cdf0e10cSrcweir        ;;
34839d1669aeSMatthias Seidel	# we never should get here since we check the architecture/os at the beginning,
3484cdf0e10cSrcweir	# but go sure...
3485cdf0e10cSrcweir	*)
3486cdf0e10cSrcweir		AC_MSG_ERROR([unknown system])
3487cdf0e10cSrcweir   esac
3488cdf0e10cSrcweir   if test -n "$with_package_format"; then
3489da2e13d4SMatthias Seidel	for i in $with_package_format; do
3490cdf0e10cSrcweir		case "$i" in
3491cdf0e10cSrcweir			aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
3492cdf0e10cSrcweir			;;
3493cdf0e10cSrcweir		*)
3494cdf0e10cSrcweir			AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
3495cdf0e10cSrcweiraix - AIX software distribution
3496cdf0e10cSrcweirbsd - FreeBSD, NetBSD, or OpenBSD software distribution
3497cdf0e10cSrcweirdepot or swinstall - HP-UX software distribution
3498cdf0e10cSrcweirdeb - Debian software distribution
3499cdf0e10cSrcweirinst or tardist - IRIX software distribution
3500cdf0e10cSrcweirosx - MacOS X software distribution
3501cdf0e10cSrcweirpkg - Solaris software distribution
3502cdf0e10cSrcweirrpm - RedHat software distribution
3503cdf0e10cSrcweirsetld - Tru64 (setld) software distribution
3504cdf0e10cSrcweirnative - "Native" software distribution for the platform
3505cdf0e10cSrcweirportable - Portable software distribution
3506e986c8d8SMatthias SeidelAOO additionally supports:
3507cdf0e10cSrcweirarchive - .tar.gz or .zip
3508cdf0e10cSrcweirdmg - Mac OS X .dmg
3509cdf0e10cSrcweirinstalled - installation tree
3510cdf0e10cSrcweirmsi - Windows .msi
3511da2e13d4SMatthias Seidel			])
3512cdf0e10cSrcweir			;;
3513cdf0e10cSrcweir		esac
3514cdf0e10cSrcweir	done
3515cdf0e10cSrcweir	PKGFORMAT="$with_package_format"
3516cdf0e10cSrcweir   fi
3517cdf0e10cSrcweir   AC_MSG_RESULT([$PKGFORMAT])
3518cdf0e10cSrcweir   if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
3519cdf0e10cSrcweir      AC_MSG_CHECKING([for rpm])
3520cdf0e10cSrcweir      for a in "$RPM" rpmbuild rpm; do
3521cdf0e10cSrcweir         $a --usage >/dev/null 2> /dev/null
3522cdf0e10cSrcweir         if test $? -eq 0; then
3523cdf0e10cSrcweir            RPM=$a
3524cdf0e10cSrcweir            break
3525cdf0e10cSrcweir         else
3526cdf0e10cSrcweir            $a --version >/dev/null 2> /dev/null
3527cdf0e10cSrcweir            if test $? -eq 0; then
3528cdf0e10cSrcweir               RPM=$a
3529cdf0e10cSrcweir               break
3530da2e13d4SMatthias Seidel            fi
3531cdf0e10cSrcweir         fi
3532cdf0e10cSrcweir       done
3533cdf0e10cSrcweir       if test -z "$RPM" ; then
3534cdf0e10cSrcweir          AC_MSG_ERROR([not found])
3535cdf0e10cSrcweir       elif "$RPM" --usage 2>&1 | $EGREP -- -bb >/dev/null; then
3536cdf0e10cSrcweir          RPM_PATH=`which $RPM`
3537cdf0e10cSrcweir          AC_MSG_RESULT([$RPM_PATH])
3538cdf0e10cSrcweir       else
3539cdf0e10cSrcweir          AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
3540cdf0e10cSrcweir       fi
3541cdf0e10cSrcweir   fi
3542cdf0e10cSrcweir   if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
3543cdf0e10cSrcweir      AC_PATH_PROG(DPKG, dpkg, no)
3544cdf0e10cSrcweir      if test "$DPKG" = "no"; then
3545cdf0e10cSrcweir         AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
3546cdf0e10cSrcweir      fi
3547914ff780SJim Jagielski      AC_PATH_PROG(FAKEROOT, fakeroot, no)
3548914ff780SJim Jagielski      if test "$FAKEROOT" = "no"; then
3549b1c6a57bSJim Jagielski         AC_MSG_ERROR([fakeroot needed for deb creation. Install fakeroot.])
3550914ff780SJim Jagielski      fi
3551cdf0e10cSrcweir   fi
3552f3c306a7SAndre Fischer   if echo "$PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
3553cdf0e10cSrcweir      if test "$_os" = "Darwin"; then
35542e39503fSjim         if test "$_osxpkgbuild" = "no"; then
35552e39503fSjim            AC_MSG_CHECKING([for PackageMaker availability])
35562e39503fSjim            if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
35572e39503fSjim               AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
35582e39503fSjim            else
35592e39503fSjim               AC_MSG_RESULT([ok])
35602e39503fSjim            fi
3561cdf0e10cSrcweir         fi
3562cdf0e10cSrcweir      else
3563cdf0e10cSrcweir         AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
3564cdf0e10cSrcweir       fi
3565cdf0e10cSrcweir   fi
3566cdf0e10cSrcweir   if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
3567cdf0e10cSrcweir      AC_PATH_PROG(PKGMK, pkgmk, no)
3568cdf0e10cSrcweir      if test "$PKGMK" = "no"; then
3569cdf0e10cSrcweir         AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
3570cdf0e10cSrcweir      fi
3571cdf0e10cSrcweir   fi
3572cdf0e10cSrcweir   AC_SUBST(RPM)
3573cdf0e10cSrcweir   AC_SUBST(DPKG)
3574914ff780SJim Jagielski   AC_SUBST(FAKEROOT)
3575cdf0e10cSrcweir   AC_SUBST(PKGMK)
3576cdf0e10cSrcweirelse
3577cdf0e10cSrcweir   AC_MSG_RESULT([no])
357844a214f4SJürgen Schmidt   BUILD_EPM=NO
3579cdf0e10cSrcweir   EPM=NO
3580cdf0e10cSrcweir   PKGFORMAT=native
3581cdf0e10cSrcweirfi
358244a214f4SJürgen SchmidtAC_SUBST(BUILD_EPM)
358344a214f4SJürgen SchmidtAC_SUBST(EPM_URL)
3584cdf0e10cSrcweirAC_SUBST(EPM)
3585cdf0e10cSrcweirAC_SUBST(PKGFORMAT)
3586cdf0e10cSrcweir
3587cdf0e10cSrcweirdnl ===================================================================
3588cdf0e10cSrcweirdnl Check for gperf
3589cdf0e10cSrcweirdnl ===================================================================
3590cdf0e10cSrcweirAC_PATH_PROG(GPERF, gperf)
359110e8ff58SPedro Giffuniif test -z "$with_gperf"; then
359210e8ff58SPedro Giffuni    AC_PATH_PROG(GPERF, gperf)
359310e8ff58SPedro Giffuni    if test -z "$GPERF"; then
359410e8ff58SPedro Giffuni       AC_MSG_ERROR([gperf not found but needed. Install it and/or specify --with-gperf=/path/to/it.])
359510e8ff58SPedro Giffuni    fi
359610e8ff58SPedro Giffunielse
359710e8ff58SPedro Giffuni  if test -x "$with_gperf"; then
359810e8ff58SPedro Giffuni    GPERF=$with_gperf
359910e8ff58SPedro Giffuni  else
360010e8ff58SPedro Giffuni    AC_MSG_ERROR([--with-gperf did not point to an executable])
360110e8ff58SPedro Giffuni  fi
3602cdf0e10cSrcweirfi
3603cdf0e10cSrcweirAC_MSG_CHECKING([gperf version])
3604cdf0e10cSrcweirif test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
3605cdf0e10cSrcweir	AC_MSG_RESULT([OK])
360610e8ff58SPedro Giffuni   GPERF=$GPERF
3607cdf0e10cSrcweirelse
3608cdf0e10cSrcweir	AC_MSG_ERROR([too old, you need at least 3.0.0])
3609cdf0e10cSrcweirfi
361010e8ff58SPedro GiffuniAC_SUBST(GPERF)
3611cdf0e10cSrcweir
36128550753cSPedro Giffunidnl ===================================================================
36138550753cSPedro Giffunidnl Check for building stax
36148550753cSPedro Giffunidnl ===================================================================
36158550753cSPedro GiffuniAC_MSG_CHECKING([whether to build the stax])
36168550753cSPedro Giffuniif test -f "./stax/download/stax-1.2.0.jar"; then
36178550753cSPedro Giffuni   BUILD_STAX=NO
36188550753cSPedro Giffuni   AC_MSG_RESULT([no, will use the prebuilt stax/download/stax-1.2.0.jar])
36198550753cSPedro Giffunielse
36208550753cSPedro Giffuni   BUILD_STAX=YES
36218550753cSPedro Giffuni   AC_MSG_RESULT([yes])
36228550753cSPedro Giffunifi
36238550753cSPedro GiffuniAC_SUBST(BUILD_STAX)
36248550753cSPedro Giffuni
3625cdf0e10cSrcweirdnl ===================================================================
3626cdf0e10cSrcweirdnl Check for building ODK
3627cdf0e10cSrcweirdnl ===================================================================
3628cdf0e10cSrcweirAC_MSG_CHECKING([whether to build the ODK])
3629cdf0e10cSrcweirif test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then
3630cdf0e10cSrcweir   AC_MSG_RESULT([yes])
3631cdf0e10cSrcweir   if test "$WITH_JAVA" != "no"; then
3632cdf0e10cSrcweir   AC_MSG_CHECKING([for external/unowinreg/unowinreg.dll])
3633cdf0e10cSrcweir   if ! test -f "./external/unowinreg/unowinreg.dll"; then
3634cdf0e10cSrcweir      HAVE_UNOWINREG_DLL=no
3635cdf0e10cSrcweir   else
3636cdf0e10cSrcweir      HAVE_UNOWINREG_DLL=yes
3637cdf0e10cSrcweir   fi
3638cdf0e10cSrcweir   if test "$HAVE_UNOWINREG_DLL" = "yes"; then
3639cdf0e10cSrcweir      AC_MSG_RESULT([found])
3640cdf0e10cSrcweir      BUILD_UNOWINREG=NO
3641cdf0e10cSrcweir   else
3642cdf0e10cSrcweir      if test "$_os" = "WINNT"; then
3643cdf0e10cSrcweir         AC_MSG_RESULT([not found, will be built])
3644cdf0e10cSrcweir      else
3645cdf0e10cSrcweir         AC_MSG_WARN([not found, will be cross-built using mingw32])
3646cdf0e10cSrcweir      fi
3647cdf0e10cSrcweir      BUILD_UNOWINREG=YES
3648cdf0e10cSrcweir   fi
3649cdf0e10cSrcweir   if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then
3650cdf0e10cSrcweir      if test -z "$WITH_MINGWIN" || test "$WITH_MINGWIN" = "0"; then
3651cdf0e10cSrcweir         AC_MSG_ERROR([for rebuilding unowinreg.dll you need the mingw32 C++ compiler.
3652cdf0e10cSrcweir         Specify mingw32 g++ executable name with --with-mingwin.
3653da2e13d4SMatthias Seidel         Or use prebuilt one from https://tools.openoffice.org/unowinreg_prebuild/680/ and
3654f040151fSAndrea Pescetti         put it into external/unowinreg using your browser or a command equivalent to:
3655da2e13d4SMatthias Seidel         wget -O external/unowinreg/unowinreg.dll https://www.openoffice.org/tools/unowinreg_prebuild/680/unowinreg.dll])
3656cdf0e10cSrcweir      fi
3657cdf0e10cSrcweir      if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
3658cdf0e10cSrcweir         if ! test -x "$WITH_MINGWIN"; then MINGWCXX=false; else MINGWCXX=`basename $WITH_MINGWIN`; fi
3659cdf0e10cSrcweir      else
3660cdf0e10cSrcweir         AC_CHECK_TOOL(MINGWCXX, $WITH_MINGWIN, false)
3661cdf0e10cSrcweir      fi
3662cdf0e10cSrcweir      if test "$MINGWCXX" = "false"; then
3663cdf0e10cSrcweir         AC_MSG_ERROR(specified MinGW32 C++ cross-compiler not found. Install it or correct name.)
3664cdf0e10cSrcweir      fi
3665cdf0e10cSrcweir      AC_MSG_CHECKING(whether we are using the MinGW32 cross C++ compiler)
366628633775SPedro Giffuni      if ! echo "`$MINGWCXX -dumpmachine`" | $GREP -q mingw32; then
3667cdf0e10cSrcweir         AC_MSG_ERROR(no)
3668cdf0e10cSrcweir      else
3669cdf0e10cSrcweir         AC_MSG_RESULT(yes)
3670cdf0e10cSrcweir      fi
3671cdf0e10cSrcweir      if echo "$WITH_MINGWIN" | $EGREP -q "/"; then
3672b63233d8Sdamjan         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
3673cdf0e10cSrcweir      else
3674cdf0e10cSrcweir         AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`, false)
3675cdf0e10cSrcweir      fi
3676cdf0e10cSrcweir      if test "$MINGWSTRIP" = "false"; then
3677cdf0e10cSrcweir         AC_MSG_ERROR(MinGW32 binutils needed. Install them.)
3678cdf0e10cSrcweir      fi
3679cdf0e10cSrcweir      AC_LANG_PUSH([C++])
3680cdf0e10cSrcweir      save_CXX=$CXX
3681cdf0e10cSrcweir      save_CXXCPP=$CXXCPP
3682cdf0e10cSrcweir      CXX=$MINGWCXX
3683cdf0e10cSrcweir      CXXCPP="$MINGWCXX -E"
3684cdf0e10cSrcweir      save_CXXFLAGS=$CXXFLAGS
3685cdf0e10cSrcweir      save_CPPFLAGS=$CPPFLAGS
3686cdf0e10cSrcweir      CXXFLAGS="$CXXFLAGS -I$JAVA_HOME/include"
3687cdf0e10cSrcweir      CPPFLAGS="$CPPFLAGS -I$JAVA_HOME/include"
368807a3d7f1SPedro Giffuni      # LIBS contains -lcrypt etc due to the AC_CHECK_LIBS which obviously
3689cdf0e10cSrcweir      # do not make sense here (and 'd make the check fail)
3690cdf0e10cSrcweir      save_LIBS=$LIBS
3691cdf0e10cSrcweir      LIBS=""
3692cdf0e10cSrcweir      AC_HAVE_LIBRARY(kernel32)
3693cdf0e10cSrcweir      AC_HAVE_LIBRARY(advapi32)
3694cdf0e10cSrcweir      AC_CHECK_HEADER(windows.h, [], [AC_MSG_ERROR([windows.h missing])])
3695cdf0e10cSrcweir      CXXFLAGS=$save_CXXFLAGS
3696cdf0e10cSrcweir      CPPFLAGS=$save_CPPFLAGS
3697cdf0e10cSrcweir      CXX=$save_CXX
3698cdf0e10cSrcweir      CXXCPP=$save_CXXCPP
3699cdf0e10cSrcweir      LIBS=$save_LIBS
3700cdf0e10cSrcweir      AC_LANG_POP([C++])
3701cdf0e10cSrcweir      fi
3702cdf0e10cSrcweir   fi
3703cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE ODK"
3704cdf0e10cSrcweirelse
3705cdf0e10cSrcweir   AC_MSG_RESULT([no])
3706cdf0e10cSrcweir   BUILD_UNOWINREG=NO
3707cdf0e10cSrcweirfi
3708cdf0e10cSrcweirAC_SUBST(BUILD_UNOWINREG)
3709cdf0e10cSrcweirAC_SUBST(MINGWCXX)
3710cdf0e10cSrcweirAC_SUBST(MINGWSTRIP)
3711cdf0e10cSrcweir
3712cdf0e10cSrcweirdnl ===================================================================
3713cdf0e10cSrcweirdnl Check for system stdlibs
3714cdf0e10cSrcweirdnl ===================================================================
3715cdf0e10cSrcweirAC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
3716cdf0e10cSrcweirif test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \
3717cdf0e10cSrcweir   test "$with_system_stdlibs" != "no"; then
3718cdf0e10cSrcweir   AC_MSG_RESULT([no])
3719cdf0e10cSrcweir   SYSTEM_STDLIBS=YES
3720cdf0e10cSrcweirelse
3721cdf0e10cSrcweir   AC_MSG_RESULT([yes])
3722cdf0e10cSrcweir   SYSTEM_STDLIBS=NO
3723cdf0e10cSrcweirfi
3724cdf0e10cSrcweirAC_SUBST(SYSTEM_STDLIBS)
3725cdf0e10cSrcweir
3726cdf0e10cSrcweirdnl ===================================================================
3727cdf0e10cSrcweirdnl Check for system zlib
3728cdf0e10cSrcweirdnl ===================================================================
3729cdf0e10cSrcweirif test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then
3730cdf0e10cSrcweir   with_system_zlib=yes
3731cdf0e10cSrcweirfi
3732cdf0e10cSrcweirAC_MSG_CHECKING([which zlib to use])
3733cdf0e10cSrcweirif test -n "$with_system_zlib" -o -n "$with_system_libs" && \
3734cdf0e10cSrcweir	test "$with_system_zlib" != "no"; then
3735cdf0e10cSrcweir    AC_MSG_RESULT([external])
3736cdf0e10cSrcweir    SYSTEM_ZLIB=YES
3737cdf0e10cSrcweir    AC_CHECK_HEADER(zlib.h, [],
3738cdf0e10cSrcweir        [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
3739cdf0e10cSrcweir    AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
3740cdf0e10cSrcweir        [AC_MSG_ERROR(zlib not found or functional)], [])
3741cdf0e10cSrcweirelse
3742cdf0e10cSrcweir    AC_MSG_RESULT([internal])
3743cdf0e10cSrcweir    SYSTEM_ZLIB=NO
3744cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE ZLIB"
3745cdf0e10cSrcweirfi
3746cdf0e10cSrcweirAC_SUBST(SYSTEM_ZLIB)
3747cdf0e10cSrcweir
3748cdf0e10cSrcweirdnl ===================================================================
3749cdf0e10cSrcweirdnl Check for system jpeg
3750cdf0e10cSrcweirdnl ===================================================================
3751cdf0e10cSrcweirAC_MSG_CHECKING([which jpeg to use])
3752cdf0e10cSrcweirif test -n "$with_system_jpeg" -o -n "$with_system_libs" && \
3753cdf0e10cSrcweir	test "$with_system_jpeg" != "no"; then
3754cdf0e10cSrcweir    AC_MSG_RESULT([external])
3755cdf0e10cSrcweir    SYSTEM_JPEG=YES
3756cdf0e10cSrcweir    AC_CHECK_HEADER(jpeglib.h, [],
3757cdf0e10cSrcweir        [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
3758cdf0e10cSrcweir    AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
3759cdf0e10cSrcweir	[AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
3760cdf0e10cSrcweirelse
3761cdf0e10cSrcweir    AC_MSG_RESULT([internal])
3762cdf0e10cSrcweir    SYSTEM_JPEG=NO
3763cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE JPEG"
3764cdf0e10cSrcweirfi
3765cdf0e10cSrcweirAC_SUBST(SYSTEM_JPEG)
3766cdf0e10cSrcweir
3767cdf0e10cSrcweirdnl ===================================================================
3768cdf0e10cSrcweirdnl Check for system expat
3769cdf0e10cSrcweirdnl ===================================================================
3770cdf0e10cSrcweirAC_MSG_CHECKING([which expat to use])
3771cdf0e10cSrcweirif test -n "$with_system_expat" -o -n "$with_system_libs" && \
3772cdf0e10cSrcweir	test "$with_system_expat" != "no"; then
3773cdf0e10cSrcweir    AC_MSG_RESULT([external])
3774cdf0e10cSrcweir    SYSTEM_EXPAT=YES
3775cdf0e10cSrcweir    AC_CHECK_HEADER(expat.h, [],
3776cdf0e10cSrcweir        [AC_MSG_ERROR(expat.h not found. install expat)], [])
3777cdf0e10cSrcweir    AC_CHECK_LIB(expat, XML_ParserCreate, [],
3778cdf0e10cSrcweir	[AC_MSG_RESULT(expat library not found or functional.)], [])
3779cdf0e10cSrcweirelse
3780cdf0e10cSrcweir    AC_MSG_RESULT([internal])
3781cdf0e10cSrcweir    SYSTEM_EXPAT=NO
3782cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE EXPAT"
3783cdf0e10cSrcweirfi
3784cdf0e10cSrcweirAC_SUBST(SYSTEM_EXPAT)
3785cdf0e10cSrcweir
3786cdf0e10cSrcweirdnl ===================================================================
3787cdf0e10cSrcweirdnl Check whether freetype is available
3788cdf0e10cSrcweirdnl ===================================================================
3789cdf0e10cSrcweirif test  "$test_freetype" = "yes"; then
3790cdf0e10cSrcweir   AC_MSG_CHECKING([whether freetype is available])
3791cdf0e10cSrcweir	PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
3792cdf0e10cSrcweirfi
3793cdf0e10cSrcweirAC_SUBST(FREETYPE_CFLAGS)
3794cdf0e10cSrcweirAC_SUBST(FREETYPE_LIBS)
3795cdf0e10cSrcweir
3796cdf0e10cSrcweirdnl ===================================================================
3797cdf0e10cSrcweirdnl Check whether freetype2 supports emboldening
3798cdf0e10cSrcweirdnl ===================================================================
3799cdf0e10cSrcweirif test  "$test_freetype" = "yes"; then
3800cdf0e10cSrcweir    save_CPPFLAGS="$CPPFLAGS"
3801cdf0e10cSrcweir    save_LDFLAGS="$LDFLAGS"
3802cdf0e10cSrcweir    save_LIBS="$LIBS"
3803cdf0e10cSrcweir    CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
3804cdf0e10cSrcweir    LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
3805cdf0e10cSrcweir    AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
3806cdf0e10cSrcweir                 [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
3807cdf0e10cSrcweir    LDFLAGS="$save_LDFLAGS"
3808cdf0e10cSrcweir    CPPFLAGS="$save_CPPFLAGS"
3809cdf0e10cSrcweir    LIBS="$save_LIBS"
3810cdf0e10cSrcweirfi
3811cdf0e10cSrcweirAC_SUBST(USE_FT_EMBOLDEN)
3812cdf0e10cSrcweir
3813cdf0e10cSrcweirif test -n "$with_system_libxslt" -o -n "$with_system_libs" && \
3814cdf0e10cSrcweir   test "$with_system_libxslt" != "no"; then
3815cdf0e10cSrcweir    if test -z "$with_system_libxml" -a -z "$with_system_libs" || \
3816cdf0e10cSrcweir      test "$with_system_libxml" = "no"; then
3817cdf0e10cSrcweir      # somehow AC_MSG_WARN won't work...
3818cdf0e10cSrcweir       echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml"
3819cdf0e10cSrcweir       echo "to prevent incompatibilities between internal libxml2 and libxslt, the office will be build with system-libxml" >> warn
3820cdf0e10cSrcweir       with_system_libxml=yes
3821cdf0e10cSrcweir    fi
3822cdf0e10cSrcweirfi
3823cdf0e10cSrcweirif test -n "$with_system_libxml" -o -n "$with_system_libs" && \
3824cdf0e10cSrcweir   test "$with_system_libxml" != "no"; then
3825cdf0e10cSrcweir    if test -z "$with_system_libxslt" -a -z "$with_system_libs" || \
3826cdf0e10cSrcweir      test "$with_system_libxslt" = "no"; then
3827cdf0e10cSrcweir      # somehow AC_MSG_WARN won't work...
3828cdf0e10cSrcweir       echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt"
3829cdf0e10cSrcweir       echo "to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt" >> warn
3830cdf0e10cSrcweir       with_system_libxslt=yes
3831cdf0e10cSrcweir    fi
3832cdf0e10cSrcweirfi
3833cdf0e10cSrcweir
3834cdf0e10cSrcweirdnl ===================================================================
3835cdf0e10cSrcweirdnl Check for system libxslt
3836cdf0e10cSrcweirdnl ===================================================================
3837cdf0e10cSrcweirAC_MSG_CHECKING([which libxslt to use])
3838cdf0e10cSrcweirif test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \
3839cdf0e10cSrcweir       "$_os" = "Darwin" && \
3840cdf0e10cSrcweir   test "$with_system_libxslt" != "no"; then
3841cdf0e10cSrcweir   AC_MSG_RESULT([external])
3842cdf0e10cSrcweir   SYSTEM_LIBXSLT=YES
3843cdf0e10cSrcweir
38448ba2f6f7SHerbert Dürr	if test "$_os" != "Darwin"; then
38458ba2f6f7SHerbert Dürr		PKG_CHECK_MODULES(LIBXSLT, libxslt)
38468ba2f6f7SHerbert Dürr	else
38478ba2f6f7SHerbert Dürr		LIBXSLT_CFLAGS=`xslt-config --cflags`
384839ddf648SHerbert Dürr		LIBXSLT_LIBS=`xslt-config --libs`
38498ba2f6f7SHerbert Dürr	fi
3850cdf0e10cSrcweir
3851cdf0e10cSrcweir   dnl Check for xsltproc
3852cdf0e10cSrcweir   AC_PATH_PROG(XSLTPROC, xsltproc, no)
3853cdf0e10cSrcweir   if test "$XSLTPROC" = "no"; then
3854cdf0e10cSrcweir      AC_MSG_ERROR([xsltproc is required])
3855cdf0e10cSrcweir   fi
3856cdf0e10cSrcweirelse
3857cdf0e10cSrcweir   AC_MSG_RESULT([internal])
3858cdf0e10cSrcweir   SYSTEM_LIBXSLT=NO
3859cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE LIBXSLT"
3860cdf0e10cSrcweirfi
3861cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBXSLT)
3862cdf0e10cSrcweirAC_SUBST(LIBXSLT_CFLAGS)
3863cdf0e10cSrcweirAC_SUBST(LIBXSLT_LIBS)
3864cdf0e10cSrcweir
3865cdf0e10cSrcweir
3866cdf0e10cSrcweirdnl ===================================================================
3867cdf0e10cSrcweirdnl Check for system libxml
3868cdf0e10cSrcweirdnl ===================================================================
3869cdf0e10cSrcweirAC_MSG_CHECKING([which libxml to use])
3870cdf0e10cSrcweirif test -n "$with_system_libxml" -o -n "$with_system_libs" -o \
3871cdf0e10cSrcweir            "$_os" = "Darwin" && \
3872cdf0e10cSrcweir	test "$with_system_libxml" != "no"; then
3873cdf0e10cSrcweir    AC_MSG_RESULT([external])
3874cdf0e10cSrcweir    SYSTEM_LIBXML=YES
3875cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE LIBXMLSEC"
38768ba2f6f7SHerbert Dürr
38778ba2f6f7SHerbert Dürr	if test "$_os" != "Darwin"; then
38788ba2f6f7SHerbert Dürr		PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
38798ba2f6f7SHerbert Dürr	else
38808ba2f6f7SHerbert Dürr		LIBXML_CFLAGS=`xml2-config --cflags`
388139ddf648SHerbert Dürr		LIBXML_LIBS=`xml2-config --libs`
38828ba2f6f7SHerbert Dürr	fi
3883cdf0e10cSrcweirelse
3884cdf0e10cSrcweir    AC_MSG_RESULT([internal])
3885cdf0e10cSrcweir    SYSTEM_LIBXML=NO
3886cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC"
3887cdf0e10cSrcweirfi
3888cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBXML)
3889cdf0e10cSrcweirAC_SUBST(LIBXML_CFLAGS)
3890cdf0e10cSrcweirAC_SUBST(LIBXML_LIBS)
3891cdf0e10cSrcweir
389261a3a0ffSHerbert Dürr
389361a3a0ffSHerbert Dürrdnl ===================================================================
3894a835cb2eSJim Jagielskidnl Checks for a MacOS platform SDK compatible with deployment target
389561a3a0ffSHerbert Dürrdnl ===================================================================
389661a3a0ffSHerbert Dürrif test  "$_os" = "Darwin"; then
38970d16e2e7SJim Jagielski   sdk_target=$with_macosx_target
389807a3d7f1SPedro Giffuni   AC_MSG_CHECKING([checking SDK compatibility with OSX $sdk_target])
389961a3a0ffSHerbert Dürr
390063ad6360SHerbert Dürr   sdk_minor=`echo $sdk_target | cut -d"." -f2`
390161a3a0ffSHerbert Dürr
39025fa6f516SJim Jagielski   if test "$sdk_minor" -lt "9"; then
39035fa6f516SJim Jagielski      AC_MSG_ERROR([SDK version < 10.9 is not longer supported])
390461a3a0ffSHerbert Dürr   else
390563ad6360SHerbert Dürr      MACOSX_DEPLOYMENT_TARGET=$sdk_target
3906a835cb2eSJim Jagielski      sdk_path=$with_macosx_sdk
3907a835cb2eSJim Jagielski      if test -z "$sdk_path"; then
3908a835cb2eSJim Jagielski          dnl --macosx-sdk not used (or blank): We look for the SDK
3909a835cb2eSJim Jagielski          dnl Why not MacOSX10.9.sdk? It lacks Python.h (!?)
3910a835cb2eSJim Jagielski          dnl First look for macOS10.x SDKs (Up thru Xcode 12.1)
39115fa6f516SJim Jagielski          sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx10.(10|11|12|13|14|15)" | sed -e "s/.*sdk //" | tail -n1`
3912a835cb2eSJim Jagielski          dnl If not found, look for macOS11.x SDKs (Xcode 12.2 and later)
3913a835cb2eSJim Jagielski          if test -z "$sdk_found"; then
3914f90c0f88SJim Jagielski             sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx11.(0|1)" | sed -e "s/.*sdk //" | tail -n1`
3915a835cb2eSJim Jagielski          fi
3916a835cb2eSJim Jagielski          if test -z "$sdk_found"; then
3917a835cb2eSJim Jagielski             AC_MSG_ERROR([No SDK with OSX $sdk_target compatibility found])
3918a835cb2eSJim Jagielski          else
3919a835cb2eSJim Jagielski             AC_MSG_RESULT([yes, by using SDK $sdk_found])
3920a835cb2eSJim Jagielski          fi
3921a835cb2eSJim Jagielski          sdk_path=`xcodebuild -version -sdk ${sdk_found} Path`
3922a835cb2eSJim Jagielski      elif test ! -d "$sdk_path"; then
3923a835cb2eSJim Jagielski          sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx${sdk_path}" | sed -e "s/.*sdk //" | tail -n1`
3924a835cb2eSJim Jagielski          if test -z "$sdk_found"; then
3925a835cb2eSJim Jagielski             AC_MSG_ERROR([SDK macosx${sdk_path} not found by xcodebuild])
3926a835cb2eSJim Jagielski          else
3927a835cb2eSJim Jagielski             AC_MSG_RESULT([SDK $sdk_found])
3928a835cb2eSJim Jagielski          fi
3929a835cb2eSJim Jagielski          sdk_path=`xcodebuild -version -sdk ${sdk_found} Path`
393061a3a0ffSHerbert Dürr      fi
393161a3a0ffSHerbert Dürr      AC_MSG_CHECKING([for $sdk_path])
393261a3a0ffSHerbert Dürr      if test -d "$sdk_path"; then
393361a3a0ffSHerbert Dürr         AC_MSG_RESULT([yes])
393461a3a0ffSHerbert Dürr      else
3935e4db7d0fSHerbert Dürr         AC_MSG_ERROR([not found!])
393661a3a0ffSHerbert Dürr      fi
393761a3a0ffSHerbert Dürr
393861a3a0ffSHerbert Dürr      MACOSX_SDK_PATH=$sdk_path
3939c4e9543bSJim Jagielski      SDKROOT=$sdk_path
394061a3a0ffSHerbert Dürr   fi
394161a3a0ffSHerbert Dürr
394261a3a0ffSHerbert Dürrfi
394361a3a0ffSHerbert DürrAC_SUBST(MACOSX_DEPLOYMENT_TARGET)
394461a3a0ffSHerbert DürrAC_SUBST(MACOSX_SDK_PATH)
3945c4e9543bSJim JagielskiAC_SUBST(SDKROOT)
394661a3a0ffSHerbert Dürr
394761a3a0ffSHerbert Dürr
3948cdf0e10cSrcweirdnl ===================================================================
3949cdf0e10cSrcweirdnl Check for system python
3950cdf0e10cSrcweirdnl ===================================================================
3951cdf0e10cSrcweirAC_MSG_CHECKING([which python to use])
3952cdf0e10cSrcweirif test "$_os" = "Darwin" && test "$with_system_python" != "no"; then
3953cdf0e10cSrcweir   with_system_python=yes
3954d1c42586SJürgen Schmidt
3955da2e13d4SMatthias Seidel   _python="/Library/Frameworks/Python.framework/Versions/Current/bin/python"
395664ada325SJürgen Schmidt   if test ! -f $_python; then
395764ada325SJürgen Schmidt   	  _python="/usr/bin/python"
395864ada325SJürgen Schmidt   fi
395964ada325SJürgen Schmidt   AC_MSG_RESULT([compiling against system python ($_python)])
396064ada325SJürgen Schmidt
39611fb03631SHerbert Dürr   _python_hexversion=`$_python -c "import sys; print(sys.hexversion);"`
3962da2e13d4SMatthias Seidel
3963b9b58fdaSJürgen Schmidt   dnl hex version of Python 2.7.1 = 34013680
3964434ea190SJürgen Schmidt   if test $_python_hexversion -ge 34013680 ; then
39651e1ac450SHerbert Dürr   	  _python_version=`$_python -c "import sys; print sys.version;" | head -c 3`
3966d1c42586SJürgen Schmidt      AC_MSG_RESULT([compiling against system python (version $_python_version)])
3967d1c42586SJürgen Schmidt
3968d1c42586SJürgen Schmidt	  _python_ver=`$_python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
3969da2e13d4SMatthias Seidel
397064ada325SJürgen Schmidt	  if test -d "/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"; then
397164ada325SJürgen Schmidt	  	 PYTHON_CFLAGS="-I/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"
397261a3a0ffSHerbert Dürr         elif test -d "$MACOSX_SDK_PATH/usr/include/python$_python_ver"; then
397361a3a0ffSHerbert Dürr             PYTHON_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/python$_python_ver"
397464ada325SJürgen Schmidt	  else
397561a3a0ffSHerbert Dürr             PYTHON_CFLAGS="-I$MACOSX_SDK_PATH/System/Library/Frameworks/Python.framework/Versions/$_python_ver/include/python$_python_ver"
397664ada325SJürgen Schmidt	  fi
3977d1c42586SJürgen Schmidt   else
3978b9b58fdaSJürgen Schmidt		AC_MSG_ERROR([Python 2.7.1 or higher is required])
3979d1c42586SJürgen Schmidt   fi
3980d1c42586SJürgen Schmidt
3981cdf0e10cSrcweir   PYTHON_LIBS="-framework Python"
3982cdf0e10cSrcweirelif test -n "$with_system_python" -o -n "$with_system_libs" && \
3983cdf0e10cSrcweir	test "$with_system_python" != "no"; then
3984cdf0e10cSrcweir   with_system_python=yes
3985cdf0e10cSrcweir   AC_MSG_RESULT([external])
39861e1ac450SHerbert Dürr   AM_PATH_PYTHON([2.7])
3987cdf0e10cSrcweir
3988e038f100SPedro Giffuni   python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
3989e038f100SPedro Giffuni   python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
399029195361SDamjan Jovanovic   PKG_CHECK_MODULES(PYTHON, python-$python_version, PYTHON_PC="TRUE", PYTHON_PC="" )
399129195361SDamjan Jovanovic   if test "$PYTHON_PC" != "TRUE"; then
399229195361SDamjan Jovanovic       PYTHON_CFLAGS="-I$python_include"
399329195361SDamjan Jovanovic       PYTHON_LIBS="-lpython$python_version"
399429195361SDamjan Jovanovic   fi
3995cdf0e10cSrcweirfi
3996cdf0e10cSrcweirif test "$with_system_python" = "yes" ; then
3997cdf0e10cSrcweir   SYSTEM_PYTHON=YES
3998cdf0e10cSrcweir   dnl check if the headers really work:
3999cdf0e10cSrcweir   save_CPPFLAGS="$CPPFLAGS"
4000cdf0e10cSrcweir   CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
4001cdf0e10cSrcweir   AC_CHECK_HEADER(Python.h, [],
4002cdf0e10cSrcweir       [AC_MSG_ERROR(Python headers not found)], [])
4003cdf0e10cSrcweir   CPPFLAGS="$save_CPPFLAGS"
4004cdf0e10cSrcweirelse
4005cdf0e10cSrcweir   SYSTEM_PYTHON=NO
4006cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE PYTHON"
4007cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4008cdf0e10cSrcweir   # Embedded python dies without Home set
4009cdf0e10cSrcweir   if test "z$HOME" = "z"; then
4010cdf0e10cSrcweir      export HOME="";
4011cdf0e10cSrcweir   fi
4012cdf0e10cSrcweir   # bz2 tarball and bzip2 is not standard
4013cdf0e10cSrcweir   if test -z "$BZIP2"; then
4014cdf0e10cSrcweir	AC_PATH_PROG( BZIP2, bzip2)
4015cdf0e10cSrcweir	if test -z "$BZIP2"; then
4016cdf0e10cSrcweir   		AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
4017cdf0e10cSrcweir   	fi
4018cdf0e10cSrcweir   fi
4019cdf0e10cSrcweirfi
4020cdf0e10cSrcweirAC_SUBST(SYSTEM_PYTHON)
4021cdf0e10cSrcweirAC_SUBST(PYTHON_CFLAGS)
4022cdf0e10cSrcweirAC_SUBST(PYTHON_LIBS)
4023cdf0e10cSrcweirHOME=`echo $HOME | sed 's:\\\\:/:g'`
4024cdf0e10cSrcweirAC_SUBST(HOME)
4025cdf0e10cSrcweir
4026cdf0e10cSrcweirdnl ===================================================================
4027cdf0e10cSrcweirdnl Check for system lucene
4028cdf0e10cSrcweirdnl ===================================================================
4029cdf0e10cSrcweirAC_MSG_CHECKING([which lucene to use])
4030cdf0e10cSrcweirif test -n "$with_system_lucene" -o -n "$with_system_libs" && \
4031cdf0e10cSrcweir       test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then
4032cdf0e10cSrcweir        AC_MSG_RESULT([external])
4033cdf0e10cSrcweir        SYSTEM_LUCENE=YES
4034cdf0e10cSrcweir        if test -z $LUCENE_CORE_JAR; then
4035da2e13d4SMatthias Seidel          AC_CHECK_FILE(/usr/share/java/lucene-core-2.9.4.jar,
4036ca7d9e04SPedro Giffuni            [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.9.4.jar ],
4037cdf0e10cSrcweir            [
4038da2e13d4SMatthias Seidel              AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
4039cdf0e10cSrcweir                [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
4040da2e13d4SMatthias Seidel                [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
4041cdf0e10cSrcweir                   [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
4042cdf0e10cSrcweir                   [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
4043cdf0e10cSrcweir                  )
4044cdf0e10cSrcweir                ]
4045cdf0e10cSrcweir              )
4046cdf0e10cSrcweir            ]
4047cdf0e10cSrcweir          )
4048cdf0e10cSrcweir        else
4049cdf0e10cSrcweir          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
4050cdf0e10cSrcweir               [AC_MSG_ERROR(lucene-core.jar not found.)], [])
4051cdf0e10cSrcweir        fi
4052cdf0e10cSrcweir
4053cdf0e10cSrcweir        if test -z $LUCENE_ANALYZERS_JAR; then
4054da2e13d4SMatthias Seidel          AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
4055cdf0e10cSrcweir            [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
4056cdf0e10cSrcweir            [
4057da2e13d4SMatthias Seidel              AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
4058cdf0e10cSrcweir                [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
4059cdf0e10cSrcweir                [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
4060cdf0e10cSrcweir              )
4061cdf0e10cSrcweir            ]
4062cdf0e10cSrcweir          )
4063cdf0e10cSrcweir        else
4064cdf0e10cSrcweir          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
4065cdf0e10cSrcweir               [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
4066cdf0e10cSrcweir        fi
4067cdf0e10cSrcweir        AC_MSG_CHECKING([whether lucene is version 2.x])
4068cdf0e10cSrcweir        export LUCENE_CORE_JAR
4069cdf0e10cSrcweir        if $PERL -e 'use Archive::Zip;
4070cdf0e10cSrcweir            my $file = "$ENV{'LUCENE_CORE_JAR'}";
4071cdf0e10cSrcweir            my $zip = Archive::Zip->new( $file );
4072cdf0e10cSrcweir            my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
4073cdf0e10cSrcweir            if ( $mf =~ m/Specification-Version: 2.*/ ) {
4074cdf0e10cSrcweir                exit 0;
4075cdf0e10cSrcweir            } else {
4076cdf0e10cSrcweir                exit 1;
4077cdf0e10cSrcweir            }'; then
4078cdf0e10cSrcweir            AC_MSG_RESULT([yes])
4079cdf0e10cSrcweir         else
40807fb4469bSPedro Giffuni            AC_MSG_RESULT([no])
40817fb4469bSPedro Giffuni            AC_MSG_CHECKING([whether lucene is version 3.x])
40827fb4469bSPedro Giffuni
40837fb4469bSPedro Giffuni            if $PERL -e 'use Archive::Zip;
40847fb4469bSPedro Giffuni                my $file = "$ENV{'LUCENE_CORE_JAR'}";
40857fb4469bSPedro Giffuni                my $zip = Archive::Zip->new( $file );
40867fb4469bSPedro Giffuni                my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
40877fb4469bSPedro Giffuni                if ( $mf =~ m/Specification-Version: 3.*/ ) {
40887fb4469bSPedro Giffuni                    exit 0;
40897fb4469bSPedro Giffuni                } else {
40907fb4469bSPedro Giffuni                    exit 1;
40917fb4469bSPedro Giffuni                }'; then
40927fb4469bSPedro Giffuni                AC_MSG_RESULT([yes])
40937fb4469bSPedro Giffuni             else
40947fb4469bSPedro Giffuni                AC_MSG_ERROR([no, you need lucene 2 or 3])
40957fb4469bSPedro Giffuni             fi
4096cdf0e10cSrcweir         fi
4097cdf0e10cSrcweir
4098cdf0e10cSrcweirelse
4099cdf0e10cSrcweir    AC_MSG_RESULT([internal])
4100cdf0e10cSrcweir    SYSTEM_LUCENE=NO
4101cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE LUCENE"
4102cdf0e10cSrcweirfi
4103cdf0e10cSrcweirAC_SUBST(SYSTEM_LUCENE)
4104cdf0e10cSrcweirAC_SUBST(LUCENE_CORE_JAR)
4105cdf0e10cSrcweirAC_SUBST(LUCENE_ANALYZERS_JAR)
4106cdf0e10cSrcweir
4107cdf0e10cSrcweirAC_MSG_CHECKING([whether to build the MySQL Connector extension])
4108cdf0e10cSrcweirif test -n "$enable_mysql_connector" -a "$enable_mysql_connector" != "no"; then
4109cdf0e10cSrcweir  AC_MSG_RESULT([yes])
4110cdf0e10cSrcweir  ENABLE_MYSQLC=YES
4111cdf0e10cSrcweir  AC_MSG_CHECKING([for mysqlc module])
4112cdf0e10cSrcweir  if test -d mysqlc; then
4113cdf0e10cSrcweir   AC_MSG_RESULT([OK])
4114cdf0e10cSrcweir  else
4115cdf0e10cSrcweir   AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
4116cdf0e10cSrcweir  fi
4117cdf0e10cSrcweir  BUILD_TYPE="$BUILD_TYPE MYSQLC"
4118cdf0e10cSrcweirelse
4119cdf0e10cSrcweir  AC_MSG_RESULT([no])
4120cdf0e10cSrcweir  ENABLE_MYSQLC=NO
4121cdf0e10cSrcweirfi
4122cdf0e10cSrcweirAC_SUBST(ENABLE_MYSQLC)
4123cdf0e10cSrcweir
4124cdf0e10cSrcweirif test "$ENABLE_MYSQLC" = "YES"; then
4125cdf0e10cSrcweirdnl ===================================================================
4126cdf0e10cSrcweirdnl Check for system MySQL
4127cdf0e10cSrcweirdnl ===================================================================
4128cdf0e10cSrcweirAC_MSG_CHECKING([for mysql pre-requisites])
4129cdf0e10cSrcweirif test -n "$with_system_mysql" -o -n "$with_system_libs" && \
4130cdf0e10cSrcweir       test "$with_system_mysql" != "no" && test "$with_system_libs" != "no"; then
4131cdf0e10cSrcweir	AC_MSG_RESULT([external MySQL])
4132cdf0e10cSrcweir	SYSTEM_MYSQL=YES
4133cdf0e10cSrcweir	AC_PATH_PROG( MYSQLCONFIG, mysql_config)
4134cdf0e10cSrcweir	AC_MSG_CHECKING([MySQL version])
413524687b4cSJürgen Schmidt	if test -z "$MYSQLCONFIG" -o ! -x "$MYSQLCONFIG" ; then
413624687b4cSJürgen Schmidt		AC_MSG_ERROR([can not find/execute mysql_config]);
413724687b4cSJürgen Schmidt	fi
4138da2e13d4SMatthias Seidel	MYSQL_VERSION=`$MYSQLCONFIG --version`
4139cdf0e10cSrcweir	MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
4140cdf0e10cSrcweir	if test "$MYSQL_MAJOR" -ge "5"; then
4141cdf0e10cSrcweir		AC_MSG_RESULT([OK])
4142cdf0e10cSrcweir	else
4143cdf0e10cSrcweir		AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
4144cdf0e10cSrcweir	fi
4145cdf0e10cSrcweir	AC_MSG_CHECKING([for MySQL Client library])
4146da2e13d4SMatthias Seidel	MYSQL_INC=`$MYSQLCONFIG --include`
4147cdf0e10cSrcweir	MYSQL_LIB=`$MYSQLCONFIG --libs`
4148cdf0e10cSrcweir	MYSQL_DEFINES=`$MYSQLCONFIG --cflags | sed -e s,$MYSQL_INC,,`
4149cdf0e10cSrcweir	AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
4150cdf0e10cSrcweirelse
4151cdf0e10cSrcweir    SYSTEM_MYSQL=NO
4152cdf0e10cSrcweir    if test -n "$with_libmysql_path"; then
4153cdf0e10cSrcweir        AC_MSG_RESULT([external Connector/C (libmysql)])
4154cdf0e10cSrcweir        LIBMYSQL=libmysql.so
4155cdf0e10cSrcweir        if test "$_os" = "Darwin"; then
4156cdf0e10cSrcweir            LIBMYSQL=libmysql.dylib
4157cdf0e10cSrcweir        elif test "$_os" = "WINNT"; then
4158cdf0e10cSrcweir            LIBMYSQL=libmysql.dll
4159cdf0e10cSrcweir        fi
4160cdf0e10cSrcweir        AC_MSG_CHECKING([for $LIBMYSQL])
4161cdf0e10cSrcweir        if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
4162cdf0e10cSrcweir            AC_MSG_RESULT([found.])
4163cdf0e10cSrcweir            LIBMYSQL_PATH=$with_libmysql_path
4164cdf0e10cSrcweir        else
4165cdf0e10cSrcweir            AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
4166cdf0e10cSrcweir        fi
4167cdf0e10cSrcweir    else
4168cdf0e10cSrcweir        AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
4169cdf0e10cSrcweir    fi
4170cdf0e10cSrcweirfi
4171cdf0e10cSrcweirAC_SUBST(SYSTEM_MYSQL)
4172cdf0e10cSrcweirAC_SUBST(MYSQL_INC)
4173cdf0e10cSrcweirAC_SUBST(MYSQL_LIB)
4174cdf0e10cSrcweirAC_SUBST(MYSQL_DEFINES)
4175cdf0e10cSrcweirAC_SUBST(LIBMYSQL_PATH)
4176cdf0e10cSrcweir
4177cdf0e10cSrcweirAC_LANG_PUSH([C++])
4178cdf0e10cSrcweirdnl ===================================================================
4179cdf0e10cSrcweirdnl Check for system MySQL C++ Connector
4180cdf0e10cSrcweirdnl ===================================================================
4181cdf0e10cSrcweir# FIXME!
4182cdf0e10cSrcweir# who thought this too-generic cppconn dir was a good idea?
4183cdf0e10cSrcweirAC_MSG_CHECKING([MySQL Connector/C++])
4184cdf0e10cSrcweirif test -n "$with_system_mysql_cppconn" -o -n "$with_system_libs" && \
4185cdf0e10cSrcweir		test "$with_system_mysql_cppconn" != "no" && test "$with_system_libs" != "no"; then
4186cdf0e10cSrcweir	AC_MSG_RESULT([external])
4187cdf0e10cSrcweir	SYSTEM_MYSQL_CPPCONN=YES
4188cdf0e10cSrcweir        AC_LANG_PUSH([C++])
4189cdf0e10cSrcweir	AC_CHECK_HEADER(mysql_driver.h, [],
4190cdf0e10cSrcweir					[AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
4191cdf0e10cSrcweir	AC_CHECK_LIB(mysqlcppconn, main, [],
4192cdf0e10cSrcweir					[AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
4193cdf0e10cSrcweir   AC_MSG_CHECKING([version])
4194cdf0e10cSrcweir      AC_TRY_RUN([
4195cdf0e10cSrcweir#include <mysql_driver.h>
4196cdf0e10cSrcweir
4197cdf0e10cSrcweirint main(int argc, char **argv) {
4198cdf0e10cSrcweir	sql::Driver *driver;
4199cdf0e10cSrcweir	driver = get_driver_instance();
4200cdf0e10cSrcweir	if (driver->getMajorVersion() > 1 || \
4201cdf0e10cSrcweir	   (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
4202da2e13d4SMatthias Seidel	   (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
4203cdf0e10cSrcweir        return 0;
4204cdf0e10cSrcweir      else
4205cdf0e10cSrcweir        return 1;
4206cdf0e10cSrcweir}
4207cdf0e10cSrcweir      ], [AC_MSG_RESULT(OK)], [AC_MSG_ERROR([not suitable, we need >= 1.0.6])])
4208cdf0e10cSrcweir        AC_LANG_POP([C++])
4209cdf0e10cSrcweir
4210cdf0e10cSrcweirelse
421124687b4cSJürgen Schmidt	AC_MSG_RESULT([no])
421224687b4cSJürgen Schmidt	SYSTEM_MYSQL_CPPCONN=
4213cdf0e10cSrcweirfi
4214cdf0e10cSrcweirAC_LANG_POP([C++])
4215cdf0e10cSrcweirAC_SUBST(SYSTEM_MYSQL_CPPCONN)
4216cdf0e10cSrcweirfi
4217cdf0e10cSrcweir
4218cdf0e10cSrcweirdnl ===================================================================
4219cdf0e10cSrcweirdnl Check for system hsqldb
4220cdf0e10cSrcweirdnl ===================================================================
4221cdf0e10cSrcweirAC_MSG_CHECKING([which hsqldb to use])
4222cdf0e10cSrcweirif test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \
4223cdf0e10cSrcweir       test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then
4224cdf0e10cSrcweir        AC_MSG_RESULT([external])
4225cdf0e10cSrcweir        SYSTEM_HSQLDB=YES
4226cdf0e10cSrcweir        if test -z $HSQLDB_JAR; then
4227cdf0e10cSrcweir               HSQLDB_JAR=/usr/share/java/hsqldb.jar
4228cdf0e10cSrcweir        fi
4229cdf0e10cSrcweir        AC_CHECK_FILE($HSQLDB_JAR, [],
4230cdf0e10cSrcweir               [AC_MSG_ERROR(hsqldb.jar not found.)], [])
4231cdf0e10cSrcweir        AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
4232cdf0e10cSrcweir        export HSQLDB_JAR
4233cdf0e10cSrcweir        if $PERL -e 'use Archive::Zip;
4234cdf0e10cSrcweir            my $file = "$ENV{'HSQLDB_JAR'}";
4235cdf0e10cSrcweir            my $zip = Archive::Zip->new( $file );
4236cdf0e10cSrcweir            my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
4237cdf0e10cSrcweir            if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
4238cdf0e10cSrcweir               push @l, split(/\n/, $mf);
4239cdf0e10cSrcweir               foreach my $line (@l) {
4240cdf0e10cSrcweir                  if ($line =~ m/Specification-Version:/) {
4241cdf0e10cSrcweir                      ($t, $version) = split (/:/,$line);
4242cdf0e10cSrcweir                      $version =~ s/^\s//;
4243cdf0e10cSrcweir                      ($a, $b, $c, $d) = split (/\./,$version);
4244cdf0e10cSrcweir                      if ($c == "0" && $d > "8")  {
4245cdf0e10cSrcweir                          exit 0;
4246cdf0e10cSrcweir                      } else {
4247cdf0e10cSrcweir                          exit 1;
4248cdf0e10cSrcweir                      }
4249cdf0e10cSrcweir                  }
4250cdf0e10cSrcweir               }
4251cdf0e10cSrcweir            } else {
4252cdf0e10cSrcweir                exit 1;
4253cdf0e10cSrcweir            }'; then
4254cdf0e10cSrcweir            AC_MSG_RESULT([yes])
4255cdf0e10cSrcweir         else
4256cdf0e10cSrcweir            AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
4257cdf0e10cSrcweir         fi
4258cdf0e10cSrcweirelse
4259cdf0e10cSrcweir    AC_MSG_RESULT([internal])
4260cdf0e10cSrcweir    SYSTEM_HSQLDB=NO
4261cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE HSQLDB"
4262cdf0e10cSrcweirfi
4263cdf0e10cSrcweirAC_SUBST(SYSTEM_HSQLDB)
4264cdf0e10cSrcweirAC_SUBST(HSQLDB_JAR)
4265cdf0e10cSrcweir
4266cdf0e10cSrcweirdnl ===================================================================
4267cdf0e10cSrcweirdnl Check for system beanshell
4268cdf0e10cSrcweirdnl ===================================================================
42699ef65f0eSAndre FischerENABLE_BEANSHELL=YES
4270cdf0e10cSrcweirAC_MSG_CHECKING([which beanshell to use])
4271cdf0e10cSrcweirif test -n "$with_system_beanshell" -o -n "$with_system_libs" && \
4272cdf0e10cSrcweir       test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then
4273cdf0e10cSrcweir        AC_MSG_RESULT([external])
4274cdf0e10cSrcweir        SYSTEM_BSH=YES
4275cdf0e10cSrcweir        if test -z $BSH_JAR; then
4276cdf0e10cSrcweir               BSH_JAR=/usr/share/java/bsh.jar
4277cdf0e10cSrcweir        fi
4278cdf0e10cSrcweir        AC_CHECK_FILE($BSH_JAR, [],
4279cdf0e10cSrcweir               [AC_MSG_ERROR(bsh.jar not found.)], [])
42809ef65f0eSAndre Fischerelif test "x$enable_beanshell" = "xyes"; then
4281cdf0e10cSrcweir    AC_MSG_RESULT([internal])
4282cdf0e10cSrcweir    SYSTEM_BSH=NO
4283cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE BSH"
42849ef65f0eSAndre Fischerelse
42859ef65f0eSAndre Fischer    AC_MSG_RESULT([none (disabled)])
42869ef65f0eSAndre Fischer    SYSTEM_BSH=NO
42879ef65f0eSAndre Fischer    ENABLE_BEANSHELL=NO
4288cdf0e10cSrcweirfi
4289cdf0e10cSrcweirAC_SUBST(SYSTEM_BSH)
4290cdf0e10cSrcweirAC_SUBST(BSH_JAR)
42919ef65f0eSAndre FischerAC_SUBST(ENABLE_BEANSHELL)
4292cdf0e10cSrcweir
4293cdf0e10cSrcweir
4294cdf0e10cSrcweirdnl ===================================================================
4295da2e13d4SMatthias Seideldnl Check for saxon. It can come from two different places:
4296da2e13d4SMatthias Seideldnl - pre-installed on the system. This is checked when the --with-system-saxon
42979ef65f0eSAndre Fischerdnl   option is given to configure.
42989ef65f0eSAndre Fischerdnl   The exact place can be specified with the --with-saxon-jar=<path> option.
4299da2e13d4SMatthias Seideldnl - From the saxon tar ball in ext_sources/. This is used when --enable-saxon
43009ef65f0eSAndre Fischerdnl   is given to configure but not any of --with-system-saxon or --with-saxon-jar.
4301cdf0e10cSrcweirdnl ===================================================================
43029ef65f0eSAndre FischerDISABLE_SAXON=
4303cdf0e10cSrcweirAC_MSG_CHECKING([which saxon to use])
4304cdf0e10cSrcweirif test -n "$with_system_saxon" -o -n "$with_system_libs" && \
4305cdf0e10cSrcweir       test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then
4306cdf0e10cSrcweir        AC_MSG_RESULT([external])
4307cdf0e10cSrcweir        SYSTEM_SAXON=YES
4308cdf0e10cSrcweir        if test -z $SAXON_JAR; then
4309da2e13d4SMatthias Seidel          AC_CHECK_FILE(/usr/share/java/saxon9.jar,
4310cdf0e10cSrcweir            [ SAXON_JAR=/usr/share/java/saxon9.jar ],
4311cdf0e10cSrcweir            [
4312da2e13d4SMatthias Seidel              AC_CHECK_FILE(/usr/share/java/saxon.jar,
4313cdf0e10cSrcweir                [ SAXON_JAR=/usr/share/java/saxon.jar ],
4314cdf0e10cSrcweir                [ AC_CHECK_FILE(/usr/share/java/saxon9.jar,
4315cdf0e10cSrcweir                    [ SAXON_JAR=/usr/share/java/saxon9.jar ],
4316cdf0e10cSrcweir                    [ AC_MSG_ERROR(saxon.jar replacement not found)]
4317cdf0e10cSrcweir                  )
4318cdf0e10cSrcweir                ]
4319cdf0e10cSrcweir              )
4320cdf0e10cSrcweir            ]
4321cdf0e10cSrcweir          )
4322cdf0e10cSrcweir        else
4323cdf0e10cSrcweir          AC_CHECK_FILE($SAXON_JAR, [],
4324cdf0e10cSrcweir               [AC_MSG_ERROR(saxon.jar replacement not found.)], [])
4325cdf0e10cSrcweir        fi
4326cdf0e10cSrcweir        if test -n "$SERIALIZER_JAR"; then
4327cdf0e10cSrcweir          AC_CHECK_FILE($SERIALIZER_JAR, [],
4328cdf0e10cSrcweir               [AC_MSG_ERROR(serializer.jar not found.)], [])
4329cdf0e10cSrcweir          AC_SUBST(SERIALIZER_JAR)
4330cdf0e10cSrcweir        fi
4331cdf0e10cSrcweir
4332cdf0e10cSrcweirdnl Saxon comes in two practically available versions, the out-of-date saxonb which
4333e986c8d8SMatthias Seideldnl supports the java extensions that AOO uses, and the up-to-date saxon he
4334cdf0e10cSrcweirdnl "home edition" version, which is crippled to not support those java extensions.
4335e986c8d8SMatthias Seideldnl And as an aside the he one also needs to be tweaked to include
4336cdf0e10cSrcweirdnl a META-INF/services to broadcast that it supports the jaxp transform factory
4337cdf0e10cSrcweir
4338cdf0e10cSrcweir        AC_MSG_CHECKING([if saxon works])
4339cdf0e10cSrcweir        cat > saxontest.java <<_ACEOF
4340cdf0e10cSrcweir[import javax.xml.transform.TransformerFactory;
4341cdf0e10cSrcweirimport javax.xml.transform.Transformer;
4342cdf0e10cSrcweirimport javax.xml.transform.stream.StreamSource;
4343cdf0e10cSrcweirimport java.io.*;
4344cdf0e10cSrcweir
4345cdf0e10cSrcweirimport net.sf.saxon.FeatureKeys;
4346cdf0e10cSrcweir
4347cdf0e10cSrcweirclass saxontest {
4348cdf0e10cSrcweir    public static void main(String[] args) {
4349cdf0e10cSrcweir      System.setProperty("javax.xml.transform.TransformerFactory",
4350cdf0e10cSrcweir        "net.sf.saxon.TransformerFactoryImpl");
4351cdf0e10cSrcweir      try {
4352cdf0e10cSrcweir        TransformerFactory tfactory = TransformerFactory.newInstance();
4353cdf0e10cSrcweir	// some external saxons (Debian, Ubuntu, ...) have this disabled
4354cdf0e10cSrcweir	// per default
4355cdf0e10cSrcweir	tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
4356cdf0e10cSrcweir        System.out.println("TransformerFactory is" +
4357cdf0e10cSrcweir          tfactory.getClass().getName());
4358cdf0e10cSrcweir        Transformer transformer = tfactory.newTransformer(
4359cdf0e10cSrcweir          new StreamSource(new File(args[0])));
4360cdf0e10cSrcweir      } catch(Exception e){
4361cdf0e10cSrcweir        e.printStackTrace(System.err);
4362cdf0e10cSrcweir        System.exit(-1);
4363cdf0e10cSrcweir      }
4364cdf0e10cSrcweir      System.exit(0);
4365cdf0e10cSrcweir    }
4366cdf0e10cSrcweir}
4367cdf0e10cSrcweir]
4368cdf0e10cSrcweir_ACEOF
4369cdf0e10cSrcweir        cat > saxontest.xsl<<_ACEOF
4370cdf0e10cSrcweir[<?xml version="1.0" encoding="UTF-8"?>
4371cdf0e10cSrcweir<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4372cdf0e10cSrcweir <xsl:template match="/">
4373cdf0e10cSrcweir  <xsl:value-of select="math:sqrt(1)" xmlns:math="java:java.lang.Math"/>
4374cdf0e10cSrcweir </xsl:template>
4375cdf0e10cSrcweir</xsl:stylesheet>
4376cdf0e10cSrcweir]
4377cdf0e10cSrcweir_ACEOF
4378cdf0e10cSrcweir        javac_cmd="$JAVACOMPILER -cp $SAXON_JAR saxontest.java 1>&2"
4379cdf0e10cSrcweir        AC_TRY_EVAL(javac_cmd)
4380cdf0e10cSrcweir        if test $? = 0 && test -f ./saxontest.class ; then
4381cdf0e10cSrcweir            java_cmd="$JAVAINTERPRETER -cp $SAXON_JAR:. saxontest saxontest.xsl 1>&2"
4382cdf0e10cSrcweir            AC_TRY_EVAL(java_cmd)
4383cdf0e10cSrcweir            if test $? = 0; then
4384cdf0e10cSrcweir              AC_MSG_RESULT([yes])
4385cdf0e10cSrcweir            else
4386cdf0e10cSrcweir              cat saxontest.java >&5
4387cdf0e10cSrcweir              AC_MSG_RESULT([no])
4388cdf0e10cSrcweir              AC_MSG_ERROR([Non-functional saxon jar, e.g. crippled saxon-he instead of saxonb])
4389cdf0e10cSrcweir            fi
4390cdf0e10cSrcweir        else
4391cdf0e10cSrcweir          AC_MSG_RESULT([no])
4392cdf0e10cSrcweir          cat saxontest.java >&5
4393cdf0e10cSrcweir          AC_MSG_ERROR([saxontest could not be compiled, non-functional saxon jar])
4394cdf0e10cSrcweir        fi
43959ef65f0eSAndre Fischerelif test "x$enable_saxon" = "xyes"; then
4396cdf0e10cSrcweir    AC_MSG_RESULT([internal])
4397cdf0e10cSrcweir    SYSTEM_SAXON=NO
43989ef65f0eSAndre Fischer    BUILD_TYPE="$BUILD_TYPE SAXON"
43999ef65f0eSAndre Fischerelse
44009ef65f0eSAndre Fischer    AC_MSG_RESULT([none (disabled)])
44019ef65f0eSAndre Fischer    SYSTEM_SAXON=NO
44029ef65f0eSAndre Fischer    DISABLE_SAXON=YES
4403cdf0e10cSrcweirfi
4404cdf0e10cSrcweirAC_SUBST(SYSTEM_SAXON)
4405cdf0e10cSrcweirAC_SUBST(SAXON_JAR)
44069ef65f0eSAndre FischerAC_SUBST(DISABLE_SAXON)
4407cdf0e10cSrcweir
44089ef65f0eSAndre Fischer
44099ef65f0eSAndre Fischerdnl ===================================================================
44109ef65f0eSAndre Fischerdnl Check for rhino
44119ef65f0eSAndre Fischerdnl ===================================================================
44129ef65f0eSAndre FischerENABLE_JAVASCRIPT=
44139ef65f0eSAndre FischerAC_MSG_CHECKING([whether to enable support for JavaScript])
44149ef65f0eSAndre Fischerif test "x$enable_javascript" = "xyes"; then
44159ef65f0eSAndre Fischer   BUILD_TYPE="$BUILD_TYPE RHINO"
44169ef65f0eSAndre Fischer   AC_MSG_RESULT([yes])
44179ef65f0eSAndre Fischer   ENABLE_JAVASCRIPT=YES
44189ef65f0eSAndre Fischerelse
44199ef65f0eSAndre Fischer   AC_MSG_RESULT([no])
44209ef65f0eSAndre Fischer   ENABLE_JAVASCRIPT=NO
44210ea1a209SEike Rathkefi
44229ef65f0eSAndre FischerAC_SUBST(ENABLE_JAVASCRIPT)
44239ef65f0eSAndre Fischer
4424cdf0e10cSrcweir
4425fdf35928SAndre Fischerdnl ===================================================================
4426fdf35928SAndre Fischerdnl Check for system apr
4427fdf35928SAndre Fischerdnl ===================================================================
4428fdf35928SAndre FischerSYSTEM_APR=NO
4429fdf35928SAndre FischerAPR_CFLAGS=
4430fdf35928SAndre FischerAPR_LIBS=
4431fdf35928SAndre FischerAC_MSG_CHECKING([which libapr to use])
4432fdf35928SAndre Fischerif test "x$with_system_apr" = "xyes" -o -n "$with_system_libs"; then
4433fdf35928SAndre Fischer    AC_MSG_RESULT([system])
4434fdf35928SAndre Fischer    PKG_CHECK_MODULES([APR], [apr-1 >= 1.0])
4435fdf35928SAndre Fischer    SYSTEM_APR=YES
4436fdf35928SAndre Fischerelse
4437fdf35928SAndre Fischer    AC_MSG_RESULT([internal])
4438fdf35928SAndre Fischer    SYSTEM_APR=NO
4439fdf35928SAndre Fischer    BUILD_TYPE="$BUILD_TYPE APR"
4440fdf35928SAndre Fischerfi
4441fdf35928SAndre FischerAC_SUBST(SYSTEM_APR)
4442fdf35928SAndre FischerAC_SUBST(APR_CFLAGS)
4443fdf35928SAndre FischerAC_SUBST(APR_LIBS)
4444fdf35928SAndre Fischer
4445fdf35928SAndre Fischer
4446fdf35928SAndre Fischerdnl ===================================================================
4447fdf35928SAndre Fischerdnl Check for system apr-util
4448fdf35928SAndre Fischerdnl ===================================================================
444958b02f87SAndre FischerSYSTEM_APR_UTIL=NO
445058b02f87SAndre FischerAPR_UTIL_CFLAGS=
445158b02f87SAndre FischerAPR_UTIL_LIBS=
4452fdf35928SAndre FischerAC_MSG_CHECKING([which libapr-util to use])
4453fdf35928SAndre Fischerif test "x$with_system_apr_util" = "xyes" -o -n "$with_system_libs"; then
4454fdf35928SAndre Fischer    AC_MSG_RESULT([system])
445558b02f87SAndre Fischer    PKG_CHECK_MODULES([APR_UTIL], [apr-util-1 >= 1.0])
445658b02f87SAndre Fischer    SYSTEM_APR_UTIL=YES
4457fdf35928SAndre Fischerelse
4458fdf35928SAndre Fischer    AC_MSG_RESULT([internal])
445958b02f87SAndre Fischer    SYSTEM_APR_UTIL=NO
4460fdf35928SAndre Fischer    BUILD_TYPE="$BUILD_TYPE APR_UTIL"
4461fdf35928SAndre Fischerfi
446258b02f87SAndre FischerAC_SUBST(SYSTEM_APR_UTIL)
446358b02f87SAndre FischerAC_SUBST(APR_UTIL_CFLAGS)
446458b02f87SAndre FischerAC_SUBST(APR_UTIL_LIBS)
4465fdf35928SAndre Fischer
4466fdf35928SAndre Fischer
4467fdf35928SAndre Fischerdnl ===================================================================
4468fdf35928SAndre Fischerdnl Check for system serf
4469fdf35928SAndre Fischerdnl ===================================================================
4470fdf35928SAndre FischerSYSTEM_SERF=NO
4471fdf35928SAndre FischerSERF_CFLAGS=
4472fdf35928SAndre FischerSERF_LIBS=
4473fdf35928SAndre FischerAC_MSG_CHECKING([which libserf to use])
4474cfd1b5f7SAndrea Pescettiif test -n "$with_system_serf" -o -n "$with_system_libs" && \
4475cfd1b5f7SAndrea Pescetti  test "$with_system_serf" != "no"; then
4476fdf35928SAndre Fischer    AC_MSG_RESULT([system])
4477fdf35928SAndre Fischer    PKG_CHECK_MODULES([SERF], [serf-1 >= 1.1])
4478fdf35928SAndre Fischer    SYSTEM_SERF=YES
4479fdf35928SAndre Fischerelse
4480fdf35928SAndre Fischer    AC_MSG_RESULT([internal])
4481fdf35928SAndre Fischer    SYSTEM_SERF=NO
4482fdf35928SAndre Fischer    BUILD_TYPE="$BUILD_TYPE SERF"
4483fdf35928SAndre Fischerfi
4484fdf35928SAndre FischerAC_SUBST(SYSTEM_SERF)
4485fdf35928SAndre FischerAC_SUBST(SERF_CFLAGS)
4486fdf35928SAndre FischerAC_SUBST(SERF_LIBS)
4487fdf35928SAndre Fischer
4488fdf35928SAndre Fischer
448927b2fc91SAndre Fischerdnl ===================================================================
449027b2fc91SAndre Fischerdnl Check for CoinMP
449127b2fc91SAndre Fischerdnl ===================================================================
449227b2fc91SAndre FischerENABLE_COINMP=
4493fdf35928SAndre FischerSYSTEM_COINMP=NO
4494fdf35928SAndre FischerCOINMP_CFLAGS=
4495fdf35928SAndre FischerCOINMP_LIBS=
449627b2fc91SAndre FischerAC_MSG_CHECKING([whether to enable support for CoinMP])
449727b2fc91SAndre Fischerif test "x$enable_coinmp" = "xyes"; then
4498fdf35928SAndre Fischer    BUILD_TYPE="$BUILD_TYPE COINMP"
4499fdf35928SAndre Fischer    AC_MSG_RESULT([yes])
4500fdf35928SAndre Fischer    ENABLE_COINMP=YES
4501fdf35928SAndre Fischer
4502940681c7SMatthias Seidel    dnl Check whether to use system or internal CoinMP
4503fdf35928SAndre Fischer    AC_MSG_CHECKING([which coinmp to use])
4504fdf35928SAndre Fischer    if test "x$with_system_coinmp" = "xyes" -o -n "$with_system_libs"; then
4505fdf35928SAndre Fischer        AC_MSG_RESULT([system])
4506fdf35928SAndre Fischer	PKG_CHECK_MODULES([COINMP], [coinmp])
4507fdf35928SAndre Fischer        SYSTEM_COINMP=YES
4508fdf35928SAndre Fischer        # some systems need this. Like Ubuntu....
4509fdf35928SAndre Fischer        AC_CHECK_LIB(m, floor)
4510fdf35928SAndre Fischer        AC_CHECK_LIB(dl, dlopen)
4511fdf35928SAndre Fischer    else
4512fdf35928SAndre Fischer        AC_MSG_RESULT([internal])
4513fdf35928SAndre Fischer        SYSTEM_COINMP=NO
4514fdf35928SAndre Fischer        BUILD_TYPE="$BUILD_TYPE COINMP"
4515fdf35928SAndre Fischer    fi
451627b2fc91SAndre Fischerelse
4517fdf35928SAndre Fischer    AC_MSG_RESULT([no])
4518fdf35928SAndre Fischer    ENABLE_COINMP=NO
451927b2fc91SAndre Fischerfi
452027b2fc91SAndre FischerAC_SUBST(ENABLE_COINMP)
4521fdf35928SAndre FischerAC_SUBST(SYSTEM_COINMP)
4522fdf35928SAndre FischerAC_SUBST(COINMP_CFLAGS)
4523fdf35928SAndre FischerAC_SUBST(COINMP_LIBS)
452427b2fc91SAndre Fischer
452527b2fc91SAndre Fischer
4526cdf0e10cSrcweirdnl ===================================================================
4527cdf0e10cSrcweirdnl Check for system curl
4528cdf0e10cSrcweirdnl ===================================================================
4529cdf0e10cSrcweirif test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then
4530cdf0e10cSrcweir   with_system_curl=yes
4531cdf0e10cSrcweirfi
4532cdf0e10cSrcweirAC_MSG_CHECKING([which curl to use])
4533cdf0e10cSrcweirif test -n "$with_system_curl" -o -n "$with_system_libs" && \
4534cdf0e10cSrcweir	test "$with_system_curl" != "no"; then
4535cdf0e10cSrcweir   AC_MSG_RESULT([external])
4536cdf0e10cSrcweir   SYSTEM_CURL=YES
4537cdf0e10cSrcweir
4538cdf0e10cSrcweir   AC_PATH_PROG( CURLCONFIG, curl-config)
4539cdf0e10cSrcweir   if test -z "$CURLCONFIG"; then
4540cdf0e10cSrcweir      AC_MSG_ERROR([install curl to run this script])
4541cdf0e10cSrcweir   fi
4542cdf0e10cSrcweir
4543cdf0e10cSrcweir   # check curl version
4544cdf0e10cSrcweir   AC_MSG_CHECKING([whether curl is >= 7.13.1])
4545cdf0e10cSrcweir   if test "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $1 }'`" -gt "7" -a \
4546cdf0e10cSrcweir	"`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $2 }'`" -gt "13" -a \
4547da2e13d4SMatthias Seidel	"`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $3 }'`" -gt "1"; then
4548cdf0e10cSrcweir      AC_MSG_ERROR([no, you need at least curl 7.13,1])
4549cdf0e10cSrcweir   else
4550cdf0e10cSrcweir      AC_MSG_RESULT([yes])
4551cdf0e10cSrcweir   fi
4552cdf0e10cSrcweir   CURL_LIBS=`$CURLCONFIG --libs`
4553cdf0e10cSrcweir   CURL_CFLAGS=`$CURLCONFIG --cflags`
4554cdf0e10cSrcweirelse
4555cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4556cdf0e10cSrcweir   SYSTEM_CURL=NO
4557cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE CURL"
4558cdf0e10cSrcweirfi
4559cdf0e10cSrcweirAC_SUBST(SYSTEM_CURL)
4560cdf0e10cSrcweirAC_SUBST(CURL_CFLAGS)
4561cdf0e10cSrcweirAC_SUBST(CURL_LIBS)
4562cdf0e10cSrcweir
4563cdf0e10cSrcweirdnl ===================================================================
4564cdf0e10cSrcweirdnl Check for system mdds
4565cdf0e10cSrcweirdnl ===================================================================
4566cdf0e10cSrcweirAC_MSG_CHECKING([which mdds to use])
4567cdf0e10cSrcweirif test -n "$with_system_mdds" -o -n "$with_system_headers" && \
4568cdf0e10cSrcweir	test "$with_system_mdds" != "no"; then
4569cdf0e10cSrcweir    AC_MSG_RESULT([external])
4570cdf0e10cSrcweir    SYSTEM_MDDS=YES
4571cdf0e10cSrcweir    AC_LANG_PUSH([C++])
4572cdf0e10cSrcweir    AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
4573cdf0e10cSrcweir        [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
4574cdf0e10cSrcweir    AC_LANG_POP([C++])
4575cdf0e10cSrcweirelse
4576cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4577cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE MDDS"
4578cdf0e10cSrcweir   SYSTEM_MDDS=NO
4579cdf0e10cSrcweirfi
4580cdf0e10cSrcweirAC_SUBST(SYSTEM_MDDS)
4581cdf0e10cSrcweir
4582cdf0e10cSrcweirdnl ===================================================================
4583cdf0e10cSrcweirdnl Check for system boost
4584cdf0e10cSrcweirdnl ===================================================================
4585cdf0e10cSrcweirAC_MSG_CHECKING([which boost to use])
4586cdf0e10cSrcweirif test -n "$with_system_boost" -o -n "$with_system_headers" && \
4587cdf0e10cSrcweir	test "$with_system_boost" != "no"; then
4588cdf0e10cSrcweir   AC_MSG_RESULT([external])
4589cdf0e10cSrcweir   SYSTEM_BOOST=YES
4590cdf0e10cSrcweir   AC_LANG_PUSH([C++])
4591cdf0e10cSrcweir   AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
4592cdf0e10cSrcweir       [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
4593cdf0e10cSrcweir   AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
4594cdf0e10cSrcweir       [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
4595cdf0e10cSrcweir   AC_CHECK_HEADER(boost/function.hpp, [],
4596cdf0e10cSrcweir       [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
4597cdf0e10cSrcweir
4598cdf0e10cSrcweir   save_CXXFLAGS=$CXXFLAGS
4599cdf0e10cSrcweir   CXXFLAGS="$CXXFLAGS -fno-exceptions"
4600cdf0e10cSrcweir   AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
4601cdf0e10cSrcweir   AC_TRY_COMPILE([#include <boost/function.hpp>
4602cdf0e10cSrcweir], [],
4603cdf0e10cSrcweir   ac_cv_cxx_boost_no_exceptons_broken=no, ac_cv_cxx_boost_no_exceptons_broken=yes)
4604cdf0e10cSrcweir
4605cdf0e10cSrcweir   if test "$ac_cv_cxx_boost_no_exceptons_broken" = "yes"; then
4606cdf0e10cSrcweir	AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
4607cdf0e10cSrcweir   else
4608cdf0e10cSrcweir  	AC_MSG_RESULT([yes])
4609cdf0e10cSrcweir   fi
4610cdf0e10cSrcweir   CXXFLAGS=$save_CXXFLAGS
4611cdf0e10cSrcweir   AC_LANG_POP([C++])
4612cdf0e10cSrcweirelse
4613cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4614cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE BOOST"
4615cdf0e10cSrcweir   SYSTEM_BOOST=NO
4616cdf0e10cSrcweirfi
4617cdf0e10cSrcweirAC_SUBST(SYSTEM_BOOST)
4618cdf0e10cSrcweir
4619cdf0e10cSrcweirdnl ===================================================================
4620cdf0e10cSrcweirdnl Check for system vigra
4621cdf0e10cSrcweirdnl ===================================================================
4622cdf0e10cSrcweirAC_MSG_CHECKING([which vigra to use])
4623cdf0e10cSrcweirif test -n "$with_system_vigra" -o -n "$with_system_headers" && \
4624cdf0e10cSrcweir	test "$with_system_vigra" != "no"; then
4625cdf0e10cSrcweir   AC_MSG_RESULT([external])
4626cdf0e10cSrcweir   SYSTEM_VIGRA=YES
4627cdf0e10cSrcweir   AC_LANG_PUSH([C++])
4628cdf0e10cSrcweir   AC_CHECK_HEADER(vigra/copyimage.hxx, [],
4629cdf0e10cSrcweir       [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
4630cdf0e10cSrcweir   AC_LANG_POP([C++])
4631cdf0e10cSrcweirelse
4632cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4633cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE VIGRA"
4634cdf0e10cSrcweir   SYSTEM_VIGRA=NO
4635cdf0e10cSrcweirfi
4636cdf0e10cSrcweirAC_SUBST(SYSTEM_VIGRA)
4637cdf0e10cSrcweir
4638cdf0e10cSrcweirdnl ===================================================================
4639cdf0e10cSrcweirdnl Check for system odbc
4640cdf0e10cSrcweirdnl ===================================================================
4641cdf0e10cSrcweirAC_MSG_CHECKING([which odbc headers to use])
4642cdf0e10cSrcweirif test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \
4643cdf0e10cSrcweir	test "$with_system_odbc_headers" != "no"; then
4644cdf0e10cSrcweir   AC_MSG_RESULT([external])
4645cdf0e10cSrcweir   SYSTEM_ODBC_HEADERS=YES
4646cdf0e10cSrcweir
4647cdf0e10cSrcweir   AC_CHECK_HEADER(sqlext.h, [],
4648cdf0e10cSrcweir      [AC_MSG_ERROR(odbc not found. install odbc)], [])
4649cdf0e10cSrcweirelse
4650cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4651cdf0e10cSrcweir   SYSTEM_ODBC_HEADERS=NO
4652cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE UNIXODBC"
4653cdf0e10cSrcweirfi
4654cdf0e10cSrcweirAC_SUBST(SYSTEM_ODBC_HEADERS)
4655cdf0e10cSrcweir
4656cdf0e10cSrcweirAC_MSG_CHECKING([whether to build XML Security support])
465706f2ef55SHerbert Dürrif test "$enable_nss_module" = "no"; then
465806f2ef55SHerbert Dürr   AC_MSG_RESULT([no, since NSS disabled but needed])
4659cdf0e10cSrcweirelse
4660cdf0e10cSrcweir   AC_MSG_RESULT([yes])
4661cdf0e10cSrcweirfi
4662cdf0e10cSrcweir
4663cdf0e10cSrcweirAC_MSG_CHECKING([whether to build LDAP configuration backend])
4664cdf0e10cSrcweirif test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then
466506f2ef55SHerbert Dürr   if test "$with_openldap" = "yes"; then
4666cdf0e10cSrcweir      AC_MSG_RESULT([yes])
4667cdf0e10cSrcweir      WITH_LDAP=YES
4668cdf0e10cSrcweir   else
4669cdf0e10cSrcweir      WITH_LDAP=NO
4670cdf0e10cSrcweir   fi
4671cdf0e10cSrcweirelse
4672cdf0e10cSrcweir   AC_MSG_RESULT([no])
4673cdf0e10cSrcweir   WITH_LDAP=NO
4674cdf0e10cSrcweirfi
4675cdf0e10cSrcweir
4676cdf0e10cSrcweirif test "$WITH_LDAP" = "YES"; then
4677cdf0e10cSrcweir   dnl ===================================================================
467806f2ef55SHerbert Dürr   dnl Test whether we want to use the OpenLDAP LDAP SDK
4679cdf0e10cSrcweir   dnl ===================================================================
4680cdf0e10cSrcweir   AC_MSG_CHECKING([which LDAP SDK to use])
4681cdf0e10cSrcweir   if test -n "$with_openldap" && test "$with_openldap" != "no"; then
4682cdf0e10cSrcweir  	   AC_MSG_RESULT([OpenLDAP])
4683cdf0e10cSrcweir	   WITH_OPENLDAP=YES
4684cdf0e10cSrcweir	   AC_CHECK_HEADERS(ldap.h, [],
4685cdf0e10cSrcweir		   [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
4686cdf0e10cSrcweir	   AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
4687cdf0e10cSrcweir		   [AC_MSG_ERROR(openldap lib not found or functional)], [])
4688cdf0e10cSrcweir	   # rumours say that OpenLDAP doesn't have that function. I looked and
4689cdf0e10cSrcweir	   # it has it. Test for it to be sure
4690cdf0e10cSrcweir         AC_CHECK_LIB(ldap, ldap_set_option, [],
4691cdf0e10cSrcweir                [AC_MSG_ERROR(openldap lib not found or functional)], [])
4692cdf0e10cSrcweir   fi
4693cdf0e10cSrcweirfi
4694cdf0e10cSrcweirAC_SUBST(WITH_LDAP)
4695cdf0e10cSrcweirAC_SUBST(WITH_OPENLDAP)
4696cdf0e10cSrcweir
46976f8e4455SHerbert DürrAC_MSG_CHECKING([whether to build the internal NSS module])
4698cdf0e10cSrcweirif test "$enable_nss_module" != "no"; then
4699cdf0e10cSrcweir   ENABLE_NSS_MODULE="YES"
4700cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE NSS"
4701cdf0e10cSrcweir   AC_MSG_RESULT([yes])
4702cdf0e10cSrcweir   if test "$_os" = "WINNT"; then
4703cdf0e10cSrcweir      AC_MSG_CHECKING([for Mozilla build tooling])
4704cdf0e10cSrcweir      if test -z "$MOZILLABUILD" ; then
47056f8e4455SHerbert DürrAC_MSG_ERROR([
47066f8e4455SHerbert DürrMozilla build tooling not found!
47076f8e4455SHerbert Dürr  It is required for NSS that is needed for AOO's security facilities.
47086f8e4455SHerbert Dürr  Either disable NSS using the option --disable-nss-module
47096f8e4455SHerbert Dürr  or use the --with-mozilla-build option after installing the tool obtained
4710da2e13d4SMatthias Seidel  from https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/])
4711cdf0e10cSrcweir      else
4712cdf0e10cSrcweir         if test \( "$WITH_MINGWIN" = "yes" \) ; then
4713cdf0e10cSrcweir            if test ! -d "$MOZILLABUILD" ; then
4714cdf0e10cSrcweirAC_MSG_ERROR([Mozilla build tooling incomplete!])
4715cdf0e10cSrcweir            else
4716cdf0e10cSrcweir               AC_MSG_RESULT([ok])
4717cdf0e10cSrcweir            fi
4718cdf0e10cSrcweir         else
4719c4e06ec6SMatthias Seidel            if test ! -d "$MOZILLABUILD/msys" ; then
4720cdf0e10cSrcweirAC_MSG_ERROR([Mozilla build tooling incomplete!])
4721cdf0e10cSrcweir            else
4722cdf0e10cSrcweir               AC_MSG_RESULT([ok])
4723cdf0e10cSrcweir            fi
4724cdf0e10cSrcweir         fi
4725cdf0e10cSrcweir      fi
4726cdf0e10cSrcweir   fi
4727cdf0e10cSrcweirelse
4728cdf0e10cSrcweir   ENABLE_NSS_MODULE="NO"
4729cdf0e10cSrcweir   AC_MSG_RESULT([no])
4730cdf0e10cSrcweirfi
4731cdf0e10cSrcweir
4732cdf0e10cSrcweirAC_SUBST(ENABLE_NSS_MODULE)
4733cdf0e10cSrcweirAC_SUBST(MOZILLABUILD)
4734cdf0e10cSrcweirAC_SUBST(MOZ_INC)
4735cdf0e10cSrcweir
4736cdf0e10cSrcweirdnl ===================================================================
4737cdf0e10cSrcweirdnl Check for system sane
4738cdf0e10cSrcweirdnl ===================================================================
4739cdf0e10cSrcweirAC_MSG_CHECKING([which sane header to use])
4740cdf0e10cSrcweirif test -n "$with_system_sane_header" -o -n "$with_system_headers" && \
4741cdf0e10cSrcweir	test "$with_system_sane_header" != "no"; then
4742cdf0e10cSrcweir   AC_MSG_RESULT([external])
4743cdf0e10cSrcweir   SYSTEM_SANE_HEADER=YES
4744cdf0e10cSrcweir   AC_CHECK_HEADER(sane/sane.h, [],
4745cdf0e10cSrcweir      [AC_MSG_ERROR(sane not found. install sane)], [])
4746cdf0e10cSrcweirelse
4747cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4748cdf0e10cSrcweir   SYSTEM_SANE_HEADER=NO
4749cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE SANE"
4750cdf0e10cSrcweirfi
4751cdf0e10cSrcweirAC_SUBST(SYSTEM_SANE_HEADER)
4752cdf0e10cSrcweir
4753cdf0e10cSrcweirdnl ===================================================================
4754cdf0e10cSrcweirdnl Check for system icu
4755cdf0e10cSrcweirdnl ===================================================================
4756cdf0e10cSrcweirAC_MSG_CHECKING([which icu to use])
4757cdf0e10cSrcweirif test -n "$with_system_icu" -o -n "$with_system_libs" && \
4758cdf0e10cSrcweir	test "$with_system_icu" != "no"; then
4759cdf0e10cSrcweir   AC_MSG_RESULT([external])
4760cdf0e10cSrcweir   SYSTEM_ICU=YES
4761cdf0e10cSrcweir   AC_LANG_PUSH([C++])
4762cdf0e10cSrcweir   AC_MSG_CHECKING([for unicode/rbbi.h])
4763cdf0e10cSrcweir   AC_TRY_CPP(unicode/rbbi.h, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([icu headers not found.]))
4764cdf0e10cSrcweir   AC_LANG_POP([C++])
4765cdf0e10cSrcweir   AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
4766cdf0e10cSrcweir   if test -z "$SYSTEM_GENBRK"; then
4767cdf0e10cSrcweir      AC_MSG_ERROR([\"genbrk\" not found in \$PATH, install the icu development tool \"genbrk"\])
4768cdf0e10cSrcweir   fi
4769cdf0e10cSrcweir   AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin])
4770cdf0e10cSrcweir   if test -z "$SYSTEM_GENCCODE"; then
4771cdf0e10cSrcweir      AC_MSG_ERROR([\"genccode\" not found in \$PATH, install the icu development tool \"genccode"\])
4772cdf0e10cSrcweir   fi
4773cdf0e10cSrcweir   AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin])
4774cdf0e10cSrcweir   if test -z "$SYSTEM_GENCMN"; then
4775cdf0e10cSrcweir      AC_MSG_ERROR([\"gencmn\" not found in \$PATH, install the icu development tool \"gencmn"\])
4776cdf0e10cSrcweir   fi
4777cdf0e10cSrcweir
4778cdf0e10cSrcweir   AC_PATH_PROG( ICUCONFIG, icu-config)
4779cdf0e10cSrcweir   AC_MSG_CHECKING([ICU version])
478086bbd642SYuri Dario   if test "$_os" = "OS2"; then
478186bbd642SYuri Dario      ICU_MAJOR=4
478286bbd642SYuri Dario   else
478386bbd642SYuri Dario      ICU_VERSION=`$ICUCONFIG --version`
478486bbd642SYuri Dario      ICU_MAJOR=`$ICUCONFIG --version | cut -d"." -f1`
478586bbd642SYuri Dario      ICU_MINOR=`$ICUCONFIG --version | cut -d"." -f2`
478686bbd642SYuri Dario      ICU_MICRO=`$ICUCONFIG --version | cut -d"." -f3`
478786bbd642SYuri Dario   fi
4788cdf0e10cSrcweir
4789cdf0e10cSrcweir   if test "$ICU_MAJOR" -ge "4"; then
4790cdf0e10cSrcweir      AC_MSG_RESULT([OK])
4791cdf0e10cSrcweir   else
4792cdf0e10cSrcweir      AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
4793cdf0e10cSrcweir   fi
4794cdf0e10cSrcweir
4795cdf0e10cSrcweirelse
4796cdf0e10cSrcweir    AC_MSG_RESULT([internal])
4797cdf0e10cSrcweir    SYSTEM_ICU=NO
4798cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE ICU"
4799cdf0e10cSrcweirfi
4800cdf0e10cSrcweirAC_SUBST(SYSTEM_ICU)
4801cdf0e10cSrcweirAC_SUBST(SYSTEM_GENBRK)
4802cdf0e10cSrcweirAC_SUBST(SYSTEM_GENCCODE)
4803cdf0e10cSrcweirAC_SUBST(SYSTEM_GENCMN)
4804cdf0e10cSrcweirAC_SUBST(ICU_MAJOR)
4805cdf0e10cSrcweirAC_SUBST(ICU_MINOR)
4806cdf0e10cSrcweirAC_SUBST(ICU_MICRO)
4807cdf0e10cSrcweir
4808cdf0e10cSrcweirdnl ===================================================================
4809cdf0e10cSrcweirdnl Graphite
4810cdf0e10cSrcweirdnl ===================================================================
4811cdf0e10cSrcweir
48129ef65f0eSAndre FischerENABLE_GRAPHITE="FALSE"
4813cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable graphite support])
4814539e46a3SPedro Giffuniif test "x$enable_graphite" = "xyes" -a \( "$_os" = "WINNT" -o "$_os" = "Linux" -o "$_os" = "FreeBSD" \) ; then
4815cdf0e10cSrcweir    AC_MSG_RESULT([yes])
4816cdf0e10cSrcweir    ENABLE_GRAPHITE="TRUE"
4817cdf0e10cSrcweir    AC_MSG_CHECKING([which graphite to use])
4818cdf0e10cSrcweir    if test -n "$with_system_graphite" -o -n "$with_system_libs" && \
4819cdf0e10cSrcweir        test "$with_system_graphite" != "no"; then
4820cdf0e10cSrcweir        AC_MSG_RESULT([external])
4821cdf0e10cSrcweir        SYSTEM_GRAPHITE=YES
4822cdf0e10cSrcweir        PKG_CHECK_MODULES( GRAPHITE, silgraphite )
4823cdf0e10cSrcweir    else
4824cdf0e10cSrcweir        AC_MSG_RESULT([internal])
4825cdf0e10cSrcweir        SYSTEM_GRAPHITE=NO
4826cdf0e10cSrcweir        BUILD_TYPE="$BUILD_TYPE GRAPHITE"
4827cdf0e10cSrcweir    fi
4828cdf0e10cSrcweirelse
4829cdf0e10cSrcweir   AC_MSG_RESULT([no])
48309ef65f0eSAndre Fischer   ENABLE_GRAPHITE="FALSE"
4831cdf0e10cSrcweirfi
4832cdf0e10cSrcweirAC_SUBST(ENABLE_GRAPHITE)
4833cdf0e10cSrcweirAC_SUBST(SYSTEM_GRAPHITE)
4834cdf0e10cSrcweirAC_SUBST(GRAPHITE_LIBS)
4835cdf0e10cSrcweirAC_SUBST(GRAPHITE_CFLAGS)
4836cdf0e10cSrcweir
483761a3a0ffSHerbert Dürr
4838cdf0e10cSrcweirdnl ===================================================================
4839cdf0e10cSrcweirdnl Checks for libraries.
4840cdf0e10cSrcweirdnl ===================================================================
4841cdf0e10cSrcweirdnl Check for Mac OS X native GUI, which may is now required; the X11 build is no longer supported
4842cdf0e10cSrcweirdnl See if we have the AppKit framework for building with Quartz graphics.
4843cdf0e10cSrcweir
4844cdf0e10cSrcweirif test  "$_os" = "Darwin"; then
4845cdf0e10cSrcweir   if test "x$with_x" = "xyes"; then
4846cdf0e10cSrcweir      AC_MSG_ERROR([X11 build is no longer supported on MacOSX, please use the native aqua build])
4847cdf0e10cSrcweir   else
4848cdf0e10cSrcweir      AC_MSG_CHECKING([for /System/Library/Frameworks/AppKit.framework])
4849cdf0e10cSrcweir      if test -d "/System/Library/Frameworks/AppKit.framework/"; then
4850cdf0e10cSrcweir         AC_MSG_RESULT([yes])
4851cdf0e10cSrcweir         x_includes="no_x_includes"
4852cdf0e10cSrcweir         x_libraries="no_x_libraries"
4853cdf0e10cSrcweir         dnl disable some things used on other Unix versions but not on the aqua build
4854cdf0e10cSrcweir         enable_gtk=no
4855cdf0e10cSrcweir         enable_cups=no
4856cdf0e10cSrcweir         ENABLE_CUPS=""
4857cdf0e10cSrcweir         AC_SUBST(ENABLE_CUPS)
4858cdf0e10cSrcweir      else
4859cdf0e10cSrcweir         AC_MSG_ERROR([No AppKit.framewrok found])
4860cdf0e10cSrcweir      fi
4861cdf0e10cSrcweir   fi
4862cdf0e10cSrcweirfi
4863cdf0e10cSrcweir
4864cdf0e10cSrcweirdnl ***************************************
4865cdf0e10cSrcweirdnl testing for X libraries and includes...
4866cdf0e10cSrcweirdnl ***************************************
4867cdf0e10cSrcweirif test "$_os" = "Darwin" -a "x$x_includes" = "xno_x_includes"; then
4868cdf0e10cSrcweir   echo "Do Nothing for _os = Darwin"
4869cdf0e10cSrcweir   dnl Mac OS X using Aqua graphics. Don't check for X11.
4870cdf0e10cSrcweir   :
4871cdf0e10cSrcweirelif test "$_os" = "OS2" ; then
4872cdf0e10cSrcweir   echo "Do Nothing for _os = OS2. Don't check for X11."
4873cdf0e10cSrcweir   dnl OS/2 uses native graphics. Don't check for X11.
4874cdf0e10cSrcweir   :
4875cdf0e10cSrcweirelif test "$_os" != "WINNT" ; then
4876cdf0e10cSrcweir   AC_PATH_X
4877cdf0e10cSrcweir   AC_PATH_XTRA
4878cdf0e10cSrcweir   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4879cdf0e10cSrcweir
4880cdf0e10cSrcweir   if test "x$x_includes" = "x"; then
4881cdf0e10cSrcweir     x_includes="default_x_includes"
4882cdf0e10cSrcweir   fi
4883cdf0e10cSrcweir   if test "x$x_libraries" = "x"; then
4884cdf0e10cSrcweir     x_libraries="default_x_libraries"
4885cdf0e10cSrcweir   fi
4886cdf0e10cSrcweir   dnl The variables $x_libraries and $x_includes are set.
4887cdf0e10cSrcweir   if test -z "$x_libraries"; then
4888cdf0e10cSrcweir      AC_MSG_ERROR([No X libraries found]) # Exit
4889cdf0e10cSrcweir   fi
4890cdf0e10cSrcweir   if test -z "$x_includes"; then
4891cdf0e10cSrcweir      AC_MSG_ERROR([No X includes found]) # Exit
4892cdf0e10cSrcweir   fi
4893cdf0e10cSrcweir   CFLAGS=$X_CFLAGS
4894cdf0e10cSrcweir   LDFLAGS="$X_LDFLAGS $X_LIBS"
4895cdf0e10cSrcweir   AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
4896cdf0e10cSrcweir   dnl Check if the XauDisposeAuth symbol is provided by libXau.
4897cdf0e10cSrcweir   AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
4898cdf0e10cSrcweirelse
4899cdf0e10cSrcweir   x_includes="no_x_includes"
4900cdf0e10cSrcweir   x_libraries="no_x_libraries"
4901cdf0e10cSrcweirfi
4902cdf0e10cSrcweirif test -z "$x_includes"; then
4903cdf0e10cSrcweir   x_includes="no_x_includes"
4904cdf0e10cSrcweirfi
4905cdf0e10cSrcweirif test -z "$x_libraries"; then
4906cdf0e10cSrcweir   x_libraries="no_x_libraries"
4907cdf0e10cSrcweirfi
4908cdf0e10cSrcweirif test "$x_includes" = "default_x_includes"; then
4909cdf0e10cSrcweir   XINC="/usr/include"
4910cdf0e10cSrcweirelse
4911cdf0e10cSrcweir   XINC="$x_includes"
4912cdf0e10cSrcweirfi
4913cdf0e10cSrcweirAC_SUBST(XINC)
4914cdf0e10cSrcweirif test "$x_libraries" = "default_x_libraries"; then
4915cdf0e10cSrcweir   XLIB=`$PKG_CONFIG --variable=libdir x11`
4916cdf0e10cSrcweir   if test "x$XLIB" = x; then
4917cdf0e10cSrcweir         XLIB="/usr/lib"
4918cdf0e10cSrcweir   fi
4919cdf0e10cSrcweirelse
4920cdf0e10cSrcweir   XLIB="$x_libraries"
4921cdf0e10cSrcweirfi
4922cdf0e10cSrcweirAC_SUBST(XLIB)
4923cdf0e10cSrcweirAC_SUBST(XAU_LIBS)
4924cdf0e10cSrcweir
4925cdf0e10cSrcweirdnl ===================================================================
4926da2e13d4SMatthias Seideldnl Check if fontconfig/fontconfig.h is available
4927cdf0e10cSrcweirdnl ===================================================================
4928cdf0e10cSrcweirif test "$ENABLE_FONTCONFIG" = "TRUE" ; then
4929cdf0e10cSrcweir    AC_CHECK_HEADER(fontconfig/fontconfig.h, [],
4930cdf0e10cSrcweir                    [AC_MSG_ERROR([fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?])], [])
4931cdf0e10cSrcweir    AC_MSG_CHECKING([whether fontconfig is >= 2.2.0])
4932cdf0e10cSrcweir    AC_TRY_RUN([
4933cdf0e10cSrcweir#include <fontconfig/fontconfig.h>
4934cdf0e10cSrcweir
4935cdf0e10cSrcweirint main(int argc, char **argv) {
4936cdf0e10cSrcweir	if(FC_MAJOR > 2 || (FC_MAJOR == 2 && FC_MINOR >= 2)) return 0;
4937cdf0e10cSrcweir	else return 1;
4938cdf0e10cSrcweir}
4939cdf0e10cSrcweir], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, fontconfig >= 2.2.0 needed])])
4940cdf0e10cSrcweirfi
4941cdf0e10cSrcweir
4942cdf0e10cSrcweirdnl ===================================================================
4943cdf0e10cSrcweirdnl Check for system Xrender
4944cdf0e10cSrcweirdnl ===================================================================
4945cdf0e10cSrcweirAC_MSG_CHECKING([whether to link to Xrender])
4946cdf0e10cSrcweirif test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then
4947cdf0e10cSrcweir   AC_MSG_RESULT([yes])
4948cdf0e10cSrcweir   XRENDER_LINK=YES
4949cdf0e10cSrcweir   with_system_xrender_headers=yes
4950cdf0e10cSrcweirelse
4951cdf0e10cSrcweir   AC_MSG_RESULT([no, dynamically open it])
4952cdf0e10cSrcweir   XRENDER_LINK=NO
4953cdf0e10cSrcweirfi
4954cdf0e10cSrcweirAC_MSG_CHECKING([which Xrender headers to use])
4955cdf0e10cSrcweirif test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \
4956cdf0e10cSrcweir	test "$with_system_xrender_headers" != "no"; then
4957cdf0e10cSrcweir   AC_MSG_RESULT([external])
4958cdf0e10cSrcweir   SYSTEM_XRENDER_HEADERS=YES
4959cdf0e10cSrcweir   AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
4960cdf0e10cSrcweir      [AC_MSG_ERROR(Xrender not found. install X)], [])
4961cdf0e10cSrcweirelse
4962cdf0e10cSrcweir   AC_MSG_RESULT([internal])
4963cdf0e10cSrcweir   SYSTEM_XRENDER_HEADERS=NO
4964cdf0e10cSrcweir   BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
4965cdf0e10cSrcweirfi
4966cdf0e10cSrcweirif test "$XRENDER_LINK" = "YES"; then
4967cdf0e10cSrcweir   AC_CHECK_LIB(Xrender, XRenderQueryVersion, [],
4968cdf0e10cSrcweir      [AC_MSG_ERROR(libXrender not found or functional)], [])
4969cdf0e10cSrcweirfi
4970cdf0e10cSrcweirAC_SUBST(SYSTEM_XRENDER_HEADERS)
4971cdf0e10cSrcweirAC_SUBST(XRENDER_LINK)
4972cdf0e10cSrcweir
4973cdf0e10cSrcweirdnl ===================================================================
4974cdf0e10cSrcweirdnl Check for XRandr
4975cdf0e10cSrcweirdnl ===================================================================
4976cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable RandR support])
4977cdf0e10cSrcweirif test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then
4978cdf0e10cSrcweir   if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
4979cdf0e10cSrcweir	  XRANDR_DLOPEN="TRUE"
4980cdf0e10cSrcweir	  AC_MSG_RESULT([resorting to dlopen libXrandr at runtime])
4981cdf0e10cSrcweir   else
4982cdf0e10cSrcweir	  XRANDR_DLOPEN="FALSE"
4983cdf0e10cSrcweir      PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
4984cdf0e10cSrcweir      if test "$ENABLE_RANDR" != "TRUE"; then
4985cdf0e10cSrcweir         AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
4986cdf0e10cSrcweir                        [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
4987cdf0e10cSrcweir         XRANDR_CFLAGS=" "
4988cdf0e10cSrcweir         AC_CHECK_LIB(Xrandr, XRRQueryExtension, [],
4989cdf0e10cSrcweir              [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
4990cdf0e10cSrcweir         XRANDR_LIBS="-lXrandr "
4991cdf0e10cSrcweir         ENABLE_RANDR="TRUE"
4992cdf0e10cSrcweir	     AC_MSG_RESULT([enabling RandR support])
4993cdf0e10cSrcweir      fi
4994cdf0e10cSrcweir   fi
4995cdf0e10cSrcweirelse
4996cdf0e10cSrcweir   ENABLE_RANDR=""
4997cdf0e10cSrcweir   AC_MSG_RESULT([no])
4998cdf0e10cSrcweirfi
4999cdf0e10cSrcweirAC_SUBST(XRANDR_DLOPEN)
5000cdf0e10cSrcweirAC_SUBST(XRANDR_CFLAGS)
5001cdf0e10cSrcweirAC_SUBST(XRANDR_LIBS)
5002cdf0e10cSrcweirAC_SUBST(ENABLE_RANDR)
5003cdf0e10cSrcweir
50040021cf80SHerbert Dürrdnl ===================================================================
50050021cf80SHerbert Dürrdnl Check for system nss
50060021cf80SHerbert Dürrdnl ===================================================================
50070021cf80SHerbert DürrAC_MSG_CHECKING([which libnss to use])
50080021cf80SHerbert Dürrif test -n "$with_system_nss" -o -n "$with_system_libs" && test "$with_system_nss" != "no"; then
50090021cf80SHerbert Dürr    AC_MSG_RESULT([external])
50100021cf80SHerbert Dürr    PKG_CHECK_MODULES( NSS, nss )
50110021cf80SHerbert Dürr    SYSTEM_NSS=YES
50120021cf80SHerbert Dürrelse
50130021cf80SHerbert Dürr    AC_MSG_RESULT([internal])
50140021cf80SHerbert Dürr    SYSTEM_NSS=NO
50150021cf80SHerbert Dürr    BUILD_TYPE="$BUILD_TYPE NSS"
50160021cf80SHerbert Dürrfi
50170021cf80SHerbert DürrAC_SUBST(SYSTEM_NSS)
50180021cf80SHerbert DürrAC_SUBST(NSS_CFLAGS)
50190021cf80SHerbert DürrAC_SUBST(NSS_LIBS)
50200021cf80SHerbert Dürr
5021cdf0e10cSrcweirdnl ===================================================================
5022cdf0e10cSrcweirdnl Check for system openssl
5023cdf0e10cSrcweirdnl ===================================================================
5024cdf0e10cSrcweirAC_MSG_CHECKING([which libssl to use])
5025cdf0e10cSrcweirif test -n "$with_system_openssl" -o -n "$with_system_libs" && \
5026cdf0e10cSrcweir        test "$with_system_openssl" != "no"; then
5027cdf0e10cSrcweir    AC_MSG_RESULT([external])
5028239c1b90SJim Jagielski    if test "$_os" = "FreeBSD"; then
5029cdf0e10cSrcweir        OPENSSL_CFLAGS=
5030cdf0e10cSrcweir        OPENSSL_LIBS="-lssl -lcrypto"
5031cdf0e10cSrcweir    else
5032cdf0e10cSrcweir    	PKG_CHECK_MODULES( OPENSSL, openssl )
5033cdf0e10cSrcweir    fi
5034cdf0e10cSrcweir    SYSTEM_OPENSSL=YES
5035cdf0e10cSrcweirelse
5036cdf0e10cSrcweir    AC_MSG_RESULT([internal])
5037cdf0e10cSrcweir    SYSTEM_OPENSSL=NO
5038cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE OPENSSL"
5039cdf0e10cSrcweirfi
5040cdf0e10cSrcweirAC_SUBST(SYSTEM_OPENSSL)
5041cdf0e10cSrcweirAC_SUBST(OPENSSL_CFLAGS)
5042cdf0e10cSrcweirAC_SUBST(OPENSSL_LIBS)
5043cdf0e10cSrcweir
5044cdf0e10cSrcweirdnl ===================================================================
5045cdf0e10cSrcweirdnl Check for system redland
5046cdf0e10cSrcweirdnl ===================================================================
5047cdf0e10cSrcweirAC_MSG_CHECKING([which redland library to use])
5048cdf0e10cSrcweirif test -n "$with_system_redland" -o -n "$with_system_libs" && \
5049cdf0e10cSrcweir	test "$with_system_redland" != "no"; then
5050cdf0e10cSrcweir	AC_MSG_RESULT([external])
5051cdf0e10cSrcweir	SYSTEM_REDLAND=YES
5052cdf0e10cSrcweir   dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
5053cdf0e10cSrcweir   PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
5054cdf0e10cSrcweirelse
5055cdf0e10cSrcweir	AC_MSG_RESULT([internal])
5056cdf0e10cSrcweir	BUILD_TYPE="$BUILD_TYPE REDLAND"
5057cdf0e10cSrcweir	SYSTEM_REDLAND=NO
5058cdf0e10cSrcweirfi
5059cdf0e10cSrcweirAC_SUBST(SYSTEM_REDLAND)
5060cdf0e10cSrcweirAC_SUBST(REDLAND_CFLAGS)
5061cdf0e10cSrcweirAC_SUBST(REDLAND_LIBS)
5062cdf0e10cSrcweir
5063cdf0e10cSrcweirdnl ===================================================================
5064a44fea77SAriel Constenla-Hailednl Check for hunspell
5065cdf0e10cSrcweirdnl ===================================================================
5066a44fea77SAriel Constenla-HaileAC_MSG_CHECKING([whether to build the Spell Checking component])
5067a44fea77SAriel Constenla-HaileENABLE_HUNSPELL=
50680ea1a209SEike Rathke
5069a44fea77SAriel Constenla-Haileif test "x$enable_hunspell" != "xno" ; then
5070a44fea77SAriel Constenla-Haile    AC_MSG_CHECKING([which libhunspell to use])
5071a44fea77SAriel Constenla-Haile    if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \
5072a44fea77SAriel Constenla-Haile        test "$with_system_hunspell" != "no"; then
5073a44fea77SAriel Constenla-Haile        AC_MSG_RESULT([external])
5074a44fea77SAriel Constenla-Haile        SYSTEM_HUNSPELL=YES
5075a44fea77SAriel Constenla-Haile        AC_LANG_PUSH([C++])
5076a44fea77SAriel Constenla-Haile        PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
5077a44fea77SAriel Constenla-Haile        if test "$HUNSPELL_PC" != "TRUE"; then
5078a44fea77SAriel Constenla-Haile            AC_CHECK_HEADER(hunspell.hxx, [],
5079a44fea77SAriel Constenla-Haile            [AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
5080a44fea77SAriel Constenla-Haile                [AC_MSG_ERROR(hunspell headers not found.)], [])
5081a44fea77SAriel Constenla-Haile             ], [])
5082a44fea77SAriel Constenla-Haile            AC_CHECK_LIB(hunspell, main, [],
5083a44fea77SAriel Constenla-Haile            [ AC_MSG_ERROR(hunspell library not found.) ], [])
5084a44fea77SAriel Constenla-Haile            HUNSPELL_LIBS=-lhunspell
5085a44fea77SAriel Constenla-Haile        fi
5086a44fea77SAriel Constenla-Haile        AC_LANG_POP([C++])
5087a44fea77SAriel Constenla-Haile    else
5088a44fea77SAriel Constenla-Haile        AC_MSG_RESULT([internal])
5089a44fea77SAriel Constenla-Haile        SYSTEM_HUNSPELL=NO
5090a44fea77SAriel Constenla-Haile        BUILD_TYPE="$BUILD_TYPE HUNSPELL"
5091a44fea77SAriel Constenla-Haile    fi
5092a44fea77SAriel Constenla-Haile    ENABLE_HUNSPELL=YES
5093a44fea77SAriel Constenla-Haile    AC_SUBST(SYSTEM_HUNSPELL)
5094a44fea77SAriel Constenla-Haile    AC_SUBST(HUNSPELL_CFLAGS)
5095a44fea77SAriel Constenla-Haile    AC_SUBST(HUNSPELL_LIBS)
5096cdf0e10cSrcweirelse
5097a44fea77SAriel Constenla-Haile    AC_MSG_RESULT([no])
5098cdf0e10cSrcweirfi
5099a44fea77SAriel Constenla-HaileAC_SUBST(ENABLE_HUNSPELL)
5100cdf0e10cSrcweir
5101cdf0e10cSrcweirdnl ===================================================================
5102a44fea77SAriel Constenla-Hailednl Checking for libhyphen
5103cdf0e10cSrcweirdnl ===================================================================
5104a44fea77SAriel Constenla-HaileAC_MSG_CHECKING([whether to build the Hyphenator component])
5105a44fea77SAriel Constenla-HaileENABLE_HYPHEN=
5106a44fea77SAriel Constenla-Haile
5107a44fea77SAriel Constenla-Haileif test "x$enable_hyphen" != "xno" ; then
5108a44fea77SAriel Constenla-Haile    AC_MSG_CHECKING([which libhyphen to use])
5109a44fea77SAriel Constenla-Haile    if test -n "$with_system_hyphen" -o -n "$with_system_libs" && \
5110a44fea77SAriel Constenla-Haile        test "$with_system_hyphen" != "no"; then
5111a44fea77SAriel Constenla-Haile        AC_MSG_RESULT([external])
5112a44fea77SAriel Constenla-Haile        SYSTEM_HYPH=YES
5113a44fea77SAriel Constenla-Haile        AC_CHECK_HEADER(hyphen.h, [],
5114a44fea77SAriel Constenla-Haile        [ AC_MSG_ERROR(libhyphen headers not found.)], [])
5115a44fea77SAriel Constenla-Haile        AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
5116a44fea77SAriel Constenla-Haile        [ AC_MSG_ERROR(no. You are sure you have libhyphen headers?)],
5117a44fea77SAriel Constenla-Haile        [#include <hyphen.h>])
5118a44fea77SAriel Constenla-Haile        AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
5119a44fea77SAriel Constenla-Haile            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
5120a44fea77SAriel Constenla-Haile        if test -z "$HYPHEN_LIB"; then
5121a44fea77SAriel Constenla-Haile        AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
5122a44fea77SAriel Constenla-Haile            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
5123a44fea77SAriel Constenla-Haile        fi
5124a44fea77SAriel Constenla-Haile        if test -z "$HYPHEN_LIB"; then
5125a44fea77SAriel Constenla-Haile        AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
5126a44fea77SAriel Constenla-Haile            [ AC_MSG_ERROR(libhyphen not found or too old.)], [])
5127a44fea77SAriel Constenla-Haile        fi
5128a44fea77SAriel Constenla-Haile    else
5129a44fea77SAriel Constenla-Haile        AC_MSG_RESULT([internal])
5130a44fea77SAriel Constenla-Haile        SYSTEM_HYPH=NO
5131a44fea77SAriel Constenla-Haile        BUILD_TYPE="$BUILD_TYPE HYPHEN"
5132cdf0e10cSrcweir    fi
5133a44fea77SAriel Constenla-Haile    ENABLE_HYPHEN=YES
5134a44fea77SAriel Constenla-Haile    AC_SUBST(SYSTEM_HYPH)
5135a44fea77SAriel Constenla-Haile    AC_SUBST(HYPHEN_LIB)
5136cdf0e10cSrcweirelse
5137a44fea77SAriel Constenla-Haile    AC_MSG_RESULT([no])
5138cdf0e10cSrcweirfi
5139a44fea77SAriel Constenla-HaileAC_SUBST(ENABLE_HYPHEN)
5140cdf0e10cSrcweir
5141764319a5SAndre Fischer
5142764319a5SAndre Fischer#dnl ===================================================================
5143764319a5SAndre Fischer#dnl Check whether we are allowed to bundle dictionaries and whether
5144764319a5SAndre Fischer#dnl hunspell is available.
5145764319a5SAndre Fischer#dnl ===================================================================
5146764319a5SAndre FischerENABLE_BUNDLED_DICTIONARIES=
5147764319a5SAndre Fischerif test "x$enable_bundled_dictionaries" != "xno" -a "x$ENABLE_HUNSPELL" = "xYES"; then
5148764319a5SAndre Fischer   ENABLE_BUNDLED_DICTIONARIES=YES
5149764319a5SAndre Fischerfi
5150764319a5SAndre FischerAC_SUBST(ENABLE_BUNDLED_DICTIONARIES)
5151764319a5SAndre Fischer
5152764319a5SAndre Fischer
5153764319a5SAndre Fischer
5154cdf0e10cSrcweirdnl ===================================================================
5155cdf0e10cSrcweirdnl Checking for mythes
5156cdf0e10cSrcweirdnl ===================================================================
5157cdf0e10cSrcweirAC_MSG_CHECKING([which mythes to use])
515835266ad7SPedro Giffuniif test -n "$with_system_mythes" -o -n "$with_system_libs" && \
515935266ad7SPedro Giffuni   test "$with_system_mythes" != "no"; then
5160cdf0e10cSrcweir    AC_MSG_RESULT([external])
5161cdf0e10cSrcweir    SYSTEM_MYTHES=YES
5162cdf0e10cSrcweir    AC_LANG_PUSH([C++])
5163cdf0e10cSrcweir    PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
5164cdf0e10cSrcweir    if test "$MYTHES_PKGCONFIG" = "no"; then
5165cdf0e10cSrcweir        AC_CHECK_HEADER(mythes.hxx, [],
5166cdf0e10cSrcweir            [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
5167cdf0e10cSrcweir        AC_CHECK_LIB(mythes-1.2, main, [],
5168cdf0e10cSrcweir            [ MYTHES_FOUND=no], [])
5169cdf0e10cSrcweir 	if test "$MYTHES_FOUND" = "no"; then
5170cdf0e10cSrcweir            AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
5171cdf0e10cSrcweir                [ MYTHES_FOUND=no], [])
5172cdf0e10cSrcweir	fi
5173cdf0e10cSrcweir	if test "$MYTHES_FOUND" = "no"; then
5174cdf0e10cSrcweir		AC_MSG_ERROR([mythes library not found!.])
5175cdf0e10cSrcweir	fi
5176cdf0e10cSrcweir    fi
5177cdf0e10cSrcweir    AC_LANG_POP([C++])
5178cdf0e10cSrcweirelse
5179cdf0e10cSrcweir    AC_MSG_RESULT([internal])
5180cdf0e10cSrcweir    SYSTEM_MYTHES=NO
5181cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE MYTHES"
5182cdf0e10cSrcweirfi
5183cdf0e10cSrcweirAC_SUBST(SYSTEM_MYTHES)
5184cdf0e10cSrcweirAC_SUBST(MYTHES_CFLAGS)
5185cdf0e10cSrcweirAC_SUBST(MYTHES_LIBS)
5186cdf0e10cSrcweir
51870ea1a209SEike Rathke
5188cdf0e10cSrcweirdnl ===================================================================
5189cdf0e10cSrcweirdnl Checking for libtextcat
5190cdf0e10cSrcweirdnl ===================================================================
5191cdf0e10cSrcweirAC_MSG_CHECKING([which libtextcat to use])
5192cdf0e10cSrcweirif test -n "$with_system_libtextcat" && test "$with_system_libtextcat" != "no"; then
5193cdf0e10cSrcweir    AC_MSG_RESULT([external])
5194cdf0e10cSrcweir    SYSTEM_LIBTEXTCAT=YES
5195cdf0e10cSrcweir    AC_CHECK_HEADER(libtextcat/textcat.h, [],
5196cdf0e10cSrcweir       [ AC_MSG_ERROR(libtextcat headers not found.)], [])
5197cdf0e10cSrcweir    AC_CHECK_LIB(textcat, special_textcat_Init, ,
5198cdf0e10cSrcweir        [ AC_MSG_ERROR(libtextcat library not found or not suitable. libtextcat typically needs to be patched)], [])
5199cdf0e10cSrcweirelse
5200cdf0e10cSrcweir    AC_MSG_RESULT([internal])
5201cdf0e10cSrcweir    SYSTEM_LIBTEXTCAT=NO
5202cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE LIBTEXTCAT"
5203cdf0e10cSrcweirfi
5204cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBTEXTCAT)
5205cdf0e10cSrcweir
5206cdf0e10cSrcweirAC_MSG_CHECKING([which libtextcat data directory to use])
5207cdf0e10cSrcweirif test -n "$with_system_libtextcat_data" && test "$with_system_libtextcat_data" != "no"; then
5208cdf0e10cSrcweir    if test "$with_system_libtextcat_data" = "yes"; then
5209cdf0e10cSrcweir        SYSTEM_LIBTEXTCAT_DATA=file:///usr/share/libtextcat
5210cdf0e10cSrcweir    else
5211cdf0e10cSrcweir        SYSTEM_LIBTEXTCAT_DATA=file://$with_system_libtextcat_data
5212cdf0e10cSrcweir    fi
5213cdf0e10cSrcweir    AC_MSG_RESULT([$SYSTEM_LIBTEXTCAT_DATA])
5214cdf0e10cSrcweirelse
5215cdf0e10cSrcweir    AC_MSG_RESULT([internal])
5216cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE LIBTEXTCATDATA"
5217cdf0e10cSrcweirfi
5218cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBTEXTCAT_DATA)
5219cdf0e10cSrcweir
5220cdf0e10cSrcweirdnl ***************************************
5221cdf0e10cSrcweirdnl testing libc version for Linux...
5222cdf0e10cSrcweirdnl ***************************************
5223cdf0e10cSrcweirif test "$_os" = "Linux"; then
5224cdf0e10cSrcweir   AC_MSG_CHECKING([whether libc is >= 2.1.1])
5225cdf0e10cSrcweir   exec 6>/dev/null # no output
5226cdf0e10cSrcweir   AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
5227cdf0e10cSrcweir   exec 6>&1 # output on again
5228cdf0e10cSrcweir   if test "$HAVE_LIBC"; then
5229cdf0e10cSrcweir      AC_MSG_RESULT([yes])
5230cdf0e10cSrcweir   else
5231cdf0e10cSrcweir      AC_MSG_ERROR([no, upgrade libc])
5232cdf0e10cSrcweir   fi
5233cdf0e10cSrcweirfi
5234cdf0e10cSrcweir
5235cdf0e10cSrcweirif test "$_os" != "WNT"; then
5236cdf0e10cSrcweir  AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
5237cdf0e10cSrcweir  AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
5238cdf0e10cSrcweir  if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
5239cdf0e10cSrcweir	SYSTEM_LIBC=YES
5240cdf0e10cSrcweir  fi
5241cdf0e10cSrcweirelse
5242cdf0e10cSrcweir  HAVE_GETOPT=NO
5243cdf0e10cSrcweir  HAVE_READDIR_R=NO
5244cdf0e10cSrcweir  SYSTEM_LIBC=YES
5245cdf0e10cSrcweirfi
5246cdf0e10cSrcweirAC_SUBST(HAVE_GETOPT)
5247cdf0e10cSrcweirAC_SUBST(HAVE_READDIR_R)
5248cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBC)
5249cdf0e10cSrcweir
5250cdf0e10cSrcweirdnl =========================================
5251cdf0e10cSrcweirdnl Check for the Microsoft Platform SDK.
5252cdf0e10cSrcweirdnl =========================================
5253cdf0e10cSrcweirdnl FIXME: I don't know yet if PSDK works with MinGW, keep it until I know better,
5254cdf0e10cSrcweirdnl and add "-a \( "$WITH_MINGWIN" != "yes" \)" then
5255cdf0e10cSrcweirif test \( "$_os" = "WINNT" \) ; then
5256cdf0e10cSrcweir	AC_MSG_CHECKING([for PSDK files])
5257cdf0e10cSrcweir	if test -z "$with_psdk_home"; then
5258cdf0e10cSrcweir		# This first line will detect a February 2003 Microsoft Platform SDK
5259edd74ba5SDamjan Jovanovic		PSDK_HOME=`$OOWINTOOL --psdk-home`
5260cdf0e10cSrcweir        # But there might be also an April 2005 PSDK, unfortunately MS changed
5261cdf0e10cSrcweir        # the registry entry. (we prefer the old version!?)
5262cdf0e10cSrcweir        if test -z "$PSDK_HOME"; then
5263cdf0e10cSrcweir          PSDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
5264cdf0e10cSrcweir        fi
5265cdf0e10cSrcweir            # normalize if found
5266cdf0e10cSrcweir            if test -n "$PSDK_HOME"; then
5267cdf0e10cSrcweir              PSDK_HOME=`cygpath -d "$PSDK_HOME"`
5268cdf0e10cSrcweir              PSDK_HOME=`cygpath -u "$PSDK_HOME"`
5269cdf0e10cSrcweir           fi
5270cdf0e10cSrcweir	else
5271cdf0e10cSrcweir           PSDK_HOME=`cygpath -u "$with_psdk_home"`
5272cdf0e10cSrcweir	fi
5273cdf0e10cSrcweir        # Remove a possible trailing backslash
5274cdf0e10cSrcweir        PSDK_HOME=`echo $PSDK_HOME | $SED 's/\/$//'`
5275cdf0e10cSrcweir    # Problem with current PSDK (iz 49865)
5276cdf0e10cSrcweir    if test -f "$PSDK_HOME/Lib/libcp.lib"; then
5277cdf0e10cSrcweir        AC_MSG_ERROR([
5278cdf0e10cSrcweir
5279cdf0e10cSrcweirSome modules do not build correctly with MS Platform SDK - April 2005
5280cdf0e10cSrcweirEdition if the library ($PSDK_HOME/Lib/libcp.lib) is found.
5281cdf0e10cSrcweirRemove/rename/backup that file and restart configure. Details about this
5282cdf0e10cSrcweirproblem can be found in issue 49856.])
5283cdf0e10cSrcweir    fi
5284407bc2eeSMatthias Seidel# Windows SDK has different headers
5285cdf0e10cSrcweir	if test \( -f "$PSDK_HOME/Include/adoint.h" \) \
5286cdf0e10cSrcweir		 -a \( -f "$PSDK_HOME/Include/SqlUcode.h" \) \
5287cdf0e10cSrcweir		 -a \( -f "$PSDK_HOME/Include/usp10.h" \); then
5288cdf0e10cSrcweir		HAVE_PSDK_H="yes"
5289cdf0e10cSrcweir	else
5290cdf0e10cSrcweir		HAVE_PSDK_H="no"
5291cdf0e10cSrcweir	fi
5292cdf0e10cSrcweir	if test -f "$PSDK_HOME/lib/unicows.lib"; then
5293cdf0e10cSrcweir		HAVE_PSDK_LIB="yes"
5294cdf0e10cSrcweir	else
5295cdf0e10cSrcweir		HAVE_PSDK_LIB="no"
5296cdf0e10cSrcweir	fi
5297cdf0e10cSrcweir    if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
5298cdf0e10cSrcweir        AC_MSG_ERROR([Some (all?) PSDK files not found, please check if all needed Platform SDKs
5299cdf0e10cSrcweirare installed or use --with-psdk-home .])
5300cdf0e10cSrcweir    fi
5301cdf0e10cSrcweir    if test ! -x "$PSDK_HOME/bin/msiinfo.exe" \
5302cdf0e10cSrcweir         -o ! -x "$PSDK_HOME/bin/msidb.exe" \
5303cdf0e10cSrcweir         -o ! -x "$PSDK_HOME/bin/uuidgen.exe" \
5304cdf0e10cSrcweir         -o ! -x "$PSDK_HOME/bin/msitran.exe" ; then
5305cdf0e10cSrcweir        AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
5306cdf0e10cSrcweir    fi
5307cdf0e10cSrcweir    AC_MSG_RESULT([SDK files found ...)])
5308cdf0e10cSrcweirdnl Check if this is the right SDK.
530928633775SPedro Giffuni    if echo $PSDK_HOME | $GREP "v6.1" >/dev/null 2>/dev/null; then
5310cdf0e10cSrcweir        AC_MSG_RESULT([Found Windows SDK 6.1 ($PSDK_HOME)])
5311cdf0e10cSrcweir        WINDOWS_VISTA_PSDK=TRUE
531228633775SPedro Giffuni    elif echo $PSDK_HOME | $GREP "v6.0" >/dev/null 2>/dev/null; then
5313cdf0e10cSrcweir        AC_MSG_RESULT([Found Windows SDK 6.0 ($PSDK_HOME)])
5314cdf0e10cSrcweir        WINDOWS_VISTA_PSDK=TRUE
531528633775SPedro Giffuni    elif echo $PSDK_HOME | $GREP "v7.0" >/dev/null 2>/dev/null; then
53168e162c1bSOliver-Rainer Wittmann        AC_MSG_RESULT([Found Windows SDK 7.0 ($PSDK_HOME)])
53178e162c1bSOliver-Rainer Wittmann        WINDOWS_VISTA_PSDK=TRUE
5318cdf0e10cSrcweir    else
5319cdf0e10cSrcweir        AC_MSG_RESULT([Found Legacy Windows Platform SDK ($PSDK_HOME)])
5320cdf0e10cSrcweir    fi
5321cdf0e10cSrcweirfi
5322cdf0e10cSrcweirAC_SUBST(PSDK_HOME)
5323cdf0e10cSrcweirAC_SUBST(WINDOWS_VISTA_PSDK)
5324cdf0e10cSrcweir
5325cdf0e10cSrcweirdnl =========================================
5326cdf0e10cSrcweirdnl Check for the Microsoft DirectX SDK.
5327cdf0e10cSrcweirdnl =========================================
5328cdf0e10cSrcweirif test \( "$_os" = "WINNT" \) ; then
5329cdf0e10cSrcweir    AC_MSG_CHECKING([for DirectX SDK files])
5330cdf0e10cSrcweir    if test -z "$with_directx_home"; then
5331cdf0e10cSrcweir        dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
5332cdf0e10cSrcweir        if test -n "$DXSDK_DIR"; then
5333cdf0e10cSrcweir            DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
5334cdf0e10cSrcweir            DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
5335cdf0e10cSrcweir        fi
5336cdf0e10cSrcweir        # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
5337cdf0e10cSrcweir        # the "DirectX SDK files not found" error later
5338cdf0e10cSrcweir    else
5339cdf0e10cSrcweir	DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
5340cdf0e10cSrcweir    fi
5341cdf0e10cSrcweir    # Remove a possible trailing backslash
5342cdf0e10cSrcweir    DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
5343cdf0e10cSrcweir
5344cdf0e10cSrcweir    if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" ; then
5345549fe914SJürgen Schmidt        HAVE_DIRECTDRAW_H="yes"
5346549fe914SJürgen Schmidt    else
5347549fe914SJürgen Schmidt        HAVE_DIRECTDRAW_H="no"
5348549fe914SJürgen Schmidt    fi
5349549fe914SJürgen Schmidt    if test -f "$DIRECTXSDK_HOME/Include/d3d9.h" ; then
5350cdf0e10cSrcweir        HAVE_DIRECTXSDK_H="yes"
5351cdf0e10cSrcweir    else
5352cdf0e10cSrcweir        HAVE_DIRECTXSDK_H="no"
5353cdf0e10cSrcweir    fi
5354549fe914SJürgen Schmidt
5355cdf0e10cSrcweir    # MS changed the location of the libraries with dec 2004 directx sdk
5356cdf0e10cSrcweir    if test -d "$DIRECTXSDK_HOME/lib/x86" ; then
5357cdf0e10cSrcweir        DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
5358cdf0e10cSrcweir    else
5359cdf0e10cSrcweir        DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib"
5360cdf0e10cSrcweir    fi
5361cdf0e10cSrcweir    if test -f "$DIRECTXSDK_LIB/ddraw.lib" ; then
5362549fe914SJürgen Schmidt        HAVE_DIRECTDRAW_LIB="yes"
5363549fe914SJürgen Schmidt    else
5364549fe914SJürgen Schmidt        HAVE_DIRECTDRAW_LIB="no"
5365549fe914SJürgen Schmidt    fi
5366549fe914SJürgen Schmidt    if test -f "$DIRECTXSDK_LIB/d3d9.lib" ; then
5367cdf0e10cSrcweir        HAVE_DIRECTXSDK_LIB="yes"
5368cdf0e10cSrcweir    else
5369cdf0e10cSrcweir        HAVE_DIRECTXSDK_LIB="no"
5370cdf0e10cSrcweir    fi
5371549fe914SJürgen Schmidt
5372549fe914SJürgen Schmidt    if test "$HAVE_DIRECTDRAW_H" = "yes" -a "$HAVE_DIRECTDRAW_LIB" = "yes" ; then
5373549fe914SJürgen Schmidt       ENABLE_DIRECT_DRAW="TRUE"
5374549fe914SJürgen Schmidt    fi
5375549fe914SJürgen Schmidt    if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes" ; then
5376549fe914SJürgen Schmidt       HAVE_DIRECTXSDK="yes"
5377549fe914SJürgen Schmidt    else
5378549fe914SJürgen Schmidt       HAVE_DIRECTXSDK="no"
5379549fe914SJürgen Schmidt    fi
5380549fe914SJürgen Schmidt
5381cdf0e10cSrcweir    if test -n "$ENABLE_DIRECTX"; then
5382549fe914SJürgen Schmidt	    if test "$HAVE_DIRECTDRAW" = "yes" -o "$HAVE_DIRECTXSDK" = "yes" ; then
5383cdf0e10cSrcweir		    AC_MSG_RESULT([found])
5384cdf0e10cSrcweir	    else
53857f413237SHerbert Dürr		    AC_MSG_ERROR([DirectX SDK files not found, please use --with-directx-home or --disable-directx.])
5386cdf0e10cSrcweir	    fi
5387cdf0e10cSrcweir    else
5388cdf0e10cSrcweir		DIRECTXSDK_HOME=""
5389cdf0e10cSrcweir		AC_MSG_RESULT([disabled])
5390cdf0e10cSrcweir    fi
5391cdf0e10cSrcweirfi
5392549fe914SJürgen SchmidtAC_SUBST(ENABLE_DIRECT_DRAW)
5393cdf0e10cSrcweirAC_SUBST(DIRECTXSDK_HOME)
5394cdf0e10cSrcweirAC_SUBST(DIRECTXSDK_LIB)
5395cdf0e10cSrcweir
53968e8da03fSAriel Constenla-Haile
53978e8da03fSAriel Constenla-Hailednl ============================================
53988e8da03fSAriel Constenla-Hailednl Check for ATL and MFC
53998e8da03fSAriel Constenla-Hailednl ============================================
54008e8da03fSAriel Constenla-Haileif test \( "$_os" = "WINNT" \) ; then
54018e8da03fSAriel Constenla-Haile    AC_MSG_CHECKING([for ATL and MFC])
54020fd36615SAriel Constenla-Haile    if test "$DISABLE_ATL" = "TRUE"; then
54030fd36615SAriel Constenla-Haile        AC_MSG_RESULT([ATL is disabled, nothing to check])
54048e8da03fSAriel Constenla-Haile    else
54058e8da03fSAriel Constenla-Haile        AC_MSG_NOTICE([testing ATL/MFC libs and includes])
54068e8da03fSAriel Constenla-Haile        if test -z "$with_atl_include_dir"; then
54078e8da03fSAriel Constenla-Haile            ATL_INCLUDE=$COMPATH/atlmfc/include
54088e8da03fSAriel Constenla-Haile        else
54098e8da03fSAriel Constenla-Haile            ATL_INCLUDE=`cygpath -u "$with_atl_include_dir"`
54108e8da03fSAriel Constenla-Haile        fi
54118e8da03fSAriel Constenla-Haile        if test -z "$with_atl_lib_dir"; then
54128e8da03fSAriel Constenla-Haile            ATL_LIB=$COMPATH/atlmfc/lib
5413da2e13d4SMatthias Seidel        ATL_LIB_X64=$COMPATH/atlmfc/lib/amd64
54148e8da03fSAriel Constenla-Haile        else
54158e8da03fSAriel Constenla-Haile            ATL_LIB=`cygpath -u "$with_atl_lib_dir"`
541633605542SJürgen Schmidt            ATL_LIB_X64=$ATL_LIB/../amd64
54178e8da03fSAriel Constenla-Haile        fi
54188e8da03fSAriel Constenla-Haile        if test -z "$with_mfc_include_dir"; then
54198e8da03fSAriel Constenla-Haile            MFC_INCLUDE=$COMPATH/atlmfc/include
54208e8da03fSAriel Constenla-Haile        else
54218e8da03fSAriel Constenla-Haile            MFC_INCLUDE=`cygpath -u "$with_mfc_include_dir"`
54228e8da03fSAriel Constenla-Haile        fi
54238e8da03fSAriel Constenla-Haile        if test -z "$with_mfc_lib_dir"; then
54248e8da03fSAriel Constenla-Haile            MFC_LIB=$COMPATH/atlmfc/lib
54258e8da03fSAriel Constenla-Haile        else
54268e8da03fSAriel Constenla-Haile            MFC_LIB=`cygpath -u "$with_mfc_lib_dir"`
54278e8da03fSAriel Constenla-Haile        fi
54288e8da03fSAriel Constenla-Haile
54298e8da03fSAriel Constenla-Haile        ATL_INCLUDE=`echo $ATL_INCLUDE | $SED 's/\/$//'`
54308e8da03fSAriel Constenla-Haile        ATL_LIB=`echo $ATL_LIB | $SED 's/\/$//'`
543133605542SJürgen Schmidt        ATL_LIB_X64=`echo $ATL_LIB_X64 | $SED 's/\/$//'`
54328e8da03fSAriel Constenla-Haile        MFC_INCLUDE=`echo $MFC_INCLUDE | $SED 's/\/$//'`
54338e8da03fSAriel Constenla-Haile        MFC_LIB=`echo $MFC_LIB | $SED 's/\/$//'`
54348e8da03fSAriel Constenla-Haile
54351706e35bSAriel Constenla-Haile        AC_MSG_NOTICE([looking for atlbase.h in "$ATL_INCLUDE"])
54361706e35bSAriel Constenla-Haile        if test -f "$ATL_INCLUDE/atlbase.h"; then
54378e8da03fSAriel Constenla-Haile            HAVE_ATL_H="yes"
54388e8da03fSAriel Constenla-Haile        else
54391706e35bSAriel Constenla-Haile            HAVE_ATL_H="no"
54408e8da03fSAriel Constenla-Haile        fi
54411706e35bSAriel Constenla-Haile        AC_MSG_NOTICE([found atlbase.h in "$ATL_INCLUDE"? "$HAVE_ATL_H"])
54421706e35bSAriel Constenla-Haile
54431706e35bSAriel Constenla-Haile        AC_MSG_NOTICE([looking for afx.h in "$MFC_INCLUDE"])
54448e8da03fSAriel Constenla-Haile        if test -f "$MFC_INCLUDE/afx.h"; then
54458e8da03fSAriel Constenla-Haile            HAVE_MFC_H="yes"
54468e8da03fSAriel Constenla-Haile        else
54471706e35bSAriel Constenla-Haile            HAVE_MFC_H="no"
54488e8da03fSAriel Constenla-Haile        fi
54491706e35bSAriel Constenla-Haile        AC_MSG_NOTICE([found afx.h in "$MFC_INCLUDE"? "$HAVE_MFC_H"])
54501706e35bSAriel Constenla-Haile
54511706e35bSAriel Constenla-Haile        AC_MSG_NOTICE([looking for atls.lib in "$ATL_LIB"])
54528e8da03fSAriel Constenla-Haile        if test -f "$ATL_LIB/atls.lib"; then
54538e8da03fSAriel Constenla-Haile            HAVE_ATL_LIB="yes"
54541706e35bSAriel Constenla-Haile            AC_MSG_NOTICE([looking for atlthunk.lib in "$ATL_LIB"])
54558e8da03fSAriel Constenla-Haile            if test -f "$ATL_LIB/atlthunk.lib"; then
54568e8da03fSAriel Constenla-Haile                HAVE_ATLTHUNK="YES"
54578e8da03fSAriel Constenla-Haile            else
54588e8da03fSAriel Constenla-Haile                HAVE_ATLTHUNK="NO"
54598e8da03fSAriel Constenla-Haile            fi
54601706e35bSAriel Constenla-Haile            AC_MSG_NOTICE([found atlthunk.lib in "$ATL_LIB"? "$HAVE_ATLTHUNK"])
54618e8da03fSAriel Constenla-Haile        else
54628e8da03fSAriel Constenla-Haile            HAVE_ATL_LIB="no"
54638e8da03fSAriel Constenla-Haile        fi
54641706e35bSAriel Constenla-Haile        AC_MSG_NOTICE([found atls.lib in "$ATL_LIB"? "$HAVE_ATL_LIB"])
54658e8da03fSAriel Constenla-Haile
546607a3d7f1SPedro Giffuni        dnl TODO check also MFC libraries, they seem to have different names
54678e8da03fSAriel Constenla-Haile        dnl mfc42.lib mfc90.lib
54688e8da03fSAriel Constenla-Haile        if test -d "$MFC_LIB"; then
54698e8da03fSAriel Constenla-Haile            HAVE_MFC_LIB="yes"
54708e8da03fSAriel Constenla-Haile        else
54718e8da03fSAriel Constenla-Haile            HAVE_MFC_LIB="no"
54728e8da03fSAriel Constenla-Haile        fi
54738e8da03fSAriel Constenla-Haile
54748e8da03fSAriel Constenla-Haile        if test "$HAVE_ATL_H" = "no" -o "$HAVE_MFC_H" = "no" -o "$HAVE_ATL_LIB" = "no" -o "$HAVE_MFC_LIB" = "no"; then
54758e8da03fSAriel Constenla-Haile            ATL_INCLUDE=
54768e8da03fSAriel Constenla-Haile            ATL_LIB=
547733605542SJürgen Schmidt            ATL_LIB_X64=
54788e8da03fSAriel Constenla-Haile            MFC_INCLUDE=
54798e8da03fSAriel Constenla-Haile            MFC_LIB=
54808e8da03fSAriel Constenla-Haile            HAVE_ATL_LIB=
54818e8da03fSAriel Constenla-Haile            dnl TODO shouldn't this be an error?
54828e8da03fSAriel Constenla-Haile            DISABLE_ACTIVEX="TRUE"
54838e8da03fSAriel Constenla-Haile            DISABLE_ATL="TRUE"
54848e8da03fSAriel Constenla-Haile            AC_MSG_RESULT([ATL/MFC disabled])
54858e8da03fSAriel Constenla-Haile        else
54868e8da03fSAriel Constenla-Haile            ATL_INCLUDE=`cygpath -dm "$ATL_INCLUDE"`
54878e8da03fSAriel Constenla-Haile            ATL_LIB=`cygpath -dm "$ATL_LIB"`
548833605542SJürgen Schmidt            ATL_LIB_X64=`cygpath -dm "$ATL_LIB_X64"`
54898e8da03fSAriel Constenla-Haile            MFC_INCLUDE=`cygpath -dm "$MFC_INCLUDE"`
54908e8da03fSAriel Constenla-Haile            MFC_LIB=`cygpath -dm "$MFC_LIB"`
54918e8da03fSAriel Constenla-Haile            AC_MSG_RESULT([ATL/MFC enabled])
54928e8da03fSAriel Constenla-Haile        fi
54938e8da03fSAriel Constenla-Haile    fi
54948e8da03fSAriel Constenla-Hailefi
54958e8da03fSAriel Constenla-HaileAC_SUBST(ATL_INCLUDE)
54968e8da03fSAriel Constenla-HaileAC_SUBST(ATL_LIB)
549733605542SJürgen SchmidtAC_SUBST(ATL_LIB_X64)
54988e8da03fSAriel Constenla-HaileAC_SUBST(HAVE_ATLTHUNK)
54998e8da03fSAriel Constenla-HaileAC_SUBST(MFC_INCLUDE)
55008e8da03fSAriel Constenla-HaileAC_SUBST(MFC_LIB)
55018e8da03fSAriel Constenla-Haile
55028e8da03fSAriel Constenla-Haile
5503cdf0e10cSrcweirdnl ============================================
5504cdf0e10cSrcweirdnl Check for Nullsoft Scriptable Install System
5505cdf0e10cSrcweirdnl ============================================
5506cdf0e10cSrcweirNSIS_PATH=""
5507cdf0e10cSrcweirif test "$_os" = "WINNT" ; then
5508cdf0e10cSrcweir    AC_MSG_CHECKING([for NSIS])
5509cdf0e10cSrcweir    AC_PATH_PROG(NSIS_PATH, nsis.exe)
5510cdf0e10cSrcweir    if test -n "$NSIS_PATH"; then
5511cdf0e10cSrcweir        NSIS_PATH=`dirname "$NSIS_PATH"`
5512cdf0e10cSrcweir    fi
5513cdf0e10cSrcweir    if test -n "$with_nsis_path"; then
5514cdf0e10cSrcweir        with_nsis_path=`cygpath -u "$with_nsis_path"`
5515cdf0e10cSrcweir    fi
5516cdf0e10cSrcweir    if test -e "$with_nsis_path/nsis.exe"; then
5517cdf0e10cSrcweir        NSIS_PATH="$with_nsis_path"
5518cdf0e10cSrcweir    fi
5519edd74ba5SDamjan Jovanovic    nsistest=`$OOWINTOOL --nsis-dir`;
5520cdf0e10cSrcweir    if test -x "$nsistest/nsis.exe"; then
5521cdf0e10cSrcweir        NSIS_PATH="$nsistest"
5522cdf0e10cSrcweir    fi
5523cdf0e10cSrcweir    if test -z "$NSIS_PATH"; then
5524cdf0e10cSrcweir        AC_MSG_WARN([NSIS not found, no self contained installer will be build.])
5525cdf0e10cSrcweir        echo "NSIS not found, no self contained installer will be build." >> warn
5526cdf0e10cSrcweir    else
5527cdf0e10cSrcweir        NSIS_PATH=`cygpath -d "$NSIS_PATH"`
5528cdf0e10cSrcweir        NSIS_PATH=`cygpath -u "$NSIS_PATH"`
5529cdf0e10cSrcweir        AC_MSG_RESULT([found ($NSIS_PATH)])
5530b871de36Sarielch		AC_MSG_CHECKING([whether NSIS version is >= 3.*])
5531b871de36Sarielch		nsis_version_string=`"$NSIS_PATH/makensis.exe" /VERSION | $SED -e s/^v//i`
5532b871de36Sarielch        nsis_version_major=`echo $nsis_version_string | cut -d. -f1`
5533b871de36Sarielch		nsis_version_minor=`echo $nsis_version_string | cut -d. -f2`
5534b871de36Sarielch		if test "$nsis_version_major" -ge "3"; then
5535b871de36Sarielch			AC_MSG_RESULT([found NSIS $nsis_version_major.$nsis_version_minor >= 3.*])
5536b871de36Sarielch			AC_MSG_CHECKING([whether NSIS was compiled with Unicode support])
5537b871de36Sarielch			if echo `"$NSIS_PATH/makensis.exe" /HDRINFO` | $EGREP  "\bNSIS_UNICODE_MAKENSIS\b" 2>&1 >/dev/null; then
5538b871de36Sarielch				AC_MSG_RESULT([NSIS version compiled with Unicode support.])
5539b871de36Sarielch			else
5540b871de36Sarielch				NSIS_PATH=""
5541b871de36Sarielch				AC_MSG_WARN([NSIS version compiled without Unicode support, no self contained installer will be build.])
5542b871de36Sarielch			fi
5543b871de36Sarielch		else
5544b871de36Sarielch			NSIS_PATH=""
5545b871de36Sarielch			AC_MSG_WARN([NSIS version found is < 3.*, no self contained installer will be build.])
5546b871de36Sarielch		fi
5547cdf0e10cSrcweir    fi
5548cdf0e10cSrcweirfi
5549cdf0e10cSrcweirAC_SUBST(NSIS_PATH)
5550cdf0e10cSrcweir
5551cdf0e10cSrcweirdnl ***************************************
5552cdf0e10cSrcweirdnl testing bison and flex exist
5553cdf0e10cSrcweirdnl ***************************************
5554cdf0e10cSrcweirAC_PATH_PROG(BISON, bison)
5555cdf0e10cSrcweirif test -z "$BISON"; then
5556cdf0e10cSrcweir   AC_MSG_ERROR([no bison found in \$PATH, install bison])
5557cdf0e10cSrcweirelse
5558cdf0e10cSrcweir   AC_MSG_CHECKING([the bison version])
555928633775SPedro Giffuni   _bison_version=`$BISON --version | $GREP GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`;
5560cdf0e10cSrcweir    _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
5561cdf0e10cSrcweir    # Accept newer than 1.875 or older(equal) than 1.75
5562cdf0e10cSrcweir    if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
5563cdf0e10cSrcweir       if test "$_bison_version" = "1.875" ; then
5564cdf0e10cSrcweir          AC_MSG_WARN([suspect ($BISON $_bison_version)])
5565cdf0e10cSrcweir          echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn
5566cdf0e10cSrcweir       else
5567cdf0e10cSrcweir          AC_MSG_RESULT([checked ($BISON $_bison_version)])
5568cdf0e10cSrcweir       fi
5569cdf0e10cSrcweir    else
5570cdf0e10cSrcweir       AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
5571cdf0e10cSrcweir    fi
5572cdf0e10cSrcweirfi
5573cdf0e10cSrcweirAC_PATH_PROG(FLEX, flex)
5574cdf0e10cSrcweirif test -z "$FLEX"; then
5575cdf0e10cSrcweir   AC_MSG_ERROR([no flex found in \$PATH, install flex])
5576cdf0e10cSrcweirfi
5577cdf0e10cSrcweirdnl ***************************************
5578cdf0e10cSrcweirdnl testing that patch exists
5579cdf0e10cSrcweirdnl ***************************************
5580cdf0e10cSrcweirAC_PATH_PROG(PATCH, patch)
5581cdf0e10cSrcweirif test -z "$PATCH"; then
5582cdf0e10cSrcweir   AC_MSG_ERROR([\"patch\" not found in \$PATH, install the development tool named\"patch"\])
5583cdf0e10cSrcweirfi
5584cdf0e10cSrcweir
5585cdf0e10cSrcweirdnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
5586cdf0e10cSrcweirif test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
5587cdf0e10cSrcweir   if test -z "$with_gnu_patch"; then
5588cdf0e10cSrcweir      GNUPATCH=$PATCH
5589cdf0e10cSrcweir   else
5590cdf0e10cSrcweir      if test -x "$with_gnu_patch"; then
5591cdf0e10cSrcweir	      GNUPATCH=$with_gnu_patch
5592cdf0e10cSrcweir      else
5593cdf0e10cSrcweir         AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
5594cdf0e10cSrcweir      fi
5595cdf0e10cSrcweir   fi
5596cdf0e10cSrcweir
5597cdf0e10cSrcweir   AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
559828633775SPedro Giffuni   if $GNUPATCH --version | $GREP "Free Software Foundation" >/dev/null 2>/dev/null; then
5599cdf0e10cSrcweir	   AC_MSG_RESULT([yes])
5600cdf0e10cSrcweir   else
5601cdf0e10cSrcweir      AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
5602cdf0e10cSrcweir   fi
5603cdf0e10cSrcweirfi
5604cdf0e10cSrcweir
5605cdf0e10cSrcweirdnl We also need to check for --with-gnu-cp
5606cdf0e10cSrcweir
5607cdf0e10cSrcweirif test -z "$with_gnu_cp"; then
560862840caaSPedro Giffuni   # check the place where the GNU stuff is hidden on Solaris...
5609cdf0e10cSrcweir   if test -x /usr/gnu/bin/cp; then
5610cdf0e10cSrcweir      GNUCP=/usr/gnu/bin/cp
5611cdf0e10cSrcweir   else
5612cdf0e10cSrcweir      AC_PATH_PROGS(GNUCP, gnucp cp)
5613cdf0e10cSrcweir   fi
5614cdf0e10cSrcweir   if test -z $GNUCP; then
5615cdf0e10cSrcweir      AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
5616cdf0e10cSrcweir   fi
5617cdf0e10cSrcweirelse
5618cdf0e10cSrcweir   if test -x "$with_gnu_cp"; then
5619cdf0e10cSrcweir      GNUCP=$with_gnu_cp
5620cdf0e10cSrcweir   else
5621cdf0e10cSrcweir      AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
5622cdf0e10cSrcweir   fi
5623cdf0e10cSrcweirfi
5624cdf0e10cSrcweir
5625cdf0e10cSrcweirAC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
562628633775SPedro Giffuniif $GNUCP --version 2>/dev/null | $GREP "coreutils" >/dev/null 2>/dev/null; then
5627cdf0e10cSrcweir   AC_MSG_RESULT([yes])
5628cdf0e10cSrcweirelse
5629cdf0e10cSrcweir   AC_MSG_RESULT([no])
5630cdf0e10cSrcweir   GNUCP=''
5631cdf0e10cSrcweirfi
5632cdf0e10cSrcweir
5633cdf0e10cSrcweirif test -z "$GNUCP"; then
563462840caaSPedro Giffuni   if test "$_os" = "SunOS"; then
5635cdf0e10cSrcweir      AC_MSG_ERROR([no, GNU cp from coreutils is needed. install or specify with --with-gnu-cp=/path/to/it])
5636cdf0e10cSrcweir   else
5637cdf0e10cSrcweir      AC_MSG_RESULT([no GNU cp from coreutils found - using the system's cp command])
5638cdf0e10cSrcweir   fi
5639cdf0e10cSrcweirfi
5640cdf0e10cSrcweir
5641cdf0e10cSrcweirAC_SUBST(GNUPATCH)
5642cdf0e10cSrcweirAC_SUBST(GNUCP)
5643cdf0e10cSrcweir
5644cdf0e10cSrcweirdnl ***************************************
5645cdf0e10cSrcweirdnl testing bash tools path on Windows
5646cdf0e10cSrcweirdnl ***************************************
5647cdf0e10cSrcweirif test "$_os" = "WINNT"; then
5648cdf0e10cSrcweir    CYGWIN_PATH=""
5649cdf0e10cSrcweir    AC_PATH_PROG(CYGWIN_PATH, bash)
5650cdf0e10cSrcweir    CYGWIN_PATH=`dirname "$CYGWIN_PATH"`
5651cdf0e10cSrcweirfi
5652cdf0e10cSrcweirif test -z "$CYGWIN_PATH"; then
5653cdf0e10cSrcweir   CYGWIN_PATH="NO_CYGWIN"
5654cdf0e10cSrcweirfi
5655cdf0e10cSrcweirAC_SUBST(CYGWIN_PATH)
5656cdf0e10cSrcweir
5657cdf0e10cSrcweirdnl ***************************************
5658cdf0e10cSrcweirdnl testing ml.exe assembler path
5659cdf0e10cSrcweirdnl ***************************************
5660cdf0e10cSrcweirif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
5661cdf0e10cSrcweir  AC_MSG_CHECKING([ml.exe assembler path])
5662cdf0e10cSrcweir  if test -n "$with_asm_home"; then
5663cdf0e10cSrcweir    with_asm_home=`cygpath -u "$with_asm_home"`
5664cdf0e10cSrcweir  fi
5665cdf0e10cSrcweir  if test ! -x "$with_asm_home/ml.exe"; then
5666cdf0e10cSrcweir    AC_PATH_PROG(ML_EXE, ml.exe)
5667cdf0e10cSrcweir    if test -z "$ML_EXE"; then
5668cdf0e10cSrcweir      if test -x "$with_cl_home/bin/ml.exe"; then
5669cdf0e10cSrcweir        with_asm_home=$with_cl_home/bin
5670cdf0e10cSrcweir        AC_MSG_RESULT([found ($with_asm_home)])
5671cdf0e10cSrcweir      else
5672cdf0e10cSrcweir        AC_MSG_ERROR([Configure did not find ml.exe assembler.])
5673cdf0e10cSrcweir      fi
5674cdf0e10cSrcweir    else
5675cdf0e10cSrcweir       with_asm_home="ASM_IN_PATH"
5676cdf0e10cSrcweir    fi
5677cdf0e10cSrcweir  fi
5678cdf0e10cSrcweir  AC_MSG_RESULT([$ASM_HOME])
5679cdf0e10cSrcweirelse
5680cdf0e10cSrcweir  with_asm_home="NO_ASM_HOME"
5681cdf0e10cSrcweirfi
5682cdf0e10cSrcweirASM_HOME="$with_asm_home"
5683cdf0e10cSrcweirAC_SUBST(ASM_HOME)
5684da2e13d4SMatthias Seidel
5685ad35682bStruckmandnl ***************************************
5686ad35682bStruckmandnl testing nasm.exe assembler path
5687ad35682bStruckmandnl ***************************************
5688ad35682bStruckmanif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes" -a "$SYSTEM_OPENSSL" = "NO"; then
5689ad35682bStruckman  AC_MSG_CHECKING([nasm.exe assembler path])
5690ad35682bStruckman  if test -n "$with_nasm_home"; then
5691ad35682bStruckman    with_nasm_home=`cygpath -u "$with_nasm_home"`
5692ad35682bStruckman  fi
5693ad35682bStruckman  if test ! -x "$with_nasm_home/nasm.exe"; then
5694ad35682bStruckman    AC_PATH_PROG(NASM_EXE, nasm.exe)
5695ad35682bStruckman    if test -z "$NASM_EXE"; then
5696ad35682bStruckman      with_nasm_home="NO_NASM_HOME"
5697069075cfSDon Lewis      AC_MSG_ERROR([NASM is required to build on Windows, please install or use --with-nasm-home],,)
5698ad35682bStruckman    else
5699ad35682bStruckman      with_nasm_home="NASM_IN_PATH"
5700ad35682bStruckman    fi
5701ad35682bStruckman  fi
5702ad35682bStruckman  AC_MSG_RESULT([$NASM_HOME])
5703ad35682bStruckmanelse
5704ad35682bStruckman  with_nasm_home="NO_NASM_HOME"
5705ad35682bStruckmanfi
5706ad35682bStruckmanNASM_HOME="$with_nasm_home"
5707ad35682bStruckmanAC_SUBST(NASM_HOME)
5708da2e13d4SMatthias Seidel
5709cdf0e10cSrcweirdnl ===================================================================
5710cdf0e10cSrcweirdnl testing handle deprecated unzip switch
5711cdf0e10cSrcweirdnl ===================================================================
5712cdf0e10cSrcweirif test -z "$with_zip_home"; then
5713cdf0e10cSrcweir	with_zip_home="$with_unzip_home"
5714cdf0e10cSrcweirfi
5715cdf0e10cSrcweirdnl ===================================================================
5716cdf0e10cSrcweirdnl Zip will be found where you tell me to find it
5717cdf0e10cSrcweirdnl ===================================================================
5718cdf0e10cSrcweirif test -n "$with_zip_home" ; then
5719cdf0e10cSrcweir    if test "$_os" = "WINNT"; then
5720cdf0e10cSrcweir        with_zip_home=`cygpath -u "$with_zip_home"`
5721cdf0e10cSrcweir    fi
5722cdf0e10cSrcweir    ZIP="$with_zip_home/zip"
5723cdf0e10cSrcweir    UNZIP="$with_zip_home/unzip"
5724cdf0e10cSrcweir    ZIP_HOME="$with_zip_home"
5725cdf0e10cSrcweirelse
5726cdf0e10cSrcweir    AC_PATH_PROG(ZIP, zip)
5727cdf0e10cSrcweir    AC_PATH_PROG(UNZIP, unzip)
5728cdf0e10cSrcweir    ZIP_HOME=`dirname "$ZIP"`
5729cdf0e10cSrcweirfi
5730cdf0e10cSrcweirdnl ===================================================================
5731cdf0e10cSrcweirdnl Zip must be available or else it is an error, all platforms
5732cdf0e10cSrcweirdnl ===================================================================
5733cdf0e10cSrcweirif test -z "$ZIP" -o -z "$UNZIP"; then
5734cdf0e10cSrcweir    AC_MSG_ERROR([Zip/Unzip are required to build, please install or use --with-zip-home],,)
5735cdf0e10cSrcweirfi
5736b63233d8Sdamjanif "$ZIP" -FS < /dev/null 2>&1 | $EGREP "no such option: S" > /dev/null; then
5737b63233d8Sdamjan    AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install or use --with-zip-home],,)
5738b63233d8Sdamjanfi
5739cdf0e10cSrcweir
5740cdf0e10cSrcweirdnl ===================================================================
5741cdf0e10cSrcweirdnl Zip must be a specific type for different build types.
5742cdf0e10cSrcweirdnl ===================================================================
5743cdf0e10cSrcweirif test "$_os" = "WINNT"; then
574428633775SPedro Giffuni    if test -n "`$ZIP -h | $GREP -i WinNT`" ; then
5745cdf0e10cSrcweirAC_MSG_ERROR([$ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe.])
5746cdf0e10cSrcweir    fi
5747cdf0e10cSrcweirfi
5748cdf0e10cSrcweirAC_SUBST(ZIP_HOME)
5749cdf0e10cSrcweir
5750cdf0e10cSrcweirdnl ===================================================================
5751cdf0e10cSrcweirdnl Windows builds need dbghelp.dll in external/dbghelp/
5752cdf0e10cSrcweirdnl ===================================================================
5753cdf0e10cSrcweirif test "$_os" = "WINNT"; then
5754cdf0e10cSrcweir   AC_MSG_CHECKING([for dbghelp.dll])
5755cdf0e10cSrcweir   if test -x ./external/dbghelp/dbghelp.dll; then
57567f413237SHerbert Dürr      AC_MSG_RESULT([found and executable])
5757cdf0e10cSrcweir   else
5758cdf0e10cSrcweir      AC_MSG_ERROR([dbghelp.dll is missing in external/dbghelp/.
5759cdf0e10cSrcweirGet it from the Microsoft site and put it into external/dbghelp.
5760cdf0e10cSrcweir(Note: Microsoft seems to enjoy changing the exact location of this file. You
5761cdf0e10cSrcweirmay have to search Microsoft's website.) Last time it was seen at:
5762da2e13d4SMatthias Seidel<https://www.microsoft.com/downloads/release.asp?releaseid=30682>.])
5763cdf0e10cSrcweir   fi
5764cdf0e10cSrcweirfi
5765cdf0e10cSrcweir
57663edd2c3eSJürgen Schmidtdnl ===================================================================
57673edd2c3eSJürgen Schmidtdnl Windows builds need vcredist_x*.exe in external/vcredist/
57683edd2c3eSJürgen Schmidtdnl ===================================================================
57693edd2c3eSJürgen SchmidtWITH_VC_REDIST=""
57703edd2c3eSJürgen Schmidt
57713edd2c3eSJürgen Schmidtif test "$_os" = "WINNT"; then
57723edd2c3eSJürgen Schmidt   AC_MSG_CHECKING([for vcredist_x86.exe])
57733edd2c3eSJürgen Schmidt   if test -x ./external/vcredist/vcredist_x86.exe; then
57743edd2c3eSJürgen Schmidt      AC_MSG_RESULT([found and executable])
57753edd2c3eSJürgen Schmidt   else
57763edd2c3eSJürgen Schmidt      AC_MSG_ERROR([ vcredist_x86.exe is missing in external/vcredist/.
5777da2e13d4SMatthias SeidelGet it from the Microsoft site and put it into external/vcredist. You can try
5778da2e13d4SMatthias Seidelto download it from https://www.microsoft.com/download/en/search.aspx?q=redistributable%20package.])
57793edd2c3eSJürgen Schmidt   fi
57803edd2c3eSJürgen Schmidt   AC_MSG_CHECKING([for vcredist_x64.exe])
57813edd2c3eSJürgen Schmidt   if test -x ./external/vcredist/vcredist_x64.exe; then
57823edd2c3eSJürgen Schmidt      AC_MSG_RESULT([found and executable])
57833edd2c3eSJürgen Schmidt   else
57843edd2c3eSJürgen Schmidt      AC_MSG_ERROR([ vcredist_x64.exe is missing in external/vcredist/.
5785da2e13d4SMatthias SeidelGet it from the Microsoft site and put it into external/vcredist. You can try
5786da2e13d4SMatthias Seidelto download it from https://www.microsoft.com/download/en/search.aspx?q=redistributable%20package.])
57873edd2c3eSJürgen Schmidt   fi
57883edd2c3eSJürgen Schmidt   WITH_VC_REDIST=YES
57893edd2c3eSJürgen Schmidt   AC_SUBST(WITH_VC_REDIST)
57903edd2c3eSJürgen Schmidtfi
57913edd2c3eSJürgen Schmidt
5792cdf0e10cSrcweirdnl ===================================================================
5793cdf0e10cSrcweirdnl Windows builds - use oowintool to copy CRT dlls and manifest
5794cdf0e10cSrcweirdnl ===================================================================
5795cdf0e10cSrcweirif test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
5796edd74ba5SDamjan Jovanovic       if $OOWINTOOL --msvc-copy-dlls ./external/msvcp ; then
5797cdf0e10cSrcweir          :
5798cdf0e10cSrcweir       else
5799cdf0e10cSrcweir          AC_MSG_ERROR([oowintool failed to copy CRT])
5800cdf0e10cSrcweir       fi
5801cdf0e10cSrcweirfi
5802cdf0e10cSrcweir
5803cdf0e10cSrcweirdnl ===================================================================
5804cdf0e10cSrcweirdnl Windows builds need gdiplus.dll in external/gdiplus/
5805cdf0e10cSrcweirdnl ===================================================================
5806cdf0e10cSrcweirif test "$_os" = "WINNT"; then
5807cdf0e10cSrcweir   AC_MSG_CHECKING([for gdiplus.dll])
5808cdf0e10cSrcweir   if test -x ./external/gdiplus/gdiplus.dll; then
58097f413237SHerbert Dürr      AC_MSG_RESULT([found and executable])
5810cdf0e10cSrcweir   else
5811cdf0e10cSrcweir      AC_MSG_ERROR([gdiplus.dll is missing in external/gdiplus/.
5812cdf0e10cSrcweirGet it from the Microsoft site and put it into external/gdiplus.
5813cdf0e10cSrcweirYou may have to search Microsoft's website. Last time it was seen at:
5814da2e13d4SMatthias Seidel<https://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en>.])
5815cdf0e10cSrcweir   fi
5816cdf0e10cSrcweirfi
5817cdf0e10cSrcweir
581885e23226SAriel Constenla-Hailednl ===================================================================
581985e23226SAriel Constenla-Hailednl Windows builds need msvcr100.dll in external/msvcp100/
582085e23226SAriel Constenla-Hailednl ===================================================================
582185e23226SAriel Constenla-Haileif test "$_os" = "WINNT"; then
582285e23226SAriel Constenla-Haile   AC_MSG_CHECKING([for msvcr100.dll])
582385e23226SAriel Constenla-Haile   if test -x ./external/msvcp100/msvcr100.dll; then
582485e23226SAriel Constenla-Haile      AC_MSG_RESULT([found and executable])
582585e23226SAriel Constenla-Haile   else
582685e23226SAriel Constenla-Haile      AC_MSG_ERROR([msvcr100.dll is missing in external/msvcp100/.
582785e23226SAriel Constenla-HaileGet it from the Microsoft Visual C++ 2010 Redistributable Package (x86),
582885e23226SAriel Constenla-Hailefrom the Microsoft site and put it into external/msvcp100.
582985e23226SAriel Constenla-HaileYou may have to search Microsoft's website. Last time it was seen at:
5830da2e13d4SMatthias Seidel<https://www.microsoft.com/en-us/download/search.aspx?q=Microsoft+Visual+C%2b%2b+2010+Redistributable>.])
583185e23226SAriel Constenla-Haile   fi
583285e23226SAriel Constenla-Hailefi
583385e23226SAriel Constenla-Haile
5834cdf0e10cSrcweirdnl ===================================================================
5835cdf0e10cSrcweirdnl Test which vclplugs have to be built.
5836cdf0e10cSrcweirdnl ===================================================================
5837cdf0e10cSrcweirAC_MSG_CHECKING([which VCLplugs shall be built])
5838cdf0e10cSrcweirENABLE_GTK=""
5839cdf0e10cSrcweirif test "x$enable_gtk" = "xyes"; then
5840cdf0e10cSrcweir    ENABLE_GTK="TRUE"
5841cdf0e10cSrcweir    R="gtk"
5842cdf0e10cSrcweirfi
5843cdf0e10cSrcweirAC_SUBST(ENABLE_GTK)
5844cdf0e10cSrcweir
5845cdf0e10cSrcweirENABLE_KDE=""
5846cdf0e10cSrcweirif test "x$enable_kde" = "xyes"; then
5847cdf0e10cSrcweir    ENABLE_KDE="TRUE"
5848cdf0e10cSrcweir    R="$R kde"
5849cdf0e10cSrcweirfi
5850cdf0e10cSrcweirAC_SUBST(ENABLE_KDE)
5851cdf0e10cSrcweir
5852cdf0e10cSrcweirENABLE_KDE4=""
5853cdf0e10cSrcweirif test "x$enable_kde4" = "xyes"; then
5854cdf0e10cSrcweir    ENABLE_KDE4="TRUE"
5855cdf0e10cSrcweir    R="$R kde4"
5856cdf0e10cSrcweirfi
5857cdf0e10cSrcweirAC_SUBST(ENABLE_KDE4)
5858cdf0e10cSrcweir
5859cdf0e10cSrcweirif test -z "$R"; then
5860cdf0e10cSrcweir	AC_MSG_RESULT([none])
5861cdf0e10cSrcweirelse
5862cdf0e10cSrcweir	AC_MSG_RESULT([$R])
5863cdf0e10cSrcweirfi
5864cdf0e10cSrcweir
5865cdf0e10cSrcweirdnl ===================================================================
5866cdf0e10cSrcweirdnl GCONF check
5867cdf0e10cSrcweirdnl ===================================================================
5868cdf0e10cSrcweir
5869cdf0e10cSrcweirENABLE_GCONF=""
5870cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable GConf support])
5871cdf0e10cSrcweirif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then
5872cdf0e10cSrcweir    ENABLE_GCONF="TRUE"
5873cdf0e10cSrcweir    AC_MSG_RESULT([yes])
5874cdf0e10cSrcweir    PKG_CHECK_MODULES( GCONF, gconf-2.0 )
5875cdf0e10cSrcweirelse
5876cdf0e10cSrcweir    AC_MSG_RESULT([no])
5877cdf0e10cSrcweirfi
5878cdf0e10cSrcweirAC_SUBST(ENABLE_GCONF)
5879cdf0e10cSrcweir
5880cdf0e10cSrcweirdnl ===================================================================
5881cdf0e10cSrcweirdnl Gnome VFS check
5882cdf0e10cSrcweirdnl ===================================================================
5883cdf0e10cSrcweir
5884cdf0e10cSrcweirENABLE_GNOMEVFS=""
5885cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable GNOME VFS support])
5886cdf0e10cSrcweirif test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then
5887cdf0e10cSrcweir    ENABLE_GNOMEVFS="TRUE"
5888cdf0e10cSrcweir    AC_MSG_RESULT([yes])
5889cdf0e10cSrcweir    PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
5890cdf0e10cSrcweir    if test "$ENABLE_GCONF" != "TRUE"; then
5891cdf0e10cSrcweir        PKG_CHECK_MODULES( GCONF, gconf-2.0 )
5892cdf0e10cSrcweir    fi
5893cdf0e10cSrcweirelse
5894cdf0e10cSrcweir    AC_MSG_RESULT([no])
5895cdf0e10cSrcweirfi
5896cdf0e10cSrcweirAC_SUBST(ENABLE_GNOMEVFS)
5897cdf0e10cSrcweir
5898cdf0e10cSrcweirdnl ===================================================================
5899cdf0e10cSrcweirdnl Check whether the gtk 2.0 libraries are available.
5900cdf0e10cSrcweirdnl ===================================================================
5901cdf0e10cSrcweir
5902cdf0e10cSrcweirGTK_CFLAGS=""
5903cdf0e10cSrcweirGTK_LIBS=""
5904cdf0e10cSrcweirENABLE_SYSTRAY_GTK=""
5905cdf0e10cSrcweirENABLE_DBUS=""
5906cdf0e10cSrcweirif test  "$test_gtk" = "yes"; then
5907cdf0e10cSrcweir
5908cdf0e10cSrcweir   if test "$ENABLE_GTK" = "TRUE" ; then
5909cdf0e10cSrcweir      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]))
5910cdf0e10cSrcweir      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]))
5911cdf0e10cSrcweir      BUILD_TYPE="$BUILD_TYPE GTK"
5912cdf0e10cSrcweir
5913cdf0e10cSrcweir      if test "x$enable_systray" = "xyes"; then
5914595ead2bSAriel Constenla-Haile         PKG_CHECK_MODULES(GTK_2_10,gtk+-2.0 >= 2.10.0,
59152ad018beSPedro Giffuni                           [ENABLE_SYSTRAY_GTK="TRUE"
59162ad018beSPedro Giffuni                            BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"],
59172ad018beSPedro Giffuni                           [ENABLE_SYSTRAY_GTK=""])
5918cdf0e10cSrcweir      fi
5919cdf0e10cSrcweir
5920cdf0e10cSrcweir      AC_MSG_CHECKING([whether to enable DBUS support])
5921cdf0e10cSrcweir      if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
5922cdf0e10cSrcweir          ENABLE_DBUS="TRUE"
5923cdf0e10cSrcweir          AC_MSG_RESULT([yes])
5924cdf0e10cSrcweir          PKG_CHECK_MODULES( DBUS, dbus-glib-1 >= 0.70 )
5925cdf0e10cSrcweir      else
5926cdf0e10cSrcweir          AC_MSG_RESULT([no])
5927cdf0e10cSrcweir      fi
5928cdf0e10cSrcweir
5929cdf0e10cSrcweir      AC_MSG_CHECKING([whether to enable GIO support])
5930cdf0e10cSrcweir      if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
5931cdf0e10cSrcweir          if test "$ENABLE_GNOMEVFS" = "TRUE" ; then
5932cdf0e10cSrcweir             AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
5933cdf0e10cSrcweir          fi
5934cdf0e10cSrcweir          ENABLE_GIO="TRUE"
5935cdf0e10cSrcweir          AC_MSG_RESULT([yes])
5936cdf0e10cSrcweir          PKG_CHECK_MODULES( GIO, gio-2.0 )
5937cdf0e10cSrcweir      else
5938cdf0e10cSrcweir          AC_MSG_RESULT([no])
5939cdf0e10cSrcweir      fi
5940cdf0e10cSrcweir
5941cdf0e10cSrcweir   fi
5942cdf0e10cSrcweir
5943cdf0e10cSrcweirfi
5944cdf0e10cSrcweirAC_SUBST(ENABLE_GIO)
5945cdf0e10cSrcweirAC_SUBST(ENABLE_DBUS)
5946cdf0e10cSrcweirAC_SUBST(ENABLE_SYSTRAY_GTK)
5947cdf0e10cSrcweirAC_SUBST(GTK_CFLAGS)
5948cdf0e10cSrcweirAC_SUBST(GTK_LIBS)
5949cdf0e10cSrcweirAC_SUBST(GTHREAD_CFLAGS)
5950cdf0e10cSrcweirAC_SUBST(GTHREAD_LIBS)
5951cdf0e10cSrcweir
5952cdf0e10cSrcweirdnl ===================================================================
5953cdf0e10cSrcweirdnl Check whether the GStreamer libraries are available.
5954cdf0e10cSrcweirdnl ===================================================================
5955cdf0e10cSrcweir
5956cdf0e10cSrcweirGSTREAMER_CFLAGS=""
5957cdf0e10cSrcweirGSTREAMER_LIBS=""
5958cdf0e10cSrcweirENABLE_GSTREAMER=""
5959cdf0e10cSrcweir
5960cdf0e10cSrcweirif test "$test_gstreamer" = "yes"; then
5961cdf0e10cSrcweir    AC_MSG_CHECKING([whether to build the GStreamer media backend])
5962cdf0e10cSrcweir    if test "x$enable_gstreamer" != "xno" ; then
5963b6e71573SDamjan 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]))
5964cdf0e10cSrcweir        ENABLE_GSTREAMER="TRUE"
5965cdf0e10cSrcweir        AC_MSG_RESULT([yes])
5966cdf0e10cSrcweir    else
5967cdf0e10cSrcweir        AC_MSG_RESULT([no])
5968cdf0e10cSrcweir    fi
5969cdf0e10cSrcweirfi
5970cdf0e10cSrcweirAC_SUBST(ENABLE_GSTREAMER)
5971cdf0e10cSrcweirAC_SUBST(GSTREAMER_CFLAGS)
5972cdf0e10cSrcweirAC_SUBST(GSTREAMER_LIBS)
5973cdf0e10cSrcweir
59741309f2c9SPedro Giffunidnl ===================================================================
59751309f2c9SPedro Giffunidnl Check the ARM target
59761309f2c9SPedro Giffunidnl ===================================================================
59771309f2c9SPedro Giffuni
5978a5232f55Spfgif echo "$build_cpu" | $GREP -q arm; then
59791309f2c9SPedro Giffuni    # default value
59801309f2c9SPedro Giffuni    ARM_TARGET=ARMV4T
59811309f2c9SPedro Giffuni    AC_MSG_CHECKING([which ARM processor optimization to use])
59821309f2c9SPedro Giffuni    if test "$with_arm_target" -lt "6"; then
59831309f2c9SPedro Giffuni	ARM_TARGET=ARMV4T
59841309f2c9SPedro Giffuni    elif test "$with_arm_target" = "6"; then
59851309f2c9SPedro Giffuni	ARM_TARGET=ARMV6
59861309f2c9SPedro Giffuni    elif test "$with_arm_target" -gt "6"; then
59871309f2c9SPedro Giffuni	ARM_TARGET=ARMV7
59881309f2c9SPedro Giffuni    fi
59891309f2c9SPedro Giffuni    AC_MSG_RESULT([$ARM_TARGET])
59901309f2c9SPedro Giffuni    AC_SUBST(ARM_TARGET)
59911309f2c9SPedro Giffunifi
5992cdf0e10cSrcweir
5993cdf0e10cSrcweirdnl ===================================================================
5994cdf0e10cSrcweirdnl Check whether the Cairo libraries are available.
5995cdf0e10cSrcweirdnl ===================================================================
5996cdf0e10cSrcweir
5997cdf0e10cSrcweirENABLE_CAIRO=""
5998cdf0e10cSrcweirBUILD_PIXMAN=""
5999cdf0e10cSrcweirSYSTEM_CAIRO=""
6000cdf0e10cSrcweir
6001cdf0e10cSrcweirif test  "$test_cairo" = "yes"; then
6002cdf0e10cSrcweir
6003cdf0e10cSrcweir    AC_MSG_CHECKING([whether to use cairo])
6004cdf0e10cSrcweir    if test "x$enable_cairo" != "xno" ; then
6005cdf0e10cSrcweir        ENABLE_CAIRO="TRUE"
6006cdf0e10cSrcweir	AC_MSG_RESULT([yes])
6007cdf0e10cSrcweir        AC_MSG_CHECKING([which cairo to use])
6008cdf0e10cSrcweir        if test -n "$with_system_cairo" -o -n "$with_system_libs" && \
6009cdf0e10cSrcweir           test "$with_system_cairo" != "no"; then
6010cdf0e10cSrcweir           AC_MSG_RESULT([external])
6011cdf0e10cSrcweir           SYSTEM_CAIRO=YES
6012da2e13d4SMatthias Seidel
6013cdf0e10cSrcweir           PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
6014cdf0e10cSrcweir	   if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$ENABLE_FONTCONFIG" != "TRUE" ; then
6015cdf0e10cSrcweir	      AC_MSG_ERROR([Cairo library requires fontconfig.])
6016cdf0e10cSrcweir	   fi
6017cdf0e10cSrcweir           if test "$with_system_xrender_headers" = "yes"; then
6018cdf0e10cSrcweir              AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
6019cdf0e10cSrcweir              AC_TRY_RUN([
6020cdf0e10cSrcweir#include <X11/extensions/Xrender.h>
6021cdf0e10cSrcweir
6022cdf0e10cSrcweirint main(int argc, char **argv) {
6023cdf0e10cSrcweir#ifdef PictStandardA8
6024cdf0e10cSrcweir      return 0;
6025cdf0e10cSrcweir#else
6026cdf0e10cSrcweir      return 1;
6027cdf0e10cSrcweir#endif
6028cdf0e10cSrcweir}
6029cdf0e10cSrcweir               ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, X headers too old.])])
6030cdf0e10cSrcweir           fi
6031cdf0e10cSrcweir        else
6032cdf0e10cSrcweir           BUILD_TYPE="$BUILD_TYPE CAIRO"
6033cdf0e10cSrcweir	   dnl === compiler fails on pixman with 64bit architectures...===
6034cdf0e10cSrcweir	   if test "$build_cpu" != "x86_64"; then
6035cdf0e10cSrcweir	      BUILD_PIXMAN=YES
6036cdf0e10cSrcweir	   fi
6037da2e13d4SMatthias Seidel           AC_MSG_RESULT([internal])
6038cdf0e10cSrcweir        fi
6039cdf0e10cSrcweir    else
6040cdf0e10cSrcweir	   AC_MSG_RESULT([no])
6041cdf0e10cSrcweir    fi
6042cdf0e10cSrcweirfi
6043cdf0e10cSrcweir
6044cdf0e10cSrcweirAC_SUBST(ENABLE_CAIRO)
6045cdf0e10cSrcweirAC_SUBST(BUILD_PIXMAN)
6046cdf0e10cSrcweirAC_SUBST(SYSTEM_CAIRO)
6047cdf0e10cSrcweirAC_SUBST(CAIRO_CFLAGS)
6048cdf0e10cSrcweirAC_SUBST(CAIRO_LIBS)
6049cdf0e10cSrcweir
605046dacce6SMichael StahlENABLE_CAIRO_CANVAS="FALSE"
605146dacce6SMichael Stahlif test "$enable_cairo_canvas" = "yes" -a "$ENABLE_CAIRO" = "TRUE" ; then
605246dacce6SMichael Stahl   ENABLE_CAIRO_CANVAS="TRUE"
605346dacce6SMichael Stahlfi
605446dacce6SMichael StahlAC_SUBST(ENABLE_CAIRO_CANVAS)
605546dacce6SMichael Stahl
6056cdf0e10cSrcweirdnl ===================================================================
6057cdf0e10cSrcweirdnl Check whether the OpenGL libraries are available
6058cdf0e10cSrcweirdnl ===================================================================
6059cdf0e10cSrcweir
6060cdf0e10cSrcweirAC_MSG_CHECKING([whether to build the OpenGL Transitions component])
6061cdf0e10cSrcweirENABLE_OPENGL=
6062cdf0e10cSrcweir
6063cdf0e10cSrcweirif test "x$enable_opengl" != "xno" ; then
6064cdf0e10cSrcweir   AC_MSG_RESULT([yes])
6065cdf0e10cSrcweir   AC_CHECK_HEADER(GL/gl.h, [],
6066cdf0e10cSrcweir                   [AC_MSG_ERROR([OpenGL headers not found])], [])
6067cdf0e10cSrcweir   AC_CHECK_LIB(GL, main, [],
6068cdf0e10cSrcweir     [AC_MSG_ERROR(libGL not installed or functional)], [])
6069cdf0e10cSrcweir   AC_CHECK_LIB(GLU, main, [],
6070cdf0e10cSrcweir     [AC_MSG_ERROR(libGLU not installed or functional)], [])
6071cdf0e10cSrcweir   ENABLE_OPENGL=TRUE
6072cdf0e10cSrcweirelse
6073cdf0e10cSrcweir   AC_MSG_RESULT([no])
6074cdf0e10cSrcweirfi
6075cdf0e10cSrcweir
6076cdf0e10cSrcweirAC_SUBST(ENABLE_OPENGL)
6077cdf0e10cSrcweir
6078cdf0e10cSrcweir
6079cdf0e10cSrcweirAC_MSG_CHECKING([whether to build the PDF Import extension])
6080cdf0e10cSrcweirif test -n "$enable_pdfimport" -a "$enable_pdfimport" != "no"; then
6081cdf0e10cSrcweir  AC_MSG_RESULT([yes])
6082cdf0e10cSrcweir  ENABLE_PDFIMPORT=YES
6083cdf0e10cSrcweir
6084cdf0e10cSrcweir  dnl ===================================================================
6085cdf0e10cSrcweir  dnl Check for system poppler
6086cdf0e10cSrcweir  dnl ===================================================================
60877afab28fSJürgen Schmidt  AC_MSG_CHECKING([whether to use system pdf backend])
6088cdf0e10cSrcweir  if test -n "$with_system_poppler" -o -n "$with_system_libs" && \
6089cdf0e10cSrcweir       test "$with_system_poppler" != "no"; then
6090cdf0e10cSrcweir      AC_MSG_RESULT([external])
6091cdf0e10cSrcweir      SYSTEM_POPPLER=YES
6092cdf0e10cSrcweir      PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
6093cdf0e10cSrcweir  else
60947afab28fSJürgen Schmidt      AC_MSG_RESULT([no])
6095cdf0e10cSrcweir      SYSTEM_POPPLER=NO
60967afab28fSJürgen Schmidt      ENABLE_PDFIMPORT=NO
6097cdf0e10cSrcweir  fi
6098cdf0e10cSrcweirelse
6099cdf0e10cSrcweir   AC_MSG_RESULT([no])
6100cdf0e10cSrcweir   ENABLE_PDFIMPORT=NO
6101cdf0e10cSrcweirfi
6102cdf0e10cSrcweirAC_SUBST(ENABLE_PDFIMPORT)
6103cdf0e10cSrcweirAC_SUBST(SYSTEM_POPPLER)
6104cdf0e10cSrcweirAC_SUBST(POPPLER_CFLAGS)
6105cdf0e10cSrcweirAC_SUBST(POPPLER_LIBS)
6106cdf0e10cSrcweir
6107cdf0e10cSrcweirAC_MSG_CHECKING([whether to build the Wiki Publisher extension])
6108da2e13d4SMatthias Seidelif test -n "$enable_wiki_publisher" -a "$enable_wiki_publisher" != "no" && test "$WITH_JAVA" != "no"; then
6109cdf0e10cSrcweir  AC_MSG_RESULT([yes])
6110cdf0e10cSrcweir  AC_MSG_CHECKING([for swext module])
6111cdf0e10cSrcweir  if test -d ./swext; then
6112cdf0e10cSrcweir   AC_MSG_RESULT([OK])
6113cdf0e10cSrcweir  else
6114cdf0e10cSrcweir   AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
6115cdf0e10cSrcweir  fi
6116cdf0e10cSrcweir  ENABLE_MEDIAWIKI=YES
6117cdf0e10cSrcweir  BUILD_TYPE="$BUILD_TYPE SWEXT"
6118cdf0e10cSrcweirelse
6119cdf0e10cSrcweir  AC_MSG_RESULT([no])
6120cdf0e10cSrcweir  ENABLE_MEDIAWIKI=NO
6121cdf0e10cSrcweirfi
6122cdf0e10cSrcweirAC_SUBST(ENABLE_MEDIAWIKI)
6123cdf0e10cSrcweir
6124cdf0e10cSrcweirif test "$ENABLE_MEDIAWIKI" = "YES"; then
6125cdf0e10cSrcweir  AC_MSG_CHECKING([which Servlet API Jar to use])
6126cdf0e10cSrcweir  if test -n "$with_system_servlet_api"; then
6127cdf0e10cSrcweir    AC_MSG_RESULT([external])
6128cdf0e10cSrcweir    SYSTEM_SERVLETAPI=YES
6129cdf0e10cSrcweir      if test -z "$SERVLETAPI_JAR"; then
6130cdf0e10cSrcweir	SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
6131cdf0e10cSrcweir      fi
6132cdf0e10cSrcweir      AC_CHECK_FILE($SERVLETAPI_JAR, [],
6133cdf0e10cSrcweir             [AC_MSG_ERROR(servlet-api.jar not found.)], [])
6134cdf0e10cSrcweir  else
6135cdf0e10cSrcweir    AC_MSG_RESULT([internal])
6136cdf0e10cSrcweir    SYSTEM_SERVLETAPI=NO
6137cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE TOMCAT"
6138cdf0e10cSrcweir  fi
6139cdf0e10cSrcweirfi
6140cdf0e10cSrcweirAC_SUBST(SYSTEM_SERVLETAPI)
6141cdf0e10cSrcweirAC_SUBST(SERVLETAPI_JAR)
6142cdf0e10cSrcweir
6143cdf0e10cSrcweirAC_MSG_CHECKING([whether to build the Report Builder extension])
6144cdf0e10cSrcweirif test -n "$enable_report_builder" -a "$enable_report_builder" != "no" && test "$WITH_JAVA" != "no"; then
6145cdf0e10cSrcweir  AC_MSG_RESULT([yes])
6146cdf0e10cSrcweir  ENABLE_REPORTBUILDER=YES
614757f49b00SOliver-Rainer Wittmann  SYSTEM_JFREEREPORT=YES
6148cdf0e10cSrcweir  AC_MSG_CHECKING([for reportbuilder module])
6149cdf0e10cSrcweir  if test -d ./reportbuilder; then
6150cdf0e10cSrcweir    AC_MSG_RESULT([OK])
6151cdf0e10cSrcweir  else
6152cdf0e10cSrcweir    AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
6153cdf0e10cSrcweir  fi
615424fe865aSOliver-Rainer Wittmann  AC_MSG_CHECKING([which jfreereport libs to use (for Report Builder extension)])
615524fe865aSOliver-Rainer Wittmann  AC_MSG_RESULT([external])
615624fe865aSOliver-Rainer Wittmann  if test -z $SAC_JAR; then
615724fe865aSOliver-Rainer Wittmann         SAC_JAR=/usr/share/java/sac.jar
615824fe865aSOliver-Rainer Wittmann  fi
615924fe865aSOliver-Rainer Wittmann  AC_CHECK_FILE($SAC_JAR, [],
616024fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(sac.jar not found.)], [])
616124fe865aSOliver-Rainer Wittmann
616224fe865aSOliver-Rainer Wittmann  if test -z $LIBXML_JAR; then
6163da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
616424fe865aSOliver-Rainer Wittmann      [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
616524fe865aSOliver-Rainer Wittmann      [
6166da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/libxml.jar,
616724fe865aSOliver-Rainer Wittmann          [ LIBXML_JAR=/usr/share/java/libxml.jar ],
616824fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(libxml.jar replacement not found.)]
6169cdf0e10cSrcweir        )
617024fe865aSOliver-Rainer Wittmann      ]
617124fe865aSOliver-Rainer Wittmann    )
617224fe865aSOliver-Rainer Wittmann  else
617324fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBXML_JAR, [],
617424fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(libxml.jar not found.)], [])
617524fe865aSOliver-Rainer Wittmann  fi
6176cdf0e10cSrcweir
617724fe865aSOliver-Rainer Wittmann  if test -z $FLUTE_JAR; then
6178da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
617924fe865aSOliver-Rainer Wittmann      [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
618024fe865aSOliver-Rainer Wittmann      [
6181da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/flute.jar,
618224fe865aSOliver-Rainer Wittmann          [ FLUTE_JAR=/usr/share/java/flute.jar ],
618324fe865aSOliver-Rainer Wittmann          [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
6184cdf0e10cSrcweir        )
618524fe865aSOliver-Rainer Wittmann      ]
618624fe865aSOliver-Rainer Wittmann    )
618724fe865aSOliver-Rainer Wittmann  else
618824fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($FLUTE_JAR, [],
618924fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
619024fe865aSOliver-Rainer Wittmann  fi
6191cdf0e10cSrcweir
619224fe865aSOliver-Rainer Wittmann  if test -z $JFREEREPORT_JAR; then
6193da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
619424fe865aSOliver-Rainer Wittmann      [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
619524fe865aSOliver-Rainer Wittmann      [
6196da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
619724fe865aSOliver-Rainer Wittmann          [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
619824fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
6199cdf0e10cSrcweir        )
620024fe865aSOliver-Rainer Wittmann      ]
620124fe865aSOliver-Rainer Wittmann    )
620224fe865aSOliver-Rainer Wittmann  else
620324fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($JFREEREPORT_JAR, [],
620424fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(jfreereport.jar not found.)], [])
620524fe865aSOliver-Rainer Wittmann  fi
6206cdf0e10cSrcweir
620724fe865aSOliver-Rainer Wittmann  if test -z $LIBLAYOUT_JAR; then
6208da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
620924fe865aSOliver-Rainer Wittmann      [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
621024fe865aSOliver-Rainer Wittmann      [
6211da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/liblayout.jar,
621224fe865aSOliver-Rainer Wittmann          [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
621324fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(liblayout.jar replacement not found.)]
6214cdf0e10cSrcweir        )
621524fe865aSOliver-Rainer Wittmann      ]
621624fe865aSOliver-Rainer Wittmann    )
621724fe865aSOliver-Rainer Wittmann  else
621824fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBLAYOUT_JAR, [],
621924fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(liblayout.jar not found.)], [])
622024fe865aSOliver-Rainer Wittmann  fi
6221cdf0e10cSrcweir
622224fe865aSOliver-Rainer Wittmann  if test -z $LIBLOADER_JAR; then
6223da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
622424fe865aSOliver-Rainer Wittmann      [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
622524fe865aSOliver-Rainer Wittmann      [
6226da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/libloader.jar,
622724fe865aSOliver-Rainer Wittmann          [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
622824fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(libloader.jar replacement not found.)]
6229cdf0e10cSrcweir        )
623024fe865aSOliver-Rainer Wittmann      ]
623124fe865aSOliver-Rainer Wittmann    )
623224fe865aSOliver-Rainer Wittmann  else
623324fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBLOADER_JAR, [],
623424fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(libloader.jar not found.)], [])
623524fe865aSOliver-Rainer Wittmann  fi
6236cdf0e10cSrcweir
623724fe865aSOliver-Rainer Wittmann  if test -z $LIBFORMULA_JAR; then
6238da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
623924fe865aSOliver-Rainer Wittmann      [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
624024fe865aSOliver-Rainer Wittmann      [
6241da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/libformula.jar,
624224fe865aSOliver-Rainer Wittmann          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
624324fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(libformula.jar replacement not found.)]
6244cdf0e10cSrcweir        )
624524fe865aSOliver-Rainer Wittmann      ]
624624fe865aSOliver-Rainer Wittmann    )
624724fe865aSOliver-Rainer Wittmann  else
624824fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBFORMULA_JAR, [],
624924fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(libformula.jar not found.)], [])
625024fe865aSOliver-Rainer Wittmann  fi
6251cdf0e10cSrcweir
625224fe865aSOliver-Rainer Wittmann  if test -z $LIBREPOSITORY_JAR; then
6253da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
625424fe865aSOliver-Rainer Wittmann      [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
625524fe865aSOliver-Rainer Wittmann      [
6256da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/librepository.jar,
625724fe865aSOliver-Rainer Wittmann          [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
625824fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(librepository.jar replacement not found.)]
6259cdf0e10cSrcweir        )
626024fe865aSOliver-Rainer Wittmann      ]
626124fe865aSOliver-Rainer Wittmann    )
626224fe865aSOliver-Rainer Wittmann  else
626324fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
626424fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(librepository.jar not found.)], [])
626524fe865aSOliver-Rainer Wittmann  fi
6266cdf0e10cSrcweir
626724fe865aSOliver-Rainer Wittmann  if test -z $LIBFONTS_JAR; then
6268da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
626924fe865aSOliver-Rainer Wittmann      [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
627024fe865aSOliver-Rainer Wittmann      [
6271da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/libfonts.jar,
627224fe865aSOliver-Rainer Wittmann          [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
627324fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(libfonts.jar replacement not found.)]
6274cdf0e10cSrcweir        )
627524fe865aSOliver-Rainer Wittmann      ]
627624fe865aSOliver-Rainer Wittmann    )
627724fe865aSOliver-Rainer Wittmann  else
627824fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBFONTS_JAR, [],
627924fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(libfonts.jar not found.)], [])
628024fe865aSOliver-Rainer Wittmann  fi
6281cdf0e10cSrcweir
628224fe865aSOliver-Rainer Wittmann  if test -z $LIBSERIALIZER_JAR; then
6283da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
628424fe865aSOliver-Rainer Wittmann      [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
628524fe865aSOliver-Rainer Wittmann      [
6286da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/libserializer.jar,
628724fe865aSOliver-Rainer Wittmann          [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
628824fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(libserializer.jar replacement not found.)]
6289cdf0e10cSrcweir        )
629024fe865aSOliver-Rainer Wittmann      ]
629124fe865aSOliver-Rainer Wittmann    )
629224fe865aSOliver-Rainer Wittmann  else
629324fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
629424fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(libserializer.jar not found.)], [])
629524fe865aSOliver-Rainer Wittmann  fi
6296cdf0e10cSrcweir
6297cdf0e10cSrcweir
629824fe865aSOliver-Rainer Wittmann  if test -z $LIBBASE_JAR; then
6299da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
630024fe865aSOliver-Rainer Wittmann      [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
630124fe865aSOliver-Rainer Wittmann      [
6302da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/libbase.jar,
630324fe865aSOliver-Rainer Wittmann          [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
630424fe865aSOliver-Rainer Wittmann          [AC_MSG_ERROR(libbase.jar replacement not found.)]
6305cdf0e10cSrcweir        )
630624fe865aSOliver-Rainer Wittmann      ]
630724fe865aSOliver-Rainer Wittmann    )
6308cdf0e10cSrcweir  else
630924fe865aSOliver-Rainer Wittmann    AC_CHECK_FILE($LIBBASE_JAR, [],
631024fe865aSOliver-Rainer Wittmann         [AC_MSG_ERROR(libbase.jar not found.)], [])
6311cdf0e10cSrcweir  fi
6312cdf0e10cSrcweir  BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
6313cdf0e10cSrcweirelse
6314cdf0e10cSrcweir  AC_MSG_RESULT([no])
6315cdf0e10cSrcweir  ENABLE_REPORTBUILDER=NO
6316cdf0e10cSrcweirfi
6317cdf0e10cSrcweirAC_SUBST(ENABLE_REPORTBUILDER)
631857f49b00SOliver-Rainer WittmannAC_SUBST(SYSTEM_JFREEREPORT)
6319cdf0e10cSrcweirAC_SUBST(SAC_JAR)
6320cdf0e10cSrcweirAC_SUBST(LIBXML_JAR)
6321cdf0e10cSrcweirAC_SUBST(FLUTE_JAR)
6322cdf0e10cSrcweirAC_SUBST(JFREEREPORT_JAR)
6323cdf0e10cSrcweirAC_SUBST(LIBBASE_JAR)
6324cdf0e10cSrcweirAC_SUBST(LIBLAYOUT_JAR)
6325cdf0e10cSrcweirAC_SUBST(LIBLOADER_JAR)
6326cdf0e10cSrcweirAC_SUBST(LIBFORMULA_JAR)
6327cdf0e10cSrcweirAC_SUBST(LIBREPOSITORY_JAR)
6328cdf0e10cSrcweirAC_SUBST(LIBFONTS_JAR)
6329cdf0e10cSrcweirAC_SUBST(LIBSERIALIZER_JAR)
6330cdf0e10cSrcweir
6331b0374c35Smseidel# this has to be here because both the Wiki Publisher and the Report
6332b0374c35Smseidel# Builder use commons-logging, while the non-optional PostgreSQL
6333b0374c35Smseidel# connector uses commons-lang.
63343c5114b8SDamjan JovanovicAC_MSG_CHECKING([which Apache commons-* libs to use])
63353c5114b8SDamjan Jovanovicif test "$with_system_apache_commons" = "yes"; then
63363c5114b8SDamjan Jovanovic  SYSTEM_APACHE_COMMONS=YES
63373c5114b8SDamjan Jovanovic  AC_MSG_RESULT([external])
6338cdf0e10cSrcweir
63393c5114b8SDamjan Jovanovic  if test -z $COMMONS_LANG_JAR; then
6340da2e13d4SMatthias Seidel    AC_CHECK_FILE(/usr/share/java/commons-lang3-3.3.jar,
63413c5114b8SDamjan Jovanovic      [ COMMONS_LANG_JAR=/usr/share/java/commons-lang3-3.3.jar ],
63423c5114b8SDamjan Jovanovic      [
6343da2e13d4SMatthias Seidel        AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
63443c5114b8SDamjan Jovanovic          [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
63453c5114b8SDamjan Jovanovic          [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
6346cdf0e10cSrcweir        )
63473c5114b8SDamjan Jovanovic      ]
63483c5114b8SDamjan Jovanovic    )
63493c5114b8SDamjan Jovanovic  else
63503c5114b8SDamjan Jovanovic    AC_CHECK_FILE($COMMONS_LANG_JAR, [],
63513c5114b8SDamjan Jovanovic         [AC_MSG_ERROR(commons-lang.jar not found.)], [])
63523c5114b8SDamjan Jovanovic  fi
63533c5114b8SDamjan Jovanovic  AC_MSG_CHECKING([whether commons-lang is version 3.x])
63543c5114b8SDamjan Jovanovic  export COMMONS_LANG_JAR
63553c5114b8SDamjan Jovanovic  if $PERL -e 'use Archive::Zip;
63563c5114b8SDamjan Jovanovic      my $file = "$ENV{'COMMONS_LANG_JAR'}";
63573c5114b8SDamjan Jovanovic      my $zip = Archive::Zip->new( $file );
63583c5114b8SDamjan Jovanovic      my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
63593c5114b8SDamjan Jovanovic      if ( $mf =~ m/Specification-Version: 3.*/ ) {
63603c5114b8SDamjan Jovanovic          exit 0;
63613c5114b8SDamjan Jovanovic      } else {
63623c5114b8SDamjan Jovanovic          exit 1;
63633c5114b8SDamjan Jovanovic      }'; then
63643c5114b8SDamjan Jovanovic      AC_MSG_RESULT([yes])
63653c5114b8SDamjan Jovanovic  else
63663c5114b8SDamjan Jovanovic      AC_MSG_ERROR([no, you need Apache Commons Lang 3.x])
63673c5114b8SDamjan Jovanovic  fi
6368cdf0e10cSrcweir
63693c5114b8SDamjan Jovanovic  if test "$ENABLE_MEDIAWIKI" = "YES"; then
63703c5114b8SDamjan Jovanovic    if test -z $COMMONS_CODEC_JAR; then
6371da2e13d4SMatthias Seidel      AC_CHECK_FILE(/usr/share/java/commons-codec-1.9.jar,
63723c5114b8SDamjan Jovanovic        [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.9.jar ],
63733c5114b8SDamjan Jovanovic        [
6374da2e13d4SMatthias Seidel          AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
63753c5114b8SDamjan Jovanovic            [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
63763c5114b8SDamjan Jovanovic            [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
63773c5114b8SDamjan Jovanovic          )
63783c5114b8SDamjan Jovanovic        ]
63793c5114b8SDamjan Jovanovic      )
63803c5114b8SDamjan Jovanovic    else
63813c5114b8SDamjan Jovanovic      AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
63823c5114b8SDamjan Jovanovic           [AC_MSG_ERROR(commons-codec.jar not found.)], [])
6383cdf0e10cSrcweir    fi
63843c5114b8SDamjan Jovanovic
63853c5114b8SDamjan Jovanovic    if test -z $COMMONS_HTTPCLIENT_JAR; then
6386da2e13d4SMatthias Seidel      AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
63873c5114b8SDamjan Jovanovic        [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
63883c5114b8SDamjan Jovanovic        [
6389da2e13d4SMatthias Seidel          AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
63903c5114b8SDamjan Jovanovic            [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
63913c5114b8SDamjan Jovanovic            [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
63923c5114b8SDamjan Jovanovic          )
63933c5114b8SDamjan Jovanovic        ]
63943c5114b8SDamjan Jovanovic      )
63953c5114b8SDamjan Jovanovic    else
63963c5114b8SDamjan Jovanovic      AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
63973c5114b8SDamjan Jovanovic           [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
6398cdf0e10cSrcweir    fi
6399cdf0e10cSrcweir  fi
64003c5114b8SDamjan Jovanovic  if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
64013c5114b8SDamjan Jovanovic    if test -z $COMMONS_LOGGING_JAR; then
6402da2e13d4SMatthias Seidel      AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.3.jar,
64033c5114b8SDamjan Jovanovic        [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.3.jar ],
64043c5114b8SDamjan Jovanovic        [
6405da2e13d4SMatthias Seidel          AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
64063c5114b8SDamjan Jovanovic            [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
64073c5114b8SDamjan Jovanovic            [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
64083c5114b8SDamjan Jovanovic          )
64093c5114b8SDamjan Jovanovic        ]
64103c5114b8SDamjan Jovanovic      )
64113c5114b8SDamjan Jovanovic    else
64123c5114b8SDamjan Jovanovic      AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
64133c5114b8SDamjan Jovanovic           [AC_MSG_ERROR(commons-logging.jar not found.)], [])
64143c5114b8SDamjan Jovanovic    fi
64153c5114b8SDamjan Jovanovic  fi
64163c5114b8SDamjan Jovanovicelse
64173c5114b8SDamjan Jovanovic  AC_MSG_RESULT([internal])
64183c5114b8SDamjan Jovanovic  SYSTEM_APACHE_COMMONS=NO
64193c5114b8SDamjan Jovanovic  BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
6420cdf0e10cSrcweirfi
6421cdf0e10cSrcweirAC_SUBST(SYSTEM_APACHE_COMMONS)
6422cdf0e10cSrcweirAC_SUBST(COMMONS_CODEC_JAR)
6423cdf0e10cSrcweirAC_SUBST(COMMONS_LANG_JAR)
6424cdf0e10cSrcweirAC_SUBST(COMMONS_HTTPCLIENT_JAR)
6425cdf0e10cSrcweirAC_SUBST(COMMONS_LOGGING_JAR)
6426cdf0e10cSrcweir
6427cdf0e10cSrcweirdnl ===================================================================
6428cdf0e10cSrcweirdnl Check whether the Qt and KDE libraries are available.
6429cdf0e10cSrcweirdnl ===================================================================
6430cdf0e10cSrcweir
6431cdf0e10cSrcweirKDE_CFLAGS=""
6432cdf0e10cSrcweirKDE_LIBS=""
6433cdf0e10cSrcweirMOC="moc"
6434cdf0e10cSrcweirif test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
6435cdf0e10cSrcweir    dnl Search paths for Qt and KDE
6436cdf0e10cSrcweir    if test "$build_cpu" != "x86_64" ; then
6437cdf0e10cSrcweir        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"
6438cdf0e10cSrcweir        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"
6439cdf0e10cSrcweir    else
6440cdf0e10cSrcweir        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"
6441cdf0e10cSrcweir        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"
6442cdf0e10cSrcweir    fi
6443cdf0e10cSrcweir    if test -n "$QTDIR" ; then
6444cdf0e10cSrcweir        qt_incdirs="$QTDIR/include $qt_incdirs"
6445cdf0e10cSrcweir        if test "$build_cpu" != "x86_64" ; then
6446cdf0e10cSrcweir            qt_libdirs="$QTDIR/lib $qt_libdirs"
6447cdf0e10cSrcweir        else
6448cdf0e10cSrcweir            qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
6449cdf0e10cSrcweir        fi
6450cdf0e10cSrcweir    fi
6451cdf0e10cSrcweir    if test "$build_cpu" != "x86_64" ; then
6452cdf0e10cSrcweir        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"
6453cdf0e10cSrcweir        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"
6454cdf0e10cSrcweir    else
6455cdf0e10cSrcweir        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"
6456cdf0e10cSrcweir        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"
6457cdf0e10cSrcweir    fi
6458cdf0e10cSrcweir    if test -n "$KDEDIR" ; then
6459cdf0e10cSrcweir        kde_incdirs="$KDEDIR/include $kde_incdirs"
6460cdf0e10cSrcweir        if test "$build_cpu" != "x86_64" ; then
6461cdf0e10cSrcweir            kde_libdirs="$KDEDIR/lib $kde_libdirs"
6462cdf0e10cSrcweir        else
6463cdf0e10cSrcweir            kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
6464cdf0e10cSrcweir        fi
6465cdf0e10cSrcweir    fi
6466cdf0e10cSrcweir
6467cdf0e10cSrcweir    dnl What to test
6468cdf0e10cSrcweir    qt_test_include="qstyle.h"
6469cdf0e10cSrcweir    qt_test_library="libqt-mt.so"
6470cdf0e10cSrcweir    kde_test_include="ksharedptr.h"
6471cdf0e10cSrcweir    kde_test_library="libkdeui.so"
6472cdf0e10cSrcweir
6473cdf0e10cSrcweir    dnl Check for Qt headers
6474cdf0e10cSrcweir    AC_MSG_CHECKING([for Qt headers])
6475cdf0e10cSrcweir    qt_incdir="no"
6476cdf0e10cSrcweir    for kde_check in $qt_incdirs ; do
6477cdf0e10cSrcweir        if test -r "$kde_check/$qt_test_include" ; then
6478cdf0e10cSrcweir            qt_incdir="$kde_check"
6479cdf0e10cSrcweir            break
6480cdf0e10cSrcweir        fi
6481cdf0e10cSrcweir    done
6482cdf0e10cSrcweir    AC_MSG_RESULT([$qt_incdir])
6483cdf0e10cSrcweir    if test "x$qt_incdir" = "xno" ; then
6484da2e13d4SMatthias Seidel        AC_MSG_ERROR([Qt headers not found. Please specify the root of
6485cdf0e10cSrcweiryour Qt installation by exporting QTDIR before running "configure".])
6486cdf0e10cSrcweir    fi
6487cdf0e10cSrcweir
6488cdf0e10cSrcweir    dnl Check for Qt libraries
6489cdf0e10cSrcweir    AC_MSG_CHECKING([for Qt libraries])
6490cdf0e10cSrcweir    qt_libdir="no"
6491cdf0e10cSrcweir    for qt_check in $qt_libdirs ; do
6492cdf0e10cSrcweir        if test -r "$qt_check/$qt_test_library" ; then
6493cdf0e10cSrcweir            qt_libdir="$qt_check"
6494cdf0e10cSrcweir            break
6495cdf0e10cSrcweir        fi
6496cdf0e10cSrcweir    done
6497cdf0e10cSrcweir    AC_MSG_RESULT([$qt_libdir])
6498cdf0e10cSrcweir    if test "x$qt_libdir" = "xno" ; then
6499da2e13d4SMatthias Seidel        AC_MSG_ERROR([Qt libraries not found. Please specify the root of
6500cdf0e10cSrcweiryour Qt installation by exporting QTDIR before running "configure".])
6501cdf0e10cSrcweir    fi
6502cdf0e10cSrcweir
6503cdf0e10cSrcweir    dnl Check for Meta Object Compiler
6504cdf0e10cSrcweir    AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
6505cdf0e10cSrcweir    if test "$MOC" = "no" ; then
6506da2e13d4SMatthias Seidel        AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
6507cdf0e10cSrcweirthe root of your Qt installation by exporting QTDIR before running "configure".])
6508cdf0e10cSrcweir    fi
6509cdf0e10cSrcweir
6510cdf0e10cSrcweir    dnl Check for KDE headers
6511cdf0e10cSrcweir    AC_MSG_CHECKING([for KDE headers])
6512cdf0e10cSrcweir    kde_incdir="no"
6513cdf0e10cSrcweir    for kde_check in $kde_incdirs ; do
6514cdf0e10cSrcweir        if test -r "$kde_check/$kde_test_include" ; then
6515cdf0e10cSrcweir            kde_incdir="$kde_check"
6516cdf0e10cSrcweir            break
6517cdf0e10cSrcweir        fi
6518cdf0e10cSrcweir    done
6519cdf0e10cSrcweir    AC_MSG_RESULT([$kde_incdir])
6520cdf0e10cSrcweir    if test "x$kde_incdir" = "xno" ; then
6521da2e13d4SMatthias Seidel        AC_MSG_ERROR([KDE headers not found. Please specify the root of
6522cdf0e10cSrcweiryour KDE installation by exporting KDEDIR before running "configure".])
6523cdf0e10cSrcweir    fi
6524cdf0e10cSrcweir
6525cdf0e10cSrcweir    dnl Check for KDE libraries
6526cdf0e10cSrcweir    AC_MSG_CHECKING([for KDE libraries])
6527cdf0e10cSrcweir    kde_libdir="no"
6528cdf0e10cSrcweir    for kde_check in $kde_libdirs ; do
6529cdf0e10cSrcweir        if test -r "$kde_check/$kde_test_library" ; then
6530cdf0e10cSrcweir            kde_libdir="$kde_check"
6531cdf0e10cSrcweir            break
6532cdf0e10cSrcweir        fi
6533cdf0e10cSrcweir    done
6534cdf0e10cSrcweir    AC_MSG_RESULT([$kde_libdir])
6535cdf0e10cSrcweir    if test "x$kde_libdir" = "xno" ; then
6536da2e13d4SMatthias Seidel        AC_MSG_ERROR([KDE libraries not found. Please specify the root of
6537cdf0e10cSrcweiryour KDE installation by exporting KDEDIR before running "configure".])
6538cdf0e10cSrcweir    fi
6539cdf0e10cSrcweir
6540cdf0e10cSrcweir    dnl Set the variables
6541cdf0e10cSrcweir    KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
6542cdf0e10cSrcweir    KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
6543cdf0e10cSrcweirfi
6544cdf0e10cSrcweirAC_SUBST(KDE_CFLAGS)
6545cdf0e10cSrcweirAC_SUBST(KDE_LIBS)
6546cdf0e10cSrcweirAC_SUBST(MOC)
6547cdf0e10cSrcweir
6548cdf0e10cSrcweirdnl ===================================================================
6549cdf0e10cSrcweirdnl KDE4 Integration
6550cdf0e10cSrcweirdnl ===================================================================
6551cdf0e10cSrcweir
6552cdf0e10cSrcweirKDE4_CFLAGS=""
6553cdf0e10cSrcweirKDE4_LIBS=""
6554cdf0e10cSrcweirMOC4="moc"
6555cdf0e10cSrcweirif test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
6556cdf0e10cSrcweir   qt_incdirs="$QT4INC $QT4DIR /usr/include/qt4 /usr/include $x_includes"
6557cdf0e10cSrcweir   qt_libdirs="$QT4LIB /usr/lib $x_libraries"
6558da2e13d4SMatthias Seidel
6559c1d0fc05SHerbert Dürr   kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
6560c1d0fc05SHerbert Dürr   kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
6561da2e13d4SMatthias Seidel
6562cdf0e10cSrcweir   if test "$build_cpu" = "x86_64" ; then
6563cdf0e10cSrcweir      qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
6564c1d0fc05SHerbert Dürr      kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
6565cdf0e10cSrcweir   fi
6566cdf0e10cSrcweir
6567cdf0e10cSrcweir   if test -n "$KDE4DIR" ; then
6568cdf0e10cSrcweir      kde_incdirs="$KDE4DIR/include $kde_incdirs"
6569cdf0e10cSrcweir      if test "$build_cpu" != "x86_64" ; then
6570cdf0e10cSrcweir         kde_libdirs="$KDE4DIR/lib $kde_libdirs"
6571cdf0e10cSrcweir      else
6572cdf0e10cSrcweir         kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
6573cdf0e10cSrcweir      fi
6574cdf0e10cSrcweir   fi
6575cdf0e10cSrcweir
6576cdf0e10cSrcweir   qt_test_include="Qt/qobject.h"
6577cdf0e10cSrcweir   qt_test_library="libQtCore.so"
6578cdf0e10cSrcweir   kde_test_include="ksharedptr.h"
6579cdf0e10cSrcweir   kde_test_library="libkdeui.so"
6580da2e13d4SMatthias Seidel
6581cdf0e10cSrcweir   AC_MSG_CHECKING([for Qt4 headers])
6582cdf0e10cSrcweir   qt_header_dir="no"
6583cdf0e10cSrcweir   for inc_dir in $qt_incdirs ; do
6584cdf0e10cSrcweir      if test -r "$inc_dir/$qt_test_include" ; then
6585cdf0e10cSrcweir         qt_header_dir="$inc_dir"
6586cdf0e10cSrcweir         break
6587cdf0e10cSrcweir      fi
6588cdf0e10cSrcweir   done
6589da2e13d4SMatthias Seidel
6590cdf0e10cSrcweir   AC_MSG_RESULT([$qt_header_dir])
6591cdf0e10cSrcweir   if test "x$qt_header_dir" = "xno" ; then
6592da2e13d4SMatthias Seidel      AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
6593cdf0e10cSrcweir   fi
6594da2e13d4SMatthias Seidel
6595cdf0e10cSrcweir   AC_MSG_CHECKING([for Qt4 libraries])
6596cdf0e10cSrcweir   qt_lib_dir="no"
6597cdf0e10cSrcweir   for lib_dir in $qt_libdirs ; do
6598cdf0e10cSrcweir      if test -r "$lib_dir/$qt_test_library" ; then
6599cdf0e10cSrcweir         qt_lib_dir="$lib_dir"
6600cdf0e10cSrcweir         break
6601cdf0e10cSrcweir      fi
6602cdf0e10cSrcweir   done
6603da2e13d4SMatthias Seidel
6604cdf0e10cSrcweir   AC_MSG_RESULT([$qt_lib_dir])
6605da2e13d4SMatthias Seidel
6606cdf0e10cSrcweir   if test "x$qt_lib_dir" = "xno" ; then
6607da2e13d4SMatthias Seidel      AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
6608cdf0e10cSrcweir   fi
6609cdf0e10cSrcweir
6610cdf0e10cSrcweir   dnl Check for Meta Object Compiler
6611c1d0fc05SHerbert Dürr   AC_PATH_PROG( MOCQT4, moc-qt4, no, [$QT4DIR/bin:$PATH] )
6612c1d0fc05SHerbert Dürr   MOC4="$MOCQT4"
6613cdf0e10cSrcweir   if test "$MOC4" = "no" ; then
6614c1d0fc05SHerbert Dürr      AC_PATH_PROG( MOC4, moc, no, [$PATH:$QT4DIR/bin] )
6615c1d0fc05SHerbert Dürr      if test "$MOC4" = "no" ; then
6616da2e13d4SMatthias Seidel         AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
6617c1d0fc05SHerbert Dürr      fi
6618cdf0e10cSrcweir   fi
6619cdf0e10cSrcweir
6620cdf0e10cSrcweir   dnl Check for KDE4 headers
6621cdf0e10cSrcweir   AC_MSG_CHECKING([for KDE4 headers])
6622cdf0e10cSrcweir   kde_incdir="no"
6623cdf0e10cSrcweir   for kde_check in $kde_incdirs ; do
6624cdf0e10cSrcweir      if test -r "$kde_check/$kde_test_include" ; then
6625cdf0e10cSrcweir         kde_incdir="$kde_check"
6626cdf0e10cSrcweir         break
6627cdf0e10cSrcweir      fi
6628cdf0e10cSrcweir   done
6629cdf0e10cSrcweir   AC_MSG_RESULT([$kde_incdir])
6630cdf0e10cSrcweir   if test "x$kde_incdir" = "xno" ; then
6631da2e13d4SMatthias Seidel      AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
6632cdf0e10cSrcweir   fi
6633cdf0e10cSrcweir
6634cdf0e10cSrcweir   dnl Check for KDE4 libraries
6635cdf0e10cSrcweir   AC_MSG_CHECKING([for KDE4 libraries])
6636cdf0e10cSrcweir   kde_libdir="no"
6637cdf0e10cSrcweir   for kde_check in $kde_libdirs ; do
6638cdf0e10cSrcweir      if test -r "$kde_check/$kde_test_library" ; then
6639cdf0e10cSrcweir         kde_libdir="$kde_check"
6640cdf0e10cSrcweir         break
6641cdf0e10cSrcweir      fi
6642cdf0e10cSrcweir   done
6643da2e13d4SMatthias Seidel
6644cdf0e10cSrcweir   AC_MSG_RESULT([$kde_libdir])
6645cdf0e10cSrcweir   if test "x$kde_libdir" = "xno" ; then
6646da2e13d4SMatthias Seidel      AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
6647cdf0e10cSrcweir   fi
6648cdf0e10cSrcweir
6649cdf0e10cSrcweir   KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
6650cdf0e10cSrcweir   KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
6651cdf0e10cSrcweirfi
6652cdf0e10cSrcweirAC_SUBST(KDE4_CFLAGS)
6653cdf0e10cSrcweirAC_SUBST(KDE4_LIBS)
6654cdf0e10cSrcweirAC_SUBST(MOC4)
6655cdf0e10cSrcweir
6656cdf0e10cSrcweirdnl ===================================================================
6657cdf0e10cSrcweirdnl Test for the enabling the lockdown pieces
6658cdf0e10cSrcweirdnl ===================================================================
6659cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable the lockdown pieces])
6660cdf0e10cSrcweirENABLE_LOCKDOWN=""
6661cdf0e10cSrcweirif test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then
6662cdf0e10cSrcweir  ENABLE_LOCKDOWN=YES
6663cdf0e10cSrcweir  AC_MSG_RESULT([yes])
6664cdf0e10cSrcweirelse
6665cdf0e10cSrcweir  AC_MSG_RESULT([no])
6666cdf0e10cSrcweirfi
6667cdf0e10cSrcweirAC_SUBST(ENABLE_LOCKDOWN)
6668cdf0e10cSrcweir
6669cdf0e10cSrcweirdnl ===================================================================
6670cdf0e10cSrcweirdnl Test whether to include Evolution 2 support
6671cdf0e10cSrcweirdnl ===================================================================
6672cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable evolution 2 support])
6673cdf0e10cSrcweirif test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
6674cdf0e10cSrcweir   AC_MSG_RESULT([yes])
6675cdf0e10cSrcweir   PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
6676cdf0e10cSrcweir   ENABLE_EVOAB2="TRUE"
6677cdf0e10cSrcweirelse
6678cdf0e10cSrcweir   ENABLE_EVOAB2=""
6679cdf0e10cSrcweir   AC_MSG_RESULT([no])
6680cdf0e10cSrcweirfi
6681cdf0e10cSrcweirAC_SUBST(ENABLE_EVOAB2)
6682cdf0e10cSrcweirAC_SUBST(GOBJECT_CFLAGS)
6683da2e13d4SMatthias SeidelAC_SUBST(GOBJECT_LIBS)
6684cdf0e10cSrcweir
6685cdf0e10cSrcweirdnl ===================================================================
6686cdf0e10cSrcweirdnl Test whether to include MathMLDTD
6687cdf0e10cSrcweirdnl ===================================================================
6688cdf0e10cSrcweirAC_MSG_CHECKING([whether to include MathMLDTD])
6689cdf0e10cSrcweirif test -n "$enable_mathmldtd"; then
6690cdf0e10cSrcweir  if test "$enable_mathmldtd" = "no"; then
6691cdf0e10cSrcweir    AC_MSG_RESULT([no])
6692cdf0e10cSrcweir    SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
6693cdf0e10cSrcweir  else
6694cdf0e10cSrcweir    AC_MSG_RESULT([yes])
6695cdf0e10cSrcweir    BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
6696cdf0e10cSrcweir  fi
6697cdf0e10cSrcweirelse
6698cdf0e10cSrcweir  AC_MSG_RESULT([no])
6699cdf0e10cSrcweir  SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
6700cdf0e10cSrcweirfi
6701cdf0e10cSrcweir
6702cdf0e10cSrcweirdnl ===================================================================
67033c6578e9SAndre Fischerdnl Test whether to include category-B fonts
6704cdf0e10cSrcweirdnl ===================================================================
67053c6578e9SAndre FischerWITH_CATB_FONTS=
67063c6578e9SAndre FischerAC_MSG_CHECKING([whether to include category B fonts])
670709a06707SAndre Fischerif test "x$enable_category_b_fonts" = "xyes" && test "x$with_fonts" != "xno"; then
67083c6578e9SAndre Fischer   AC_MSG_RESULT([yes])
67093c6578e9SAndre Fischer   BUILD_TYPE="$BUILD_TYPE CATB_FONTS"
67103c6578e9SAndre Fischer   WITH_CATB_FONTS=YES
67113c6578e9SAndre Fischer   SCPDEFS="$SCPDEFS -DWITH_CATB_FONTS"
67123c6578e9SAndre Fischerelse
67133c6578e9SAndre Fischer   AC_MSG_RESULT([no])
67143c6578e9SAndre Fischer   WITH_CATB_FONTS=NO
67153c6578e9SAndre Fischerfi
67163c6578e9SAndre Fischer
67173c6578e9SAndre Fischerdnl ===================================================================
67183c6578e9SAndre Fischerdnl Test whether to include category-A fonts
67193c6578e9SAndre Fischerdnl ===================================================================
67203c6578e9SAndre FischerWITH_CATA_FONTS=
67213c6578e9SAndre FischerAC_MSG_CHECKING([whether to include category A fonts])
67223c6578e9SAndre Fischerif test "x$with_fonts" != "xno" ; then
6723cdf0e10cSrcweir  AC_MSG_RESULT([yes])
67243c6578e9SAndre Fischer  WITH_CATA_FONTS=YES
67253c6578e9SAndre Fischer  SCPDEFS="$SCPDEFS -DWITH_CATA_FONTS"
67263c6578e9SAndre Fischerelse
67273c6578e9SAndre Fischer  AC_MSG_RESULT([no])
67283c6578e9SAndre Fischer  WITH_CATA_FONTS=NO
67293c6578e9SAndre Fischer  WITH_CATB_FONTS=NO
67303c6578e9SAndre Fischerfi
67313c6578e9SAndre Fischer
67323c6578e9SAndre FischerWITH_FONTS=NO
67333c6578e9SAndre FischerAC_MSG_CHECKING([whether any fonts are included])
67343c6578e9SAndre Fischerif test "x$WITH_CATA_FONTS" = "xYES" -o "x$WITH_CATB_FONTS" = "xYES"; then
6735cdf0e10cSrcweir  BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
67363c6578e9SAndre Fischer  WITH_FONTS=YES
67373c6578e9SAndre Fischer  AC_MSG_RESULT([yes])
6738cdf0e10cSrcweirelse
6739cdf0e10cSrcweir  AC_MSG_RESULT([no])
6740cdf0e10cSrcweirfi
67413c6578e9SAndre Fischer
67423c6578e9SAndre FischerAC_SUBST(WITH_CATA_FONTS)
67433c6578e9SAndre FischerAC_SUBST(WITH_CATB_FONTS)
6744cdf0e10cSrcweirAC_SUBST(WITH_FONTS)
6745cdf0e10cSrcweir
6746cdf0e10cSrcweirdnl ===================================================================
6747cdf0e10cSrcweirdnl Test whether to include ppds
6748cdf0e10cSrcweirdnl ===================================================================
6749cdf0e10cSrcweirAC_MSG_CHECKING([whether to include PPDs])
6750cdf0e10cSrcweirif test "$with_ppds" != "no"; then
6751cdf0e10cSrcweir  AC_MSG_RESULT([yes])
6752cdf0e10cSrcweirelse
6753cdf0e10cSrcweir  AC_MSG_RESULT([no])
6754cdf0e10cSrcweir  WITHOUT_PPDS=YES
6755cdf0e10cSrcweir  SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
6756cdf0e10cSrcweirfi
6757cdf0e10cSrcweirAC_SUBST(WITHOUT_PPDS)
6758cdf0e10cSrcweir
6759cdf0e10cSrcweirdnl ===================================================================
6760cdf0e10cSrcweirdnl Test whether to include afms
6761cdf0e10cSrcweirdnl ===================================================================
6762cdf0e10cSrcweirAC_MSG_CHECKING([whether to include AFMs])
6763cdf0e10cSrcweirif test "$with_afms" != "no"; then
6764cdf0e10cSrcweir  AC_MSG_RESULT([yes])
6765cdf0e10cSrcweir  BUILD_TYPE="$BUILD_TYPE AFMS"
6766cdf0e10cSrcweirelse
6767cdf0e10cSrcweir  AC_MSG_RESULT([no])
6768cdf0e10cSrcweir  WITHOUT_AFMS=YES
6769cdf0e10cSrcweir  SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
6770cdf0e10cSrcweirfi
6771cdf0e10cSrcweirAC_SUBST(WITHOUT_AFMS)
6772cdf0e10cSrcweir
6773cdf0e10cSrcweirAC_SUBST(SCPDEFS)
6774cdf0e10cSrcweir
6775cdf0e10cSrcweirAC_MSG_CHECKING([whether and how to use Xinerama])
6776cdf0e10cSrcweirif test "$_os" = "Darwin"; then
6777cdf0e10cSrcweir   USE_XINERAMA=YES
6778cdf0e10cSrcweir   XINERAMA_LINK=dynamic
6779cdf0e10cSrcweir   AC_MSG_RESULT([yes])
6780cdf0e10cSrcweirelif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
6781cdf0e10cSrcweir   if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then
6782cdf0e10cSrcweir      # we have both versions, let the user decide but use the dynamic one
6783cdf0e10cSrcweir      # per default
6784cdf0e10cSrcweir      USE_XINERAMA=YES
6785cdf0e10cSrcweir      if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
6786cdf0e10cSrcweir         XINERAMA_LINK=dynamic
6787cdf0e10cSrcweir      else
6788cdf0e10cSrcweir         XINERAMA_LINK=static
6789cdf0e10cSrcweir      fi
6790cdf0e10cSrcweir   elif test -e "$XLIB/libXinerama.so" -a ! -e "$XLIB/libXinerama.a"; then
6791cdf0e10cSrcweir      # we have only the dynamic version
6792cdf0e10cSrcweir      USE_XINERAMA=YES
6793cdf0e10cSrcweir      XINERAMA_LINK=dynamic
6794cdf0e10cSrcweir   elif test -e "$XLIB/libXinerama.a"; then
6795cdf0e10cSrcweir      # static version
679628633775SPedro Giffuni      if echo $build_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
6797cdf0e10cSrcweir         USE_XINERAMA=YES
6798cdf0e10cSrcweir         XINERAMA_LINK=static
6799cdf0e10cSrcweir      else
6800cdf0e10cSrcweir         USE_XINERAMA=NO
6801cdf0e10cSrcweir         XINERAMA_LINK=none
6802cdf0e10cSrcweir      fi
6803cdf0e10cSrcweir   else
6804cdf0e10cSrcweir      # no Xinerama
6805cdf0e10cSrcweir      USE_XINERAMA=NO
6806cdf0e10cSrcweir      XINERAMA_LINK=none
6807cdf0e10cSrcweir   fi
6808cdf0e10cSrcweir   if test "$USE_XINERAMA" = "YES"; then
6809cdf0e10cSrcweir      AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
6810cdf0e10cSrcweir      AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
6811cdf0e10cSrcweir          [AC_MSG_ERROR(Xinerama header not found.)], [])
6812cdf0e10cSrcweir      XINERAMA_EXTRA_LIBS="-L$XLIB -lXext"
6813cdf0e10cSrcweir      if test "$_os" = "FreeBSD"; then
6814cdf0e10cSrcweir          XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
6815cdf0e10cSrcweir      fi
6816cdf0e10cSrcweir      if test "$_os" = "Linux"; then
6817cdf0e10cSrcweir          XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
6818cdf0e10cSrcweir      fi
6819cdf0e10cSrcweir      AC_CHECK_LIB(Xinerama, XineramaIsActive, [],
6820cdf0e10cSrcweir          [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
6821cdf0e10cSrcweir   else
6822cdf0e10cSrcweir      AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
6823cdf0e10cSrcweir   fi
6824cdf0e10cSrcweirelse
6825cdf0e10cSrcweir   AC_MSG_RESULT([no])
6826cdf0e10cSrcweirfi
6827cdf0e10cSrcweirAC_SUBST(USE_XINERAMA)
6828cdf0e10cSrcweirAC_SUBST(XINERAMA_LINK)
6829cdf0e10cSrcweir
6830cdf0e10cSrcweirdnl ===================================================================
6831498ce991SArmin Le Granddnl always rely on the system version of gdk-pixbuf
6832cdf0e10cSrcweirdnl ===================================================================
6833cdf0e10cSrcweir
6834498ce991SArmin Le GrandSYSTEM_GDKPIXBUF=YES
6835cdf0e10cSrcweirAC_SUBST(SYSTEM_GDKPIXBUF)
6836cdf0e10cSrcweir
6837cdf0e10cSrcweirdnl ===================================================================
6838498ce991SArmin Le Granddnl always rely on the system version of glib
6839cdf0e10cSrcweirdnl ===================================================================
6840cdf0e10cSrcweir
6841498ce991SArmin Le GrandSYSTEM_GLIB=YES
6842cdf0e10cSrcweirAC_SUBST(SYSTEM_GLIB)
6843cdf0e10cSrcweir
6844cdf0e10cSrcweirdnl ===================================================================
6845498ce991SArmin Le Granddnl always rely on the system version of gettext
6846cdf0e10cSrcweirdnl ===================================================================
6847cdf0e10cSrcweir
6848498ce991SArmin Le GrandSYSTEM_GETTEXT=YES
6849cdf0e10cSrcweirAC_SUBST(SYSTEM_GETTEXT)
6850cdf0e10cSrcweir
6851c25219e0SPedro Giffuniif test "$_os" = "FreeBSD"; then
6852c25219e0SPedro Giffuni    LIBINTL_PREFIX=
6853c25219e0SPedro Giffuni    for dir in $CPPFLAGS; do
6854c25219e0SPedro Giffuni      if dir=`expr -- $dir : '-I\(.*\)'`; then
6855c25219e0SPedro Giffuni        if test -f "$dir/libintl.h" ; then
6856c25219e0SPedro Giffuni          LIBINTL_PREFIX=`dirname $dir`
6857c25219e0SPedro Giffuni        fi
6858c25219e0SPedro Giffuni      fi
6859c25219e0SPedro Giffuni    done
6860c25219e0SPedro Giffuni    AC_SUBST(LIBINTL_PREFIX)
6861c25219e0SPedro Giffunifi
6862c25219e0SPedro Giffuni
6863cdf0e10cSrcweirdnl ===================================================================
6864498ce991SArmin Le Granddnl always rely on the system version of pango
6865cdf0e10cSrcweirdnl ===================================================================
6866cdf0e10cSrcweir
6867498ce991SArmin Le GrandSYSTEM_PANGO=YES
6868cdf0e10cSrcweirAC_SUBST(SYSTEM_PANGO)
6869cdf0e10cSrcweir
6870cdf0e10cSrcweirdnl ===================================================================
6871cdf0e10cSrcweirdnl Test whether to build libpng or rely on the system version
6872cdf0e10cSrcweirdnl ===================================================================
6873cdf0e10cSrcweirAC_MSG_CHECKING([whether to build own version of libpng])
6874cdf0e10cSrcweir
6875cdf0e10cSrcweircase "$_os" in
6876cdf0e10cSrcweir	WINNT*) # Windows
6877cdf0e10cSrcweir	    SYSTEM_LIBPNG=NO
6878cdf0e10cSrcweir	    AC_MSG_RESULT([yes])
6879cdf0e10cSrcweir		;;
6880cdf0e10cSrcweir	Darwin*)
6881cdf0e10cSrcweir	    SYSTEM_LIBPNG=NO
6882cdf0e10cSrcweir	    AC_MSG_RESULT([yes])
6883cdf0e10cSrcweir	    ;;
6884cdf0e10cSrcweir   *)
6885cdf0e10cSrcweir   SYSTEM_LIBPNG=YES
6886cdf0e10cSrcweir   AC_MSG_RESULT([no])
6887cdf0e10cSrcweir   ;;
6888cdf0e10cSrcweiresac
6889cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBPNG)
6890cdf0e10cSrcweir
6891cdf0e10cSrcweirdnl ===================================================================
6892cdf0e10cSrcweirdnl Test whether to build libjpeg or rely on the system version
6893cdf0e10cSrcweirdnl ===================================================================
6894cdf0e10cSrcweirdnl FIXME: this is currently because we have jpeg-6b for our filters
6895cdf0e10cSrcweirdnl        and jpeg-8 as dependency for librsvg
6896cdf0e10cSrcweirdnl        this should be unified into using only one version for both
6897cdf0e10cSrcweir
6898cdf0e10cSrcweirAC_MSG_CHECKING([whether to build own version of libjpeg])
6899cdf0e10cSrcweir
6900e4fb754eSPedro Giffuniif test "$SYSTEM_JPEG" = "YES"; then
6901cdf0e10cSrcweirSYSTEM_LIBJPEG=YES
6902cdf0e10cSrcweirelse
6903cdf0e10cSrcweircase "$_os" in
6904cdf0e10cSrcweir	WINNT*) # Windows
6905cdf0e10cSrcweir	    SYSTEM_LIBJPEG=NO
6906cdf0e10cSrcweir		;;
6907cdf0e10cSrcweir	Darwin*)
6908cdf0e10cSrcweir	    SYSTEM_LIBJPEG=NO
6909cdf0e10cSrcweir	    ;;
6910cdf0e10cSrcweir   *)
69119ef65f0eSAndre Fischer        SYSTEM_LIBJPEG=YES
69129ef65f0eSAndre Fischer        ;;
6913cdf0e10cSrcweiresac
6914cdf0e10cSrcweirfi
6915cdf0e10cSrcweir
6916e4fb754eSPedro Giffuniif test "$SYSTEM_LIBJPEG" = "YES"; then
6917cdf0e10cSrcweir   AC_MSG_RESULT([no])
6918cdf0e10cSrcweirelse
6919cdf0e10cSrcweir   AC_MSG_RESULT([yes])
6920cdf0e10cSrcweirfi
6921cdf0e10cSrcweirAC_SUBST(SYSTEM_LIBJPEG)
6922cdf0e10cSrcweir
69233d781bd6SAndre Fischerdnl ===================================================================
69243d781bd6SAndre Fischerdnl Test whether rat scan was requested and whether apache-rat is available
69253d781bd6SAndre Fischerdnl ===================================================================
69263d781bd6SAndre FischerRAT_JAR=
69273d781bd6SAndre FischerAC_MSG_CHECKING([whether to trigger rat scan])
692857d1faa0SMaho NAKATAif test -z "$with_rat_scan" -o "$with_rat_scan" = "no"; then
6929b23cf23bSAriel Constenla-Haile    AC_MSG_RESULT([no])
6930b23cf23bSAriel Constenla-Haileelse
693157d1faa0SMaho NAKATA    if test "$WITH_JAVA" = "no"; then
69323d781bd6SAndre Fischer        AC_MSG_ERROR([no, java disabled, enable with --with-java])
693357d1faa0SMaho NAKATA    elif test "$enable_saxon" = "no"; then
69343d781bd6SAndre Fischer        AC_MSG_ERROR([no, saxon disabled, enable with --enable-category-b])
693557d1faa0SMaho NAKATA    elif test "$with_rat_scan" = "yes"; then
69363d781bd6SAndre Fischer        AC_MSG_RESULT([yes, use pre-built library])
69373d781bd6SAndre Fischer        RAT_JAR_HOME="BUILD"
69383d781bd6SAndre Fischer        BUILD_TYPE="$BUILD_TYPE RAT"
69393d781bd6SAndre Fischer    else
69403d781bd6SAndre Fischer        AC_MSG_RESULT([yes, use pre-installed library])
69413d781bd6SAndre Fischer        AC_MSG_CHECKING([whether apache-rat is available])
69423d781bd6SAndre Fischer        if test -d "$with_rat_scan"; then
69433d781bd6SAndre Fischer            RAT_JAR_HOME=$with_rat_scan
69443d781bd6SAndre Fischer        else
69453d781bd6SAndre Fischer            AC_MSG_ERROR([$with_rat_scan is not a directory])
69463d781bd6SAndre Fischer        fi
69473d781bd6SAndre Fischer    fi
69483d781bd6SAndre Fischerfi
69493d781bd6SAndre FischerAC_SUBST(RAT_JAR_HOME)
69503d781bd6SAndre Fischer
6951cdf0e10cSrcweir
6952cdf0e10cSrcweirdnl ===================================================================
6953cdf0e10cSrcweirdnl Test for the presence of Ant and that it works
6954cdf0e10cSrcweirdnl ===================================================================
6955cdf0e10cSrcweir
6956cdf0e10cSrcweirif test "$SOLAR_JAVA" != ""; then
6957cdf0e10cSrcweirANT_HOME=; export ANT_HOME
6958cdf0e10cSrcweirWITH_ANT_HOME=; export WITH_ANT_HOME
6959cdf0e10cSrcweirif test -z "$with_ant_home"; then
696061f8b8e8SAndrew Rist   if test "$_os" = "OS2"; then
696186bbd642SYuri Dario     AC_PATH_PROGS(ANT, ant.cmd)
696261f8b8e8SAndrew Rist   else
696337cc8903SMatthias Seidel     AC_PATH_PROGS(ANT, [apache-ant ant ant.sh ant.bat ant.cmd])
696461f8b8e8SAndrew Rist   fi
6965cdf0e10cSrcweirelse
6966cdf0e10cSrcweir   if test "$_os" = "WINNT"; then
6967cdf0e10cSrcweir      with_ant_home=`cygpath -u "$with_ant_home"`
6968cdf0e10cSrcweir   fi
696961f8b8e8SAndrew Rist   if test "$_os" = "OS2"; then
697086bbd642SYuri Dario     AC_PATH_PROGS(ANT, ant.cmd,,$with_ant_home/bin:$PATH)
697161f8b8e8SAndrew Rist   else
697237cc8903SMatthias Seidel     AC_PATH_PROGS(ANT, [apache-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
697361f8b8e8SAndrew Rist   fi
6974cdf0e10cSrcweir   WITH_ANT_HOME=$with_ant_home
6975cdf0e10cSrcweir   ANT_HOME=$with_ant_home
6976cdf0e10cSrcweirfi
6977cdf0e10cSrcweir
6978cdf0e10cSrcweirif test -z "$ANT"; then
6979cdf0e10cSrcweir  AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
6980cdf0e10cSrcweirelse
6981cdf0e10cSrcweir  # resolve relative or absolute symlink
6982cdf0e10cSrcweir  while test -h "$ANT"; do
6983cdf0e10cSrcweir     a_cwd=`pwd`
6984cdf0e10cSrcweir     a_basename=`basename "$ANT"`
6985cdf0e10cSrcweir     a_script=`ls -l "$ANT" | sed "s/.*${a_basename} -> //g"`
6986cdf0e10cSrcweir     cd "`dirname "$ANT"`"
6987cdf0e10cSrcweir     cd "`dirname "$a_script"`"
6988cdf0e10cSrcweir     ANT="`pwd`"/"`basename "$a_script"`"
6989cdf0e10cSrcweir     cd "$a_cwd"
6990cdf0e10cSrcweir  done
6991cdf0e10cSrcweir
6992cdf0e10cSrcweir  if test "$_os" = "OS2"; then
6993cdf0e10cSrcweir    ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
6994cdf0e10cSrcweir    export ANT_HOME
6995cdf0e10cSrcweir  fi
6996cdf0e10cSrcweir
6997cdf0e10cSrcweir  AC_MSG_CHECKING([if $ANT works])
6998cdf0e10cSrcweircat > conftest.java << EOF
6999cdf0e10cSrcweir    public class conftest {
7000cdf0e10cSrcweir	int testmethod(int a, int b) {
7001cdf0e10cSrcweir            return a + b;
7002cdf0e10cSrcweir	}
7003cdf0e10cSrcweir    }
7004cdf0e10cSrcweirEOF
7005cdf0e10cSrcweir
7006cdf0e10cSrcweircat > conftest.xml << EOF
7007cdf0e10cSrcweir    <project name="conftest" default="conftest">
7008cdf0e10cSrcweir	<target name="conftest">
7009cdf0e10cSrcweir            <javac srcdir="." includes="conftest.java">
7010cdf0e10cSrcweir	    </javac>
7011cdf0e10cSrcweir	</target>
7012cdf0e10cSrcweir    </project>
7013cdf0e10cSrcweirEOF
7014cdf0e10cSrcweir  oldJAVA_HOME=$JAVA_HOME
7015cdf0e10cSrcweir  if test "$JAVACISGCJ" = "yes"; then
7016cdf0e10cSrcweir    JAVA_HOME=; export JAVA_HOME
7017cdf0e10cSrcweir    ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
7018cdf0e10cSrcweir  else
7019cdf0e10cSrcweir    ant_cmd="$ANT -buildfile conftest.xml 1>&2"
7020cdf0e10cSrcweir  fi
7021cdf0e10cSrcweir  AC_TRY_EVAL(ant_cmd)
7022cdf0e10cSrcweir  if test $? = 0 && test -f ./conftest.class ; then
7023da2e13d4SMatthias Seidel    AC_MSG_RESULT([Ant works])
7024cdf0e10cSrcweir    if test -z "$WITH_ANT_HOME"; then
7025cdf0e10cSrcweir        ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
7026cdf0e10cSrcweir        if test -z "$ANT_HOME"; then
7027cdf0e10cSrcweir            ANT_HOME=`echo $ANT | $SED -n "s/\/bin\/ant.*\$//p"`
7028cdf0e10cSrcweir        fi
7029cdf0e10cSrcweir    else
7030cdf0e10cSrcweir        ANT_HOME="$WITH_ANT_HOME"
7031cdf0e10cSrcweir    fi
7032cdf0e10cSrcweir  else
7033cdf0e10cSrcweir    echo "configure: Ant test failed" >&5
7034cdf0e10cSrcweir    cat conftest.java >&5
7035cdf0e10cSrcweir    cat conftest.xml >&5
7036cdf0e10cSrcweir    AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
7037cdf0e10cSrcweir    ANT_HOME=""
7038cdf0e10cSrcweir    echo "Ant does not work - Some Java projects will not build!" >>warn
7039cdf0e10cSrcweir  fi
7040cdf0e10cSrcweir  JAVA_HOME=$oldJAVA_HOME
7041cdf0e10cSrcweir  rm -f conftest* core core.* *.core
7042cdf0e10cSrcweirfi
7043cdf0e10cSrcweirif test -z "$ANT_HOME"; then
7044cdf0e10cSrcweir   ANT_HOME="NO_ANT_HOME"
7045cdf0e10cSrcweirfi
7046cdf0e10cSrcweirAC_SUBST(ANT_HOME)
7047cdf0e10cSrcweir
7048cdf0e10cSrcweirdnl Checking for ant.jar
7049cdf0e10cSrcweirif test "$ANT_HOME" != "NO_ANT_HOME"; then
7050cdf0e10cSrcweir   AC_MSG_CHECKING([Ant lib directory])
7051cdf0e10cSrcweir   if test -f $ANT_HOME/lib/ant.jar; then
7052da2e13d4SMatthias Seidel    ANT_LIB="$ANT_HOME/lib"
7053cdf0e10cSrcweir   else
7054cdf0e10cSrcweir      if test -f $ANT_HOME/ant.jar; then
7055da2e13d4SMatthias Seidel         ANT_LIB="$ANT_HOME"
7056cdf0e10cSrcweir      else
7057cdf0e10cSrcweir          if test -f /usr/share/java/ant.jar; then
7058cdf0e10cSrcweir              ANT_LIB=/usr/share/java
7059cdf0e10cSrcweir          else
7060cdf0e10cSrcweir             if test -f /usr/share/ant-core/lib/ant.jar; then
7061cdf0e10cSrcweir                 ANT_LIB=/usr/share/ant-core/lib
7062cdf0e10cSrcweir             else
7063cdf0e10cSrcweir                if test -f $ANT_HOME/lib/ant/ant.jar; then
7064cdf0e10cSrcweir                    ANT_LIB="$ANT_HOME/lib/ant"
7065cdf0e10cSrcweir                else
7066cdf0e10cSrcweir                   if test -f /usr/share/lib/ant/ant.jar; then
7067cdf0e10cSrcweir                       ANT_LIB=/usr/share/lib/ant
7068cdf0e10cSrcweir                   else
7069cdf0e10cSrcweir                       AC_MSG_ERROR([Ant libraries not found!])
7070cdf0e10cSrcweir                   fi
7071da2e13d4SMatthias Seidel                fi
7072cdf0e10cSrcweir             fi
7073cdf0e10cSrcweir          fi
7074cdf0e10cSrcweir      fi
7075cdf0e10cSrcweir   fi
7076cdf0e10cSrcweir   AC_MSG_RESULT([Ant lib directory found.])
7077cdf0e10cSrcweirfi
7078cdf0e10cSrcweirAC_SUBST(ANT_LIB)
7079cdf0e10cSrcweirfi
7080cdf0e10cSrcweir
708137cc8903SMatthias Seidelant_minver=1.9.1
7082cdf0e10cSrcweir# update for more extensions...
7083cdf0e10cSrcweirif test "$ENABLE_MEDIAWIKI" = "YES"; then
708437cc8903SMatthias Seidel  ant_minver=1.9.1
7085cdf0e10cSrcweirfi
7086cdf0e10cSrcweirant_minminor1=`echo $ant_minver | cut -d"." -f2`
7087cdf0e10cSrcweir
7088cdf0e10cSrcweirAC_MSG_CHECKING([whether ant is >= $ant_minver])
7089cdf0e10cSrcweirant_version=`$ANT -version | $AWK '{ print $4; }'`
7090cdf0e10cSrcweirant_version_major=`echo $ant_version | cut -d. -f1`
7091cdf0e10cSrcweirant_version_minor=`echo $ant_version | cut -d. -f2`
7092cdf0e10cSrcweirecho "configure: ant_version $ant_version " >&5
7093cdf0e10cSrcweirecho "configure: ant_version_major $ant_version_major " >&5
7094cdf0e10cSrcweirecho "configure: ant_version_minor $ant_version_minor " >&5
7095cdf0e10cSrcweirif test "$ant_version_major" -ge "2"; then
7096cdf0e10cSrcweir   AC_MSG_RESULT([yes, $ant_version])
7097cdf0e10cSrcweirelif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then
7098cdf0e10cSrcweir   AC_MSG_RESULT([yes, $ant_version])
7099cdf0e10cSrcweirelse
7100cdf0e10cSrcweir   AC_MSG_ERROR([no, you need at least ant >= $ant_minver])
7101cdf0e10cSrcweirfi
7102cdf0e10cSrcweir
7103cdf0e10cSrcweirif test "$ENABLE_MEDIAWIKI" = "YES"; then
7104cdf0e10cSrcweirAC_MSG_CHECKING([whether ant supports mapper type="regexp"])
7105cdf0e10cSrcweirrm -rf confdir
7106cdf0e10cSrcweirmkdir confdir
7107cdf0e10cSrcweircat > conftest.java << EOF
7108cdf0e10cSrcweir    public class conftest {
7109cdf0e10cSrcweir        int testmethod(int a, int b) {
7110cdf0e10cSrcweir            return a + b;
7111cdf0e10cSrcweir        }
7112cdf0e10cSrcweir    }
7113cdf0e10cSrcweirEOF
7114cdf0e10cSrcweir
7115cdf0e10cSrcweircat > conftest.xml << EOF
7116cdf0e10cSrcweir    <project name="conftest" default="conftest">
7117cdf0e10cSrcweir        <target name="conftest" depends="copytest">
7118cdf0e10cSrcweir            <javac srcdir="." includes="conftest.java">
7119cdf0e10cSrcweir            </javac>
7120cdf0e10cSrcweir        </target>
7121cdf0e10cSrcweir        <target name="copytest">
7122cdf0e10cSrcweir             <copy todir="confdir">
7123cdf0e10cSrcweir                 <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
7124cdf0e10cSrcweir                 <filterset/>
7125cdf0e10cSrcweir                 <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
7126cdf0e10cSrcweir             </copy>
7127cdf0e10cSrcweir        </target>
7128cdf0e10cSrcweir    </project>
7129cdf0e10cSrcweirEOF
7130cdf0e10cSrcweir  if test "$JAVACISGCJ" = "yes"; then
7131cdf0e10cSrcweir    JAVA_HOME=; export JAVA_HOME
7132cdf0e10cSrcweir    ant_cmd="$ANT -Dbuild.compiler=gcj -buildfile conftest.xml 1>&2"
7133cdf0e10cSrcweir  else
7134cdf0e10cSrcweir    ant_cmd="$ANT -buildfile conftest.xml 1>&2"
7135cdf0e10cSrcweir  fi
7136cdf0e10cSrcweir  AC_TRY_EVAL(ant_cmd)
7137cdf0e10cSrcweir  if test $? = 0 && test -f ./conftest.class ; then
7138da2e13d4SMatthias Seidel    AC_MSG_RESULT([yes])
7139cdf0e10cSrcweir    rm -rf confdir
7140cdf0e10cSrcweir  else
7141cdf0e10cSrcweir    echo "configure: Ant test failed" >&5
7142cdf0e10cSrcweir    cat conftest.java >&5
7143cdf0e10cSrcweir    cat conftest.xml >&5
7144cdf0e10cSrcweir    rm -rf confdir
7145cdf0e10cSrcweir    AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
7146cdf0e10cSrcweir  fi
7147cdf0e10cSrcweirfi
7148cdf0e10cSrcweirrm -f conftest* core core.* *.core
7149cdf0e10cSrcweir
7150cdf0e10cSrcweirOOO_JUNIT_JAR=
715111e97782SDamjan JovanovicJUNIT_NEEDS_HAMCREST=
7152f0157b90Skschenkif test "$SOLAR_JAVA" != "" && test "$with_junit" != "no"; then
715311e97782SDamjan Jovanovic    AC_MSG_CHECKING([for JUnit])
7154e4fb754eSPedro Giffuni    if test "$with_junit" = "yes"; then
7155cdf0e10cSrcweir        if test -e /usr/share/java/junit4.jar; then
715611e97782SDamjan Jovanovic           OOO_JUNIT_JAR=/usr/share/java/junit4.jar
7157cdf0e10cSrcweir        else
715811e97782SDamjan Jovanovic           if test -e /usr/local/share/java/classes/junit4.jar; then
715911e97782SDamjan Jovanovic              OOO_JUNIT_JAR=/usr/local/share/java/classes/junit4.jar
7160cdf0e10cSrcweir           else
716111e97782SDamjan Jovanovic              if test -e /usr/share/lib/java/junit.jar; then
716211e97782SDamjan Jovanovic                 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
716311e97782SDamjan Jovanovic              else
716411e97782SDamjan Jovanovic                 if test -e /usr/share/local/lib/java/junit.jar; then
716511e97782SDamjan Jovanovic                    OOO_JUNIT_JAR=/usr/share/local/lib/java/junit.jar
716611e97782SDamjan Jovanovic                 else
716711e97782SDamjan Jovanovic                    if test -e /usr/share/java/junit.jar; then
716811e97782SDamjan Jovanovic                       OOO_JUNIT_JAR=/usr/share/java/junit.jar
716911e97782SDamjan Jovanovic                    else
717011e97782SDamjan Jovanovic                       if test -e /usr/local/share/java/classes/junit.jar; then
717111e97782SDamjan Jovanovic                          OOO_JUNIT_JAR=/usr/local/share/java/classes/junit.jar
717211e97782SDamjan Jovanovic                       fi
717311e97782SDamjan Jovanovic                    fi
717411e97782SDamjan Jovanovic                 fi
717511e97782SDamjan Jovanovic              fi
7176cdf0e10cSrcweir           fi
7177cdf0e10cSrcweir        fi
7178cdf0e10cSrcweir    else
7179cdf0e10cSrcweir        OOO_JUNIT_JAR=$with_junit
7180cdf0e10cSrcweir    fi
718111e97782SDamjan Jovanovic    if test -e "$OOO_JUNIT_JAR"; then
718211e97782SDamjan Jovanovic        AC_MSG_RESULT([yes])
718311e97782SDamjan Jovanovic    else
718411e97782SDamjan Jovanovic        AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
718511e97782SDamjan Jovanoviclocations (/usr/share/java or /usr/local/share/java/classes), specify its pathname via
718611e97782SDamjan Jovanovic--with-junit=..., or disable it via --without-junit.])
718711e97782SDamjan Jovanovic    fi
7188cdf0e10cSrcweir    if test "$_os" = "WINNT"; then
7189cdf0e10cSrcweir        OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
7190cdf0e10cSrcweir    fi
719111e97782SDamjan Jovanovic    AC_MSG_CHECKING([whether JUnit is version 4.x])
719211e97782SDamjan Jovanovic    export OOO_JUNIT_JAR
719311e97782SDamjan Jovanovic    if $PERL -e 'use Archive::Zip;
719411e97782SDamjan Jovanovic        my $file = "$ENV{'OOO_JUNIT_JAR'}";
719511e97782SDamjan Jovanovic        my $zip = Archive::Zip->new( $file );
719611e97782SDamjan Jovanovic        my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
719711e97782SDamjan Jovanovic        if ( $mf =~ m/Implementation-Version: 4.12*/ ) {
719811e97782SDamjan Jovanovic            exit 0;
719911e97782SDamjan Jovanovic        } elsif ( $mf =~ m/Implementation-Version: 4.11*/ ) {
720011e97782SDamjan Jovanovic            exit 0;
72015b85db3eSDamjan Jovanovic        } elsif ( $mf =~ m/Bundle-Version: 4.12*/ ) {
72025b85db3eSDamjan Jovanovic            exit 0;
72035b85db3eSDamjan Jovanovic        } elsif ( $mf =~ m/Bundle-Version: 4.11*/ ) {
72045b85db3eSDamjan Jovanovic            exit 0;
720511e97782SDamjan Jovanovic        } else {
720611e97782SDamjan Jovanovic            exit 1;
720711e97782SDamjan Jovanovic        }'; then
720811e97782SDamjan Jovanovic        AC_MSG_RESULT([yes, but Hamcrest Core is mandatory with this JUnit version (>= 4.11)])
720911e97782SDamjan Jovanovic        JUNIT_NEEDS_HAMCREST=yes
721011e97782SDamjan Jovanovic    elif $PERL -e 'use Archive::Zip;
721111e97782SDamjan Jovanovic        my $file = "$ENV{'OOO_JUNIT_JAR'}";
721211e97782SDamjan Jovanovic        my $zip = Archive::Zip->new( $file );
721311e97782SDamjan Jovanovic        my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
721411e97782SDamjan Jovanovic        if ( $mf =~ m/Implementation-Version: 4.*/ ) {
721511e97782SDamjan Jovanovic            exit 0;
72165b85db3eSDamjan Jovanovic        } elsif ( $mf =~ m/Bundle-Version: 4.*/ ) {
721711e97782SDamjan Jovanovic        } else {
721811e97782SDamjan Jovanovic            exit 1;
721911e97782SDamjan Jovanovic        }'; then
722011e97782SDamjan Jovanovic        AC_MSG_RESULT([yes])
7221cdf0e10cSrcweir    else
722211e97782SDamjan Jovanovic        AC_MSG_ERROR([no, your JUnit version is too old, you need JUnit 4.x])
7223cdf0e10cSrcweir    fi
7224cdf0e10cSrcweirfi
7225cdf0e10cSrcweirAC_SUBST(OOO_JUNIT_JAR)
7226cdf0e10cSrcweir
7227947c15fcSDamjan JovanovicHAMCREST_CORE_JAR=
722811e97782SDamjan Jovanovicif test "$SOLAR_JAVA" != "" && test "$with_hamcrest_core" != "no"; then
7229947c15fcSDamjan Jovanovic    AC_MSG_CHECKING([for hamcrest-core])
7230947c15fcSDamjan Jovanovic    if test "$with_hamcrest_core" = "yes"; then
723111e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest-core-1.3.jar; then
7232947c15fcSDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest-core-1.3.jar
723311e97782SDamjan Jovanovic        fi
723411e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest-core-1.3.jar; then
723511e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest-core-1.3.jar
723611e97782SDamjan Jovanovic        fi
723711e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/lib/java/hamcrest-core.jar; then
723811e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/lib/java/hamcrest-core.jar
723911e97782SDamjan Jovanovic        fi
724011e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/lib/java/hamcrest-core.jar; then
724111e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/lib/java/hamcrest-core.jar
724211e97782SDamjan Jovanovic        fi
724311e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest-core.jar; then
724411e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest-core.jar
724511e97782SDamjan Jovanovic        fi
724611e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest-core.jar; then
724711e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest-core.jar
724811e97782SDamjan Jovanovic        fi
724911e97782SDamjan Jovanovic        # Sometimes the "-core-" part is missing...
725011e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest1.3.jar; then
725111e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest1.3.jar
725211e97782SDamjan Jovanovic        fi
725311e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest1.3.jar; then
725411e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest1.3.jar
725511e97782SDamjan Jovanovic        fi
725611e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/lib/java/hamcrest.jar; then
725711e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/lib/java/hamcrest.jar
725811e97782SDamjan Jovanovic        fi
725911e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/lib/java/hamcrest.jar; then
726011e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/lib/java/hamcrest.jar
726111e97782SDamjan Jovanovic        fi
726211e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/share/java/hamcrest.jar; then
726311e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/share/java/hamcrest.jar
726411e97782SDamjan Jovanovic        fi
726511e97782SDamjan Jovanovic        if test "$HAMCREST_CORE_JAR" = "" && test -e /usr/local/share/java/classes/hamcrest.jar; then
726611e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=/usr/local/share/java/classes/hamcrest.jar
7267947c15fcSDamjan Jovanovic        fi
7268947c15fcSDamjan Jovanovic    else
7269947c15fcSDamjan Jovanovic        HAMCREST_CORE_JAR=$with_hamcrest_core
7270947c15fcSDamjan Jovanovic    fi
727111e97782SDamjan Jovanovic    if test -e "$HAMCREST_CORE_JAR"; then
727211e97782SDamjan Jovanovic        AC_MSG_RESULT([yes])
727311e97782SDamjan Jovanovic        if test "$_os" = "WINNT"; then
727411e97782SDamjan Jovanovic            HAMCREST_CORE_JAR=`cygpath -m "$HAMCREST_CORE_JAR"`
727511e97782SDamjan Jovanovic        fi
7276947c15fcSDamjan Jovanovic    else
727711e97782SDamjan Jovanovic        if test "$JUNIT_NEEDS_HAMCREST" = "yes"; then
727811e97782SDamjan Jovanovic            AC_MSG_ERROR([cannot find hamcrest-core jar; please install one in the
727911e97782SDamjan Jovanovicdefault locations (/usr/share/java or /usr/local/share/java/classes), specify its
7280947c15fcSDamjan Jovanovicpathname via --with-hamcrest-core=..., or disable
728111e97782SDamjan Jovanovicit via --without-hamcrest-core or --without-junit])
728211e97782SDamjan Jovanovic        else
728311e97782SDamjan Jovanovic            AC_MSG_RESULT([no, skipping])
728411e97782SDamjan Jovanovic        fi
728511e97782SDamjan Jovanovic    fi
728611e97782SDamjan Jovanovicelse
728711e97782SDamjan Jovanovic    if test "$JUNIT_NEEDS_HAMCREST" = "yes"; then
728811e97782SDamjan Jovanovic        AC_MSG_ERROR([JUnit needs Hamcrest but Hamcrest disabled.])
7289947c15fcSDamjan Jovanovic    fi
7290947c15fcSDamjan Jovanovicfi
7291947c15fcSDamjan JovanovicAC_SUBST(HAMCREST_CORE_JAR)
7292947c15fcSDamjan Jovanovic
7293cdf0e10cSrcweirAC_MSG_CHECKING([which languages to be built])
7294cdf0e10cSrcweirWITH_LANG="$with_lang"
7295cdf0e10cSrcweirif test -z "$WITH_LANG"; then
7296cdf0e10cSrcweir   AC_MSG_RESULT([en-US])
7297cdf0e10cSrcweirelse
7298cdf0e10cSrcweir   AC_MSG_RESULT([$WITH_LANG])
72993e9d7d56SAndre Fischer   ADDITIONAL_REPOSITORIES="$ADDITIONAL_REPOSITORIES ../extras"
73003e9d7d56SAndre Fischer   BUILD_TYPE="$BUILD_TYPE L10N"
7301cdf0e10cSrcweirfi
7302cdf0e10cSrcweirAC_SUBST(WITH_LANG)
7303cdf0e10cSrcweir
7304cdf0e10cSrcweirAC_MSG_CHECKING([which languages have poor help localizations])
7305cdf0e10cSrcweirWITH_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations"
7306cdf0e10cSrcweirif test -z "$WITH_POOR_HELP_LOCALIZATIONS"; then
7307cdf0e10cSrcweir   AC_MSG_RESULT([none])
7308cdf0e10cSrcweirelse
7309cdf0e10cSrcweir   AC_MSG_RESULT([$WITH_POOR_HELP_LOCALIZATIONS])
7310cdf0e10cSrcweirfi
7311cdf0e10cSrcweirAC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
7312cdf0e10cSrcweir
7313cdf0e10cSrcweirAC_MSG_CHECKING([which dictionaries to include])
7314cdf0e10cSrcweirif test -z "$with_dict"; then
7315cdf0e10cSrcweir   WITH_DICT=,ALL,
7316cdf0e10cSrcweir   AC_MSG_RESULT([ALL])
7317cdf0e10cSrcweirelse
7318cdf0e10cSrcweir   WITH_DICT=","$with_dict","
7319cdf0e10cSrcweir   AC_MSG_RESULT([$with_dict])
7320cdf0e10cSrcweirfi
7321cdf0e10cSrcweirAC_SUBST(WITH_DICT)
7322cdf0e10cSrcweir
7323cdf0e10cSrcweirAC_MSG_CHECKING([for additional 'intro' bitmaps])
7324cdf0e10cSrcweirINTRO_BITMAPS=
7325cdf0e10cSrcweirif test -z "$with_intro_bitmaps" -o "$with_intro_bitmaps" = "no" ; then
7326cdf0e10cSrcweir   INTRO_BITMAPS=
7327cdf0e10cSrcweir   AC_MSG_RESULT([none])
7328cdf0e10cSrcweirelse
7329cdf0e10cSrcweir   for bitmap in `echo $with_intro_bitmaps | tr ',' ' '` ; do
7330cdf0e10cSrcweir      case "$bitmap" in
7331073e6ddbSmseidel         *.png) ;;
7332073e6ddbSmseidel         *)     bitmap= ; AC_MSG_WARN([Intro bitmaps should be .png files!]) ;;
7333cdf0e10cSrcweir      esac
7334cdf0e10cSrcweir      if test -n "$bitmap" ; then
7335cdf0e10cSrcweir         INTRO_BITMAPS="$INTRO_BITMAPS $bitmap"
7336cdf0e10cSrcweir      fi
7337cdf0e10cSrcweir   done
7338cdf0e10cSrcweir   AC_MSG_RESULT([$INTRO_BITMAPS])
7339cdf0e10cSrcweirfi
7340cdf0e10cSrcweirAC_SUBST(INTRO_BITMAPS)
7341cdf0e10cSrcweir
7342cdf0e10cSrcweirAC_MSG_CHECKING([for additional 'about' bitmaps])
7343cdf0e10cSrcweirABOUT_BITMAPS=
7344cdf0e10cSrcweirif test -z "$with_about_bitmaps" -o "$with_about_bitmaps" = "no" ; then
7345cdf0e10cSrcweir   ABOUT_BITMAPS=
7346cdf0e10cSrcweir   AC_MSG_RESULT([none])
7347cdf0e10cSrcweirelse
7348cdf0e10cSrcweir   for bitmap in `echo $with_about_bitmaps | tr ',' ' '` ; do
7349cdf0e10cSrcweir      case "$bitmap" in
7350073e6ddbSmseidel         *.png) ;;
7351073e6ddbSmseidel         *)     bitmap= ; AC_MSG_WARN([About bitmaps should be .png files!]) ;;
7352cdf0e10cSrcweir      esac
7353cdf0e10cSrcweir      if test -n "$bitmap" ; then
7354cdf0e10cSrcweir         ABOUT_BITMAPS="$ABOUT_BITMAPS $bitmap"
7355cdf0e10cSrcweir      fi
7356cdf0e10cSrcweir   done
7357cdf0e10cSrcweir   AC_MSG_RESULT([$ABOUT_BITMAPS])
7358cdf0e10cSrcweirfi
7359cdf0e10cSrcweirAC_SUBST(ABOUT_BITMAPS)
7360cdf0e10cSrcweir
7361cdf0e10cSrcweirOOO_VENDOR=
7362cdf0e10cSrcweirAC_MSG_CHECKING([for vendor])
7363cdf0e10cSrcweirif test -z "$with_vendor" -o "$with_vendor" = "no" ; then
7364cdf0e10cSrcweir   AC_MSG_RESULT([not set])
7365cdf0e10cSrcweirelse
7366cdf0e10cSrcweir   OOO_VENDOR="$with_vendor"
7367cdf0e10cSrcweir   AC_MSG_RESULT([$OOO_VENDOR])
7368cdf0e10cSrcweirfi
7369cdf0e10cSrcweirAC_SUBST(OOO_VENDOR)
7370cdf0e10cSrcweir
7371cdf0e10cSrcweirUNIXWRAPPERNAME=
7372cdf0e10cSrcweirAC_MSG_CHECKING([for UNIX wrapper name])
7373da2e13d4SMatthias Seidelif test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no" -o "$with_unix_wrapper" = "yes" ; then
7374cdf0e10cSrcweir   AC_MSG_RESULT([not set])
7375cdf0e10cSrcweirelse
7376cdf0e10cSrcweir   UNIXWRAPPERNAME="$with_unix_wrapper"
7377cdf0e10cSrcweir   AC_MSG_RESULT([$UNIXWRAPPERNAME])
7378cdf0e10cSrcweirfi
7379cdf0e10cSrcweirAC_SUBST(UNIXWRAPPERNAME)
7380cdf0e10cSrcweir
7381cdf0e10cSrcweirAC_MSG_CHECKING([whether to statically link to Gtk])
7382cdf0e10cSrcweirif test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then
7383cdf0e10cSrcweir   ENABLE_STATIC_GTK="TRUE"
7384cdf0e10cSrcweir   AC_MSG_RESULT([yes])
7385cdf0e10cSrcweirelse
7386da2e13d4SMatthias Seidel   ENABLE_STATIC_GTK="FALSE"
7387cdf0e10cSrcweir   AC_MSG_RESULT([no])
7388cdf0e10cSrcweirfi
7389cdf0e10cSrcweirAC_SUBST(ENABLE_STATIC_GTK)
7390cdf0e10cSrcweir
7391cdf0e10cSrcweirAC_MSG_CHECKING([whether to use layout dialogs])
7392cdf0e10cSrcweirif test -n "$enable_layout" && test "$enable_layout" != "no"; then
7393cdf0e10cSrcweir   ENABLE_LAYOUT="TRUE"
7394cdf0e10cSrcweir   AC_MSG_RESULT([yes])
7395cdf0e10cSrcweirelse
7396da2e13d4SMatthias Seidel   ENABLE_LAYOUT="FALSE"
7397cdf0e10cSrcweir   AC_MSG_RESULT([no])
7398cdf0e10cSrcweirfi
7399cdf0e10cSrcweirAC_SUBST(ENABLE_LAYOUT)
7400cdf0e10cSrcweir
7401cdf0e10cSrcweir# ===================================================================
7402cdf0e10cSrcweir# De- or increase default verbosity of build process
7403cdf0e10cSrcweir# ===================================================================
7404cdf0e10cSrcweirAC_MSG_CHECKING([build verbosity])
7405cdf0e10cSrcweirif test -n "$enable_verbose"; then
7406cdf0e10cSrcweir   if test "$enable_verbose" = "yes"; then
7407cdf0e10cSrcweir      VERBOSE="TRUE"
7408cdf0e10cSrcweir      AC_MSG_RESULT([high])
7409cdf0e10cSrcweir   fi
7410cdf0e10cSrcweir   if test "$enable_verbose" = "no"; then
7411cdf0e10cSrcweir      VERBOSE="FALSE"
7412cdf0e10cSrcweir      AC_MSG_RESULT([low])
7413cdf0e10cSrcweir   fi
7414cdf0e10cSrcweirelse
7415cdf0e10cSrcweir   AC_MSG_RESULT([not set])
7416cdf0e10cSrcweirfi
7417cdf0e10cSrcweirAC_SUBST(VERBOSE)
7418cdf0e10cSrcweir
7419cdf0e10cSrcweirdnl ===================================================================
7420e986c8d8SMatthias Seideldnl Hook up AOOs nodep environmental variable to automake's equivalent
7421cdf0e10cSrcweirdnl --enable-dependency-tracking configure option
7422cdf0e10cSrcweirdnl ===================================================================
7423cdf0e10cSrcweirAC_MSG_CHECKING([whether to enable dependency tracking])
7424cdf0e10cSrcweirif test "$enable_dependency_tracking" = "no"; then
7425cdf0e10cSrcweir    nodep=TRUE
7426cdf0e10cSrcweir    AC_MSG_RESULT([no])
7427cdf0e10cSrcweirelse
7428cdf0e10cSrcweir    AC_MSG_RESULT([yes])
7429cdf0e10cSrcweirfi
7430cdf0e10cSrcweirAC_SUBST(nodep)
7431cdf0e10cSrcweir
7432cdf0e10cSrcweirdnl ===================================================================
7433cdf0e10cSrcweirdnl Setting up the environment.
7434cdf0e10cSrcweirdnl ===================================================================
7435cdf0e10cSrcweirecho "********************************************************************"
7436cdf0e10cSrcweirecho "*                                                                  *"
7437cdf0e10cSrcweirecho "*   Setting up the build environment variables.                    *"
7438cdf0e10cSrcweirecho "*                                                                  *"
7439cdf0e10cSrcweirecho "********************************************************************"
7440cdf0e10cSrcweir
7441cdf0e10cSrcweirif test -z "$COMPATH"; then
7442cdf0e10cSrcweir   AC_MSG_ERROR([No compiler found.])
7443cdf0e10cSrcweirfi
7444cdf0e10cSrcweirAC_SUBST(COMPATH)
74451e1ac450SHerbert DürrAC_SUBST(CC_PATH)
7446cdf0e10cSrcweir
7447cdf0e10cSrcweirAC_MSG_CHECKING([solver path])
7448cdf0e10cSrcweirif test -z "$with_local_solver"; then
7449cdf0e10cSrcweir   LOCAL_SOLVER="DEFAULT"
7450cdf0e10cSrcweir   AC_MSG_RESULT([default])
7451cdf0e10cSrcweirelse
7452cdf0e10cSrcweir   LOCAL_SOLVER=$with_local_solver
7453cdf0e10cSrcweir   AC_MSG_RESULT([$with_local_solver])
7454cdf0e10cSrcweirfi
7455cdf0e10cSrcweirAC_SUBST(LOCAL_SOLVER)
7456cdf0e10cSrcweir
7457cdf0e10cSrcweirAC_SUBST(BUILD_TYPE)
7458149f2bc0SAndre FischerAC_SUBST(ADDITIONAL_REPOSITORIES)
7459cdf0e10cSrcweir
7460da2e13d4SMatthias Seidel# make sure config.guess is +x; we execute config.guess, so it has to be so;
7461cdf0e10cSrcweirchmod +x ./config.guess
7462cdf0e10cSrcweir
74639ef65f0eSAndre Fischer# Create files from their *.in templates.
74649ef65f0eSAndre FischerAC_CONFIG_FILES([set_soenv Makefile])
74659ef65f0eSAndre Fischer
74669ef65f0eSAndre FischerAC_MSG_NOTICE([writing config.status])
74679ef65f0eSAndre FischerAC_OUTPUT
7468cdf0e10cSrcweir
7469cdf0e10cSrcweirdnl Executing the set_soenv script to setup the environment variables.
7470cdf0e10cSrcweirchmod a+x set_soenv
7471cdf0e10cSrcweirif test -z "$enable_check_only"; then
7472cdf0e10cSrcweir   './set_soenv'
7473cdf0e10cSrcweirelse
7474cdf0e10cSrcweir   echo
7475cdf0e10cSrcweir   echo Test Complete
7476cdf0e10cSrcweir   echo No environment file will be generated
7477cdf0e10cSrcweir   echo
7478cdf0e10cSrcweir   num_warnings=`wc -l warn`
7479cdf0e10cSrcweir   _num=`echo $num_warnings | $AWK '{ print $1 }'`
7480cdf0e10cSrcweir   if test $_num -gt 0; then
7481cdf0e10cSrcweir      echo The following warning\(s\) were generated by configure
7482cdf0e10cSrcweir      echo ----------------------------------------------------
7483cdf0e10cSrcweir      echo
7484cdf0e10cSrcweir      cat warn
7485cdf0e10cSrcweir      echo
7486cdf0e10cSrcweir   else
7487cdf0e10cSrcweir      echo There were no warnings
7488cdf0e10cSrcweir   fi
7489cdf0e10cSrcweir   echo
7490da2e13d4SMatthias Seidelfi
7491f0157b90Skschenk
749236a2d835Smseidel
7493