]> git.saurik.com Git - wxWidgets.git/blame - configure.in
Make callback names consistent
[wxWidgets.git] / configure.in
CommitLineData
9a98a854
VZ
1dnl Process this file with autoconf to produce a configure script.
2AC_REVISION($Id$)dnl
3
44309ea1 4AC_PREREQ(2.58)
e6cc62c6 5
9a98a854
VZ
6dnl ---------------------------------------------------------------------------
7dnl
77ffb593 8dnl Top-level configure.in for wxWidgets by Robert Roebling, Phil Blecker,
3a922bb4 9dnl Vadim Zeitlin and Ron Lee
9a98a854 10dnl
526954c5 11dnl This script is under the wxWindows licence.
9a98a854
VZ
12dnl
13dnl Version: $Id$
bcd2b961 14dnl ---------------------------------------------------------------------------
9a98a854
VZ
15
16dnl ---------------------------------------------------------------------------
17dnl initialization
18dnl ---------------------------------------------------------------------------
19
f203de0c 20AC_INIT([wxWidgets], [2.9.2], [wx-dev@lists.wxwidgets.org])
e6cc62c6
VS
21
22dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package
23AC_CONFIG_SRCDIR([wx-config.in])
9a98a854 24
b3f453f8 25dnl sets build, host variables and the same with _alias
e6cc62c6
VS
26AC_CANONICAL_BUILD
27AC_CANONICAL_HOST
e6cc62c6 28
6ab6fc6e
VZ
29dnl notice that if --host was given but --build was not, cross_compiling is
30dnl only set to "maybe" and not "yes" and will be either set to "yes" later or
31dnl configure will exit with error in AC_PROG_CC so don't test for = "yes" here
32if test "$cross_compiling" != "no"; then
28c59491
VZ
33 HOST_PREFIX="${host_alias}-"
34 HOST_SUFFIX="-$host_alias"
35else
36 HOST_PREFIX=
37 HOST_SUFFIX=
38fi
7c66a493
VZ
39
40dnl When making releases do:
41dnl
ceec2216 42dnl wx_release_number += 1
9a98a854 43
ceec2216 44wx_major_version_number=2
7fd3acaf 45wx_minor_version_number=9
f203de0c 46wx_release_number=2
7fd3acaf 47wx_subrelease_number=0
9a98a854 48
ceec2216
RL
49WX_RELEASE=$wx_major_version_number.$wx_minor_version_number
50WX_VERSION=$WX_RELEASE.$wx_release_number
51WX_SUBVERSION=$WX_VERSION.$wx_subrelease_number
6426998c 52
ceec2216 53WX_MSW_VERSION=$wx_major_version_number$wx_minor_version_number$wx_release_number
978f1259 54
6426998c 55
6589dc98
VS
56dnl Autoconf-2.60 changed the meaning of top_builddir variable, so we have
57dnl to use our own replacement that will work with both 2.5x and 2.60+:
58wx_top_builddir="`pwd`"
59AC_SUBST(wx_top_builddir)
60
9a98a854
VZ
61
62dnl ------------------------------------------------------------------------
63dnl Check platform (host system)
64dnl ------------------------------------------------------------------------
65
4a8900f2 66dnl OS (assume Unix)
9a98a854 67USE_UNIX=1
5cc55caf 68USE_OS2=0
4882bf1b 69USE_WIN32=0
f9bc1684 70USE_DOS=0
b12915c1 71USE_BEOS=0
1216f52d 72USE_MAC=0
b12915c1 73
4a8900f2 74dnl Unix kind
9a98a854 75USE_AIX=
32b38f99
VZ
76USE_BSD= dnl any BSD
77USE_DARWIN= dnl a.k.a. Mac OS X
9a98a854 78USE_FREEBSD=
32b38f99 79USE_GNU= dnl GNU/Hurd
4a8900f2
VZ
80USE_HPUX=
81USE_LINUX=
f6bcfd97 82USE_NETBSD=
4a8900f2 83USE_OPENBSD=
32b38f99 84USE_OSF= dnl OSF/1 (obsolete?)
4a8900f2 85USE_SGI=
32b38f99
VZ
86USE_SOLARIS= dnl Solaris ("SunOS" >= 5)
87USE_SUN= dnl SunOS or Solaris
88USE_SUNOS= dnl old/real SunOS (obsolete)
89USE_SVR4= dnl SysV R4
90USE_SYSV= dnl any System V
9a98a854
VZ
91USE_VMS=
92USE_ULTRIX=
4a8900f2
VZ
93USE_UNIXWARE=
94
95dnl hardware platform
96USE_ALPHA=
9a98a854 97
ab9b9eab
VZ
98dnl on some platforms xxx_r() functions are declared inside "#ifdef
99dnl _REENTRANT" and it's easier to just define this symbol for these platforms
100dnl than checking it during run-time
101NEEDS_D_REENTRANT_FOR_R_FUNCS=0
102
ced859c3 103dnl the list of all available toolkits
1e6feb95
VZ
104dnl
105dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
80aa2a2f 106ALL_TOOLKITS="COCOA GTK OSX_CARBON OSX_COCOA OSX_IPHONE MGL MICROWIN MOTIF MSW PM X11 DFB"
ced859c3 107
9a98a854
VZ
108dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
109dnl which are either yes or no
f10f4c87 110DEFAULT_wxUSE_OLD_COCOA=0
9a98a854 111DEFAULT_wxUSE_GTK=0
2ea057f9
SC
112DEFAULT_wxUSE_OSX_CARBON=0
113DEFAULT_wxUSE_OSX_COCOA=0
80aa2a2f 114DEFAULT_wxUSE_OSX_IPHONE=0
1e6feb95 115DEFAULT_wxUSE_MGL=0
1725144d 116DEFAULT_wxUSE_MICROWIN=0
9a98a854
VZ
117DEFAULT_wxUSE_MOTIF=0
118DEFAULT_wxUSE_MSW=0
e07802fc 119DEFAULT_wxUSE_PM=0
7f5c07ab 120DEFAULT_wxUSE_X11=0
b3c86150 121DEFAULT_wxUSE_DFB=0
9a98a854 122
105a81f3
VZ
123dnl these are the values which are really default for the given platform:
124dnl they're used if no --with-<toolkit> options were given to detect the
125dnl toolkit to use by default for the target platform
f10f4c87 126DEFAULT_DEFAULT_wxUSE_OLD_COCOA=0
143121c5 127DEFAULT_DEFAULT_wxUSE_GTK=0
2ea057f9
SC
128DEFAULT_DEFAULT_wxUSE_OSX_CARBON=0
129DEFAULT_DEFAULT_wxUSE_OSX_COCOA=0
80aa2a2f 130DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=0
1e6feb95 131DEFAULT_DEFAULT_wxUSE_MGL=0
1725144d 132DEFAULT_DEFAULT_wxUSE_MICROWIN=0
143121c5
VZ
133DEFAULT_DEFAULT_wxUSE_MOTIF=0
134DEFAULT_DEFAULT_wxUSE_MSW=0
e07802fc 135DEFAULT_DEFAULT_wxUSE_PM=0
7f5c07ab 136DEFAULT_DEFAULT_wxUSE_X11=0
b3c86150 137DEFAULT_DEFAULT_wxUSE_DFB=0
143121c5 138
d6a55c4b 139PROGRAM_EXT=
fe0895cf 140SAMPLES_RPATH_FLAG=
19beefa6
KO
141DYLIB_RPATH_INSTALL=
142DYLIB_RPATH_POSTLINK=
d6a55c4b 143
a03b8b04
RD
144DEFAULT_STD_FLAG=yes
145
b12915c1
VZ
146dnl to support a new system, you need to add its canonical name (as determined
147dnl by config.sub or specified by the configure command line) to this "case"
148dnl and also define the shared library flags below - search for
149dnl SHARED_LIB_SETUP to find the exact place
9a98a854
VZ
150case "${host}" in
151 *-hp-hpux* )
152 USE_HPUX=1
143121c5 153 DEFAULT_DEFAULT_wxUSE_MOTIF=1
ab9b9eab 154 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
9a98a854 155 AC_DEFINE(__HPUX__)
65baafba
VZ
156
157 dnl many standard declarations in HP-UX headers are only included if either
158 dnl _HPUX_SOURCE is defined, see stdsyms(5)
c92ad099 159 CPPFLAGS="-D_HPUX_SOURCE $CPPFLAGS"
9a98a854
VZ
160 ;;
161 *-*-linux* )
162 USE_LINUX=1
163 AC_DEFINE(__LINUX__)
164 TMP=`uname -m`
165 if test "x$TMP" = "xalpha"; then
166 USE_ALPHA=1
167 AC_DEFINE(__ALPHA__)
168 fi
143121c5 169 DEFAULT_DEFAULT_wxUSE_GTK=1
9a98a854 170 ;;
e1293dcf 171 *-*-gnu* | *-*-k*bsd*-gnu )
32b38f99 172 USE_GNU=1
32b38f99
VZ
173 TMP=`uname -m`
174 if test "x$TMP" = "xalpha"; then
175 USE_ALPHA=1
176 AC_DEFINE(__ALPHA__)
177 fi
178 DEFAULT_DEFAULT_wxUSE_GTK=1
179 ;;
9a98a854
VZ
180 *-*-irix5* | *-*-irix6* )
181 USE_SGI=1
182 USE_SVR4=1
183 AC_DEFINE(__SGI__)
184 AC_DEFINE(__SVR4__)
143121c5 185 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854 186 ;;
229251af
VZ
187 *-*-qnx*)
188 USE_QNX=1
189 AC_DEFINE(__QNX__)
190 DEFAULT_DEFAULT_wxUSE_X11=1
191 ;;
9a98a854
VZ
192 *-*-solaris2* )
193 USE_SUN=1
194 USE_SOLARIS=1
195 USE_SVR4=1
196 AC_DEFINE(__SUN__)
197 AC_DEFINE(__SOLARIS__)
198 AC_DEFINE(__SVR4__)
143121c5 199 DEFAULT_DEFAULT_wxUSE_MOTIF=1
ab9b9eab 200 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
9a98a854
VZ
201 ;;
202 *-*-sunos4* )
203 USE_SUN=1
204 USE_SUNOS=1
205 USE_BSD=1
206 AC_DEFINE(__SUN__)
207 AC_DEFINE(__SUNOS__)
208 AC_DEFINE(__BSD__)
143121c5 209 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854 210 ;;
f6bcfd97 211 *-*-freebsd*)
9a98a854
VZ
212 USE_BSD=1
213 USE_FREEBSD=1
214 AC_DEFINE(__FREEBSD__)
215 AC_DEFINE(__BSD__)
143121c5 216 DEFAULT_DEFAULT_wxUSE_GTK=1
9a98a854 217 ;;
58247773 218 *-*-openbsd*|*-*-mirbsd*)
1cf8c0a9
VZ
219 USE_BSD=1
220 USE_OPENBSD=1
1cf8c0a9 221 AC_DEFINE(__OPENBSD__)
2b5f62a0 222 AC_DEFINE(__BSD__)
1cf8c0a9
VZ
223 DEFAULT_DEFAULT_wxUSE_GTK=1
224 ;;
f6bcfd97
BP
225 *-*-netbsd*)
226 USE_BSD=1
227 USE_NETBSD=1
f6bcfd97 228 AC_DEFINE(__NETBSD__)
2b5f62a0 229 AC_DEFINE(__BSD__)
f6bcfd97 230 DEFAULT_DEFAULT_wxUSE_GTK=1
728258f4 231 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
def7c04a
SN
232
233 dnl some standard declarations in NetBSD headers are only included if
234 dnl _NETBSD_SOURCE and _LIBC are defined, e.g. getservbyname_r in netdb.h
235 CPPFLAGS="-D_NETBSD_SOURCE -D_LIBC $CPPFLAGS"
f6bcfd97 236 ;;
9a98a854
VZ
237 *-*-osf* )
238 USE_ALPHA=1
239 USE_OSF=1
240 AC_DEFINE(__ALPHA__)
241 AC_DEFINE(__OSF__)
143121c5 242 DEFAULT_DEFAULT_wxUSE_MOTIF=1
f6bcfd97 243 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
9a98a854
VZ
244 ;;
245 *-*-dgux5* )
246 USE_ALPHA=1
247 USE_SVR4=1
248 AC_DEFINE(__ALPHA__)
249 AC_DEFINE(__SVR4__)
143121c5 250 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
251 ;;
252 *-*-sysv5* )
253 USE_SYSV=1
254 USE_SVR4=1
255 AC_DEFINE(__SYSV__)
256 AC_DEFINE(__SVR4__)
143121c5 257 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
258 ;;
259 *-*-aix* )
260 USE_AIX=1
261 USE_SYSV=1
262 USE_SVR4=1
263 AC_DEFINE(__AIX__)
264 AC_DEFINE(__SYSV__)
265 AC_DEFINE(__SVR4__)
143121c5 266 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854 267 ;;
a9b5e89f 268
4a8900f2
VZ
269 *-*-*UnixWare*)
270 USE_SYSV=1
271 USE_SVR4=1
272 USE_UNIXWARE=1
273 AC_DEFINE(__UNIXWARE__)
274 ;;
275
1c8183e2 276 *-*-cygwin* | *-*-mingw32* )
17234b26
MB
277 dnl MBN: some of the defines have been moved after toolkit detection
278 dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin
279 dnl USE_UNIX must be set and not USE_WIN32
cf27ef00 280 PROGRAM_EXT=".exe"
a9b5e89f
VZ
281 DEFAULT_DEFAULT_wxUSE_MSW=1
282 ;;
283
f9bc1684
VS
284 *-pc-msdosdjgpp )
285 USE_UNIX=0
286 USE_DOS=1
287 AC_DEFINE(__DOS__)
288 PROGRAM_EXT=".exe"
289 DEFAULT_DEFAULT_wxUSE_MGL=1
f9bc1684
VS
290 ;;
291
9829f277 292 *-pc-os2_emx | *-pc-os2-emx )
91b8de8d 293 AC_DEFINE(__EMX__)
5cc55caf 294 USE_OS2=1
ff398597 295 AC_DEFINE(__OS2__)
cf27ef00 296 PROGRAM_EXT=".exe"
e07802fc 297 DEFAULT_DEFAULT_wxUSE_PM=1
35c49c4b
SN
298 dnl "c++" wrapper is not always available, so always use plain gcc.
299 CXX=gcc
dc4118b8 300 LDFLAGS="$LDFLAGS -Zcrtdll"
e223b099
SN
301 dnl
302 dnl Some special code that's automatically added by autoconf-2.57 for OS/2
303 dnl and hopefully also by autoconf-2.58 and newer on all other platforms.
304 dnl For now however, we still need it to make sure the configure script
305 dnl works on OS/2 no matter what platform it is generated on.
306 ac_executable_extensions=".exe"
307 export ac_executable_extensions
308 dnl This strange code is necessary to deal with handling of
309 dnl backslashes by ksh and pdksh's sh variant.
310 ac_save_IFS="$IFS"
4199367e 311 IFS='\\'
e223b099
SN
312 ac_TEMP_PATH=
313 for ac_dir in $PATH; do
314 IFS=$ac_save_IFS
315 if test -z "$ac_TEMP_PATH"; then
316 ac_TEMP_PATH="$ac_dir"
317 else
318 ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
319 fi
320 done
321 export PATH="$ac_TEMP_PATH"
322 unset ac_TEMP_PATH
a03b8b04 323 DEFAULT_STD_FLAG=no
91b8de8d 324 ;;
a9b5e89f 325
80aa2a2f
VZ
326 arm-apple-darwin*)
327 dnl iPhone
328 USE_BSD=1
329 USE_DARWIN=1
330 AC_DEFINE(__BSD__)
331 AC_DEFINE(__DARWIN__)
332 DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=1
333 ;;
334
cfda0ea8
DE
335 *-*-darwin* )
336 dnl Darwin based distributions (including Mac OS X)
b4085ce6 337 USE_BSD=1
f11bdd03 338 USE_DARWIN=1
b4085ce6 339 AC_DEFINE(__BSD__)
f11bdd03 340 AC_DEFINE(__DARWIN__)
82d43113 341 AC_DEFINE(TARGET_CARBON)
2ea057f9 342 DEFAULT_DEFAULT_wxUSE_OSX_CARBON=1
b4085ce6
GD
343 ;;
344
b12915c1
VZ
345 *-*-beos* )
346 dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
347 USE_BEOS=1
348 AC_DEFINE(__BEOS__)
349 ;;
350
9a98a854 351 *)
88aaf4f5
VZ
352 AC_MSG_WARN([*** System type ${host} is unknown, assuming generic Unix and continuing nevertheless.])
353 AC_MSG_WARN([*** Please report the build results to wx-dev@lists.wxwidgets.org.])
047cffd2
MW
354
355 DEFAULT_DEFAULT_wxUSE_X11=1
356 DEFAULT_wxUSE_SHARED=no
9a98a854
VZ
357esac
358
9a98a854
VZ
359dnl ---------------------------------------------------------------------------
360dnl command line options for configure
361dnl ---------------------------------------------------------------------------
362
363dnl the default values for all options - we collect them all here to simplify
364dnl modification of the default values (for example, if the defaults for some
365dnl platform should be changed, it can be done here too)
366dnl
367dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
368
6e198e97
VZ
369dnl it's only necessary to list the options which should be disabled by
370dnl default, all the rest have default value of "yes" (or, rather, of
371dnl wxUSE_ALL_FEATURES which is the only which has to be set to "yes" by
372dnl default)
373DEFAULT_wxUSE_ALL_FEATURES=yes
9a98a854 374
01871bf6 375DEFAULT_wxUSE_STD_CONTAINERS=$DEFAULT_STD_FLAG
6e198e97
VZ
376DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
377DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
9a98a854 378
238663c1
VZ
379dnl libraries disabled by default
380DEFAULT_wxUSE_DMALLOC=no
381DEFAULT_wxUSE_LIBGNOMEVFS=no
382DEFAULT_wxUSE_LIBHILDON=no
426d19f1 383DEFAULT_wxUSE_LIBHILDON2=no
238663c1
VZ
384DEFAULT_wxUSE_LIBMSPACK=no
385DEFAULT_wxUSE_LIBSDL=no
238663c1
VZ
386
387dnl features disabled by default
388DEFAULT_wxUSE_ACCESSIBILITY=no
8575ff50 389DEFAULT_wxUSE_IPV6=no
4e63bd7e 390DEFAULT_wxUSE_GSTREAMER8=no
238663c1 391
f03637a2 392dnl automatic features
c1d2466a 393DEFAULT_wxUSE_ARTPROVIDER_TANGO=auto
6e198e97 394DEFAULT_wxUSE_UNICODE_UTF8=auto
f03637a2
FM
395DEFAULT_wxUSE_OPENGL=auto
396DEFAULT_wxUSE_MEDIACTRL=auto
7beff712 397DEFAULT_wxUSE_COMPILER_TLS=auto
f03637a2 398
6e198e97 399DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
9a98a854 400
57309d14
VZ
401dnl Mac/Cocoa users need to enable building universal binaries explicitly
402DEFAULT_wxUSE_UNIVERSAL_BINARY=no
80367c29 403DEFAULT_wxUSE_MAC_ARCH=no
57309d14 404
6e198e97
VZ
405DEFAULT_wxUSE_OFFICIAL_BUILD=no
406
407dnl Applicable only when --with-gtk was used:
408DEFAULT_wxUSE_GTK2=yes
9a98a854 409
931d7698
DE
410dnl Always default to no. Only special cases require this.
411DEFAULT_wxUSE_OBJC_UNIQUIFYING=no
412
6e198e97
VZ
413dnl ===========================
414dnl deal with configure options
415dnl ===========================
416
417dnl we use several macros here:
418dnl - AC_ARG_WITH/AC_ARG_ENABLE are the standard autoconf macros, see
419dnl autoconf manual for details about them
420dnl - WX_ARG_WITH/WX_ARG_ENABLE are their wx counterparts which perform
421dnl the caching of the command line options and also use DEFAULT_foo
422dnl variable as the default value for "foo" if neither --enable-foo nor
423dnl --disable-foo is specified
424dnl - WX_ARG_SYS_WITH is a special version of WX_ARG_WITH which allows
425dnl to choose not only whether an external library is used but also if we
426dnl use the copy of it included with wxWidgets or an already installed
427dnl system version
428dnl - WX_ARG_WITHOUT/WX_ARG_DISABLE mirror WX_ARG_WITH/WX_ARG_ENABLE but
429dnl should be used for the options which are enabled by default
430dnl - WX_ARG_FEATURE is a version of WX_ARG_ENABLE which should be used for
431dnl optional features, i.e. options which should be disabled if
a1873279 432dnl --disable-all-features is specified (WX_ARG_WITH/WX_ARG_SYS_WITH are
6e198e97
VZ
433dnl also affected by this)
434
435dnl ---------------------------------------------------------------------------
436dnl global build options
437dnl ---------------------------------------------------------------------------
438
439WX_ARG_DISABLE(gui, [ --disable-gui don't build GUI parts of the library], wxUSE_GUI)
77ffb593
JS
440WX_ARG_ENABLE(monolithic, [ --enable-monolithic build wxWidgets as single library], wxUSE_MONOLITHIC)
441WX_ARG_ENABLE(plugins, [ --enable-plugins build parts of wxWidgets as loadable components], wxUSE_PLUGINS)
6e198e97
VZ
442WX_ARG_WITHOUT(subdirs, [ --without-subdirs don't generate makefiles for samples/demos/...], wxWITH_SUBDIRS)
443AC_ARG_WITH(flavour, [ --with-flavour=NAME specify a name to identify this build], [WX_FLAVOUR="$withval"])
444WX_ARG_ENABLE(official_build, [ --enable-official_build official build of wxWidgets (win32 DLL only)], wxUSE_OFFICIAL_BUILD)
445AC_ARG_ENABLE(vendor, [ --enable-vendor=VENDOR vendor name (win32 DLL only)], [VENDOR="$enableval"])
446if test "x$VENDOR" = "x"; then
447 VENDOR="custom"
448fi
449
a1873279 450WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
6e198e97 451
055400c9
VZ
452if test "$wxUSE_ALL_FEATURES" = "no"; then
453 dnl this is a bit ugly but currently we have no choice but to manually
454 dnl reset all the options with default value of auto if all features are to
455 dnl be disabled because we can't have an option with default value of
456 dnl "auto-or-no-if-wxUSE_ALL_FEATURES-is-disabled"
c1d2466a 457 DEFAULT_wxUSE_ARTPROVIDER_TANGO=no
055400c9
VZ
458 DEFAULT_wxUSE_MEDIACTRL=no
459fi
460
6e198e97
VZ
461dnl ---------------------------------------------------------------------------
462dnl port selection
463dnl ---------------------------------------------------------------------------
e90c1d2a 464
b12915c1 465if test "$wxUSE_GUI" = "yes"; then
e90c1d2a 466
77ffb593 467WX_ARG_ENABLE(universal, [ --enable-universal use wxWidgets GUI controls instead of native ones], wxUSE_UNIVERSAL)
6e198e97
VZ
468if test "$wxUSE_UNIVERSAL" = "yes"; then
469 AC_ARG_WITH(themes, [ --with-themes=all|list use only the specified comma-separated list of wxUniversal themes], [wxUNIV_THEMES="$withval"])
470fi
471
472dnl we use AC_ARG_WITH and not WX_ARG_WITH for the toolkit options as they
105a81f3 473dnl shouldn't default to wxUSE_ALL_FEATURES
f34ca037 474AC_ARG_WITH(gtk, [[ --with-gtk[=VERSION] use GTK+, VERSION can be 2 (default), 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
ced859c3 475AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
f10f4c87
VZ
476AC_ARG_WITH(osx_carbon, [ --with-osx_carbon use Mac OS X (Carbon)], [wxUSE_OSX_CARBON="$withval" CACHE_OSX_CARBON=1 TOOLKIT_GIVEN=1])
477AC_ARG_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
80aa2a2f 478AC_ARG_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
f10f4c87
VZ
479AC_ARG_WITH(osx, [ --with-osx use Mac OS X (default port, currently Carbon)], [wxUSE_OSX_CARBON="$withval" CACHE_OSX_CARBON=1 TOOLKIT_GIVEN=1])
480AC_ARG_WITH(carbon, [ --with-carbon same as --with-osx_carbon], [wxUSE_OSX_CARBON="$withval" CACHE_OSX_CARBON=1 TOOLKIT_GIVEN=1])
481AC_ARG_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
80aa2a2f 482AC_ARG_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
f10f4c87
VZ
483AC_ARG_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_CARBON="$withval" CACHE_OSX_CARBON=1 TOOLKIT_GIVEN=1])
484AC_ARG_WITH(old_cocoa, [ --with-old_cocoa use old, deprecated, Cocoa port], [wxUSE_OLD_COCOA="$withval" CACHE_OLD_COCOA=1 TOOLKIT_GIVEN=1])
d1188635 485AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1])
b4efce5e 486AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
e07802fc 487AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
6c657b52 488AC_ARG_WITH(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1])
b3c86150 489AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
1725144d 490AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
3c011993 491AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
ba875e66 492WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX)
143121c5 493
f34ca037 494AC_ARG_ENABLE(gtk2, [ --disable-gtk2 use GTK+ 1.2 instead of 2.0], [wxUSE_GTK2="$enableval"])
16bd311d 495WX_ARG_ENABLE(gpe, [ --enable-gpe use GNOME PDA Environment features if possible], wxUSE_GPE)
a9b5e89f 496
91a2809d
VZ
497dnl check that no more than one toolkit is given and that if none are given that
498dnl we have a default one
499
500AC_MSG_CHECKING(for toolkit)
501
2ea057f9
SC
502
503
91a2809d
VZ
504# In Wine, we need to default to MSW, not GTK or MOTIF
505if test "$wxUSE_WINE" = "yes"; then
506 DEFAULT_DEFAULT_wxUSE_GTK=0
507 DEFAULT_DEFAULT_wxUSE_MOTIF=0
508 DEFAULT_DEFAULT_wxUSE_MSW=1
509 wxUSE_SHARED=no
510 CC=${CC:-winegcc}
511 CXX=${CXX:-wineg++}
512fi
513
514
515if test "$wxUSE_GUI" = "yes"; then
516
517 if test "$USE_BEOS" = 1; then
518 AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
519 fi
520
521 if test "$TOOLKIT_GIVEN" = 1; then
522 dnl convert "yes", "any" or a number to 1 and "no" to 0
523 for toolkit in $ALL_TOOLKITS; do
524 var=wxUSE_$toolkit
525 eval "value=\$${var}"
526 if test "x$value" = "xno"; then
527 eval "$var=0"
528 elif test "x$value" != "x"; then
529 eval "$var=1"
530 fi
531
532 if test "x$value" != "x" -a "x$value" != "xyes" -a "x$value" != "xno"; then
533 eval "wx${toolkit}_VERSION=$value"
534 fi
535 done
536 else
d13b34d3 537 dnl try to guess the most appropriate toolkit for this platform
91a2809d
VZ
538 for toolkit in $ALL_TOOLKITS; do
539 var=DEFAULT_DEFAULT_wxUSE_$toolkit
540 eval "wxUSE_$toolkit=\$${var}"
541 done
542 fi
543
544 dnl we suppose that expr is available (maybe there is a better way to do
545 dnl this? what about using ALL_TOOLKITS? TODO)
f10f4c87 546 NUM_TOOLKITS=`expr ${wxUSE_OLD_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_OSX_CARBON:-0} \
80aa2a2f 547 + ${wxUSE_OSX_COCOA:-0} + ${wxUSE_OSX_IPHONE:-0} + ${wxUSE_MGL:-0} + ${wxUSE_DFB:-0} \
2ea057f9 548 + ${wxUSE_MICROWIN:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}`
91a2809d
VZ
549
550 dnl Allow wxUSE_PM only for OS/2 with EMX.
551 case "${host}" in
552 *-pc-os2_emx | *-pc-os2-emx )
553 NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}`
554 esac
555
556 case "$NUM_TOOLKITS" in
557 1)
558 ;;
559 0)
560 AC_MSG_ERROR(Please specify a toolkit -- cannot determine the default for ${host})
561 ;;
562 *)
563 AC_MSG_ERROR(Please specify at most one toolkit)
564 esac
565
566 # to be removed when --disable-gtk2 isn't needed
567 if test "x$wxUSE_GTK2" = "xyes"; then
568 wxGTK_VERSION=2
bfd62c8c 569 wxUSE_GTK1=0
91a2809d
VZ
570 elif test "x$wxUSE_GTK2" = "xno"; then
571 wxGTK_VERSION=1
bfd62c8c 572 wxUSE_GTK1=1
91a2809d
VZ
573 fi
574
575 for toolkit in $ALL_TOOLKITS; do
576 var=wxUSE_$toolkit
577 eval "value=\$${var}"
578 if test "$value" = 1; then
579 toolkit_echo=`echo $toolkit | tr '[[A-Z]]' '[[a-z]]'`
580 AC_MSG_RESULT($toolkit_echo)
581 fi
582 done
583else
584 if test "x$host_alias" != "x"; then
585 AC_MSG_RESULT(base ($host_alias hosted) only)
586 else
587 AC_MSG_RESULT(base only)
588 fi
589fi
590
2ea057f9 591wxUSE_MAC=0
80aa2a2f
VZ
592if test "$wxUSE_OSX_CARBON" = 1 \
593 -o "$wxUSE_OSX_COCOA" = 1 \
594 -o "$wxUSE_OSX_IPHONE" = 1; then
2ea057f9
SC
595 wxUSE_MAC=1
596fi
597
6e198e97
VZ
598dnl ---------------------------------------------------------------------------
599dnl external libraries
600dnl ---------------------------------------------------------------------------
601
422107f9
VZ
602WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
603WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
0dcf9893 604WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF)
c8818622 605WX_ARG_SYS_WITH(libxpm, [ --with-libxpm use libxpm (XPM file format)], wxUSE_LIBXPM)
dab9a60f 606WX_ARG_WITH(libiconv, [ --with-libiconv use libiconv (character conversion)], wxUSE_LIBICONV)
3527f29c 607WX_ARG_WITH(libmspack, [ --with-libmspack use libmspack (CHM help files loading)], wxUSE_LIBMSPACK)
bd8a7646 608WX_ARG_WITHOUT(gtkprint, [ --without-gtkprint don't use GTK printing support], wxUSE_GTKPRINT)
6e198e97 609WX_ARG_WITHOUT(gnomeprint, [ --without-gnomeprint don't use GNOME printing libraries], wxUSE_LIBGNOMEPRINT)
2b850ae1 610WX_ARG_WITH(gnomevfs, [ --with-gnomevfs use GNOME VFS for associating MIME types], wxUSE_LIBGNOMEVFS)
426d19f1 611WX_ARG_WITH(hildon, [ --with-hildon use Hildon framework for Nokia 770/800/810], wxUSE_LIBHILDON)
143121c5 612WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
b12915c1
VZ
613
614fi
615dnl for GUI only
616
d0e9b150 617WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC)
84ebfcbd 618WX_ARG_WITH(sdl, [ --with-sdl use SDL for audio on Unix], wxUSE_LIBSDL)
3e44f09d 619WX_ARG_SYS_WITH(regex, [ --with-regex enable support for wxRegEx class], wxUSE_REGEX)
422107f9 620WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
672abd7a 621WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT)
9a98a854 622
b4e05bdd
DE
623AC_MSG_CHECKING([for --with-macosx-sdk])
624AC_ARG_WITH(macosx-sdk, [ --with-macosx-sdk=PATH use an OS X SDK at PATH], [
625 wxUSE_MACOSX_SDK=$withval
626 wx_cv_use_macosx_sdk="wxUSE_MACOSX_SDK=$withval"
b4e05bdd
DE
627 ])
628AC_MSG_RESULT([$wxUSE_MACOSX_SDK])
629
630AC_MSG_CHECKING([for --with-macosx-version-min])
631AC_ARG_WITH(macosx-version-min, [ --with-macosx-version-min=VER build binaries which require at least this OS X version], [
632 wxUSE_MACOSX_VERSION_MIN=$withval
633 wx_cv_use_macosx_version_min="wxUSE_MACOSX_VERSION_MIN=$withval"
b4e05bdd
DE
634 ])
635AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
636
89b1afb4
VZ
637dnl ---------------------------------------------------------------------------
638dnl debugging options
639dnl ---------------------------------------------------------------------------
640
641dnl don't use WX_ARG_ENABLE as it just gets in the way instead of helping with
642dnl this rather unusual option
643AC_MSG_CHECKING([for --enable-debug])
644AC_ARG_ENABLE(debug, [ --enable-debug build library for debugging],
645 [
646 if test "$enableval" = yes; then
647 wxUSE_DEBUG=yes
648 elif test "$enableval" = no; then
649 wxUSE_DEBUG=no
650 elif test "$enableval" = max; then
651 wxUSE_DEBUG=yes
652 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -DwxDEBUG_LEVEL=2"
653 else
654 AC_MSG_ERROR([Invalid --enable-debug value, must be yes, no or max])
655 fi
656 ],
657 wxUSE_DEBUG=default
658)
659
660case "$wxUSE_DEBUG" in
661 yes)
662 dnl build the library for debugging: enable debugging code and generate
663 dnl the debug information for the library itself
664 DEFAULT_wxUSE_DEBUG_FLAG=yes
665 DEFAULT_wxUSE_DEBUG_INFO=yes
666
667 dnl also disable optimizations by default if --enable-debug was used
668 dnl (this can still be overridden by an explicit --enable-optimise)
669 DEFAULT_wxUSE_OPTIMISE=no
670 ;;
671
672 no)
673 dnl --disable-debug is equivalent to both --disable-debug_flag and
674 dnl --disable-debug_info
675 DEFAULT_wxUSE_DEBUG_FLAG=no
676 DEFAULT_wxUSE_DEBUG_INFO=no
677 ;;
678
679 default)
680 dnl the library is built with debugging support by default but without
681 dnl debug information as this requires much, much more disk space
682 DEFAULT_wxUSE_DEBUG_FLAG=yes
683 DEFAULT_wxUSE_DEBUG_INFO=no
684 ;;
685esac
686
687WX_ARG_DISABLE(debug_flag, [ --disable-debug_flag disable all debugging support], wxUSE_DEBUG_FLAG)
688WX_ARG_ENABLE(debug_info, [ --enable-debug_info generate debug information], wxUSE_DEBUG_INFO)
689
690dnl enabled if just --enable-debug_{flag,info} was
691dnl
692dnl in any case, only set the default value and allow overriding it with an
693
694WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
695WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt obsolete, don't use: use wxDebugContext], wxUSE_DEBUG_CONTEXT)
696WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing obsolete, don't use: create code with memory tracing], wxUSE_MEM_TRACING)
697
9a98a854 698dnl ---------------------------------------------------------------------------
6e198e97 699dnl global compile options
9a98a854
VZ
700dnl ---------------------------------------------------------------------------
701
6e198e97 702WX_ARG_DISABLE(shared, [ --disable-shared create static library instead of shared], wxUSE_SHARED)
01871bf6
VZ
703WX_ARG_ENABLE(stl, [ --enable-stl use standard C++ classes for everything], wxUSE_STL)
704WX_ARG_ENABLE(std_containers,[ --enable-std_containers use standard C++ container classes], wxUSE_STD_CONTAINERS)
6e198e97
VZ
705WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
706WX_ARG_ENABLE(std_string, [ --enable-std_string use standard C++ string classes], wxUSE_STD_STRING)
01871bf6 707WX_ARG_ENABLE(std_string_conv_in_wxstring, [ --enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString], wxUSE_STD_STRING_CONV_IN_WXSTRING)
6e198e97
VZ
708WX_ARG_DISABLE(unicode, [ --disable-unicode compile without Unicode support], wxUSE_UNICODE)
709WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (Win32 only)], wxUSE_UNICODE_MSLU)
710WX_ARG_ENABLE_PARAM(utf8, [ --enable-utf8 use UTF-8 representation for strings (Unix only)], wxUSE_UNICODE_UTF8)
24b67be4 711WX_ARG_ENABLE(utf8only, [ --enable-utf8only only support UTF-8 locales in UTF-8 build (Unix only)], wxUSE_UNICODE_UTF8_LOCALE)
afc89ff4 712WX_ARG_ENABLE(extended_rtti, [ --enable-extended_rtti use extended RTTI (XTI)], wxUSE_EXTENDED_RTTI)
4216d21f 713if test "$USE_OS2" = 1; then
f47af52b 714 DEFAULT_wxUSE_OMF=no
3cceb09b
SN
715 WX_ARG_ENABLE(omf, [ --enable-omf use OMF object format], wxUSE_OMF)
716fi
70d1b3cf 717
44710405
VZ
718WX_ARG_DISABLE(optimise, [ --disable-optimise compile without optimisations], wxUSE_OPTIMISE)
719
f7bdcdd7
RR
720WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
721WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
b3e8d00a 722WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS)
5586805b
RR
723WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
724WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
6e198e97 725WX_ARG_DISABLE(vararg_macros,[ --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS)
80367c29
RD
726
727WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary create universal binary with Mac PPC and i386 (and x86_64 if using Cocoa) architectures ]], wxUSE_UNIVERSAL_BINARY)
728WX_ARG_ENABLE_PARAM(macosx_arch, [[ --enable-macosx_arch=ARCH build for just the specified architecture]], wxUSE_MAC_ARCH)
9a98a854 729
6e198e97
VZ
730WX_ARG_ENABLE(compat26, [ --enable-compat26 enable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6)
731WX_ARG_DISABLE(compat28, [ --disable-compat28 disable wxWidgets 2.8 compatibility], WXWIN_COMPATIBILITY_2_8)
54276ccf 732
6e198e97 733WX_ARG_DISABLE(rpath, [ --disable-rpath disable use of rpath for uninstalled builds], wxUSE_RPATH)
3bd8fb5f 734
931d7698 735WX_ARG_ENABLE(objc_uniquifying,[ --enable-objc_uniquifying enable Objective-C class name uniquifying], wxUSE_OBJC_UNIQUIFYING)
3bd8fb5f 736
a2bd84a5 737WX_ARG_DISABLE(visibility, [ --disable-visibility disable use of ELF symbols visibility even if supported], wxUSE_VISIBILITY)
7beff712 738WX_ARG_DISABLE(tls, [ --disable-tls disable use of compiler TLS support], wxUSE_COMPILER_TLS)
a2bd84a5 739
9a98a854 740dnl ---------------------------------------------------------------------------
6e198e97 741dnl optional non GUI features
9a98a854
VZ
742dnl ---------------------------------------------------------------------------
743
6e198e97 744WX_ARG_FEATURE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
6e4ae332 745WX_ARG_FEATURE(xlocale, [ --enable-xlocale use x-locale support (requires wxLocale)], wxUSE_XLOCALE)
6e198e97 746WX_ARG_FEATURE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
b12915c1 747
6e198e97
VZ
748WX_ARG_FEATURE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL)
749WX_ARG_FEATURE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP)
750WX_ARG_FEATURE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP)
751WX_ARG_FEATURE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE)
752WX_ARG_FEATURE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
8575ff50 753WX_ARG_FEATURE(ipv6, [ --enable-ipv6 enable IPv6 support in wxSocket], wxUSE_IPV6)
6e198e97
VZ
754WX_ARG_FEATURE(ole, [ --enable-ole use OLE classes (Win32 only)], wxUSE_OLE)
755WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ)
b12915c1 756
6e198e97 757WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
eb4efbdc 758
e7ff34ed 759WX_ARG_FEATURE(baseevtloop, [ --enable-baseevtloop use event loop in console programs too], wxUSE_CONSOLE_EVENTLOOP)
73a790d8 760WX_ARG_FEATURE(epollloop, [ --enable-epollloop use wxEpollDispatcher class (Linux only)], wxUSE_EPOLL_DISPATCHER)
e7ff34ed 761WX_ARG_FEATURE(selectloop, [ --enable-selectloop use wxSelectDispatcher class], wxUSE_SELECT_DISPATCHER)
a1873279 762
4199367e 763dnl please keep the settings below in alphabetical order
178c7760 764WX_ARG_FEATURE(any, [ --enable-any use wxAny class], wxUSE_ANY)
6e198e97
VZ
765WX_ARG_FEATURE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
766WX_ARG_FEATURE(arcstream, [ --enable-arcstream use wxArchive streams], wxUSE_ARCHIVE_STREAMS)
767WX_ARG_FEATURE(base64, [ --enable-base64 use base64 encoding/decoding functions], wxUSE_BASE64)
768WX_ARG_FEATURE(backtrace, [ --enable-backtrace use wxStackWalker class for getting backtraces], wxUSE_STACKWALKER)
769WX_ARG_FEATURE(catch_segvs, [ --enable-catch_segvs catch signals in wxApp::OnFatalException (Unix only)], wxUSE_ON_FATAL_EXCEPTION)
770WX_ARG_FEATURE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER)
771WX_ARG_FEATURE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME)
772WX_ARG_FEATURE(debugreport, [ --enable-debugreport use wxDebugReport class], wxUSE_DEBUGREPORT)
773WX_ARG_FEATURE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
774WX_ARG_FEATURE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
775WX_ARG_FEATURE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
776WX_ARG_FEATURE(exceptions, [ --enable-exceptions build exception-safe library], wxUSE_EXCEPTIONS)
777WX_ARG_FEATURE(ffile, [ --enable-ffile use wxFFile class], wxUSE_FFILE)
778WX_ARG_FEATURE(file, [ --enable-file use wxFile class], wxUSE_FILE)
a0219e45 779WX_ARG_FEATURE(filehistory, [ --enable-filehistory use wxFileHistory class], wxUSE_FILE_HISTORY)
6e198e97 780WX_ARG_FEATURE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM)
ff427585 781WX_ARG_FEATURE(fontenum, [ --enable-fontenum use wxFontEnumerator class], wxUSE_FONTENUM)
6e198e97
VZ
782WX_ARG_FEATURE(fontmap, [ --enable-fontmap use font encodings conversion classes], wxUSE_FONTMAP)
783WX_ARG_FEATURE(fs_archive, [ --enable-fs_archive use virtual archive filesystems], wxUSE_FS_ARCHIVE)
784WX_ARG_FEATURE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
785WX_ARG_FEATURE(fs_zip, [ --enable-fs_zip now replaced by fs_archive], wxUSE_FS_ZIP)
6b8ef0b3 786WX_ARG_FEATURE(fswatcher, [ --enable-fswatcher use wxFileSystemWatcher class], wxUSE_FSWATCHER)
6e198e97
VZ
787WX_ARG_FEATURE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
788WX_ARG_FEATURE(log, [ --enable-log use logging system], wxUSE_LOG)
789WX_ARG_FEATURE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
790WX_ARG_FEATURE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE)
4732e2dc 791WX_ARG_FEATURE(printfposparam,[ --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
6e198e97 792WX_ARG_FEATURE(snglinst, [ --enable-snglinst use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER)
4732e2dc 793WX_ARG_FEATURE(sound, [ --enable-sound use wxSound class], wxUSE_SOUND)
6e198e97
VZ
794WX_ARG_FEATURE(stdpaths, [ --enable-stdpaths use wxStandardPaths class], wxUSE_STDPATHS)
795WX_ARG_FEATURE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH)
796WX_ARG_FEATURE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS)
16d4f440 797WX_ARG_FEATURE(sysoptions, [ --enable-sysoptions use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
6e198e97
VZ
798WX_ARG_FEATURE(tarstream, [ --enable-tarstream use wxTar streams], wxUSE_TARSTREAM)
799WX_ARG_FEATURE(textbuf, [ --enable-textbuf use wxTextBuffer class], wxUSE_TEXTBUFFER)
800WX_ARG_FEATURE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE)
801WX_ARG_FEATURE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER)
4732e2dc 802WX_ARG_FEATURE(variant, [ --enable-variant use wxVariant class], wxUSE_VARIANT)
6e198e97
VZ
803WX_ARG_FEATURE(zipstream, [ --enable-zipstream use wxZip streams], wxUSE_ZIPSTREAM)
804
4732e2dc 805dnl URL-related classes
6e198e97 806WX_ARG_FEATURE(url, [ --enable-url use wxURL class], wxUSE_URL)
6e198e97
VZ
807WX_ARG_FEATURE(protocol, [ --enable-protocol use wxProtocol class], wxUSE_PROTOCOL)
808WX_ARG_FEATURE(protocol_http, [ --enable-protocol-http HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP)
809WX_ARG_FEATURE(protocol_ftp, [ --enable-protocol-ftp FTP support in wxProtocol], wxUSE_PROTOCOL_FTP)
810WX_ARG_FEATURE(protocol_file, [ --enable-protocol-file FILE support in wxProtocol], wxUSE_PROTOCOL_FILE)
811
812WX_ARG_FEATURE(threads, [ --enable-threads use threads], wxUSE_THREADS)
9a98a854 813
91a5e00c
VS
814WX_ARG_ENABLE(iniconf, [ --enable-iniconf use wxIniConfig (Win32 only)], wxUSE_INICONF)
815WX_ARG_FEATURE(regkey, [ --enable-regkey use wxRegKey class (Win32 only)], wxUSE_REGKEY)
816
b12915c1
VZ
817if test "$wxUSE_GUI" = "yes"; then
818
9a98a854 819dnl ---------------------------------------------------------------------------
6e198e97 820dnl optional "big" GUI features
9a98a854
VZ
821dnl ---------------------------------------------------------------------------
822
6e198e97
VZ
823WX_ARG_FEATURE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
824WX_ARG_FEATURE(help, [ --enable-help use help subsystem], wxUSE_HELP)
825WX_ARG_FEATURE(mshtmlhelp, [ --enable-mshtmlhelp use MS HTML Help (win32)], wxUSE_MS_HTML_HELP)
826WX_ARG_FEATURE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML)
827WX_ARG_FEATURE(htmlhelp, [ --enable-htmlhelp use wxHTML-based help], wxUSE_WXHTML_HELP)
828WX_ARG_FEATURE(xrc, [ --enable-xrc use XRC resources sub-library], wxUSE_XRC)
829WX_ARG_FEATURE(aui, [ --enable-aui use AUI docking library], wxUSE_AUI)
1c4293cb 830WX_ARG_FEATURE(propgrid, [ --enable-propgrid use wxPropertyGrid library], wxUSE_PROPGRID)
3c3ead1d 831WX_ARG_FEATURE(ribbon, [ --enable-ribbon use wxRibbon library], wxUSE_RIBBON)
6e198e97
VZ
832WX_ARG_FEATURE(stc, [ --enable-stc use wxStyledTextCtrl library], wxUSE_STC)
833WX_ARG_FEATURE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS)
6e198e97
VZ
834WX_ARG_FEATURE(loggui, [ --enable-loggui use standard GUI logger], wxUSE_LOGGUI)
835WX_ARG_FEATURE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_LOGWINDOW)
836WX_ARG_FEATURE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG)
4732e2dc
VZ
837WX_ARG_FEATURE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI)
838WX_ARG_FEATURE(mdidoc, [ --enable-mdidoc use docview architecture with MDI], wxUSE_MDI_ARCHITECTURE)
839WX_ARG_FEATURE(mediactrl, [ --enable-mediactrl use wxMediaCtrl class], wxUSE_MEDIACTRL)
840WX_ARG_FEATURE(gstreamer8, [ --enable-gstreamer8 force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8)
6e198e97
VZ
841WX_ARG_FEATURE(webkit, [ --enable-webkit use wxWebKitCtrl (Mac)], wxUSE_WEBKIT)
842WX_ARG_FEATURE(richtext, [ --enable-richtext use wxRichTextCtrl], wxUSE_RICHTEXT)
6e198e97 843WX_ARG_FEATURE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
4732e2dc 844WX_ARG_FEATURE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
b0fc907f 845WX_ARG_FEATURE(svg, [ --enable-svg use wxSVGFileDC device context], wxUSE_SVG)
3544f421 846WX_ARG_FEATURE(web, [ --enable-web use wxWeb library], wxUSE_WEB)
9a98a854 847
a12bd55b
VZ
848dnl wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter
849dnl can't be disabled, don't even provide an option to do it
850if test "$wxUSE_MAC" != 1; then
851WX_ARG_FEATURE(graphics_ctx,[ --enable-graphics_ctx use graphics context 2D drawing API], wxUSE_GRAPHICS_CONTEXT)
852fi
853
9a98a854
VZ
854dnl ---------------------------------------------------------------------------
855dnl IPC &c
856dnl ---------------------------------------------------------------------------
9a98a854 857
6e198e97
VZ
858WX_ARG_FEATURE(clipboard, [ --enable-clipboard use wxClipboard class], wxUSE_CLIPBOARD)
859WX_ARG_FEATURE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
860WX_ARG_FEATURE(metafile, [ --enable-metafile use win32 metafiles], wxUSE_METAFILE)
9a98a854
VZ
861
862dnl ---------------------------------------------------------------------------
863dnl optional GUI controls (in alphabetical order except the first one)
864dnl ---------------------------------------------------------------------------
865
3c7410a5
VZ
866dnl don't set DEFAULT_wxUSE_XXX below if the option is not specified
867DEFAULT_wxUSE_CONTROLS=none
868WX_ARG_DISABLE(controls, [ --disable-controls disable compilation of all standard controls], wxUSE_CONTROLS)
9a98a854 869
e6d984e2
VZ
870dnl even with --disable-controls, some may be enabled by an explicit
871dnl --enable-<control> later on the command line -- but by default all will be
872dnl disabled
873if test "$wxUSE_CONTROLS" = "no"; then
874 DEFAULT_wxUSE_ACCEL=no
875 DEFAULT_wxUSE_ANIMATIONCTRL=no
876 DEFAULT_wxUSE_BMPBUTTON=no
877 DEFAULT_wxUSE_BUTTON=no
878 DEFAULT_wxUSE_CALCTRL=no
879 DEFAULT_wxUSE_CARET=no
880 DEFAULT_wxUSE_CHECKBOX=no
881 DEFAULT_wxUSE_CHECKLISTBOX=no
882 DEFAULT_wxUSE_CHOICE=no
883 DEFAULT_wxUSE_CHOICEBOOK=no
884 DEFAULT_wxUSE_COLLPANE=no
885 DEFAULT_wxUSE_COLOURPICKERCTRL=no
886 DEFAULT_wxUSE_COMBOBOX=no
887 DEFAULT_wxUSE_COMBOBOX=no
3571e1ad 888 DEFAULT_wxUSE_COMMANDLINKBUTTON=no
e6d984e2
VZ
889 DEFAULT_wxUSE_DATAVIEWCTRL=no
890 DEFAULT_wxUSE_DATEPICKCTRL=no
891 DEFAULT_wxUSE_DETECT_SM=no
892 DEFAULT_wxUSE_DIRPICKERCTRL=no
893 DEFAULT_wxUSE_DISPLAY=no
894 DEFAULT_wxUSE_FILECTRL=no
895 DEFAULT_wxUSE_FILEPICKERCTRL=no
896 DEFAULT_wxUSE_FONTPICKERCTRL=no
897 DEFAULT_wxUSE_GAUGE=no
898 DEFAULT_wxUSE_GRID=no
e721a2a2 899 DEFAULT_wxUSE_HEADERCTRL=no
e6d984e2
VZ
900 DEFAULT_wxUSE_HYPERLINKCTRL=no
901 DEFAULT_wxUSE_IMAGLIST=no
902 DEFAULT_wxUSE_LISTBOOK=no
903 DEFAULT_wxUSE_LISTBOX=no
904 DEFAULT_wxUSE_LISTCTRL=no
f5bdfc69 905 DEFAULT_wxUSE_MARKUP=no
e6d984e2
VZ
906 DEFAULT_wxUSE_NOTEBOOK=no
907 DEFAULT_wxUSE_POPUPWIN=no
908 DEFAULT_wxUSE_RADIOBOX=no
909 DEFAULT_wxUSE_RADIOBTN=no
a1bdd4ab 910 DEFAULT_wxUSE_RICHMSGDLG=no
e6d984e2
VZ
911 DEFAULT_wxUSE_REARRANGECTRL=no
912 DEFAULT_wxUSE_SASH=no
913 DEFAULT_wxUSE_SCROLLBAR=no
914 DEFAULT_wxUSE_SEARCHCTRL=no
915 DEFAULT_wxUSE_SLIDER=no
916 DEFAULT_wxUSE_SPINBTN=no
917 DEFAULT_wxUSE_SPINCTRL=no
918 DEFAULT_wxUSE_SPLITTER=no
919 DEFAULT_wxUSE_STATBMP=no
920 DEFAULT_wxUSE_STATBOX=no
921 DEFAULT_wxUSE_STATLINE=no
922 DEFAULT_wxUSE_STATUSBAR=no
923 DEFAULT_wxUSE_TIPWINDOW=no
924 DEFAULT_wxUSE_TOGGLEBTN=no
925 DEFAULT_wxUSE_TOOLBAR=no
926 DEFAULT_wxUSE_TOOLBAR_NATIVE=no
927 DEFAULT_wxUSE_TOOLBOOK=no
928 DEFAULT_wxUSE_TOOLTIPS=no
929 DEFAULT_wxUSE_TREEBOOK=no
930 DEFAULT_wxUSE_TREECTRL=no
9a98a854
VZ
931fi
932
f5bdfc69
VZ
933dnl features affecting multiple controls
934WX_ARG_FEATURE(markup, [ --enable-markup support wxControl::SetLabelMarkup], wxUSE_MARKUP)
935
e6d984e2 936dnl please keep the settings below in alphabetical order
6e198e97
VZ
937WX_ARG_FEATURE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
938WX_ARG_FEATURE(animatectrl, [ --enable-animatectrl use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL)
2e9b5717 939WX_ARG_FEATURE(artstd, [ --enable-artstd use standard XPM icons in wxArtProvider], wxUSE_ARTPROVIDER_STD)
c1d2466a 940WX_ARG_FEATURE(arttango, [ --enable-arttango use Tango icons in wxArtProvider], wxUSE_ARTPROVIDER_TANGO)
6e198e97
VZ
941WX_ARG_FEATURE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
942WX_ARG_FEATURE(bmpcombobox, [ --enable-bmpcombobox use wxBitmapComboBox class], wxUSE_BITMAPCOMBOBOX)
e6d984e2 943WX_ARG_FEATURE(button, [ --enable-button use wxButton class], wxUSE_BUTTON)
6e198e97
VZ
944WX_ARG_FEATURE(calendar, [ --enable-calendar use wxCalendarCtrl class], wxUSE_CALCTRL)
945WX_ARG_FEATURE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET)
946WX_ARG_FEATURE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX)
947WX_ARG_FEATURE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
948WX_ARG_FEATURE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE)
949WX_ARG_FEATURE(choicebook, [ --enable-choicebook use wxChoicebook class], wxUSE_CHOICEBOOK)
950WX_ARG_FEATURE(collpane, [ --enable-collpane use wxCollapsiblePane class], wxUSE_COLLPANE)
951WX_ARG_FEATURE(colourpicker,[ --enable-colourpicker use wxColourPickerCtrl class], wxUSE_COLOURPICKERCTRL)
952WX_ARG_FEATURE(combobox, [ --enable-combobox use wxComboBox class], wxUSE_COMBOBOX)
953WX_ARG_FEATURE(comboctrl, [ --enable-comboctrl use wxComboCtrl class], wxUSE_COMBOCTRL)
3571e1ad 954WX_ARG_FEATURE(commandlinkbutton, [ --enable-commandlinkbutton use wxCommmandLinkButton class], wxUSE_COMMANDLINKBUTTON)
e6d984e2 955WX_ARG_FEATURE(dataviewctrl,[ --enable-dataviewctrl use wxDataViewCtrl class], wxUSE_DATAVIEWCTRL)
6e198e97 956WX_ARG_FEATURE(datepick, [ --enable-datepick use wxDatePickerCtrl class], wxUSE_DATEPICKCTRL)
e6d984e2 957WX_ARG_FEATURE(detect_sm, [ --enable-detect_sm use code to detect X11 session manager], wxUSE_DETECT_SM)
6e198e97
VZ
958WX_ARG_FEATURE(dirpicker, [ --enable-dirpicker use wxDirPickerCtrl class], wxUSE_DIRPICKERCTRL)
959WX_ARG_FEATURE(display, [ --enable-display use wxDisplay class], wxUSE_DISPLAY)
6e198e97 960WX_ARG_FEATURE(editablebox, [ --enable-editablebox use wxEditableListBox class], wxUSE_EDITABLELISTBOX)
0cf3e587 961WX_ARG_FEATURE(filectrl, [ --enable-filectrl use wxFileCtrl class], wxUSE_FILECTRL)
e6d984e2 962WX_ARG_FEATURE(filepicker, [ --enable-filepicker use wxFilePickerCtrl class], wxUSE_FILEPICKERCTRL)
6e198e97
VZ
963WX_ARG_FEATURE(fontpicker, [ --enable-fontpicker use wxFontPickerCtrl class], wxUSE_FONTPICKERCTRL)
964WX_ARG_FEATURE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
965WX_ARG_FEATURE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
e721a2a2 966WX_ARG_FEATURE(headerctrl, [ --enable-headerctrl use wxHeaderCtrl class], wxUSE_HEADERCTRL)
6e198e97
VZ
967WX_ARG_FEATURE(hyperlink, [ --enable-hyperlink use wxHyperlinkCtrl class], wxUSE_HYPERLINKCTRL)
968WX_ARG_FEATURE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
a92b5dfe 969WX_ARG_FEATURE(infobar, [ --enable-infobar use wxInfoBar class], wxUSE_INFOBAR)
6e198e97
VZ
970WX_ARG_FEATURE(listbook, [ --enable-listbook use wxListbook class], wxUSE_LISTBOOK)
971WX_ARG_FEATURE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
972WX_ARG_FEATURE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
973WX_ARG_FEATURE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
e36a1739 974WX_ARG_FEATURE(notifmsg, [ --enable-notifmsg use wxNotificationMessage class], wxUSE_NOTIFICATION_MESSAGE)
6e198e97 975WX_ARG_FEATURE(odcombobox, [ --enable-odcombobox use wxOwnerDrawnComboBox class], wxUSE_ODCOMBOBOX)
e6d984e2 976WX_ARG_FEATURE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN)
6e198e97
VZ
977WX_ARG_FEATURE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX)
978WX_ARG_FEATURE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN)
a1bdd4ab 979WX_ARG_FEATURE(richmsgdlg, [ --enable-richmsgdlg use wxRichMessageDialog class], wxUSE_RICHMSGDLG)
f0bb342f 980WX_ARG_FEATURE(rearrangectrl,[ --enable-rearrangectrl use wxRearrangeList/Ctrl/Dialog], wxUSE_REARRANGECTRL)
6e198e97
VZ
981WX_ARG_FEATURE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH)
982WX_ARG_FEATURE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
983WX_ARG_FEATURE(searchctrl, [ --enable-searchctrl use wxSearchCtrl class], wxUSE_SEARCHCTRL)
984WX_ARG_FEATURE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER)
985WX_ARG_FEATURE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN)
986WX_ARG_FEATURE(spinctrl, [ --enable-spinctrl use wxSpinCtrl class], wxUSE_SPINCTRL)
987WX_ARG_FEATURE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER)
988WX_ARG_FEATURE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
989WX_ARG_FEATURE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
990WX_ARG_FEATURE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
991WX_ARG_FEATURE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT)
992WX_ARG_FEATURE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
4f167b46 993WX_ARG_FEATURE(taskbaricon, [ --enable-taskbaricon use wxTaskBarIcon class], wxUSE_TASKBARICON)
e6d984e2 994WX_ARG_FEATURE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE)
6e198e97 995WX_ARG_FEATURE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL)
e6d984e2 996WX_ARG_FEATURE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW)
6e198e97
VZ
997WX_ARG_FEATURE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN)
998WX_ARG_FEATURE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR)
6e198e97 999WX_ARG_FEATURE(toolbook, [ --enable-toolbook use wxToolbook class], wxUSE_TOOLBOOK)
e6d984e2 1000WX_ARG_FEATURE(treebook, [ --enable-treebook use wxTreebook class], wxUSE_TREEBOOK)
6e198e97 1001WX_ARG_FEATURE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL)
9a98a854
VZ
1002
1003dnl ---------------------------------------------------------------------------
b1f5d087 1004dnl common dialogs
9a98a854
VZ
1005dnl ---------------------------------------------------------------------------
1006
6e198e97
VZ
1007WX_ARG_FEATURE(commondlg, [ --enable-commondlg use all common dialogs], wxUSE_COMMONDLGS)
1008WX_ARG_FEATURE(aboutdlg, [ --enable-aboutdlg use wxAboutBox], wxUSE_ABOUTDLG)
1009WX_ARG_FEATURE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG)
1010WX_ARG_FEATURE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG)
1011WX_ARG_FEATURE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG)
1012WX_ARG_FEATURE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG)
1013WX_ARG_FEATURE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG)
1014WX_ARG_FEATURE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG)
1015WX_ARG_FEATURE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG)
1016WX_ARG_FEATURE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG)
1017WX_ARG_FEATURE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH)
1018WX_ARG_FEATURE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG)
1019WX_ARG_FEATURE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS)
1020WX_ARG_FEATURE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG)
1021WX_ARG_FEATURE(wizarddlg, [ --enable-wizarddlg use wxWizard], wxUSE_WIZARDDLG)
b1f5d087
VZ
1022
1023dnl ---------------------------------------------------------------------------
1024dnl misc GUI options
1025dnl ---------------------------------------------------------------------------
1026
6e198e97
VZ
1027WX_ARG_FEATURE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS)
1028WX_ARG_FEATURE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME)
1029WX_ARG_FEATURE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS)
1030WX_ARG_FEATURE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES)
1031WX_ARG_FEATURE(mousewheel, [ --enable-mousewheel use mousewheel], wxUSE_MOUSEWHEEL)
1032WX_ARG_FEATURE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
1033WX_ARG_FEATURE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
1034WX_ARG_FEATURE(joystick, [ --enable-joystick use wxJoystick], wxUSE_JOYSTICK)
1035WX_ARG_FEATURE(metafile, [ --enable-metafiles use wxMetaFile (Win32 only)], wxUSE_METAFILE)
1036WX_ARG_FEATURE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE)
1037WX_ARG_FEATURE(accessibility,[ --enable-accessibility enable accessibility support], wxUSE_ACCESSIBILITY)
9b7e0226 1038WX_ARG_FEATURE(uiactionsim, [ --enable-uiactionsim use wxUIActionSimulator (experimental)], wxUSE_UIACTIONSIMULATOR)
e71508e1 1039WX_ARG_FEATURE(dctransform, [ --enable-dctransform use wxDC::SetTransformMatrix and related], wxUSE_DC_TRANSFORM_MATRIX)
324c132b 1040WX_ARG_FEATURE(webviewwebkit,[ --enable-webview-webkit use wxWebView WebKit backend], wxUSE_WEBVIEW_WEBKIT)
143121c5 1041
0940bcf7
HH
1042dnl ---------------------------------------------------------------------------
1043dnl support for image formats that do not rely on external library
1044dnl ---------------------------------------------------------------------------
1045
6e198e97
VZ
1046WX_ARG_FEATURE(palette, [ --enable-palette use wxPalette class], wxUSE_PALETTE)
1047WX_ARG_FEATURE(image, [ --enable-image use wxImage class], wxUSE_IMAGE)
1048WX_ARG_FEATURE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF)
1049WX_ARG_FEATURE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX)
1050WX_ARG_FEATURE(tga, [ --enable-tga use tga images (TGA file format)], wxUSE_TGA)
1051WX_ARG_FEATURE(iff, [ --enable-iff use iff images (IFF file format)], wxUSE_IFF)
1052WX_ARG_FEATURE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM)
1053WX_ARG_FEATURE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM)
1e9a3d4b 1054WX_ARG_FEATURE(ico_cur, [ --enable-ico_cur use Windows ICO and CUR formats], wxUSE_ICO_CUR)
ceec2216 1055
5d18e029
VZ
1056dnl ---------------------------------------------------------------------------
1057dnl wxMSW-only options
1058dnl ---------------------------------------------------------------------------
1059
1060WX_ARG_FEATURE(dccache, [ --enable-dccache cache temporary wxDC objects (Win32 only)], wxUSE_DC_CACHEING)
0295153c 1061WX_ARG_FEATURE(ps-in-msw, [ --enable-ps-in-msw use PS printing in wxMSW (Win32 only)], wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
6517fa86 1062WX_ARG_FEATURE(ownerdrawn, [ --enable-ownerdrawn use owner drawn controls (Win32 and OS/2 only)], wxUSE_OWNER_DRAWN)
5d18e029 1063WX_ARG_FEATURE(uxtheme, [ --enable-uxtheme enable support for Windows XP themed look (Win32 only)], wxUSE_UXTHEME)
f77c0fe3 1064WX_ARG_FEATURE(wxdib, [ --enable-wxdib use wxDIB class (Win32 only)], wxUSE_DIB)
324c132b 1065WX_ARG_FEATURE(webviewie, [ --enable-webview-ie use wxWebView IE backend (Win32 only)], wxUSE_WEBVIEW_IE)
5d18e029 1066
91a2809d
VZ
1067dnl this one is not really MSW-specific but it exists mainly to be turned off
1068dnl under MSW, it should be off by default on the other platforms
1069if test "$wxUSE_MSW" != 1; then
1070 DEFAULT_wxUSE_AUTOID_MANAGEMENT=no
029b47ad 1071fi
143121c5 1072
91a2809d 1073WX_ARG_FEATURE(autoidman, [ --enable-autoidman use automatic ids management], wxUSE_AUTOID_MANAGEMENT)
f34ca037 1074
e90c1d2a 1075fi
91a2809d 1076dnl for GUI only
e90c1d2a 1077
9a98a854
VZ
1078dnl ---------------------------------------------------------------------------
1079dnl Checks for programs
1080dnl ---------------------------------------------------------------------------
1081
1082dnl flush the cache because checking for programs might abort
1083AC_CACHE_SAVE
1084
9a98a854
VZ
1085dnl C-compiler checks
1086dnl defines CC with the compiler to use
1087dnl defines GCC with yes if using gcc
1088dnl defines GCC empty if not using gcc
1089dnl defines CFLAGS
04727afd
VZ
1090dnl
1091dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
2b5f62a0 1092dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add
6ad6ba21 1093dnl (if not already present in C*FLAGS) the -g and -O flags ourselves below
ec603395 1094CFLAGS=${CFLAGS:=}
6dcfc289 1095AC_BAKEFILE_PROG_CC
9a98a854 1096
9a98a854
VZ
1097dnl is -traditional needed for correct compilations
1098dnl adds -traditional for gcc if needed
1099AC_PROG_GCC_TRADITIONAL
1100
9a98a854
VZ
1101dnl C++-compiler checks
1102dnl defines CXX with the compiler to use
1103dnl defines GXX with yes if using gxx
1104dnl defines GXX empty if not using gxx
1105dnl defines CXXFLAGS
04727afd
VZ
1106dnl
1107dnl see CFLAGS line above
ec603395 1108CXXFLAGS=${CXXFLAGS:=}
6dcfc289 1109AC_BAKEFILE_PROG_CXX
9a98a854 1110
d5e0be7d
VZ
1111dnl configure always sets CXX to something as it falls back to g++ even if no
1112dnl C++ compiler was found, but we prefer to abort now with a clear error
1113dnl message rather than give errors about all tests failures below
b7064225 1114if test "$CXX" = "g++" -a "$GXX" != "yes"; then
d5e0be7d
VZ
1115 AC_MSG_ERROR([C++ compiler is needed to build wxWidgets])
1116fi
1117
9a98a854
VZ
1118dnl ar command
1119dnl defines AR with the appropriate command
bd630206 1120dnl
d083d201
MW
1121dnl For Sun CC AC_BAKEFILE below sets AR to the compiler itself.
1122if test "x$SUNCXX" != xyes; then
1123 AC_CHECK_TOOL(AR, ar)
1124 if test "x$AR" = "x" ; then
1125 AC_MSG_ERROR([ar is needed to build wxWidgets])
1126 fi
911740e7 1127fi
9a98a854 1128
6c254c52
VZ
1129dnl ---------------------------------------------------------------------------
1130dnl Mac-specific SDK/architectures checks
1131dnl ---------------------------------------------------------------------------
1132
1133if test "$wxUSE_MAC" = 1; then
1134
b4e05bdd
DE
1135retest_macosx_linking=no
1136
80367c29
RD
1137OSX_ARCH_OPTS=""
1138if test "x$wxUSE_MAC_ARCH" != xno; then
1139 OSX_ARCH_OPTS="-arch $wxUSE_MAC_ARCH"
1140fi
1141
b4e05bdd 1142dnl Support the old --enable-universal_binary in case anyone was using it.
b4e05bdd
DE
1143 if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
1144 dnl --enable-universal_binary uses a default SDK (currently 10.4u)
1145 dnl --enable-universal_binary=SDK names a path to an SDK
1146 if test "x$wxUSE_UNIVERSAL_BINARY" == xyes; then
1147 # Implicitly turn on the new --with-macosx-sdk using the default
4c51a665 1148 # SDK which provides the behaviour this option has always had.
b4e05bdd
DE
1149 if test "x$wxUSE_MACOSX_SDK" = "x"; then
1150 AC_MSG_WARN([Enabling default SDK due to --enable-universal_binary.])
1151 AC_MSG_WARN([If you don't want this, specify --without-macosx-sdk])
1152 wxUSE_MACOSX_SDK=yes
1153 fi
1154 else
1155 # Complain to user if he specified an argument to --enable-universal_binary
1156 # and also 1) specified --with-macosx-sdk using the default (yes) or
1157 # 2) specified --with-macosx-sdk using a path or 3) specified
1158 # --without-macosx-sdk (no).
1159 if test "x$wxUSE_MACOSX_SDK" != "x" ; then
1160 AC_MSG_FAILURE([Please specify the new --with-macosx-sdk=PATH and do not specify an arg to --enable-universal_binary])
1161 else
1162 # Put the SDK path into the wxUSE_MACOSX_SDK. We don't have to
1163 # special-case the empty string because the below test simply
1164 # converts "no" to the empty string anyway.
1165 wxUSE_MACOSX_SDK="$wxUSE_UNIVERSAL_BINARY"
1166 dnl Warn about deprecated usage.
1167 AC_MSG_WARN([Please use --with-macosx-sdk=PATH and --enable-universal_binary without an argument])
1168 fi
1169 fi
1170 dnl FIXME: I think it would be better to put this into CC, CXX, and LD rather than the flags.
80367c29
RD
1171 OSX_ARCH_OPTS="-arch ppc -arch i386"
1172 if test "$wxUSE_OSX_COCOA" = 1; then
1173 OSX_ARCH_OPTS="$OSX_ARCH_OPTS -arch x86_64"
1174 fi
1175 AC_MSG_CHECKING([for universal binary architectures])
1176 AC_MSG_RESULT([$OSX_ARCH_OPTS])
1177
b4e05bdd
DE
1178 dnl NOTE: Only the compiler driver needs arch flags. The link editor
1179 dnl is incapable of using them but the compiler driver (which we use
1180 dnl as LD when building dynamic libraries) uses them to invoke the
1181 dnl real ld multiple times. If we moved to libtool -dynamic we would
1182 dnl need no arch flags because libtool automatically invokes ld for
1183 dnl every architecture found in the fat input files.
1184 dnl
1185 dnl For static library builds, AR/RANLIB automatically create proper
1186 dnl fat archives although AR is unable to update them once RANLIB has
1187 dnl made them into proper fat archives. Fortunately, our link process
1188 dnl simply removes the .a file before using ar to create a new one.
1189 dnl If we did move to libtool -static we still wouldn't need arch flags
1190 dnl because libtool automatically figures it out based on input.
1191 retest_macosx_linking=yes
1192
1193 dnl HACK: PCH could be made to work by precompiling for each architecture into separate directories
1194 dnl and including all architecture directories with each compiler invocation.
1195 dnl That would require a major rework of Bakefile and at the same time it would be nice to have
1196 dnl Objective-C++ precompiled headers.
1197 AC_MSG_WARN([Disabling precompiled headers due to universal binary build.])
1198 bk_use_pch=no
1199 fi
b4e05bdd 1200
80367c29
RD
1201CXXFLAGS="$OSX_ARCH_OPTS $CXXFLAGS"
1202CFLAGS="$OSX_ARCH_OPTS $CFLAGS"
1203OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
1204OBJCFLAGS="$OSX_ARCH_OPTS $OBJCFLAGS"
1205LDFLAGS="$OSX_ARCH_OPTS $LDFLAGS"
1206
b4e05bdd
DE
1207dnl Set up the Mac OS X SDK. We do this early so configure tests will occur
1208dnl with the SDK in place.
1209dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path
1210if test "x$wxUSE_MACOSX_SDK" = "xno"; then
1211 wxUSE_MACOSX_SDK=
1212elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
1213 # TODO: Search for most recent SDK and use it.
1214 wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
1215fi
1216
1217
1218if test "x$wxUSE_MACOSX_SDK" != "x"; then
1219 AC_MSG_CHECKING([for SDK directory $wxUSE_MACOSX_SDK])
1220 if ! test -d "$wxUSE_MACOSX_SDK"; then
1221 AC_MSG_FAILURE([not found])
1222 else
1223 AC_MSG_RESULT([exists])
1224 fi
e3e89e62 1225 dnl CC and CXX will have these flags added below, after the compiler has been chosen
b4e05bdd 1226 MACOSX_SDK_OPTS="-isysroot $wxUSE_MACOSX_SDK"
b4e05bdd
DE
1227 retest_macosx_linking=yes
1228 dnl NOTE: When libtool is used in lieu of AR/RANLIB (i.e. in static mode)
1229 dnl the syslibroot makes no difference. We aren't using libtool now but
1230 dnl if we ever did, be aware that you don't need to worry about it.
1231fi
1232
1233dnl Set up the deployment target
1234dnl No : Don't specify a min version even if using an SDK
1235dnl Yes : Use the version from the SDK if used, otherwise same as no
1236dnl Param: Use the specified version
1237if test "x$wxUSE_MACOSX_VERSION_MIN" = "xno"; then
1238 wxUSE_MACOSX_VERSION_MIN=
1239elif test "x$wxUSE_MACOSX_VERSION_MIN" = "xyes"; then
1240 if test "x$wxUSE_MACOSX_SDK" != "x"; then
1241 AC_MSG_CHECKING([SDK deployment version])
1242dnl We need to quote the next line where we don't need macros and do need [] in the regex
1243[
1244 MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" buildSettings | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
1245]
11804291
DE
1246 # If that failed, try again with the new key
1247 if test "x$MACOSX_SDK_PLIST_VERSION_MIN" == "x"; then
1248[
1249 MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" DefaultProperties | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
1250]
1251 fi
1252
b4e05bdd
DE
1253 if test "x$MACOSX_SDK_PLIST_VERSION_MIN" != "x"; then
1254 wxUSE_MACOSX_VERSION_MIN=$MACOSX_SDK_PLIST_VERSION_MIN
1255 AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
1256 else
1257 AC_MSG_WARN([Could not determine deployment target from SDKSettings.plist])
1258 wxUSE_MACOSX_VERSION_MIN=
1259 fi
1260 else
1261 wxUSE_MACOSX_VERSION_MIN=
1262 fi
80ba44a0 1263elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then
06a08679
VZ
1264 AC_CHECK_PROGS(OSX_SW_VERS, sw_vers)
1265 if test "$OSX_SW_VERS" != ""; then
1266 OSX_VERSION=`sw_vers -productVersion | grep 10.[[0-9]]`
1267 else
1268 dnl can't determine it (happens e.g. when cross-compiling) so use a
1269 dnl conservative default
1270 AC_MSG_WARN([Assuming OS X 10.4, use --with-macosx-version-min to override.])
1271 OSX_VERSION="10.4"
1272 fi
a49318f1
VZ
1273
1274 case "$OSX_VERSION" in
1275 10.4* )
1276 wxUSE_MACOSX_VERSION_MIN=10.4
1277 ;;
1278
1279 * )
1280 if test "$wxUSE_OSX_CARBON" = 1; then
1281 # otherwise configure stops on leopard for universal_binary
1282 wxUSE_MACOSX_VERSION_MIN=10.4
1283 else
1284 # for Cocoa, use 10.5 to be able to compile it in 64 bits too
1285 wxUSE_MACOSX_VERSION_MIN=10.5
1286 fi
1287 ;;
1288 esac
8e6b680d
KO
1289fi
1290
1291NEEDS_GCC40="no"
1292if test "x$wxUSE_MACOSX_VERSION_MIN" == "x10.4"; then
1293 NEEDS_GCC40="yes"
1294fi
1295
1296if test "$wxUSE_OSX_CARBON" = 1; then
1297 NEEDS_GCC40="yes"
1298fi
1299
1300if test "x$NEEDS_GCC40" == "xyes"; then
1301 # gcc 4.2 cannot compile 10.4 compatible code, so if the user is using it
1302 # and wants 10.4 compatible code, then 'downgrade' to 4.0
1303 # This is also the simplest way to get 32-bit binaries on Snow Leopard.
1304 if test "x$CC" = "xgcc"; then
1305 CCVERSION=`$CC --version | grep 4.[[2-9]].`
1306 if test "x$CCVERSION" != "x"; then
1307 echo "$as_me:$LINENO: WARNING: gcc >= 4.2 cannot compile 10.4 compatible code. Using gcc 4.0 instead."
e3e89e62 1308 CC="gcc-4.0"
8e6b680d
KO
1309 fi
1310 fi
1311
1312 if test "x$CXX" = "xg++"; then
1313 CCVERSION=`$CXX --version | grep 4.[[2-9]].`
1314 if test "x$CCVERSION" != "x"; then
e3e89e62 1315 CXX="g++-4.0"
8e6b680d 1316 fi
80ba44a0 1317 fi
b4e05bdd
DE
1318fi
1319
e3e89e62
RD
1320if test "x$MACOSX_SDK_OPTS" != "x"; then
1321 eval "CC=\"$CC $MACOSX_SDK_OPTS\""
1322 eval "CXX=\"$CXX $MACOSX_SDK_OPTS\""
1323 eval "LD=\"$LD $MACOSX_SDK_OPTS\""
1324fi
1325
b4e05bdd 1326if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then
380dc46f
JS
1327 if test "$wxUSE_OSX_IPHONE" = 1; then
1328 MACOSX_VERSION_MIN_OPTS="-miphoneos-version-min=$wxUSE_MACOSX_VERSION_MIN"
1329 else
1330 MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN"
cdb68deb 1331 fi
b4e05bdd
DE
1332 eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\""
1333 eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\""
1334 eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\""
1335 retest_macosx_linking=yes
1336fi
1337
1338dnl If either an SDK or a version option was added, make sure that we can
1339dnl still compile and link both C and C++. If we didn't do this, then most
1340dnl of the remaining tests would fail.
1341if test "x$retest_macosx_linking" = "xyes"; then
1342 AC_LANG_PUSH(C)
1343 AC_MSG_CHECKING([if C compiler works with SDK/version options])
1344 AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1])
1345 AC_LANG_POP()
1346
1347 AC_LANG_PUSH(C++)
1348 AC_MSG_CHECKING([if C++ compiler works with SDK/version options])
1349 AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1])
1350 AC_LANG_POP()
1351fi
1352
6c254c52 1353fi dnl wxUSE_MAC
2e033fd1 1354
d6853540
RL
1355case "${host}" in
1356
b5853384
GD
1357 dnl The other BSD's should probably go in here too, since this is
1358 dnl to workaround a strange static lib BSDism.
1359 dnl Mac OS X install seems to ignore -p option...
cfda0ea8 1360 *-*-darwin* )
eb99ae0b
GD
1361 INSTALL_PROGRAM="cp -fp"
1362 INSTALL_DATA="cp -fp"
d6853540
RL
1363 ;;
1364 *)
6054113a 1365 ;;
d6853540 1366esac
9a98a854 1367
a3603620
SN
1368dnl ------------------------------------------------------------------------
1369dnl Platform specific tests
1370dnl ------------------------------------------------------------------------
1371
4a4aafb2 1372dnl xlC needs -qunique under AIX so that one source file can be
9273ffba 1373dnl compiled to multiple object files and safely linked together.
4a4aafb2 1374if test "x$XLCXX" = "xyes" -a "x$USE_AIX" = "x1"; then
c92ad099 1375 CXXFLAGS="-qunique $CXXFLAGS"
9273ffba
DE
1376fi
1377
cfda0ea8 1378dnl This case is for PowerPC OS X vs. everything else
4d7ec9f1
DE
1379case "${host}" in
1380 powerpc-*-darwin* )
1381 AC_MSG_CHECKING([if __POWERPC__ is already defined])
1382 AC_TRY_COMPILE([],[#ifndef __POWERPC__
1383 choke me for lack of PowerPC
1384#endif
1385],
1386 [AC_MSG_RESULT([yes])],
1387 [AC_MSG_RESULT([no])
1388 AC_DEFINE(__POWERPC__)
1389 ])
cfda0ea8
DE
1390 ;;
1391esac
1392
1393dnl This case is for OS X vs. everything else
1394case "${host}" in
1395 *-*-darwin* )
4d7ec9f1
DE
1396 AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
1397 AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
1398],[],
1399 [AC_MSG_RESULT([yes])],
1400 [AC_MSG_RESULT([no])
1401 AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
1402 AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
1403#include <CoreFoundation/CFBase.h>
1404 ],[],
1405 [AC_MSG_RESULT([yes])
1406 dnl We must use -D so source files that don't include wx/setup.h
1407 dnl but do include CFBase will work.
c92ad099 1408 CPPFLAGS="-D__CF_USE_FRAMEWORK_INCLUDES__ $CPPFLAGS"],
4d7ec9f1
DE
1409 [AC_MSG_FAILURE([no. CoreFoundation not available.])]
1410 )
1411 ]
1412 )
1413 ;;
1414esac
1415
4922025a
VZ
1416dnl Determine whether we want to use Cygwin as Windows or POSIX platform: the
1417dnl latter makes more sense for wxGTK/Motif/X11 ports
1418wants_win32=0
1419doesnt_want_win32=0
1420case "${host}" in
1421 *-*-cygwin*)
1422 if test "$wxUSE_MSW" = 1 ; then
1423 wants_win32=1
1424 else
1425 dnl when we use cygwin compiler with -mno-cygwin option it uses mingw32
1426 dnl headers and libraries, so it's Windows-like in this case
1427 AC_CACHE_CHECK([if -mno-cygwin is in effect], wx_cv_nocygwin,
1428 [
1429 AC_TRY_COMPILE(
1430 [],
1431 [
1432 #ifdef __MINGW32__
1433 choke me
1434 #endif
1435 ],
1436 wx_cv_nocygwin=no,
1437 wx_cv_nocygwin=yes
1438 )
1439 ]
1440 )
1441
1442 if test "$wx_cv_nocygwin" = "yes"; then
1443 wants_win32=1
1444 else
1445 doesnt_want_win32=1
1446 fi
1447 fi
1448 if test "$wants_win32" = 1 ; then
1449 BAKEFILE_FORCE_PLATFORM=win32
1450 fi
1451 ;;
1452 *-*-mingw*)
1453 wants_win32=1
1454 ;;
1455esac
1456
1457if test "$wxUSE_WINE" = "yes"; then
1458 wants_win32=1
4922025a
VZ
1459 LDFLAGS_GUI="-mwindows"
1460fi
1461
4c51a665 1462dnl NB: The two tests below are *NOT* mutually exclusive! They should only
4922025a
VZ
1463dnl take effect on Cygwin/Mingw and not other platforms.
1464if test "$wants_win32" = 1 ; then
1465 USE_UNIX=0
1466 USE_WIN32=1
1467 AC_DEFINE(__WIN32__)
1468 AC_DEFINE(__WIN95__)
1469 AC_DEFINE(__WINDOWS__)
1470 AC_DEFINE(__GNUWIN32__)
1471 AC_DEFINE(STRICT)
1472fi
1473if test "$doesnt_want_win32" = 1 ; then
1474 USE_UNIX=1
1475 USE_WIN32=0
1476fi
1477dnl (end of Windows-only piece)
1478
1479if test "$USE_UNIX" = 1 ; then
1480 wxUSE_UNIX=yes
1481 AC_DEFINE(__UNIX__)
1482fi
1483
4d7ec9f1 1484dnl This case is for OS/2 vs. everything else
2b5f62a0
VZ
1485case "${host}" in
1486 *-pc-os2_emx | *-pc-os2-emx )
a3603620
SN
1487 dnl ---------------------------------------------------------------------
1488 dnl When we are using gcc on OS/2, we want to be either using resources
1489 dnl (PM) or a more complete POSIX emulation for Motif/GTK+/X11.
1490 dnl Moreover we need to link explicitly against either stdcpp.a or
1491 dnl stdcxx.a (depending on compiler version), since we are using "gcc",
1492 dnl not "g++/c++".
1493 dnl ---------------------------------------------------------------------
1494 dnl (OS/2-only piece)
2b5f62a0
VZ
1495 if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
1496 dnl More complete Unix emulation for unix-like ports
1497 dnl by linking in POSIX/2's cExt (if available).
1498 AC_CHECK_LIB(cExt, drand48, LIBS="$LIBS -lcExt")
1499 else
1500 dnl Include resources for the "native" port (wxPM).
1501 RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res"
1502 fi
7f8c0d74
SN
1503 dnl Check for the gcc version (and thereby for the C runtime library).
1504 dnl wx_cv_gccversion = EMX2 -> Standard EMX environment
1505 dnl wx_cv_gccversion = EMX3 -> EMX with gcc-3.0.3 or gcc-3.2.1
1506 dnl wx_cv_gccversion = Innotek5 -> gcc-3.2.2 with Innotek libc5
1507 dnl wx_cv_gccversion = Innotek6 -> gcc-3.3.5 with Innotek libc6.
f47af52b 1508 AC_CACHE_CHECK([for gcc/libc version], wx_cv_gccversion,[
7f8c0d74 1509 AC_TRY_RUN(
5ff751d6 1510 dnl Check the gcc version macro.
4cbbb631 1511 [
7f8c0d74
SN
1512 #include <stdio.h>
1513
1514 int main()
1515 {
1516 FILE *f=fopen("conftestval", "w");
1517 if (!f) exit(1);
1518 fprintf(f,
4cbbb631 1519 #if (__GNUC__ < 3)
7f8c0d74
SN
1520 "EMX2"
1521 #elif (__GNUC__==3) && ((__GNUC_MINOR__ < 2) || ((__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__<2)))
1522 "EMX3"
1523 #elif (__GNUC__==3) && (__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__==2)
1524 "Innotek5"
1525 #else
1526 "Innotek6"
4cbbb631 1527 #endif
5039a2df 1528 );
7f8c0d74
SN
1529 exit(0);
1530 }
4cbbb631 1531 ],
5039a2df 1532 wx_cv_gccversion=`cat conftestval`,
7f8c0d74
SN
1533 wx_cv_gccversion="EMX2",
1534 dnl Compilation error: Assuming standard EMX environment
1535 wx_cv_gccversion="EMX2"
4cbbb631
SN
1536 )
1537 ])
7f8c0d74 1538 if test "$wx_cv_gccversion" = "EMX2"; then
4cbbb631 1539 LIBS="$LIBS -lstdcpp"
dc4118b8 1540 LDFLAGS="$LDFLAGS -Zsysv-signals"
4cbbb631 1541 else
7f8c0d74 1542 if test "$wx_cv_gccversion" = "EMX3"; then
1ff6a165 1543 LIBS="$LIBS -lstdcxx -lgcc"
dc4118b8
SN
1544 LDFLAGS="$LDFLAGS -Zsysv-signals"
1545 else
1546 LIBS="$LIBS -lstdc++"
1547 fi
4cbbb631 1548 fi
f6a9b35e
SN
1549 if test "$wxUSE_SHARED" = "yes" -a "$wxUSE_OMF" = "no"; then
1550 AC_MSG_WARN([Building DLLs requires OMF mode, enabled])
1551 wxUSE_OMF=yes
1e613d22 1552 enable_omf=yes
f6a9b35e 1553 fi
a3603620
SN
1554 dnl (end of OS/2-only piece)
1555 ;;
1556 *)
1557 dnl ---------------------------------------------------------------------
1558 dnl look for strcasecmp() in string.h and then strings.h if it's not
1559 dnl there. Don't do this on OS/2, where "stricmp" is the function to be
1560 dnl used.
1561 dnl ---------------------------------------------------------------------
1562 dnl (non-OS/2-only piece)
1563
a3603620
SN
1564 AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
1565 AC_TRY_LINK([
1566 #include <string.h>
1567 ],
1568 [
1569 strcasecmp("foo", "bar");
1570 ],
1571 ac_cv_string_strcasecmp=yes,
1572 ac_cv_string_strcasecmp=no
1573 )
1574 ])
1575
1576 if test x"$ac_cv_string_strcasecmp" = "xyes"; then
1577 AC_DEFINE(HAVE_STRCASECMP_IN_STRING_H)
1578 else
1579 AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [
1580 AC_TRY_LINK([
1581 #include <strings.h>
1582 ],
1583 [
1584 strcasecmp("foo", "bar");
1585 ],
1586 ac_cv_strings_strcasecmp=yes,
1587 ac_cv_strings_strcasecmp=no
1588 )
1589 ])
1590
858e1e7c 1591 if test x"$ac_cv_strings_strcasecmp" = "xyes"; then
a3603620
SN
1592 AC_DEFINE(HAVE_STRCASECMP_IN_STRINGS_H)
1593 else
1594 AC_MSG_ERROR([No case-insensitive string comparison function found.])
1595 fi
1596 fi
1597
a3603620 1598 dnl (end of non-OS/2-only piece)
2b5f62a0
VZ
1599 ;;
1600esac
2b5f62a0 1601
21d1c967
GD
1602dnl ------------------------------------------------------------------------
1603dnl Check for headers
1604dnl ------------------------------------------------------------------------
1605
6e7b8bcb
PC
1606dnl Note: non-empty last parameter makes check compile-only,
1607dnl skipping worthless preprocessing check
05787cec 1608AC_CHECK_HEADERS(langinfo.h wchar.h,,, [AC_INCLUDES_DEFAULT])
21d1c967
GD
1609
1610dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
1611if test "$ac_cv_header_wchar_h" != "yes"; then
1f7e12cc 1612 AC_CHECK_HEADERS([wcstr.h],,, [AC_INCLUDES_DEFAULT()])
21d1c967
GD
1613fi
1614
ab9f788e
SN
1615case "${host}" in
1616 *-pc-os2_emx | *-pc-os2-emx )
7f8c0d74
SN
1617 dnl Explicitly link -lintl if langinfo.h is available
1618 dnl and intl not yet included in libc
1619 if test $ac_cv_header_langinfo_h = "yes" \
1620 -a \( "$wx_cv_gccversion" = "EMX2" \
1621 -o "$wx_cv_gccversion" = "EMX3" \
1622 -o "$wx_cv_gccversion" = "Innotek5" \); then
ab9f788e
SN
1623 LIBS="$LIBS -lintl"
1624 fi
1625 ;;
1626esac
1542ea39 1627
bc023abb
MW
1628dnl POSIX needs this for select(), but old systems don't have it
1629if test "$USE_UNIX" = 1 ; then
1f7e12cc 1630 AC_CHECK_HEADERS([sys/select.h],,, [AC_INCLUDES_DEFAULT()])
bc023abb
MW
1631fi
1632
90dd450c
VZ
1633dnl ---------------------------------------------------------------------------
1634dnl Checks for compiler characteristics
1635dnl ---------------------------------------------------------------------------
1636
1637dnl defines const to be empty if c-compiler does not support const fully
1638AC_C_CONST
1639dnl defines inline to a sensible value for the c-compiler
1640AC_C_INLINE
1641
1642dnl check the sizes of integral types (give some reasonable default values for
1643dnl cross-compiling)
1644dnl defines the size of certain types of variables in SIZEOF_<TYPE>
90dd450c
VZ
1645AC_CHECK_SIZEOF(short, 2)
1646AC_CHECK_SIZEOF(void *, 4)
1647AC_CHECK_SIZEOF(int, 4)
1648AC_CHECK_SIZEOF(long, 4)
a369f7c8 1649AC_CHECK_SIZEOF(size_t, 4)
90dd450c
VZ
1650
1651case "${host}" in
1652 arm-*-linux* )
1653 AC_CHECK_SIZEOF(long long, 8)
1654 ;;
4f57cf11
GD
1655 *-hp-hpux* )
1656 AC_CHECK_SIZEOF(long long, 0)
4216d21f 1657 if test "$ac_cv_sizeof_long_long" != 0; then
4f57cf11 1658 dnl HPUX 10.20 headers need this define in order to use long long definitions
c92ad099 1659 CPPFLAGS="-D_INCLUDE_LONGLONG $CPPFLAGS"
4f57cf11
GD
1660 fi
1661 ;;
90dd450c
VZ
1662 * )
1663 AC_CHECK_SIZEOF(long long, 0)
1664esac
1665
238ecede
MW
1666dnl SGI/Irix's stdio.h does not include wchar_t. Mac OS X does not provide
1667dnl wchar.h and wchar_t is defined by stdlib.h (GD)
1668AC_CHECK_SIZEOF(wchar_t, 0,
1669 [
db6d93de
MW
1670 /* DJGPP's wchar_t is now a keyword in C++ (still not C though) */
1671 #if defined(__DJGPP__) && !( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 )
238ecede
MW
1672 # error "fake wchar_t"
1673 #endif
1674 #ifdef HAVE_WCHAR_H
1675 # ifdef __CYGWIN__
1676 # include <stddef.h>
1677 # endif
1678 # include <wchar.h>
1679 #endif
1680 #ifdef HAVE_STDLIB_H
1681 # include <stdlib.h>
1682 #endif
1683 #include <stdio.h>
1684 ]
1685)
86970434
VZ
1686if test "$ac_cv_sizeof_wchar_t" = 0; then
1687 AC_MSG_ERROR([wxWidgets requires wchar_t support.])
61c213fe 1688fi
86970434 1689AC_DEFINE(wxUSE_WCHAR_T)
90dd450c 1690
8fa53e0e
VZ
1691dnl checks needed to define wxVaCopy
1692AC_CACHE_CHECK([for va_copy],
1693 wx_cv_func_va_copy,
1694 [
65c11337 1695 AC_LANG_PUSH(C++)
ba3d13e1 1696 AC_LINK_IFELSE([
8fa53e0e
VZ
1697 #include <stdarg.h>
1698 void foo(char *f, ...)
1699 {
1700 va_list ap1, ap2;
1701 va_start(ap1, f);
1702 va_copy(ap2, ap1);
1703 va_end(ap2);
1704 va_end(ap1);
5886b072
VZ
1705 }
1706 int main()
1707 {
b902e639
VZ
1708 foo("hi", 17);
1709 return 0;
8fa53e0e
VZ
1710 }],
1711 wx_cv_func_va_copy=yes,
1712 wx_cv_func_va_copy=no
1713 )
65c11337 1714 AC_LANG_POP()
8fa53e0e
VZ
1715 ]
1716)
1717
1718if test $wx_cv_func_va_copy = "yes"; then
1719 AC_DEFINE(HAVE_VA_COPY)
1720else
1721 dnl try to understand how can we copy va_lists
1722 AC_CACHE_CHECK([if va_list can be copied by value],
1723 wx_cv_type_va_list_lvalue,
1724 [
1725 AC_RUN_IFELSE([
1726 #include <stdarg.h>
1727 int foo(char *f, ...)
1728 {
1729 va_list ap1, ap2;
1730 va_start(ap1, f);
1731 ap2 = ap1;
1732 if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 )
1733 return 1;
1734 va_end(ap2);
1735 va_end(ap1);
1736 return 0;
1737 }
1738 int main()
1739 {
1740 return foo("hi", 17);
1741 }],
1742 wx_cv_type_va_list_lvalue=yes,
1743 wx_cv_type_va_list_lvalue=no,
1744 dnl assume most common case for cross-compiling...
1745 wx_cv_type_va_list_lvalue=yes
1746 )
1747 ]
1748 )
1749
1750 if test $wx_cv_type_va_list_lvalue != "yes"; then
1751 dnl we suppose that the only thing which can't be copied like this
1752 dnl are arrays... only experience will show whether this is really true
1753 AC_DEFINE(VA_LIST_IS_ARRAY)
1754 fi
1755fi
1756
70c536f3
VZ
1757dnl don't check for vararg macros if they're explicitly disabled: this is
1758dnl useful if the user code using the library wants to limit itself to standard
1759dnl C++ only (e.g. is compiled with g++ -std=c++98)
1760if test "$wxUSE_VARARG_MACROS" = "yes"; then
1761
ca766534
VS
1762dnl Check if variadic macros (C99 feature) are supported:
1763AC_CACHE_CHECK(
1764 [whether the compiler supports variadic macros],
1765 [wx_cv_have_variadic_macros],
1766 [
38c6938f
VZ
1767 dnl C compiler might support variadic macros when C++ one doesn't
1768 dnl (happens with gcc/g++ 2.95.4), so must use C++ one explicitly
1769 AC_LANG_PUSH(C++)
ca766534
VS
1770 AC_COMPILE_IFELSE(
1771 AC_LANG_PROGRAM(
1772 [
1773 #include <stdio.h>
1774 #define test(fmt, ...) printf(fmt, __VA_ARGS__)
1775 ],
1776 [
1777 test("%s %d %p", "test", 1, 0);
1778 ]
1779 ),
1780 [wx_cv_have_variadic_macros=yes],
1781 [wx_cv_have_variadic_macros=no]
1782 )
38c6938f 1783 AC_LANG_POP()
ca766534
VS
1784 ]
1785)
1786
1787if test $wx_cv_have_variadic_macros = "yes"; then
1788 AC_DEFINE(HAVE_VARIADIC_MACROS)
1789fi
1790
70c536f3
VZ
1791fi dnl wxUSE_VARARG_MACROS == yes
1792
e61c1fef 1793
90dd450c 1794dnl check for large file support
e61c1fef 1795LARGEFILE_CPPFLAGS=
90dd450c 1796AC_SYS_LARGEFILE
e61c1fef
VZ
1797if test "$ac_cv_sys_file_offset_bits" = "64"; then
1798 LARGEFILE_CPPFLAGS="-D_FILE_OFFSET_BITS=64"
1799elif test "$ac_cv_sys_large_files" = 1; then
1800 LARGEFILE_CPPFLAGS="-D_LARGE_FILES"
1801fi
90dd450c 1802
f02444d0
VZ
1803dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
1804dnl line because otherwise the system headers risk being included before
1805dnl wx/defs.h which defines these constants leading to inconsistent
1806dnl sizeof(off_t) in different source files of the same program and linking
1807dnl problems
e61c1fef
VZ
1808if test -n "$LARGEFILE_CPPFLAGS"; then
1809 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $LARGEFILE_CPPFLAGS"
1810
1811 dnl We get "Large Files (ILP32) not supported in strict ANSI mode."
1812 dnl #error from HP standard headers unless __STDC_EXT__ is defined.
1813 dnl The compiler should define it automatically, but some old g++
1814 dnl versions don't define it, so test and add it if necessary. AFAIK
1815 dnl the problem only affects the C++ compiler so it is added to
1816 dnl CXXFLAGS only.
1817 if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then
1818 AC_CACHE_CHECK(
1819 [if -D__STDC_EXT__ is required],
1820 wx_cv_STDC_EXT_required,
1821 [
1822 AC_LANG_PUSH(C++)
1823 AC_TRY_COMPILE(
1824 [],
1825 [
1826 #ifndef __STDC_EXT__
1827 choke me
1828 #endif
1829 ],
1830 wx_cv_STDC_EXT_required=no,
1831 wx_cv_STDC_EXT_required=yes
1832 )
1833 AC_LANG_POP()
1834 ]
1835 )
1836 if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
1837 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -D__STDC_EXT__"
00421666 1838 fi
026d8152 1839 fi
f02444d0
VZ
1840fi
1841
e61c1fef
VZ
1842dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source
1843dnl
1844dnl it may be affected by large file flags (this happens under HP-UX 11 for
1845dnl example) so set them before using it and also use C++ to ensure that we get
1846dnl errors, not warnings, about the missing functions
1847AC_LANG_PUSH(C++)
1848old_CPPFLAGS="$CPPFLAGS"
1849CPPFLAGS="$CPPFLAGS $LARGEFILE_CPPFLAGS"
1850AC_FUNC_FSEEKO
1851CPPFLAGS="$old_CPPFLAGS"
1852AC_LANG_POP()
1853if test "$ac_cv_sys_largefile_source" != no; then
1854 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
1855fi
1856
90dd450c
VZ
1857dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
1858WX_C_BIGENDIAN
1859
1860dnl check for iostream (as opposed to iostream.h) standard header
1861WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
1862
986ecc86
VZ
1863dnl check whether C++ compiler supports explicit keyword
1864WX_CPP_EXPLICIT
1865
8bc9a2f0
MW
1866dnl With Sun CC, temporaries have block scope by default. This flag is needed
1867dnl to get the expression scope behaviour that conforms to the standard.
1868if test "x$SUNCXX" = xyes; then
c92ad099 1869 CXXFLAGS="-features=tmplife $CXXFLAGS"
8bc9a2f0
MW
1870fi
1871
9122d155
VZ
1872dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do
1873dnl was to hack their C++ compiler to accept them silently -- but C compiler
1874dnl still spits out dozens of warnings for each X include file, so suppress
1875dnl them
1876if test "x$SUNCC" = xyes; then
c92ad099 1877 CFLAGS="-erroff=E_NO_EXPLICIT_TYPE_GIVEN $CFLAGS"
9122d155
VZ
1878fi
1879
321f760b
VZ
1880dnl SGI mipsPro compiler version 7.4.4 and later (and maybe some earlier
1881dnl versions too but it's known that 7.4.2 doesn't give this warning but does
1882dnl instead warn about "unknown warning number 3970" which explains that we
1883dnl don't want to do this for it) gives this warning for "conversion from
1884dnl pointer to same-sized integral type" even when there is an explicit cast
1885dnl and as there is no way to turn it off and there are hundreds of these
1886dnl warnings in wx sources, just turn it off for now
15b17d22
VZ
1887dnl
1888dnl a better long term solution would be to use #pragma set/reset woff in
1889dnl wxPtrToUInt() and use it instead of casts elsewhere
1890if test "x$SGICC" = "xyes"; then
321f760b
VZ
1891 AC_CACHE_CHECK([if cc version is 7.4.4 or greater],
1892 wx_cv_prog_sgicc744,
1893 [
1894 AC_TRY_COMPILE([],
1895 [
1896 #if _SGI_COMPILER_VERSION >= 744
1897 chock me: mipsPro is 7.4.4 or later
1898 #endif
1899 ],
1900 wx_cv_prog_sgicc744=no,
1901 wx_cv_prog_sgicc744=yes
1902 )
1903 ]
1904 )
1905
1906 if test "x$wx_cv_prog_sgicc744" = "xyes"; then
1907 CFLAGS="-woff 3970 $CFLAGS"
1908 fi
15b17d22
VZ
1909fi
1910if test "x$SGICXX" = "xyes"; then
321f760b
VZ
1911 AC_CACHE_CHECK([if CC version is 7.4.4 or greater],
1912 wx_cv_prog_sgicxx744,
1913 [
1914 AC_LANG_PUSH(C++)
1915 AC_TRY_COMPILE([],
1916 [
1917 #if _SGI_COMPILER_VERSION >= 744
1918 chock me: mipsPro is 7.4.4 or later
1919 #endif
1920 ],
1921 wx_cv_prog_sgicxx744=no,
1922 wx_cv_prog_sgicxx744=yes
1923 )
1924 AC_LANG_POP()
1925 ]
1926 )
1927
1928 if test "x$wx_cv_prog_sgicxx744" = "xyes"; then
1929 CXXFLAGS="-woff 3970 $CXXFLAGS"
1930 fi
15b17d22
VZ
1931fi
1932
76f13e90
VZ
1933dnl HP-UX c89/aCC compiler warnings
1934if test "x$HPCC" = "xyes"; then
1935 dnl 2011: "unrecognized preprocessor directive": nice warning but it's given
1936 dnl even for directives inside #if which is not true (i.e. which are
1937 dnl used for other compilers/OS) and so we have no way to get rid of it
1938 dnl 2450: "long long is non standard" -- yes, we know
c92ad099 1939 CFLAGS="+W 2011,2450 $CFLAGS"
76f13e90
VZ
1940fi
1941if test "x$HPCXX" = "xyes"; then
1942 dnl 2340: "value copied to temporary, reference to temporary used": very
1943 dnl painful as triggered by any occurrence of user-defined conversion
e4513a5e
VZ
1944 dnl 4232: "conversion from 'Foo *' to a more strictly aligned type 'Bar *'
1945 dnl may cause misaligned access": this might indicate a real problem
1946 dnl but any use of GTK+ cast macros results in it so it's unusable
1947 dnl for wxGTK code
1948 CXXFLAGS="+W 2340,4232 $CXXFLAGS"
76f13e90
VZ
1949fi
1950
179daed8
VZ
1951dnl DEC/Compaq/HP cxx warnings
1952if test "x$COMPAQCXX" = "xyes"; then
1953 dnl -w0 enables all warnings, then we disable some of them:
1954 dnl basclsnondto: base class dtor non virtual (sometimes we do want this)
1955 dnl unrimpret: "end of routine block may be unreachable" is given for
1956 dnl every "if ( ) return ...; else return ...;"
1957 dnl intconlosbit: "conversion to integral type of smaller size could lose
1958 dnl data" this is a useful warning but there are too many of
1959 dnl them for now
1960 CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
1961fi
1962
224d4f6d
VZ
1963dnl the next few tests are all for C++ features and so need to be done using
1964dnl C++ compiler
1965AC_LANG_PUSH(C++)
1966
f56c22b4
MW
1967dnl check for std::string or std::wstring
1968if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
f56c22b4
MW
1969 if test "$wxUSE_UNICODE" = "yes"; then
1970 std_string="std::wstring"
1971 char_type="wchar_t"
1972 else
1973 std_string="std::string"
1974 char_type="char"
1975 fi
1976
224d4f6d 1977 dnl check if <string> declares std::[w]string
d92b393c
VZ
1978 AC_CACHE_CHECK([for $std_string in <string>],
1979 wx_cv_class_stdstring,
1980 [
1981 AC_TRY_COMPILE([#include <string>],
1982 [$std_string foo;],
1983 wx_cv_class_stdstring=yes,
1984 wx_cv_class_stdstring=no
1985 )
1986 ]
1987 )
1988
1989 if test "$wx_cv_class_stdstring" = yes; then
1990 if test "$wxUSE_UNICODE" = "yes"; then
1991 AC_DEFINE(HAVE_STD_WSTRING)
1992 fi
1993 dnl we don't need HAVE_STD_STRING, we just suppose it's available if
1994 dnl wxUSE_STD_STRING==yes
1995 else
1996 AC_CACHE_CHECK([if std::basic_string<$char_type> works],
1997 wx_cv_class_stdbasicstring,
1998 [
1999 AC_TRY_COMPILE([
2000 #ifdef HAVE_WCHAR_H
2001 # ifdef __CYGWIN__
2002 # include <stddef.h>
2003 # endif
2004 # include <wchar.h>
2005 #endif
2006 #ifdef HAVE_STDLIB_H
2007 # include <stdlib.h>
2008 #endif
2009 #include <stdio.h>
2010 #include <string>
2011 ],
2012 [std::basic_string<$char_type> foo;
2013 const $char_type* dummy = foo.c_str();],
2014 wx_cv_class_stdbasicstring=yes,
2015 wx_cv_class_stdbasicstring=no
2016 )
2017 ]
2018 )
2019
2020 if test "$wx_cv_class_stdbasicstring" != yes; then
2021 if test "$wxUSE_STL" = "yes"; then
2022 AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>])
105a81f3 2023 elif test "$wxUSE_STD_STRING" = "yes"; then
d92b393c
VZ
2024 AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>])
2025 else
2026 AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string])
2027 wxUSE_STD_STRING=no
2028 fi
2029 fi
2030 fi
0a08f02a
MB
2031fi
2032
f56c22b4 2033if test "$wxUSE_STD_IOSTREAM" = "yes"; then
f56c22b4
MW
2034 AC_CHECK_TYPES([std::istream, std::ostream],,
2035 [wxUSE_STD_IOSTREAM=no],
2036 [#include <iostream>])
2037
2038 if test "$wxUSE_STD_IOSTREAM" != "yes"; then
105a81f3 2039 if test "$wxUSE_STD_IOSTREAM" = "yes"; then
4b9918c5
MW
2040 AC_MSG_ERROR([Can't use --enable-std_iostreams without std::istream and std::ostream])
2041 else
2042 AC_MSG_WARN([No std::iostreams, switching to --disable-std_iostreams])
2043 fi
f56c22b4 2044 fi
f56c22b4
MW
2045fi
2046
e87b7833 2047if test "$wxUSE_STL" = "yes"; then
e87b7833 2048 dnl check for basic STL functionality
d92b393c
VZ
2049 AC_CACHE_CHECK([for basic STL functionality],
2050 wx_cv_lib_stl,
2051 [AC_TRY_COMPILE([#include <string>
2052 #include <functional>
2053 #include <algorithm>
2054 #include <vector>
2055 #include <list>],
2056 [std::vector<int> moo;
2057 std::list<int> foo;
2058 std::vector<int>::iterator it =
2059 std::find_if(moo.begin(), moo.end(),
2060 std::bind2nd(std::less<int>(), 3));],
2061 wx_cv_lib_stl=yes,
d0dec913
VZ
2062 wx_cv_lib_stl=no
2063 )]
d92b393c
VZ
2064 )
2065
2066 if test "$wx_cv_lib_stl" != yes; then
2067 AC_MSG_ERROR([Can't use --enable-stl as basic STL functionality is missing])
2068 fi
e87b7833 2069
e87b7833 2070 dnl check for compliant std::string::compare
d92b393c
VZ
2071 AC_CACHE_CHECK([for compliant std::string::compare],
2072 wx_cv_func_stdstring_compare,
2073 [AC_TRY_COMPILE([#include <string>],
2074 [std::string foo, bar;
2075 foo.compare(bar);
2076 foo.compare(1, 1, bar);
2077 foo.compare(1, 1, bar, 1, 1);
2078 foo.compare("");
2079 foo.compare(1, 1, "");
2080 foo.compare(1, 1, "", 2);],
2081 wx_cv_func_stdstring_compare=yes,
2082 wx_cv_func_stdstring_compare=no
2083 )]
2084 )
2085
2086 if test "$wx_cv_func_stdstring_compare" = yes; then
2087 AC_DEFINE(HAVE_STD_STRING_COMPARE)
2088 fi
e87b7833 2089
d92b393c
VZ
2090 if test "$wx_cv_class_gnuhashmapset" = yes; then
2091 AC_DEFINE(HAVE_EXT_HASH_MAP)
2092 AC_DEFINE(HAVE_GNU_CXX_HASH_MAP)
2093 fi
f380544a
VZ
2094
2095 AC_CHECK_HEADER([unordered_map],
2096 [AC_CACHE_CHECK([for unordered_map and unordered_set in std],
2097 wx_cv_class_stdunorderedmapset,
2098 [AC_TRY_COMPILE([#include <unordered_map>
2099 #include <unordered_set>],
2100 [std::unordered_map<double*, char*> test1;
2101 std::unordered_set<char*> test2;],
2102 wx_cv_class_stdunorderedmapset=yes,
2103 wx_cv_class_stdunorderedmapset=no)
2104 ]
2105 )],
2106 [],
2107 [ ]
2108 )
2109
2110 if test "$wx_cv_class_stdunorderedmapset" = yes; then
2111 AC_DEFINE(HAVE_STD_UNORDERED_MAP)
2112 AC_DEFINE(HAVE_STD_UNORDERED_SET)
2113 else
2114 AC_CHECK_HEADER([tr1/unordered_map],
2115 [AC_CACHE_CHECK([for unordered_map and unordered_set in std::tr1],
2116 wx_cv_class_tr1unorderedmapset,
2117 [AC_TRY_COMPILE([#include <tr1/unordered_map>
2118 #include <tr1/unordered_set>],
2119 [std::tr1::unordered_map<double*, char*> test1;
2120 std::tr1::unordered_set<char*> test2;
2121 #if defined(__GNUC__) && (__GNUC__==4) && (__GNUC_MINOR__<2)
2122 #error can't use unordered_{map,set} with gcc-4.[01]: http://gcc.gnu.org/PR24389
2123 #endif],
2124 wx_cv_class_tr1unorderedmapset=yes,
2125 wx_cv_class_tr1unorderedmapset=no)
2126 ]
2127 )],
2128 [],
2129 [ ]
2130 )
2131
2132 if test "$wx_cv_class_tr1unorderedmapset" = yes; then
01684023
VZ
2133 AC_DEFINE(HAVE_TR1_UNORDERED_MAP)
2134 AC_DEFINE(HAVE_TR1_UNORDERED_SET)
2135 else
2136 dnl check for hash_map and hash_set headers
2137 AC_CHECK_HEADER([hash_map],
2138 [AC_CACHE_CHECK([for std::hash_map and hash_set],
2139 wx_cv_class_stdhashmapset,
2140 [AC_TRY_COMPILE([#include <hash_map>
2141 #include <hash_set>],
2142 [std::hash_map<double*, char*, std::hash<double*>, std::equal_to<double*> > test1;
2143 std::hash_set<char*, std::hash<char*>, std::equal_to<char*> > test2;],
2144 wx_cv_class_stdhashmapset=yes,
2145 wx_cv_class_stdhashmapset=no)
2146 ]
2147 )],
2148 [],
2149 [ ]
2150 )
2151
2152 if test "$wx_cv_class_stdhashmapset" = yes; then
2153 AC_DEFINE(HAVE_HASH_MAP)
2154 AC_DEFINE(HAVE_STD_HASH_MAP)
2155 fi
2156
2157 AC_CHECK_HEADER([ext/hash_map],
2158 [AC_CACHE_CHECK([for GNU hash_map and hash_set],
2159 wx_cv_class_gnuhashmapset,
2160 [AC_TRY_COMPILE([#include <ext/hash_map>
2161 #include <ext/hash_set>],
2162 [__gnu_cxx::hash_map<double*, char*, __gnu_cxx::hash<double*>, std::equal_to<double*> > test1;
2163 __gnu_cxx::hash_set<char*, __gnu_cxx::hash<char*>, std::equal_to<char*> > test2;],
2164 wx_cv_class_gnuhashmapset=yes,
2165 wx_cv_class_gnuhashmapset=no)
2166 ]
2167 )],
2168 [],
2169 [ ]
2170 )
2171
f380544a
VZ
2172 fi
2173 fi
e87b7833
MB
2174fi
2175
0f895b0c
VS
2176AC_CHECK_HEADERS([type_traits tr1/type_traits])
2177
47964710
VS
2178dnl check for atomic operations builtins for wx/atomic.h:
2179WX_ATOMIC_BUILTINS
2180
224d4f6d
VZ
2181dnl pop C++
2182AC_LANG_POP()
2183
9a98a854
VZ
2184dnl ---------------------------------------------------------------------------
2185dnl Define search path for includes and libraries: all headers and libs will be
2186dnl looked for in all directories of this path
2187dnl ---------------------------------------------------------------------------
2188
2b5f62a0
VZ
2189dnl Notice that /usr/include should *not* be in this list, otherwise it breaks
2190dnl compilation on Solaris/AIX/... with gcc because standard (non ANSI C)
2191dnl headers are included instead of the "fixed" (ANSI-fied) gcc ones.
afc31813
VZ
2192dnl
2193dnl Also try to put all directories which may contain X11R6 before those which
2194dnl may contain X11R5/4 - we want to use R6 on machines which have both!
789c5f4a
VZ
2195dnl
2196dnl In the same vein. Motif 2.1 should be tried before Motif 1.2 for the
2197dnl systems which have both (AIX 4.x does)
9a98a854 2198SEARCH_INCLUDE="\
ee31c269 2199 /usr/local/include \
235cdc6d
VZ
2200 /usr/local/X11/include \
2201 /usr/local/include/X11 \
256cddd7 2202 /usr/local/X11R7/include \
235cdc6d 2203 /usr/local/X11R6/include \
256cddd7 2204 /usr/local/include/X11R7 \
235cdc6d 2205 /usr/local/include/X11R6 \
ee31c269 2206 \
9a98a854 2207 /usr/Motif-2.1/include \
789c5f4a 2208 /usr/Motif-1.2/include \
9a98a854 2209 /usr/include/Motif1.2 \
9a98a854 2210 \
9a98a854 2211 /usr/dt/include \
afc31813
VZ
2212 /usr/openwin/include \
2213 \
9a98a854
VZ
2214 /usr/include/Xm \
2215 \
256cddd7 2216 /usr/X11R7/include \
9a98a854 2217 /usr/X11R6/include \
afc31813 2218 /usr/X11R6.4/include \
9a98a854 2219 \
256cddd7 2220 /usr/include/X11R7 \
9a98a854 2221 /usr/include/X11R6 \
9a98a854
VZ
2222 \
2223 /usr/X11/include \
2224 /usr/include/X11 \
9a98a854 2225 \
9a98a854 2226 /usr/XFree86/include/X11 \
e051b34e
MW
2227 /usr/pkg/include \
2228 \
235cdc6d
VZ
2229 /usr/local/X1R5/include \
2230 /usr/local/include/X11R5 \
2231 /usr/X11R5/include \
2232 /usr/include/X11R5 \
2233 \
2234 /usr/local/X11R4/include \
2235 /usr/local/include/X11R4 \
2236 /usr/X11R4/include \
2237 /usr/include/X11R4 \
2238 \
2b5f62a0 2239 /usr/openwin/share/include"
9a98a854 2240
c687b303
VZ
2241dnl try to find out the standard lib locations for the systems with multiple
2242dnl ABIs
0aaa804e
MW
2243AC_MSG_CHECKING([for libraries directory])
2244
c687b303 2245case "${host}" in
0aaa804e
MW
2246 *-*-irix6* )
2247 AC_CACHE_VAL(
c687b303
VZ
2248 wx_cv_std_libpath,
2249 [
2250 for d in WX_STD_LIBPATH(); do
2251 for e in a so sl dylib dll.a; do
2252 libc="$d/libc.$e"
2253 if test -f $libc; then
2254 save_LIBS="$LIBS"
2255 LIBS="$libc"
2256 AC_LINK_IFELSE([int main() { return 0; }],
2257 wx_cv_std_libpath=`echo $d | sed s@/usr/@@`)
2258 LIBS="$save_LIBS"
2259 if test "x$wx_cv_std_libpath" != "x"; then
2260 break 2
2261 fi
2262 fi
2263 done
2264 done
2265 if test "x$wx_cv_std_libpath" = "x"; then
2266 wx_cv_std_libpath="lib"
e7272c08 2267 fi
c687b303
VZ
2268 ]
2269 )
2270 ;;
2271
0aaa804e
MW
2272 *-*-solaris2* )
2273 dnl use ../lib or ../lib/64 depending on the size of void*
2274 if test "$ac_cv_sizeof_void_p" = 8 -a -d "/usr/lib/64"; then
2275 wx_cv_std_libpath="lib/64"
2276 else
2277 wx_cv_std_libpath="lib"
2278 fi
2279 ;;
2280
2281 *-*-linux* )
2282 dnl use ../lib or ../lib64 depending on the size of void*
2283 if test "$ac_cv_sizeof_void_p" = 8 -a \
2284 -d "/usr/lib64" -a ! -h "/usr/lib64"; then
2285 wx_cv_std_libpath="lib64"
2286 else
2287 wx_cv_std_libpath="lib"
2288 fi
2289 ;;
2290
c687b303
VZ
2291 *)
2292 wx_cv_std_libpath="lib";
2293 ;;
2294esac
e7272c08 2295
0aaa804e
MW
2296AC_MSG_RESULT($wx_cv_std_libpath)
2297
2298SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` /usr/$wx_cv_std_libpath"
9a98a854 2299
3eca31dc
MW
2300dnl Cross compiling with gcc?
2301if test "$build" != "$host" -a "$GCC" = yes; then
2302 dnl for gcc cross-compilers "$CC -print-prog-name=ld" prints the path to
2303 dnl the linker. Stripping off the trailing '/bin/ld' gives us a candiate
2304 dnl for a 'root' below which libraries and headers for the target system
2305 dnl might be installed.
2306 if cross_root=`$CC -print-prog-name=ld 2>/dev/null`; then
2307 cross_root=`dirname $cross_root`
2308 cross_root=`dirname $cross_root`
2309
2310 dnl substitute this candiate root for '^/usr' in the search lists,
2311 dnl strip out any that don't start '^/usr'.
2312 SEARCH_LIB=`for x in $SEARCH_LIB; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"`
2313 SEARCH_INCLUDE=`for x in $SEARCH_INCLUDE; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"`
e4809643 2314 SEARCH_INCLUDE="$SEARCH_INCLUDE $cross_root/include"
3eca31dc
MW
2315
2316 dnl also have pkg-config search for *.pc files under this 'root'
2317 if test -z "$PKG_CONFIG_PATH"; then
2318 PKG_CONFIG_PATH="$cross_root/local/lib/pkgconfig:$cross_root/lib/pkgconfig"
2319 export PKG_CONFIG_PATH
2320 fi
2321
2322 dnl AC_PATH_XTRA doesn't work currently unless -x-includes and
2323 dnl -x-libraries are given on the command line. So if they are not
2324 dnl set then set them here to plausible defaults.
2325 if test -z "$x_includes" -o "$x_includes" = NONE; then
2326 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h)
2327 x_includes=$ac_find_includes
2328 fi
2329 if test -z "$x_libraries" -o "$x_libraries" = NONE; then
2330 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xt)
2331 x_libraries=$ac_find_libraries
2332 fi
2333 fi
2334fi
2335
9a98a854
VZ
2336dnl ------------------------------------------------------------------------
2337dnl Check for libraries
2338dnl ------------------------------------------------------------------------
2339
143121c5 2340dnl flush the cache because checking for libraries below might abort
9a98a854
VZ
2341AC_CACHE_SAVE
2342
19bc6aad 2343dnl check for glibc version
efdc61a6
VZ
2344dnl
2345dnl VZ: I have no idea why had this check been there originally, but now
5c0a20c3 2346dnl we could probably do without it by just always adding _GNU_SOURCE
32b38f99 2347if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then
19bc6aad
VZ
2348 AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[
2349 AC_TRY_COMPILE([#include <features.h>],
2350 [
efdc61a6 2351 #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
dd6abbac 2352 not glibc 2.1
19bc6aad
VZ
2353 #endif
2354 ],
2355 [
2356 wx_cv_lib_glibc21=yes
2357 ],
2358 [
2359 wx_cv_lib_glibc21=no
2360 ]
2361 )
2362 ])
2363 if test "$wx_cv_lib_glibc21" = "yes"; then
2364 AC_DEFINE(wxHAVE_GLIBC2)
2365 fi
2366fi
2367
5c0a20c3
VZ
2368dnl we may need _GNU_SOURCE for 2 things:
2369dnl
2370dnl 1. to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ (strictly speaking we
2371dnl only need _XOPEN_SOURCE=500 but just defining this disables _BSD_SOURCE
2372dnl which breaks libtiff compilation, so it is simpler to just define
2373dnl _GNU_SOURCE to get everything)
2374dnl
2375dnl 2. for Unicode functions
2376if test "x$wx_cv_lib_glibc21" = "xyes"; then
2377 if test "$wxUSE_UNICODE" = "yes" -o "$wxUSE_THREADS" = "yes"; then
2378 AC_DEFINE(_GNU_SOURCE)
2379 fi
2380fi
2381
8006bf3c
VZ
2382dnl Only add the -lm library if floating point functions cannot be used
2383dnl without it. This check is important on cygwin because of the bizarre
2384dnl way that they have organized functions into libraries. On cygwin, both
2385dnl libc.a and libm.a are symbolic links to a single lib libcygwin.a. This
2386dnl means that
2387dnl 1) linking with -lm is not necessary, and
2388dnl 2) linking with -lm is dangerous if the order of libraries is wrong
2389dnl In particular, if you compile any program with -mno-cygwin and link with
2390dnl -lm, it will crash instantly when it is run. This happens because the
2391dnl linker incorrectly links the Cygwin libm.a (==libcygwin.a), which replaces
2392dnl the ___main function instead of allowing it to be defined by
2393dnl /usr/lib/mingw/libmingw32.a as it should be.
2394dnl
2395dnl On MacOS X, this test will find that -lm is unnecessary and leave it out.
2396dnl
2397dnl Just check a few floating point functions. If they are all found without
2398dnl -lm, then we must not need -lm.
2399have_cos=0
2400have_floor=0
2401AC_CHECK_FUNCS(cos, have_cos=1)
2402AC_CHECK_FUNCS(floor, have_floor=1)
2403AC_MSG_CHECKING(if floating point functions link without -lm)
2404if test "$have_cos" = 1 -a "$have_floor" = 1; then
2405 AC_MSG_RESULT(yes)
2406else
2407 AC_MSG_RESULT(no)
2408 LIBS="$LIBS -lm"
2409 # use different functions to avoid configure caching
2410 have_sin=0
2411 have_ceil=0
2412 AC_CHECK_FUNCS(sin, have_sin=1)
2413 AC_CHECK_FUNCS(ceil, have_ceil=1)
2414 AC_MSG_CHECKING(if floating point functions link with -lm)
2415 if test "$have_sin" = 1 -a "$have_ceil" = 1; then
2416 AC_MSG_RESULT(yes)
2417 else
2418 AC_MSG_RESULT(no)
2419 # not sure we should warn the user, crash, etc.
2420 fi
2421fi
2422
ec3edcc9
VZ
2423dnl check for C99 string to long long conversion functions, assume that if we
2424dnl have the unsigned variants, then we have the signed ones as well
02f0eca5
VZ
2425dnl
2426dnl at least under SGI these functions are only available in C99 code and not
2427dnl in C++ so do these tests using C++ compiler
2428AC_LANG_PUSH(C++)
ec3edcc9 2429if test "wxUSE_UNICODE" = "yes"; then
fd5199d6 2430 WX_CHECK_FUNCS(wcstoull)
ec3edcc9 2431else
fd5199d6 2432 WX_CHECK_FUNCS(strtoull)
ec3edcc9 2433fi
02f0eca5 2434AC_LANG_POP()
ec3edcc9 2435
4f14bcd8
GD
2436dnl ---------------------------------------------------------------------------
2437dnl Optional libraries
2438dnl
2439dnl --with-<lib>=sys
2440dnl looks for system library and fails if not found
2441dnl
2442dnl --with-<lib>
2443dnl --with-<lib>=yes
2444dnl looks for system library and, if not found, prints a warning,
2445dnl falls back to the builtin wx version, and continues configuration
2446dnl
2447dnl --with-<lib>=builtin
2448dnl uses builtin wx version without searching for system library
2449dnl
2450dnl --with-<lib>=no
2451dnl --without-<lib>
2452dnl do not use library (neither system nor builtin wx version)
2453dnl
2454dnl ---------------------------------------------------------------------------
2455
18dbb1f6
VZ
2456dnl ------------------------------------------------------------------------
2457dnl Check for regex libraries
2458dnl ------------------------------------------------------------------------
2459
18dbb1f6 2460if test "$wxUSE_REGEX" != "no"; then
4f14bcd8 2461 AC_DEFINE(wxUSE_REGEX)
5ff751d6 2462
30f2fa6c 2463 if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_REGEX" = "yes"; then
2a424894 2464 AC_MSG_WARN([Defaulting to the builtin regex library for Unicode build.])
30f2fa6c
VS
2465 wxUSE_REGEX=builtin
2466 fi
4f14bcd8
GD
2467
2468 if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then
2469 dnl according to Unix 98 specs, regcomp() is in libc but I believe that
2470 dnl on some old systems it may be in libregex - check for it too?
6e7b8bcb 2471 AC_CHECK_HEADER(regex.h, [AC_CHECK_FUNCS(regcomp re_search)],, [ ])
4f14bcd8
GD
2472
2473 if test "x$ac_cv_func_regcomp" != "xyes"; then
2474 if test "$wxUSE_REGEX" = "sys" ; then
2475 AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version])
2476 else
a3df447d 2477 AC_MSG_WARN([system regex library not found, will use built-in instead])
4f14bcd8
GD
2478 wxUSE_REGEX=builtin
2479 fi
2480 else
2481 dnl we are using the system library
2482 wxUSE_REGEX=sys
4996f261
VS
2483 dnl only the built-in supports advanced REs
2484 AC_DEFINE(WX_NO_REGEX_ADVANCED)
18dbb1f6 2485 fi
4f14bcd8 2486 fi
4f14bcd8 2487fi
18dbb1f6 2488
4f14bcd8
GD
2489dnl ------------------------------------------------------------------------
2490dnl Check for zlib compression library
2491dnl ------------------------------------------------------------------------
2492
4f14bcd8
GD
2493ZLIB_LINK=
2494if test "$wxUSE_ZLIB" != "no" ; then
2495 AC_DEFINE(wxUSE_ZLIB)
2496
2497 if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then
d775acfa
VZ
2498 dnl don't test for zlib under Mac -- its verson there is 1.1.3 but we
2499 dnl should still use it because hopefully (can someone confirm this?)
2500 dnl Apple did fix the security problem in it and not using the system
2501 dnl library results in a whole bunch of warnings when linking with
2502 dnl Carbon framework
2503 if test "$USE_DARWIN" = 1; then
2504 system_zlib_h_ok="yes"
2505 else
2506 dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is
2507 dnl known to not work) and although I don't know which is
2508 dnl the minimal required version it's safer to test for 1.1.4 as
2509 dnl it fixes a security problem in 1.1.3 -- and hopefully nobody
2510 dnl has anything more ancient (1.1.3 was released in July 1998)
2511 dnl anyhow
2512 AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h,
ef33c576
VZ
2513 [AC_TRY_RUN(
2514 dnl zlib.h defines ZLIB_VERSION="x.y.z"
d775acfa 2515 [
d775acfa
VZ
2516 #include <zlib.h>
2517 #include <stdio.h>
2518
d775acfa
VZ
2519 int main()
2520 {
2521 FILE *f=fopen("conftestval", "w");
2522 if (!f) exit(1);
2523 fprintf(f, "%s",
2524 ZLIB_VERSION[0] == '1' &&
2525 (ZLIB_VERSION[2] > '1' ||
2526 (ZLIB_VERSION[2] == '1' &&
2527 ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
2528 exit(0);
2529 }
d775acfa
VZ
2530 ],
2531 ac_cv_header_zlib_h=`cat conftestval`,
2532 ac_cv_header_zlib_h=no,
d1188635
JS
2533 dnl cross-compiling: don't have an answer, try later
2534 unset ac_cv_header_zlib_h
ef33c576 2535 )]
d643b80e 2536 )
d1188635
JS
2537 dnl If the test above did not come up with a value (e.g. cross
2538 dnl compiling) then this should give a definitive answer
6e7b8bcb 2539 AC_CHECK_HEADER(zlib.h,,, [ ])
d643b80e 2540
d775acfa
VZ
2541 system_zlib_h_ok=$ac_cv_header_zlib_h
2542 fi
2543
2544 if test "$system_zlib_h_ok" = "yes"; then
d643b80e
VZ
2545 AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz")
2546 fi
4f14bcd8
GD
2547
2548 if test "x$ZLIB_LINK" = "x" ; then
2549 if test "$wxUSE_ZLIB" = "sys" ; then
d643b80e 2550 AC_MSG_ERROR([zlib library not found or too old! Use --with-zlib=builtin to use built-in version])
4f14bcd8 2551 else
d643b80e 2552 AC_MSG_WARN([zlib library not found or too old, will use built-in instead])
4f14bcd8
GD
2553 wxUSE_ZLIB=builtin
2554 fi
2555 else
2556 dnl we are using the system library
2557 wxUSE_ZLIB=sys
2558 fi
2559 fi
4f14bcd8
GD
2560fi
2561
2562dnl ------------------------------------------------------------------------
2563dnl Check for png library
2564dnl ------------------------------------------------------------------------
2565
4f14bcd8
GD
2566PNG_LINK=
2567if test "$wxUSE_LIBPNG" != "no" ; then
2568 AC_DEFINE(wxUSE_LIBPNG)
3bd8fb5f 2569
81809c07
VS
2570 if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then
2571 AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead])
2572 wxUSE_LIBPNG=sys
2573 fi
4f14bcd8
GD
2574
2575 dnl for the check below to have a chance to succeed, we must already have
81809c07
VS
2576 dnl libz somewhere (don't do this when bulding wxMGL since its libpng
2577 dnl doesn't depend on zlib)
2578 if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then
a3df447d 2579 AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead])
4f14bcd8
GD
2580 wxUSE_LIBPNG=builtin
2581 fi
2582
81809c07
VS
2583 if test "$wxUSE_MGL" != 1 ; then
2584 dnl Don't check for libpng when building wxMGL, libmgl contains it
2585 if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then
5d3f766d
VZ
2586 dnl libpng version 0.9 is known to not work, if an even newer
2587 dnl version is required, just bump it up in the test below
2588 AC_CACHE_CHECK([for png.h > 0.90], ac_cv_header_png_h,
ef33c576
VZ
2589 [AC_TRY_RUN(
2590 dnl png.h defines PNG_LIBPNG_VER=number
5d3f766d 2591 [
5d3f766d
VZ
2592 #include <png.h>
2593 #include <stdio.h>
2594
2595 int main()
2596 {
2597 FILE *f=fopen("conftestval", "w");
2598 if (!f) exit(1);
2599 fprintf(f, "%s",
2600 PNG_LIBPNG_VER > 90 ? "yes" : "no");
2601 exit(0);
2602 }
2603 ],
2604 ac_cv_header_png_h=`cat conftestval`,
2605 ac_cv_header_png_h=no,
d1188635
JS
2606 dnl cross-compiling: test (later) if we have any png.h
2607 unset ac_cv_header_png_h
ef33c576 2608 )]
5d3f766d 2609 )
6e7b8bcb 2610 AC_CHECK_HEADER(png.h,,, [ ])
5d3f766d
VZ
2611
2612 if test "$ac_cv_header_png_h" = "yes"; then
4cdbd8f3 2613 AC_CHECK_LIB(png, png_sig_cmp, PNG_LINK=" -lpng -lz", , [-lz -lm])
5d3f766d 2614 fi
81809c07
VS
2615
2616 if test "x$PNG_LINK" = "x" ; then
2617 if test "$wxUSE_LIBPNG" = "sys" ; then
0c98a14e 2618 AC_MSG_ERROR([system png library not found or too old! Use --with-libpng=builtin to use built-in version])
81809c07 2619 else
0c98a14e 2620 AC_MSG_WARN([system png library not found or too old, will use built-in instead])
81809c07
VS
2621 wxUSE_LIBPNG=builtin
2622 fi
4f14bcd8 2623 else
81809c07 2624 dnl we are using the system library
2b5f62a0 2625 wxUSE_LIBPNG=sys
4f14bcd8 2626 fi
4f14bcd8
GD
2627 fi
2628 fi
4f14bcd8
GD
2629fi
2630
2631dnl ------------------------------------------------------------------------
2632dnl Check for jpeg library
2633dnl ------------------------------------------------------------------------
2634
2956d9e1
VZ
2635dnl this check must be done before the check for libtiff as libtiff uses
2636dnl libjpeg itself
4f14bcd8
GD
2637JPEG_LINK=
2638if test "$wxUSE_LIBJPEG" != "no" ; then
2639 AC_DEFINE(wxUSE_LIBJPEG)
2640
81809c07
VS
2641 if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then
2642 AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead])
2643 wxUSE_LIBJPEG=sys
2644 fi
2645
2646 if test "$wxUSE_MGL" != 1 ; then
2647 dnl Don't check for libjpeg when building wxMGL, libmgl contains it
2648 if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then
2649 dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
2650 dnl HAVE_STDLIB_H which are already defined and this provokes
2651 dnl a compiler warning which configure considers as an error...
2652 AC_MSG_CHECKING(for jpeglib.h)
2653 AC_CACHE_VAL(ac_cv_header_jpeglib_h,
2654 AC_TRY_COMPILE(
2655 [
2656 #undef HAVE_STDLIB_H
2657 #include <stdio.h>
2658 #include <jpeglib.h>
2659 ],
2660 [
2661 ],
2662 ac_cv_header_jpeglib_h=yes,
2663 ac_cv_header_jpeglib_h=no
2664 )
4f14bcd8 2665 )
81809c07 2666 AC_MSG_RESULT($ac_cv_header_jpeglib_h)
4f14bcd8 2667
81809c07
VS
2668 if test "$ac_cv_header_jpeglib_h" = "yes"; then
2669 AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg")
2670 fi
4f14bcd8 2671
81809c07
VS
2672 if test "x$JPEG_LINK" = "x" ; then
2673 if test "$wxUSE_LIBJPEG" = "sys" ; then
2674 AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version])
2675 else
2676 AC_MSG_WARN([system jpeg library not found, will use built-in instead])
2677 wxUSE_LIBJPEG=builtin
2678 fi
4f14bcd8 2679 else
81809c07
VS
2680 dnl we are using the system library
2681 wxUSE_LIBJPEG=sys
90eaf433
MW
2682
2683 if test "$wxUSE_MSW" = 1; then
2684 dnl boolean is defined by the jpeg headers and also by the
2685 dnl Windows headers of some compilers. This type has been
2686 dnl renamed in the builtin, so it is only an issue when
2687 dnl using an external jpeg lib on Windows.
2688 AC_CHECK_TYPES(
2689 [boolean],
2690 [
2691 AC_CHECK_SIZEOF(
2692 [boolean],
2693 [],
2694 [
2695 #undef HAVE_BOOLEAN
2696 #include <stdio.h>
2697 #include <jpeglib.h>
2698 ])
2699 AC_DEFINE_UNQUOTED(
2700 [wxHACK_BOOLEAN],
2701 [wxInt`expr 8 \* $ac_cv_sizeof_boolean`])
2702 ],
2703 [],
2704 [#include <windows.h>])
2705 fi
4f14bcd8 2706 fi
4f14bcd8
GD
2707 fi
2708 fi
2956d9e1
VZ
2709fi
2710
2711dnl ------------------------------------------------------------------------
2712dnl Check for tiff library
2713dnl ------------------------------------------------------------------------
2714
2715TIFF_LINK=
2716TIFF_PREREQ_LINKS=-lm
2717if test "$wxUSE_LIBTIFF" != "no" ; then
2718 AC_DEFINE(wxUSE_LIBTIFF)
2719
2720 if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then
2721 dnl libtiff may depend on libjpeg and libz so use them in the test
2722 dnl below or it would fail
2723 if test "$wxUSE_LIBJPEG" = "sys"; then
2724 TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK"
2725 fi
2726 if test "$wxUSE_ZLIB" = "sys"; then
2727 TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK"
2728 fi
2729 AC_CHECK_HEADER(tiffio.h,
2730 [
2731 AC_CHECK_LIB(tiff, TIFFError,
2732 TIFF_LINK=" -ltiff",
2733 ,
2734 $TIFF_PREREQ_LINKS)
2735 ],
2736 [],
2737 [ ]
2738 )
2739
2740 if test "x$TIFF_LINK" = "x" ; then
2741 if test "$wxUSE_LIBTIFF" = "sys" ; then
2742 AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version])
2743 else
2744 AC_MSG_WARN([system tiff library not found, will use built-in instead])
2745 wxUSE_LIBTIFF=builtin
2746 fi
2747 else
2748 dnl we are using the system library
2749 wxUSE_LIBTIFF=sys
2750 fi
2751 fi
2752 if test "$wxUSE_LIBTIFF" = "builtin" ; then
2753 if test "$wxUSE_LIBJPEG" = "no"; then
2754 dnl we have to prevent the builtin libtiff configure from building the
2755 dnl library with JPEG support as this was explicitly disabled by user,
2756 dnl but unfortunately it needs --disable-jpeg and not --without-libjpeg
2757 dnl (which will be passed to it anyhow as configure passes arguments to
2758 dnl the top-level script to all the other ones called recursively), so
2759 dnl we need to hack around this
2760 ac_configure_args="$ac_configure_args --disable-jpeg"
2761 fi
2762 AC_CONFIG_SUBDIRS([src/tiff])
4f14bcd8 2763 fi
4f14bcd8
GD
2764fi
2765
672abd7a
VS
2766dnl ------------------------------------------------------------------------
2767dnl Check for expat libraries
2768dnl ------------------------------------------------------------------------
2769
2770if test "$wxUSE_EXPAT" != "no"; then
8bcf2d20 2771 wxUSE_XML=yes
672abd7a
VS
2772 AC_DEFINE(wxUSE_EXPAT)
2773 AC_DEFINE(wxUSE_XML)
5ff751d6
VZ
2774
2775 if test "$wxUSE_EXPAT" = "sys" -o "$wxUSE_EXPAT" = "yes" ; then
6e7b8bcb 2776 AC_CHECK_HEADER([expat.h], [found_expat_h=1],, [ ])
5f0b6dff
VS
2777 if test "x$found_expat_h" = "x1"; then
2778 dnl Expat 1.95.6 comes with broken expat.h:
2779 AC_CACHE_CHECK([if expat.h is valid C++ header],
2780 wx_cv_expat_is_not_broken,
2781 [
224d4f6d 2782 AC_LANG_PUSH(C++)
5f0b6dff
VS
2783 AC_TRY_COMPILE([#include <expat.h>],[],
2784 wx_cv_expat_is_not_broken=yes,
2785 wx_cv_expat_is_not_broken=no
2786 )
224d4f6d 2787 AC_LANG_POP()
5f0b6dff
VS
2788 ]
2789 )
2790 if test "$wx_cv_expat_is_not_broken" = "yes" ; then
2791 AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LINK=" -lexpat")
2792 fi
672abd7a
VS
2793 fi
2794 if test "x$EXPAT_LINK" = "x" ; then
2795 if test "$wxUSE_EXPAT" = "sys" ; then
2796 AC_MSG_ERROR([system expat library not found! Use --with-expat=builtin to use built-in version])
2797 else
2798 AC_MSG_WARN([system expat library not found, will use built-in instead])
2799 wxUSE_EXPAT=builtin
2800 fi
2801 else
2802 dnl we are using the system library
2803 wxUSE_EXPAT=sys
2804 fi
2805 fi
2806 if test "$wxUSE_EXPAT" = "builtin" ; then
2807 dnl Expat needs this:
2808 AC_CONFIG_SUBDIRS([src/expat])
2809 fi
2810fi
2811
2812
3527f29c
VS
2813dnl ------------------------------------------------------------------------
2814dnl Check for libmspack
2815dnl ------------------------------------------------------------------------
2816
2817if test "$wxUSE_LIBMSPACK" != "no"; then
6e7b8bcb 2818 AC_CHECK_HEADER([mspack.h], [found_mspack_h=1],, [ ])
3527f29c
VS
2819 if test "x$found_mspack_h" = "x1"; then
2820 AC_CHECK_LIB(mspack, mspack_create_chm_decompressor,
2821 MSPACK_LINK=" -lmspack")
2822 fi
2823 if test "x$MSPACK_LINK" = "x" ; then
2824 wxUSE_LIBMSPACK=no
3527f29c
VS
2825 fi
2826fi
2827
dd3a2d96
VZ
2828if test "$wxUSE_LIBMSPACK" != "no"; then
2829 AC_DEFINE(wxUSE_LIBMSPACK)
dd3a2d96
VZ
2830fi
2831
3527f29c 2832
9a98a854
VZ
2833dnl ----------------------------------------------------------------
2834dnl search for toolkit (widget sets)
2835dnl ----------------------------------------------------------------
2836
dad6c0ea 2837AFMINSTALL=
2b5f62a0 2838WIN32INSTALL=
dad6c0ea 2839
3a922bb4
RL
2840TOOLKIT=
2841TOOLKIT_INCLUDE=
2842WIDGET_SET=
e90c1d2a 2843
3a922bb4
RL
2844dnl are we building for a win32 target environment?
2845dnl If so, setup common stuff needed for both GUI and Base libs.
2846if test "$USE_WIN32" = 1 ; then
be2ad872 2847 AC_CHECK_HEADERS(w32api.h,,, [ ])
6e7b8bcb 2848 AC_CHECK_HEADER(windows.h,,
3a922bb4
RL
2849 [
2850 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
6e7b8bcb
PC
2851 ],
2852 [ ])
dad6c0ea 2853
78dfd1fd 2854 LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32"
b152ff67 2855 case "${host}" in
03773e40 2856 x86_64-*-mingw32* )
da16724e
VZ
2857 dnl we need to define this to embed the manifest for correct
2858 dnl platform from wx/msw/wx.rc (this is not needed for x86 which is
2859 dnl the default in wx/msw/rcdefs.h)
2860 WINDRES_CPU_DEFINE="--define WX_CPU_AMD64"
b152ff67 2861 ;;
b152ff67 2862 esac
7bb2947d
MB
2863 if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
2864 LIBS="$LIBS -loleacc"
2865 fi
2866
77e13408
RL
2867 case "${host}" in
2868 *-*-cygwin* )
2869 dnl Cygwin doesn't include these by default
b3dfbbc9 2870 LIBS="$LIBS -lkernel32 -luser32"
77e13408 2871 esac
7b7a7637 2872
370d2fd7 2873 dnl This one is still used by some sample makefiles.
ef5dbede 2874 RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__ $WINDRES_CPU_DEFINE"
3a922bb4 2875 RESPROGRAMOBJ="\$(PROGRAM)_resources.o"
2b5f62a0 2876
004ee6da
RL
2877 dnl This lot we export to wx-config. It must add the relevant
2878 dnl include directories at the point when they can be known.
2879 dnl (but are these (still) required anyway?)
ef5dbede 2880 WXCONFIG_RESFLAGS="--define __WIN32__ --define __WIN95__ --define __GNUWIN32__ $WINDRES_CPU_DEFINE"
370d2fd7 2881
2b5f62a0
VZ
2882 dnl install Win32-specific files in "make install"
2883 WIN32INSTALL=win32install
5f41d1bf 2884
dcfd4ac4 2885 dnl pbt.h is missing on Wine at least
1f7e12cc 2886 AC_CHECK_HEADER([pbt.h],, [AC_DEFINE(NEED_PBT_H)], [ ])
3a922bb4 2887fi
3f0f0161 2888
3a922bb4
RL
2889if test "$wxUSE_GUI" = "yes"; then
2890 USE_GUI=1
a9b5e89f 2891
3a922bb4 2892 GUI_TK_LIBRARY=
32832908 2893
3a922bb4
RL
2894 WXGTK12=
2895 WXGTK127=
88262190 2896 WXGTK2=
16bd311d 2897 WXGPE=
32832908 2898
f10f4c87 2899 if test "$wxUSE_OLD_COCOA" = 1 ; then
207bc66c
RN
2900 if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes"; then
2901 AC_MSG_WARN([Printing not supported under wxCocoa yet, disabled])
2902 wxUSE_PRINTING_ARCHITECTURE=no
2903 fi
2904 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
2905 AC_MSG_WARN([Drag and Drop not supported under wxCocoa yet, disabled])
2906 wxUSE_DRAG_AND_DROP=no
2907 fi
2908 if test "$wxUSE_DRAGIMAGE" = "yes"; then
cde242b8 2909 AC_MSG_WARN([wxDragImage not supported under wxCocoa yet, disabled])
207bc66c
RN
2910 wxUSE_DRAGIMAGE=no
2911 fi
2912 fi
2913
77e13408 2914 if test "$wxUSE_MSW" = 1 ; then
1e6feb95
VZ
2915 TOOLKIT=MSW
2916 GUIDIST=MSW_DIST
ffef10f6
VS
2917
2918 dnl -mwindows causes a heap of other default gui libs to be linked in.
ffef10f6
VS
2919 case "${host}" in
2920 *-*-mingw32* )
2921 WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows"
2922 esac
7e99ad86
VZ
2923 fi
2924
1e6feb95 2925 if test "$wxUSE_GTK" = 1; then
d84cedb3 2926 dnl GTK+ test program must be compiled with C compiler
8168de4c 2927 AC_MSG_CHECKING([for GTK+ version])
b9fa850d 2928
8168de4c
VZ
2929 gtk_version_cached=1
2930 AC_CACHE_VAL(wx_cv_lib_gtk,
2931 [
2932 dnl stupid GTK+ AM macros produce their own messages, so we
2933 dnl have to pass to the next line
2934 gtk_version_cached=0
d48ad9bd 2935 AC_MSG_RESULT()
8168de4c 2936
3f345b47
VZ
2937 dnl we must link against lgthread unless the user
2938 dnl used --disable-threads
2939 GTK_MODULES=
2940 if test "$wxUSE_THREADS" = "yes"; then
2941 GTK_MODULES=gthread
2942 fi
2943
f34ca037 2944 dnl detect GTK2
8168de4c 2945 wx_cv_lib_gtk=
5001df0d
MW
2946 if test "x$wxGTK_VERSION" != "x1"
2947 then
8802d332 2948 dnl The gthread.pc that ships with Solaris returns '-mt',
5001df0d
MW
2949 dnl it's correct for Sun CC, but gcc requires '-pthreads'.
2950 dnl So disable the compile check and remove the -mt below.
2951 case "${host}" in
2952 *-*-solaris2* )
2953 if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
8802d332 2954 enable_gtktest=no
5001df0d
MW
2955 fi
2956 esac
2957
88262190 2958 AM_PATH_GTK_2_0(2.4.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
5001df0d 2959
a17305ea
PC
2960 dnl we use symbols from X11 directly so we should link with it
2961 GTK_LIBS="$GTK_LIBS -lX11"
f597b41c
MW
2962 fi
2963
f34ca037
MW
2964 dnl detect GTK1.x
2965 if test -z "$wx_cv_lib_gtk"; then
2966 if test "x$wxGTK_VERSION" = "x1" -o "x$wxGTK_VERSION" = "xany" ; then
2967 AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
8168de4c 2968
f34ca037
MW
2969 if test -z "$wx_cv_lib_gtk"; then
2970 AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
2971 fi
2b5f62a0 2972 fi
8168de4c
VZ
2973 fi
2974
2975 if test -z "$wx_cv_lib_gtk"; then
2976 dnl looks better in AC_MSG_RESULT
2977 wx_cv_lib_gtk=none
138be253
VZ
2978 else
2979 dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
2980 dnl subsequent runs
2981 wx_cv_cflags_gtk=$GTK_CFLAGS
38fd5bad 2982 wx_cv_libs_gtk=$GTK_LIBS
8168de4c
VZ
2983 fi
2984 ]
2985 )
b9fa850d 2986
8168de4c
VZ
2987 dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
2988 dnl enough
2989 if test "$gtk_version_cached" = 1; then
2990 AC_MSG_RESULT($wx_cv_lib_gtk)
2991 fi
b9fa850d 2992
8168de4c 2993 case "$wx_cv_lib_gtk" in
88262190 2994 2.0) WXGTK2=1
2b5f62a0 2995 TOOLKIT_VERSION=2
8168de4c
VZ
2996 ;;
2997 1.2.7) WXGTK127=1
d1a8d972 2998 WXGTK12=1
8168de4c
VZ
2999 ;;
3000 1.2.3) WXGTK12=1
3001 ;;
3002 *) AC_MSG_ERROR([
f597b41c
MW
3003The development files for GTK+ were not found. For GTK+ 2, please
3004ensure that pkg-config is in the path and that gtk+-2.0.pc is
3005installed. For GTK+ 1.2 please check that gtk-config is in the path,
3006and that the version is 1.2.3 or above. Also check that the
3007libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
3008--libs' are in the LD_LIBRARY_PATH or equivalent.
8168de4c
VZ
3009 ])
3010 ;;
3011 esac
c596875e 3012
88262190 3013 if test "$WXGTK2" = 1; then
831778df 3014 save_CFLAGS="$CFLAGS"
304205f1 3015 save_LIBS="$LIBS"
831778df 3016 CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
fb4c95cb 3017 LIBS="$LIBS $wx_cv_libs_gtk"
6ebeb4c7 3018
d85aece1
VZ
3019 dnl test if we have at least GTK+ 2.18:
3020 AC_MSG_CHECKING([if GTK+ is version >= 2.18])
ec376c8f
VZ
3021 AC_TRY_COMPILE([
3022 #include <gtk/gtk.h>
3023 ],
3024 [
d85aece1
VZ
3025 #if !GTK_CHECK_VERSION(2,18,0)
3026 Not GTK+ 2.18
ec376c8f
VZ
3027 #endif
3028 ],
3029 [
d85aece1 3030 AC_DEFINE(__WXGTK218__)
a48b6595 3031 AC_DEFINE(__WXGTK210__)
ec376c8f 3032 AC_DEFINE(__WXGTK26__)
ec376c8f 3033 AC_MSG_RESULT([yes])
d85aece1 3034 ac_wxgtk218=1
ec376c8f
VZ
3035 ],
3036 [
3037 AC_MSG_RESULT([no])
d85aece1 3038 ac_wxgtk218=0
ec376c8f
VZ
3039 ])
3040
d85aece1
VZ
3041 if test "$ac_wxgtk218" = 0; then
3042 dnl test if we have at least GTK+ 2.10:
3043 AC_MSG_CHECKING([if GTK+ is version >= 2.10])
a48b6595
VZ
3044 AC_TRY_COMPILE([
3045 #include <gtk/gtk.h>
d85aece1
VZ
3046 ],
3047 [
3048 #if !GTK_CHECK_VERSION(2,10,0)
3049 Not GTK+ 2.10
a48b6595 3050 #endif
d85aece1
VZ
3051 ],
3052 [
3053 AC_DEFINE(__WXGTK210__)
a48b6595 3054 AC_DEFINE(__WXGTK26__)
a48b6595 3055 AC_MSG_RESULT([yes])
d85aece1
VZ
3056 ac_wxgtk210=1
3057 ],
3058 [
a48b6595 3059 AC_MSG_RESULT([no])
d85aece1
VZ
3060 ac_wxgtk210=0
3061 ])
3062
3063 if test "$ac_wxgtk210" = 0; then
3064 dnl test if we have at least GTK+ 2.6:
3065 AC_MSG_CHECKING([if GTK+ is version >= 2.6])
3066 AC_TRY_COMPILE([
3067 #include <gtk/gtk.h>
3068 ],
3069 [
3070 #if !GTK_CHECK_VERSION(2,6,0)
3071 Not GTK+ 2.6
3072 #endif
3073 ],
3074 [
3075 AC_DEFINE(__WXGTK26__)
3076 AC_MSG_RESULT([yes])
3077 ac_wxgtk26=1
3078 ],
3079 [
3080 AC_MSG_RESULT([no])
3081 ac_wxgtk26=0
3082 ])
3083 fi
a48b6595
VZ
3084 fi
3085
831778df 3086 CFLAGS="$save_CFLAGS"
304205f1 3087 LIBS="$save_LIBS"
2b5f62a0
VZ
3088 else
3089 if test "$wxUSE_UNICODE" = "yes"; then
3090 AC_MSG_WARN([Unicode configuration not supported with GTK+ 1.x])
3091 wxUSE_UNICODE=no
3092 fi
bfeeb7f3
PC
3093
3094 dnl test for XIM support in libgdk
3095 AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
2b5f62a0 3096
3f83a9cd
PC
3097 dnl we need poll() in src/gtk1/app.cpp (we know that Darwin doesn't
3098 dnl have it but we do the check for the others)
3099 if test "$USE_DARWIN" != 1; then
3100 AC_CHECK_FUNCS(poll)
3101 fi
f09359cf
VS
3102 fi
3103
138be253 3104 TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
c74dc163 3105 GUI_TK_LIBRARY="$wx_cv_libs_gtk $GUI_TK_LIBRARY"
7799a2d7 3106
493c499e
RR
3107 dnl disable GTK runtime type checks
3108 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -DG_DISABLE_CAST_CHECKS"
3109
1e6feb95
VZ
3110 AFMINSTALL=afminstall
3111 TOOLKIT=GTK
3112 GUIDIST=GTK_DIST
9a98a854 3113
16bd311d
RR
3114 dnl test for external libxpm if we're configured to use it
3115 if test "$wxUSE_GPE" = "yes"; then
3116 AC_MSG_CHECKING(for gpewidget library)
3117 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpewidget)
3118 if test "$ac_find_libraries" != "" ; then
3119 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
3120 dnl -lgpewidget must be before all GTK libs and
3121 dnl we guess its path from the prefix
3122 GUI_TK_LIBRARY="-L${prefix}/lib -lgpewidget $GUI_TK_LIBRARY"
3123 WXGPE=1
a8793ff9 3124 AC_MSG_RESULT([found in $ac_find_libraries])
16bd311d
RR
3125 else
3126 AC_MSG_RESULT(not found)
3127 fi
3128
3129 dnl AC_MSG_CHECKING(for gpe library)
3130 dnl WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpe)
3131 dnl if test "$ac_find_libraries" != "" ; then
3132 dnl WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
3133 dnl GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe"
a8793ff9 3134 dnl AC_MSG_RESULT(found in $ac_find_libraries)
16bd311d
RR
3135 dnl else
3136 dnl AC_MSG_RESULT(not found)
3137 dnl fi
3138 fi
5a92d200
RR
3139 fi
3140
1e6feb95 3141 if test "$wxUSE_MGL" = 1; then
63a76696 3142 AC_MSG_CHECKING(for SciTech MGL library)
1e6feb95
VZ
3143 if test "x$MGL_ROOT" = x ; then
3144 AC_MSG_RESULT(not found)
3145 AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.])
3146 else
3147 AC_MSG_RESULT($MGL_ROOT)
3148 fi
5a92d200 3149
63a76696 3150 AC_MSG_CHECKING(for libmgl location)
f9bc1684 3151 dnl Find MGL library that we want
e46d2a18
VS
3152 dnl FIXME_MGL - test for MGL variants for freebsd etc.;
3153 dnl and for non-x86 versions
f9bc1684
VS
3154 case "${host}" in
3155 *-*-linux* )
e46d2a18
VS
3156 dnl glibc.so, glibc are for older versions of MGL,
3157 dnl x86/a, x86/so are used by >= 5.0 R11
63a76696 3158 if test "x$wxUSE_SHARED" = xyes ; then
e46d2a18 3159 mgl_os_candidates="linux/gcc/x86/so linux/gcc/x86/a linux/gcc/glibc.so linux/gcc/glibc"
63a76696 3160 else
e46d2a18 3161 mgl_os_candidates="linux/gcc/x86/a linux/gcc/x86/so linux/gcc/glibc linux/gcc/glibc.so"
63a76696 3162 fi
f9bc1684
VS
3163 ;;
3164 *-pc-msdosdjgpp )
63a76696 3165 mgl_os_candidates="dos32/dj2"
f9bc1684
VS
3166 ;;
3167 *)
3168 AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
3169 esac
3170
3a922bb4 3171 mgl_lib_type=""
63a76696
VS
3172 mgl_os=""
3173
3174 for mgl_os_i in $mgl_os_candidates ; do
3175 if test "x$mgl_os" = x ; then
3176 if test "$wxUSE_DEBUG_FLAG" = yes ; then
3177 if test -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.a -o \
3178 -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.so; then
3179 mgl_lib_type=debug
3180 mgl_os=$mgl_os_i
3181 fi
3182 fi
3183 if test "x$mgl_lib_type" = x ; then
3184 if test -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.a -o \
3185 -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.so; then
3186 mgl_lib_type=release
3187 mgl_os=$mgl_os_i
3188 fi
3189 fi
1e6feb95 3190 fi
63a76696 3191 done
264de0cc 3192
63a76696
VS
3193 if test "x$mgl_os" = x ; then
3194 AC_MSG_RESULT(not found)
3195 AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
3196 fi
3197 AC_MSG_RESULT("$MGL_ROOT/lib/$mgl_lib_type/$mgl_os")
1542ea39 3198
1d1b75ac
VZ
3199 wxUSE_UNIVERSAL="yes"
3200
1e6feb95 3201 TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
3a922bb4 3202 GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
d607e6c3 3203
1e6feb95
VZ
3204 AFMINSTALL=afminstall
3205 TOOLKIT=MGL
3206 GUIDIST=MGL_DIST
d607e6c3 3207 fi
143121c5 3208
b3c86150 3209 if test "$wxUSE_DFB" = 1; then
479c790c
VZ
3210 PKG_PROG_PKG_CONFIG()
3211
b3c86150 3212 PKG_CHECK_MODULES(DIRECTFB,
d7ae4a62 3213 [directfb >= 0.9.23],
b3c86150
VS
3214 [
3215 wxUSE_UNIVERSAL="yes"
3216 TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS"
3217 GUI_TK_LIBRARY="$DIRECTFB_LIBS"
3218 TOOLKIT=DFB
3219 GUIDIST=DFB_DIST
3220 ],
3221 [
3222 AC_MSG_ERROR([DirectFB not found.])
3223 ]
3224 )
3225 fi
3226
1725144d
RR
3227 if test "$wxUSE_MICROWIN" = 1; then
3228 AC_MSG_CHECKING(for MicroWindows)
3229 if test "x$MICROWINDOWS" = x ; then
3230 AC_MSG_RESULT(not found)
3231 AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
3232 else
3233 AC_MSG_RESULT($MICROWINDOWS)
3234 fi
3235
3236 if test -f $MICROWINDOWS/lib/libmwin.a; then
3237 AC_MSG_RESULT(MicroWindows' libraries found.)
3238 else
3239 AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
3240 fi
3241
3242 TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
3243 GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
3244
1d1b75ac
VZ
3245 wxUSE_UNIVERSAL="yes"
3246
1725144d
RR
3247 AFMINSTALL=afminstall
3248 TOOLKIT=MICROWIN
3249 GUIDIST=MICROWIN_DIST
1d1b75ac
VZ
3250
3251 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
1725144d
RR
3252 fi
3253
0acc5a40
VZ
3254 dnl common part of X11 and Motif port checks
3255 if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
3256 dnl use standard macros to check for X headers/libs, this brings
3257 dnl support for the standard configure options --x-includes,
3258 dnl --x-libraries and --no-x
7f5c07ab
JS
3259 AC_PATH_XTRA
3260
3261 if test "$no_x" = "yes"; then
89d90d6d 3262 AC_MSG_ERROR([X11 not found, please use --x-includes and/or --x-libraries options (see config.log for details)])
7f5c07ab
JS
3263 fi
3264
0acc5a40
VZ
3265 dnl for some reason AC_PATH_XTRA seems to add -INONE and -LNONE (and
3266 dnl also sometimes -RNONE) to X_CFLAGS and X_LIBS respectively, filter
3267 dnl this junk out
3268 GUI_TK_LIBRARY=`echo $X_LIBS | sed 's/ -LNONE//' | sed 's/ -RNONE//'`
3269 TOOLKIT_INCLUDE=`echo $X_CFLAGS | sed 's/ -INONE//'`
7f5c07ab
JS
3270 AFMINSTALL=afminstall
3271 COMPILED_X_PROGRAM=0
3272
0acc5a40
VZ
3273 fi
3274
3275 if test "$wxUSE_X11" = 1; then
256d631a 3276 if test "$wxUSE_NANOX" = "yes"; then
6ec507fd
JS
3277 AC_MSG_CHECKING(for MicroWindows/NanoX distribution)
3278 if test "x$MICROWIN" = x ; then
3279 AC_MSG_RESULT(not found)
3280 AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.])
3281 else
3282 AC_MSG_RESULT($MICROWIN)
c79a329d 3283 AC_DEFINE(wxUSE_NANOX)
6ec507fd
JS
3284 fi
3285 fi
3286
2b5f62a0 3287 if test "$wxUSE_UNICODE" = "yes"; then
479c790c
VZ
3288 PKG_PROG_PKG_CONFIG()
3289
3290 PKG_CHECK_MODULES(PANGOX, pangox,
3291 [
d0dec913 3292 CFLAGS="$PANGOX_CFLAGS $CFLAGS"
479c790c
VZ
3293 CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS"
3294 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS"
3295 ],
3296 [
3297 AC_MSG_ERROR([pangox library not found, library cannot be compiled in Unicode mode])
3298 ]
3299 )
3300 PKG_CHECK_MODULES(PANGOFT2, pangoft2,
3301 [
d0dec913 3302 CFLAGS="$PANGOFT2_CFLAGS $CFLAGS"
479c790c
VZ
3303 CXXFLAGS="$PANGOFT2_CFLAGS $CXXFLAGS"
3304 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOFT2_LIBS"
3305 ],
3306 [
3307 AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support])
3308 wxUSE_PRINTING_ARCHITECTURE="no"
3309 ]
3310 )
3311 PKG_CHECK_MODULES(PANGOXFT, pangoxft,
3312 [
3313 AC_DEFINE(HAVE_PANGO_XFT)
d0dec913 3314 CFLAGS="$PANGOXFT_CFLAGS $CFLAGS"
479c790c
VZ
3315 CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS"
3316 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS"
3317 ],
3318 [
3319 AC_MSG_WARN([pangoxft library not found, library will be compiled without anti-aliasing support])
3320 ]
3321 )
479c790c 3322 save_LIBS="$LIBS"
479c790c
VZ
3323 LIBS="$LIBS $PANGOX_LIBS"
3324 AC_CHECK_FUNCS([pango_font_family_is_monospace])
479c790c 3325 LIBS="$save_LIBS"
2b5f62a0
VZ
3326 fi
3327
1d1b75ac
VZ
3328 wxUSE_UNIVERSAL="yes"
3329
256d631a 3330 if test "$wxUSE_NANOX" = "yes"; then
4e5a4800 3331 TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
32b38f99 3332 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
461e93f9 3333 GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
6ec507fd 3334 else
93a543aa 3335 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11"
6ec507fd
JS
3336 fi
3337
7f5c07ab
JS
3338 TOOLKIT=X11
3339 GUIDIST=X11_DIST
7f5c07ab
JS
3340 fi
3341
1e6feb95 3342 if test "$wxUSE_MOTIF" = 1; then
1e6feb95
VZ
3343 AC_MSG_CHECKING(for Motif/Lesstif headers)
3344 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
3345 if test "$ac_find_includes" != "" ; then
dd0e4a90
VZ
3346 AC_MSG_RESULT(found in $ac_find_includes)
3347 WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
3348 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
cd6d6d5b 3349 else
d0dec913
VZ
3350 save_CFLAGS=$CFLAGS
3351 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
e051b34e 3352
cd6d6d5b
VZ
3353 AC_TRY_COMPILE(
3354 [
3355 #include <Xm/Xm.h>
3356 ],
3357 [
3358 int version;
cd6d6d5b
VZ
3359 version = xmUseVersion;
3360 ],
3361 [
3362 AC_MSG_RESULT(found in default search path)
3363 COMPILED_X_PROGRAM=1
3364 ],
3365 [
3366 AC_MSG_RESULT(no)
e051b34e 3367 AC_MSG_ERROR(please set CPPFLAGS to contain the location of Xm/Xm.h)
cd6d6d5b
VZ
3368 ]
3369 )
e051b34e 3370
d0dec913 3371 CFLAGS=$save_CFLAGS
cd6d6d5b 3372 fi
9a98a854 3373
1e6feb95 3374
e7272c08
VZ
3375 AC_MSG_CHECKING(for Motif/Lesstif library)
3376 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
dd0e4a90 3377
e7272c08
VZ
3378 if test "x$ac_find_libraries" != "x" ; then
3379 AC_MSG_RESULT(found in $ac_find_libraries)
3380
3381 WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
3382 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
3383 else
3384 dnl it might happen that we found headers in one of the standard
3385 dnl paths but the libs are elsewhere but still in default (linker)
3386 dnl path -- try to compile a test program to check for this
d0dec913
VZ
3387 save_CFLAGS=$CFLAGS
3388 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
214774ce
MW
3389 save_LIBS="$LIBS"
3390 LIBS="$GUI_TK_LIBRARY -lXm -lXmu -lXext -lX11"
e7272c08
VZ
3391
3392 AC_TRY_LINK(
3393 [
3394 #include <Xm/Xm.h>
3395 ],
3396 [
3397 int version;
3398 version = xmUseVersion;
3399 ],
3400 [
3401 AC_MSG_RESULT(found in default search path)
3402 COMPILED_X_PROGRAM=1
3403 ],
3404 [
214774ce
MW
3405 AC_MSG_RESULT(no)
3406 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
3407 ]
3408 )
dd0e4a90 3409
d0dec913 3410 CFLAGS=$save_CFLAGS
214774ce 3411 LIBS="$save_LIBS"
1e6feb95
VZ
3412 fi
3413
6a30f1c8
MB
3414 AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE])
3415 libp_link=""
3416 libsm_ice_link=""
3417 libs_found=0
3418 for libp in "" " -lXp"; do
4216d21f 3419 if test "$libs_found" = 0; then
ccabcd49 3420 for libsm_ice in "" " -lSM -lICE"; do
4216d21f 3421 if test "$libs_found" = 0; then
6a30f1c8 3422 save_LIBS="$LIBS"
93a543aa 3423 LIBS="$GUI_TK_LIBRARY -lXm ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11"
d0dec913
VZ
3424 save_CFLAGS=$CFLAGS
3425 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
dd0e4a90 3426
6a30f1c8
MB
3427 AC_TRY_LINK(
3428 [
3429 #include <Xm/Xm.h>
3430 #include <Xm/List.h>
3431 ],
3432 [
3433 XmString string = NULL;
3434 Widget w = NULL;
3435 int position = 0;
3436 XmListAddItem(w, string, position);
3437 ],
3438 [
3439 libp_link="$libp"
3440 libsm_ice_link="$libsm_ice"
3441 AC_MSG_RESULT(
3442 [need${libp_link}${libsm_ice_link}])
3443 libs_found=1
3444 ], []
3445 )
dd0e4a90 3446
6a30f1c8 3447 LIBS="$save_LIBS"
d0dec913 3448 CFLAGS=$save_CFLAGS
6a30f1c8
MB
3449 fi
3450 done
3451 fi
3452 done
3453
4216d21f 3454 if test "$libs_found" = 0; then
6a30f1c8
MB
3455 AC_MSG_RESULT([can't find the right libraries])
3456 AC_MSG_ERROR([can't link a simple motif program])
3457 fi
17234b26 3458
e08ed308
VZ
3459 dnl this seems to be needed under IRIX and shouldn't do any harm
3460 dnl elsewhere
3461 AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"])
3462
d0dec913
VZ
3463 save_CFLAGS=$CFLAGS
3464 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
72e4e6a3
VZ
3465
3466 AC_CACHE_CHECK([for Motif 2],
3467 wx_cv_lib_motif2,
3468 AC_TRY_COMPILE([
3469 #include <Xm/Xm.h>
3470 ],
3471 [
3472 #if XmVersion < 2000
3473 Not Motif 2
3474 #endif
3475 ],
3476 wx_cv_lib_motif2="yes",
3477 wx_cv_lib_motif2="no"))
3478 if test "$wx_cv_lib_motif2" = "yes"; then
3479 AC_DEFINE(__WXMOTIF20__,1)
3480 else
3481 AC_DEFINE(__WXMOTIF20__,0)
3482 fi
3483
3484 AC_CACHE_CHECK([whether Motif is Lesstif],
3485 wx_cv_lib_lesstif,
3486 AC_TRY_COMPILE([
3487 #include <Xm/Xm.h>
3488 ],
3489 [
3490 #if !defined(LesstifVersion) || LesstifVersion <= 0
3491 Not Lesstif
3492 #endif
3493 ],
3494 wx_cv_lib_lesstif="yes",
3495 wx_cv_lib_lesstif="no")
3496 )
3497 if test "$wx_cv_lib_lesstif" = "yes"; then
3498 AC_DEFINE(__WXLESSTIF__,1)
3499 else
3500 AC_DEFINE(__WXLESSTIF__,0)
3501 fi
3502
d0dec913 3503 CFLAGS=$save_CFLAGS
da494b40 3504
e08ed308 3505 GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"
1e6feb95
VZ
3506 TOOLKIT=MOTIF
3507 GUIDIST=MOTIF_DIST
f7f78039
MB
3508 fi
3509
0acc5a40 3510 dnl more tests common to X11 and Motif:
c8818622
VZ
3511 if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
3512 dnl test for external libxpm if we're configured to use it
3513 if test "$wxUSE_LIBXPM" = "sys"; then
3514 AC_MSG_CHECKING(for Xpm library)
3515 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
3516 if test "$ac_find_libraries" != "" ; then
3517 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
3518 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
a8793ff9 3519 AC_MSG_RESULT(found in $ac_find_libraries)
f7f78039 3520
89fe663f
VZ
3521 AC_CACHE_CHECK([for X11/xpm.h],
3522 wx_cv_x11_xpm_h,
c8818622 3523 [
d0dec913
VZ
3524 save_CFLAGS=$CFLAGS
3525 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
89fe663f
VZ
3526
3527 AC_TRY_COMPILE(
3528 [
3529 #include <X11/xpm.h>
3530 ],
3531 [
3532 int version;
3533 version = XpmLibraryVersion();
3534 ],
3535 wx_cv_x11_xpm_h=yes,
3536 wx_cv_x11_xpm_h=no
3537 )
3538
d0dec913 3539 CFLAGS=$save_CFLAGS
c8818622
VZ
3540 ]
3541 )
3542
89fe663f 3543 if test $wx_cv_x11_xpm_h = "yes"; then
93a543aa 3544 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXpm"
89fe663f
VZ
3545 AC_DEFINE(wxHAVE_LIB_XPM)
3546 else
3547 AC_MSG_WARN([built-in less efficient XPM decoder will be used])
3548 fi
c8818622
VZ
3549 fi
3550
3551 fi
3552
3553 dnl XShapeQueryExtension checks: first the library, then prototype
3554 AC_CHECK_LIB([Xext], [XShapeQueryExtension],
3555 [
3556 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXext"
3557 wxHAVE_XEXT_LIB=1
3558 ],
3559 [], [$GUI_TK_LIBRARY -lX11])
3560
3561 if test "$wxHAVE_XEXT_LIB" = 1; then
d0dec913
VZ
3562 save_CFLAGS="$CFLAGS"
3563 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
c8818622
VZ
3564
3565 AC_MSG_CHECKING([for X11/extensions/shape.h])
3566 AC_TRY_COMPILE([
5ff751d6 3567 #include <X11/Xlib.h>
c8818622
VZ
3568 #include <X11/extensions/shape.h>
3569 ],
3570 [
3571 int dummy1, dummy2;
3572 XShapeQueryExtension((Display*)NULL,
3573 (int*)NULL, (int*)NULL);
3574 ],
3575 [
3576 AC_DEFINE(HAVE_XSHAPE)
3577 AC_MSG_RESULT([found])
3578 ],
3579 [
3580 AC_MSG_RESULT([not found])
3581 ])
d0dec913 3582 CFLAGS="$save_CFLAGS"
c8818622
VZ
3583
3584 fi
1e6feb95 3585 fi
b4085ce6 3586
2ea057f9 3587 if test "$wxUSE_OSX_CARBON" = 1; then
8e91c6f3
VZ
3588 AC_MSG_CHECKING([for compiler syntax to enable Pascal strings])
3589 if test "$GCC" = yes; then
3590 AC_MSG_RESULT([gcc])
3591 CPPFLAGS_PASCAL="-fpascal-strings"
3592 elif test "`echo $CXX | sed -e 's@.*/@@'`" = "xlC"; then
3593 AC_MSG_RESULT([xlc])
3594 CPPFLAGS_PASCAL="-qmacpstr"
3595 else
3596 AC_MSG_RESULT([none])
3597 fi
3598
031e9160 3599 if test "x$wxUSE_UNIX" = "xyes"; then
9ed154da 3600 CPPFLAGS="$CPPFLAGS_PASCAL -I/Developer/Headers/FlatCarbon $CPPFLAGS"
031e9160
DE
3601 else
3602 dnl platform.h needs TARGET_CARBON before setup.h
9ed154da 3603 CPPFLAGS="$CPPFLAGS_PASCAL -DTARGET_CARBON $CPPFLAGS"
031e9160 3604 fi
d08b457b 3605
2ea057f9 3606 TOOLKIT=OSX_CARBON
683dccda 3607 dnl we can't call this MAC_DIST or autoconf thinks its a macro
2ea057f9 3608 GUIDIST=OSX_CARBON_DIST
cf615ebb
VS
3609 dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
3610 dnl are different, so they need different names:
dd21ced8 3611 WXBASEPORT="_carbon"
17005cd7
VZ
3612
3613 dnl in addition to defining __WXOSX_CARBON__ for this toolkit we want
3614 dnl to also define these extra symbols to make it possible to test for
3615 dnl any Mac port (__WXMAC__ is for backwards compatibility, __WXOSX__
3616 dnl is a new name)
3617 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
1e6feb95 3618 fi
e07802fc 3619
2ea057f9
SC
3620 if test "$wxUSE_OSX_COCOA" = 1; then
3621 TOOLKIT=OSX_COCOA
3622 GUIDIST=OSX_COCOA_DIST
17005cd7
VZ
3623
3624 dnl see the comment above in wxUSE_OSX_CARBON branch
3625 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
2ea057f9
SC
3626 fi
3627
80aa2a2f
VZ
3628 if test "$wxUSE_OSX_IPHONE" = 1; then
3629 TOOLKIT=OSX_IPHONE
3630 fi
3631
f10f4c87 3632 if test "$wxUSE_OLD_COCOA" = 1; then
ac0c4cc3
DE
3633 TOOLKIT=COCOA
3634 GUIDIST=COCOA_DIST
3635 fi
3636
1e6feb95
VZ
3637 if test "$wxUSE_PM" = 1; then
3638 TOOLKIT=PM
0ed330b4
SN
3639 GUIDIST=PM_DIST
3640 AC_CACHE_CHECK([for type SPBCDATA],
3641 wx_cv_spbcdata,
3642 [
3643 AC_TRY_COMPILE(
3644 [
3645 #define INCL_PM
3646 #include <os2.h>
3647 ],
3648 [
3649 SPBCDATA test;
3650 ],
3651 wx_cv_spbcdata=yes,
3652 wx_cv_spbcdata=no
3653 )
3654 ]
3655 )
3656
3657 if test $wx_cv_spbcdata = "yes"; then
3658 AC_DEFINE(HAVE_SPBCDATA)
3659 fi
1e6feb95
VZ
3660 fi
3661
3662 dnl the name of the directory where the files for this toolkit live
3a922bb4 3663 if test "$TOOLKIT" = "PM" ; then
1e6feb95 3664 TOOLKIT_DIR="os2"
f6bcfd97 3665 else
435a5ad0 3666 TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[[A-Z]]' '[[a-z]]'`
1e6feb95 3667 fi
9a98a854 3668
1e6feb95 3669 if test "$wxUSE_UNIVERSAL" = "yes"; then
3a922bb4
RL
3670 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__"
3671 WIDGET_SET=univ
d9d8273d 3672 fi
2224580a 3673
2224580a
VZ
3674 dnl distribute samples/demos/utils with GUI versions
3675 GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST"
3676 DISTDIR="wx\$(TOOLKIT)"
e90c1d2a 3677else
dad6c0ea
VZ
3678 USE_GUI=0
3679
3a922bb4
RL
3680 dnl this doesn't quite work right for wxBase, but the places
3681 dnl where it is wrong aren't fatal (yet) though.
07eb77a6 3682 TOOLKIT_DIR="base"
f6bcfd97 3683
e90c1d2a 3684 dnl the sources, their dependenices and the headers
3a922bb4 3685 if test "$USE_WIN32" = 1 ; then
3a922bb4
RL
3686 dnl yes, the toolkit for wxBase on win32 is actually MSW
3687 dnl wxBase on unix does not need a 'TOOLKIT' defined.
3688 TOOLKIT="MSW"
a20b6d3a
VZ
3689 fi
3690
2224580a
VZ
3691 dnl distribute only wxBase sources/headers
3692 GUIDIST="BASE_DIST"
3693 DISTDIR="wxBase"
e90c1d2a
VZ
3694fi
3695
ca4c9b7e
VS
3696
3697dnl ---------------------------------------------------------------------------
3698dnl UTF-8 support
3699dnl ---------------------------------------------------------------------------
3700
3701dnl If UTF-8 support wasn't explicitly enabled or disabled, enable it only
3702dnl for ports where it makes sense by default (GTK+, DirectFB):
3703if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_UTF8" = "auto" ; then
4216d21f 3704 if test "$USE_UNIX" = 1 -a "$wxUSE_DARWIN" != 1 ; then
ca4c9b7e 3705 wxUSE_UNICODE_UTF8=yes
4216d21f 3706 elif test "$USE_OS2" = 1 ; then
9a5bfa1e
SN
3707 dnl wide char support is quite incomplete in libc;
3708 dnl UTF-8 might actually work when evaluating/setting
3709 dnl code pages correctly, even for ports other than GTK20.
3710 wxUSE_UNICODE_UTF8=yes
ca4c9b7e
VS
3711 else
3712 wxUSE_UNICODE_UTF8=no
3713 fi
3714fi
3715
4f14bcd8
GD
3716dnl ---------------------------------------------------------------------------
3717dnl Optional libraries included when system library is not used
3718dnl ---------------------------------------------------------------------------
e45387bf 3719
2971ea9d
VZ
3720dnl do this after test for X11 above so that we have a chance of finding Xlib.h
3721if test "$wxUSE_GUI" = "yes"; then
3722 if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then
3723 dnl defines HAVE_X11_XKBLIB_H
1f7e12cc
DE
3724 AC_CHECK_HEADERS([X11/Xlib.h],,, [ ])
3725 AC_CHECK_HEADERS([X11/XKBlib.h],,,
2971ea9d
VZ
3726 [
3727 #if HAVE_X11_XLIB_H
3728 #include <X11/Xlib.h>
3729 #endif
3730 ])
3731 fi
3732fi
3733
8647bec6 3734
b3bfe4e5 3735dnl ---------------------------------------------------------------------------
bfd62c8c 3736dnl wxDisplay checks
b3bfe4e5 3737dnl ---------------------------------------------------------------------------
01cb68df 3738
bfd62c8c 3739USE_XINERAMA=0
b3bfe4e5 3740if test "$wxUSE_DISPLAY" = "yes"; then
bfd62c8c
VZ
3741 dnl Xinerama is used for wxGTK1/wxX11/wxMotif only
3742 if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_GTK1" = 1; then
b3bfe4e5
RN
3743 AC_MSG_CHECKING([for Xinerama])
3744 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xinerama)
3745 if test "$ac_find_libraries" != "" ; then
3746 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
3747 if test "$ac_path_to_link" != " -L/usr/lib" ; then
3748 LDFLAGS="$LDFLAGS $ac_path_to_link"
3749 fi
bfd62c8c 3750 USE_XINERAMA=1
b3bfe4e5
RN
3751 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
3752 AC_MSG_RESULT([yes])
3753 else
3754 AC_MSG_RESULT([no])
dcc1b6ad 3755 AC_MSG_WARN([Xinerama not found; disabling wxDisplay])
b3bfe4e5
RN
3756 wxUSE_DISPLAY="no"
3757 fi
01cb68df 3758 elif test "$wxUSE_MSW" = 1; then
bfd62c8c 3759 dnl DirectDraw for MSW - optionally used by WxDisplay.
6e7b8bcb 3760 AC_CHECK_HEADER([ddraw.h], [], [], [#include <windows.h>])
b3bfe4e5
RN
3761 fi
3762fi
3763
bfd62c8c
VZ
3764if test "$wxUSE_DISPLAY" = "yes"; then
3765 dnl wxGTK2 needs Xxf86vm as well as Xinerama-using ports from above
3766 if test "$USE_XINERAMA" = 1 -o "$wxUSE_GTK" = 1; then
3767 AC_MSG_CHECKING([for Xxf86vm extension])
3768 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm)
3769 if test "$ac_find_libraries" != "" ; then
3770 AC_MSG_RESULT([yes])
3771 AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],
3772 [
3773 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
3774 ],
3775 [],
3776 [
3777 #if HAVE_X11_XLIB_H
3778 #include <X11/Xlib.h>
3779 #endif
3780 ])
3781 else
3782 AC_MSG_RESULT([no])
3783 fi
3784 fi
3785fi
3786
88bbc332
RR
3787dnl ---------------------------------------------------------------------------
3788dnl X11 session management
3789dnl ---------------------------------------------------------------------------
3790if test "$wxUSE_DETECT_SM" = "yes"; then
f10f4c87 3791 if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_OLD_COCOA" != 1; then
88bbc332
RR
3792 AC_MSG_CHECKING([for -lSM - X11 session management])
3793 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],SM)
3794 if test "$ac_find_libraries" != "" ; then
3795 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
3796 if test "$ac_path_to_link" != " -L/usr/lib" ; then
3797 LDFLAGS="$LDFLAGS $ac_path_to_link"
3798 fi
3799 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM"
3800 AC_MSG_RESULT([yes])
3801 else
3802 AC_MSG_RESULT([no])
3803 AC_MSG_WARN([libSM not found; disabling session management detection])
3804 wxUSE_DETECT_SM="no"
3805 fi
3806 else
3807 wxUSE_DETECT_SM="no"
3808 fi
3809fi
3810
3811
4f14bcd8
GD
3812dnl ---------------------------------------------------------------------------
3813dnl OpenGL libraries
3814dnl ---------------------------------------------------------------------------
be505a65 3815
4d264332 3816USE_OPENGL=0
f03637a2 3817if test "$wxUSE_OPENGL" = "yes" -o "$wxUSE_OPENGL" = "auto"; then
0dd9646e
FM
3818
3819 dnl look in glcanvas.h for the list of platforms supported by wxGlCanvas:
3820
f10f4c87 3821 if test "$wxUSE_OSX_CARBON" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
62d0491b 3822 OPENGL_LIBS="-framework OpenGL -framework AGL"
be505a65
VZ
3823 elif test "$wxUSE_MSW" = 1; then
3824 OPENGL_LIBS="-lopengl32 -lglu32"
0dd9646e
FM
3825 elif test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_GTK2" = 1 -o "$wxUSE_GTK" = 1; then
3826
02b05020
VZ
3827 dnl adjust CPPFLAGS to include GL/gl.h location if necessary
3828 dnl (/opt/graphics/OpenGL is for HP-UX systems, bug 925307)
e541dae0 3829 AC_MSG_CHECKING([for OpenGL headers])
02b05020 3830 WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /opt/graphics/OpenGL/include], GL/gl.h)
01aa5863
VS
3831 if test "$ac_find_includes" != "" ; then
3832 AC_MSG_RESULT(found in $ac_find_includes)
01aa5863 3833 WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
c92ad099 3834 CPPFLAGS="$ac_path_to_include $CPPFLAGS"
e541dae0
VZ
3835 else
3836 AC_MSG_RESULT([not found])
01aa5863
VS
3837 fi
3838
5dfc7e56
VZ
3839 AC_CHECK_HEADER(GL/gl.h, [
3840 AC_CHECK_HEADER(GL/glu.h, [
021fde89
VZ
3841 found_gl=0
3842
1352efdf 3843 AC_MSG_CHECKING([for -lGL])
02b05020 3844 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB /opt/graphics/OpenGL/lib],GL)
62d0491b 3845 if test "$ac_find_libraries" != "" ; then
02b05020 3846 AC_MSG_RESULT([found in $ac_find_libraries])
69120ee4 3847
62d0491b 3848 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
021fde89
VZ
3849 if test "$ac_path_to_link" != " -L/usr/lib" ; then
3850 LDFLAGS_GL="$ac_path_to_link"
4b6b4dfc 3851 fi
021fde89
VZ
3852
3853 dnl don't suppose that libGL and libGLU are always in the
3854 dnl same directory -- this is not true for some common
3855 dnl distributions
69120ee4 3856 AC_MSG_CHECKING([for -lGLU])
021fde89
VZ
3857 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GLU)
3858 if test "$ac_find_libraries" != "" ; then
3859 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
3860 if test "$ac_path_to_link" != " -L/usr/lib" -a \
3861 "$ac_path_to_link" != "$LDFLAGS_GL"; then
3862 LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
3863 fi
3864
3865 found_gl=1
3866 OPENGL_LIBS="-lGL -lGLU"
3867 AC_MSG_RESULT([yes])
69120ee4
VZ
3868 else
3869 AC_MSG_RESULT([no])
021fde89 3870 fi
69120ee4
VZ
3871 else
3872 AC_MSG_RESULT([no])
021fde89
VZ
3873 fi
3874
bb41dcbe 3875 if test "$found_gl" != 1; then
1352efdf 3876 AC_MSG_CHECKING([for -lMesaGL])
021fde89 3877 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],MesaGL)
62d0491b
RL
3878 if test "$ac_find_libraries" != "" ; then
3879 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
3880 LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
3881 OPENGL_LIBS="-lMesaGL -lMesaGLU"
1352efdf
RL
3882 AC_MSG_RESULT([yes])
3883 else
3884 AC_MSG_RESULT([no])
62d0491b
RL
3885 fi
3886 fi
bb351eab 3887 ],, [ ])
6e7b8bcb
PC
3888 ],
3889 [],
3890 [ ])
fb56368a 3891
62d0491b 3892 if test "x$OPENGL_LIBS" = "x"; then
f03637a2
FM
3893 if test "$wxUSE_OPENGL" = "yes"; then
3894 AC_MSG_ERROR([OpenGL libraries not available])
3895 else
3896 dnl case wxUSE_OPENGL=auto
3897 AC_MSG_WARN([OpenGL libraries not available, disabling support for OpenGL])
3898 wxUSE_OPENGL=no
3899 USE_OPENGL=0
3900 fi
62d0491b 3901 fi
0dd9646e
FM
3902 else
3903 AC_MSG_WARN([wxGLCanvas not implemented for this port, library will be compiled without it.])
3904 wxUSE_OPENGL="no"
6f754473 3905 fi
6f754473 3906
3dd63e02
VZ
3907 if test "$wxUSE_OPENGL" = "auto"; then
3908 dnl if the OpenGL libraries were unavailable, this would have been
3909 dnl changed to "no" above, if it wasn't, change it to "yes" as we've
3910 dnl verified that we can indeed use OpenGL
3911 wxUSE_OPENGL=yes
3912 fi
3913
62d0491b 3914 if test "$wxUSE_OPENGL" = "yes"; then
4d264332 3915 USE_OPENGL=1
62d0491b
RL
3916 AC_DEFINE(wxUSE_OPENGL)
3917 AC_DEFINE(wxUSE_GLCANVAS)
520755bb 3918 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf"
62d0491b 3919 fi
3a922bb4
RL
3920fi
3921
3a922bb4
RL
3922
3923dnl the symbol which allows conditional compilation for the given toolkit
3924if test -n "$TOOLKIT" ; then
3925 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__"
3926fi
3927
978f1259 3928
3a922bb4 3929dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
55e80573 3930
4222829b
VS
3931if test "$wxUSE_SHARED" = "yes"; then
3932 case "${host}" in
4222829b
VS
3933 *-pc-msdosdjgpp )
3934 dnl only static for now
3935 wxUSE_SHARED=no
3936 AC_MSG_WARN([Host system doesn't support shared libraries, disabling])
3937 ;;
3938 esac
3939fi
3940
3a922bb4 3941if test "$wxUSE_SHARED" = "yes"; then
55e80573 3942
2b5f62a0 3943 dnl use versioned symbols if available on the platform
6589dc98 3944 WX_VERSIONED_SYMBOLS([\$(wx_top_builddir)/version-script])
2b5f62a0 3945
0ff20b9f
VS
3946 dnl test for GCC's visibility support (sets CFLAGS_VISIBILITY, which is
3947 dnl assigned to CFLAGS and CXXFLAGS below)
a2bd84a5
VS
3948 if test "$wxUSE_VISIBILITY" != "no"; then
3949 WX_VISIBILITY
3950 fi
0ff20b9f 3951
ab595566
VZ
3952 dnl test for Sun CC which can be used under both Solaris and Linux
3953 if test "x$SUNCXX" = xyes; then
3954 SAMPLES_RPATH_FLAG="-R\$(wx_top_builddir)/lib"
3955 WXCONFIG_RPATH="-R\$libdir"
3956 else
55e80573 3957 case "${host}" in
32b38f99 3958 *-*-linux* | *-*-gnu* )
6589dc98 3959 SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
ffa0583f 3960 WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
6ebeb4c7 3961 ;;
55e80573 3962
de87c353 3963 *-*-solaris2* )
ab595566
VZ
3964 dnl here we know that Sun CC is not used as we tested for it above,
3965 dnl hence we must be using gcc
3966
3967 dnl newer versions of gcc need -isystem to compile X headers on
3968 dnl Solaris (which use old style C syntax)
3969 CPPFLAGS="-isystem /usr/openwin/include $CPPFLAGS"
3970
3971 dnl gcc may use Sun's ld, in which case -rpath gives a confusing
3972 dnl error message. We have to try both -Wl,-rpath and -Wl,-R:
3973 saveLdflags="$LDFLAGS"
3974 LDFLAGS="$saveLdflags -Wl,-rpath,/"
3975 AC_MSG_CHECKING([if the linker accepts -rpath])
3976 AC_TRY_LINK(
3977 [],[],
3978 [
3979 AC_MSG_RESULT([yes])
3980 SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
3981 WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
3982 ],[
3983 AC_MSG_RESULT([no])
3984 AC_MSG_CHECKING([if the linker accepts -R])
3985 LDFLAGS="$saveLdflags -Wl,-R,/"
3986 AC_TRY_LINK(
3987 [],[],
3988 [
3989 AC_MSG_RESULT([yes])
3990 SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib"
3991 WXCONFIG_RPATH="-Wl,-R,\$libdir"
3992 ],[
3993 AC_MSG_RESULT([no])
3994 ])
3995 ])
3996 LDFLAGS="$saveLdflags"
de87c353 3997 ;;
5ff751d6 3998
cfda0ea8 3999 *-*-darwin* )
ddd121d7 4000 install_name_tool=`which ${HOST_PREFIX}install_name_tool`
0caebc27 4001 if test "$install_name_tool" -a -x "$install_name_tool"; then
19beefa6 4002 DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
0caebc27 4003 cat <<EOF >change-install-names
ef0add05 4004#!/bin/sh
3fbba098 4005libnames=\`cd \${2} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
ef0add05 4006for i in \${libnames} ; do
3fbba098 4007 ${HOST_PREFIX}install_name_tool -id \${3}/\${i} \${1}/\${i}
19beefa6 4008 for dep in \${libnames} ; do
3fbba098 4009 ${HOST_PREFIX}install_name_tool -change \${2}/\${dep} \${3}/\${dep} \${1}/\${i}
19beefa6 4010 done
ef0add05 4011done
ef0add05 4012EOF
0caebc27 4013 chmod +x change-install-names
3fbba098 4014 DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \$(wx_top_builddir)/lib \${libdir}"
0caebc27 4015 fi
516cf181
FM
4016
4017 dnl the HEADER_PAD_OPTION is required by some wx samples to avoid the error:
4018 dnl "install_name_tool: changing install names can't be redone for: the_exe_name
4019 dnl (for architecture ppc) because larger updated load commands do not fit
4020 dnl (the program must be relinked)"
4021 HEADER_PAD_OPTION="-headerpad_max_install_names"
ef0add05 4022 ;;
5ff751d6 4023
e194780e 4024 *-*-cygwin* | *-*-mingw32* )
5ff751d6
VZ
4025 ;;
4026
2fc79cf2 4027 *-*-hpux* )
6589dc98 4028 SAMPLES_RPATH_FLAG="-Wl,+b,\$(wx_top_builddir)/lib"
2fc79cf2 4029 WXCONFIG_RPATH="-Wl,+b,\$libdir"
5ff751d6
VZ
4030 ;;
4031
de87c353 4032 esac
ab595566 4033 fi
f6bcfd97 4034
d3b8fe10
VZ
4035 dnl this one shouldn't be used for the library build so put it in a
4036 dnl separate variable from WXCONFIG_CPPFLAGS
4037 WXCONFIG_ONLY_CPPFLAGS="$WXCONFIG_ONLY_CPPFLAGS -DWXUSINGDLL"
4038
ffa0583f
RL
4039 if test $wxUSE_RPATH = "no"; then
4040 SAMPLES_RPATH_FLAG=''
19beefa6 4041 DYLIB_PATH_POSTLINK=''
ffa0583f
RL
4042 WXCONFIG_RPATH=''
4043 fi
4044
4045 SHARED=1
4046
4047else
4048
ceec2216
RL
4049 config_linkage_component="-static"
4050 SHARED=0
ffa0583f 4051
ceec2216 4052fi
f6bcfd97 4053
f6bcfd97 4054
ceec2216
RL
4055UNICODE=0
4056lib_unicode_suffix=
4057WX_CHARTYPE="ansi"
4058if test "$wxUSE_UNICODE" = "yes"; then
4059 lib_unicode_suffix=u
4060 WX_CHARTYPE="unicode"
4061 UNICODE=1
4062fi
6fa882bd 4063
ceec2216
RL
4064WX_FLAVOUR=${WX_FLAVOUR:+-$WX_FLAVOUR}
4065WX_LIB_FLAVOUR=`echo $WX_FLAVOUR | tr '-' '_'`
3a922bb4 4066
ceec2216
RL
4067DEBUG_INFO=0
4068if test "$wxUSE_DEBUG_INFO" = "yes"; then
4069 DEBUG_INFO=1
4070fi
2bffed64 4071
89b1afb4 4072WX_VERSION_TAG=`echo WX${lib_unicode_suffix}${WX_LIB_FLAVOUR}_${WX_RELEASE} | tr '[[a-z]]' '[[A-Z]]'`
ceec2216 4073
89b1afb4 4074TOOLCHAIN_NAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
ceec2216 4075
89b1afb4 4076TOOLCHAIN_FULLNAME="${HOST_PREFIX}${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}-${WX_CHARTYPE}${config_linkage_component}-${WX_RELEASE}${WX_FLAVOUR}"
517a619d 4077
ceec2216 4078dnl library link name
89b1afb4 4079dnl These just save us from exporting lib_{unicode,flavour}_suffix.
ceec2216 4080dnl If we ever need to do that, we won't need to keep these.
63d798fd 4081
f10f4c87 4082if test "$wxUSE_OSX_CARBON" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
89b1afb4 4083 WX_LIBRARY_BASENAME_NOGUI="wx_base${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
63d798fd 4084else
89b1afb4 4085 WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
63d798fd 4086fi
b9efe021 4087if test "${TOOLKIT_DIR}" = "os2"; then
89b1afb4 4088 WX_LIBRARY_BASENAME_GUI="wx_pm${WIDGET_SET}${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
b9efe021 4089else
89b1afb4 4090 WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
b9efe021 4091fi
ceec2216
RL
4092
4093
4094
f10f4c87 4095if test "$wxUSE_OLD_COCOA" = 1; then
1d1af5ea
DE
4096 AC_LANG_SAVE
4097 AC_WX_LANG_OBJECTIVEC
4098dnl Recent AppKit/NSEvent.h include parts of IOKit which eventually
4099dnl gets IOKit/graphics/IOGraphicsTypes.h included which typedefs
4100dnl Point but only if MacTypes.h was not included first. Of course,
4101dnl if MacTypes.h is included later then you're screwed when it
4102dnl tries to typedef Point. Defining __Point__ will cause IOGraphicsTypes.h
4103dnl to not typedef Point and thus fix the problem.
4104 AC_MSG_CHECKING([if AppKit/NSEvent.h conflicts with CoreFoundation])
4105 AC_TRY_COMPILE([#include <AppKit/NSEvent.h>
4106#include <CoreFoundation/CoreFoundation.h>
4107 ],[],
4108 [AC_MSG_RESULT([no])],
4109 [AC_MSG_RESULT([yes])
4110 AC_MSG_CHECKING([if defining __Point__ will fix it])
4111 AC_TRY_COMPILE([#define __Point__ 1
4112#include <AppKit/NSEvent.h>
4113#include <CoreFoundation/CoreFoundation.h>
4114 ],[],
4115 [AC_MSG_RESULT([yes])
4116 AC_DEFINE(__Point__)
4117 ],
4118 [AC_MSG_FAILURE([no])]
4119 )]
4120 )
4121 AC_LANG_RESTORE
4122fi
4123
9a98a854
VZ
4124dnl ---------------------------------------------------------------------------
4125dnl Checks for typedefs
4126dnl ---------------------------------------------------------------------------
4127
4128dnl defines mode_t if not already defined
4129AC_TYPE_MODE_T
4130dnl defines off_t if not already defined
4131AC_TYPE_OFF_T
4132dnl defines pid_t if not already defined
4133AC_TYPE_PID_T
4134dnl defines size_t if not already defined
4135AC_TYPE_SIZE_T
9a98a854 4136
d51253e8
RL
4137dnl sets HAVE_SSIZE_T if ssize_t is defined
4138AC_CHECK_TYPES(ssize_t)
4139
d836ee96 4140dnl check what exactly size_t is on this machine - this is necessary to avoid
ef33c576 4141dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h
224d4f6d 4142AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++
d836ee96
VZ
4143AC_CACHE_CHECK([if size_t is unsigned int],
4144 wx_cv_size_t_is_uint,
ef33c576 4145 [
dd2c8b7c
VZ
4146 dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
4147 dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
4148 dnl methods in a local class (i.e. class inside a function) declaration
4149 dnl without any objections!!
4150 dnl
4151 dnl hence the hack below: we must have Foo at global scope!
d836ee96
VZ
4152 AC_TRY_COMPILE([#include <stddef.h>],
4153 [
dd2c8b7c
VZ
4154 return 0; }
4155
d836ee96 4156 struct Foo { void foo(size_t); void foo(unsigned int); };
dd2c8b7c
VZ
4157
4158 int bar() {
d836ee96
VZ
4159 ],
4160 wx_cv_size_t_is_uint=no,
4161 wx_cv_size_t_is_uint=yes
4162 )
ef33c576 4163 ]
d836ee96
VZ
4164)
4165
4166if test "$wx_cv_size_t_is_uint" = "yes"; then
4167 AC_DEFINE(wxSIZE_T_IS_UINT)
4168else
4169 AC_CACHE_CHECK([if size_t is unsigned long],
4170 wx_cv_size_t_is_ulong,
4171 AC_TRY_COMPILE([#include <stddef.h>],
4172 [
dd2c8b7c
VZ
4173 return 0; }
4174
d836ee96 4175 struct Foo { void foo(size_t); void foo(unsigned long); };
dd2c8b7c
VZ
4176
4177 int bar() {
d836ee96
VZ
4178 ],
4179 wx_cv_size_t_is_ulong=no,
4180 wx_cv_size_t_is_ulong=yes
4181 )
4182 )
4183
4184 if test "$wx_cv_size_t_is_ulong" = "yes"; then
4185 AC_DEFINE(wxSIZE_T_IS_ULONG)
4186 fi
4187fi
4188
21f0762a
VS
4189AC_CACHE_CHECK([if wchar_t is separate type],
4190 wx_cv_wchar_t_is_separate_type,
4191 AC_TRY_COMPILE([#include <wchar.h>],
4192 [
4193 return 0; }
4194
4195 struct Foo { void foo(wchar_t);
4196 void foo(unsigned short);
4197 void foo(unsigned int);
4198 void foo(unsigned long); };
4199
4200 int bar() {
4201 ],
4202 wx_cv_wchar_t_is_separate_type=yes,
4203 wx_cv_wchar_t_is_separate_type=no
4204 )
4205)
4206
4207if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
c5cf8663 4208 AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 1)
4d62edfb 4209else
c5cf8663 4210 AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 0)
21f0762a
VS
4211fi
4212
224d4f6d
VZ
4213AC_LANG_POP() dnl C++
4214
9a98a854
VZ
4215dnl ---------------------------------------------------------------------------
4216dnl Checks for structures
4217dnl ---------------------------------------------------------------------------
4218
b12915c1
VZ
4219dnl does passwd struct has the pw_gecos field?
4220AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
4221 [
4222 AC_TRY_COMPILE([#include <pwd.h>],
4223 [
4224 char *p;
4225 struct passwd *pw;
4226 p = pw->pw_gecos;
4227 ],
4228 [
4229 wx_cv_struct_pw_gecos=yes
b12915c1
VZ
4230 ],
4231 [
4232 wx_cv_struct_pw_gecos=no
4233 ]
4234 )
4235 ]
4236)
4237
bd3277fe
VZ
4238if test "$wx_cv_struct_pw_gecos" = "yes"; then
4239 AC_DEFINE(HAVE_PW_GECOS)
4240fi
4241
9a98a854 4242dnl ---------------------------------------------------------------------------
9a98a854
VZ
4243dnl Check for functions
4244dnl ---------------------------------------------------------------------------
4245
86970434
VZ
4246dnl check for wcslen in all possible places
4247WCSLEN_FOUND=0
4248WCHAR_LINK=
4249AC_CHECK_FUNCS(wcslen, WCSLEN_FOUND=1)
d74f4b5a 4250
86970434
VZ
4251if test "$WCSLEN_FOUND" = 0; then
4252 if test "$TOOLKIT" = "MSW"; then
4253 AC_CHECK_LIB(msvcrt, wcslen, WCHAR_OK=1)
4254 else
4255 AC_CHECK_LIB(w, wcslen, [
4256 WCHAR_LINK=" -lw"
4257 WCSLEN_FOUND=1
4258 ])
d74f4b5a 4259 fi
86970434 4260fi
d29b553b 4261
86970434
VZ
4262if test "$WCSLEN_FOUND" = 1; then
4263 AC_DEFINE(HAVE_WCSLEN)
4264fi
8a02058a 4265
3931f3ec 4266AC_CHECK_FUNCS([wcsdup wcsftime strnlen wcsnlen wcscasecmp wcsncasecmp])
acaffac9 4267
86970434
VZ
4268dnl On HP-UX aCC need this define to find mbstrtowcs() &c
4269dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict
4270dnl with g++'s in <cwchar> (unless -D_INCLUDE__STDC_A1_SOURCE is in the
e3778b4d 4271dnl flags when g++ is configured, it will declare its own).
86970434
VZ
4272if test "$USE_HPUX" = 1 -a "$GCC" != "yes"; then
4273 CPPFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CPPFLAGS"
d29b553b 4274fi
b3e8d00a 4275
86970434
VZ
4276dnl Try to use wcsrtombs instead of wcstombs which is buggy in old GNU
4277dnl libc versions if possible. AC_CHECK_FUNCS only checks it's in the
4278dnl library, not the header, so do a header check for mbstate_t first.
4279AC_CHECK_TYPES([mbstate_t],
4280 [AC_CHECK_FUNCS(wcsrtombs)],
4281 [],
4282 [#include <wchar.h>])
4283
247f5006 4284dnl check for vsnprintf() -- a safe version of vsprintf())
ec0d6da3 4285dnl
d13b34d3 4286dnl the trouble here is that on some systems (e.g. HP-UX 10) this function is
ec0d6da3
VZ
4287dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which,
4288dnl stupidly, provides a dummy function declaration inside its extension)
77ffb593 4289dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails
ec0d6da3
VZ
4290dnl
4291dnl so we first check if the function is in the library
fd5199d6
VZ
4292dnl
4293dnl FIXME: replace this mess with WX_CHECK_FUNCS()
a93cf225 4294AC_CHECK_FUNCS(snprintf vsnprintf vsscanf)
9d8deca0 4295
e203535f 4296AC_LANG_PUSH(C++)
ec0d6da3
VZ
4297if test "$ac_cv_func_vsnprintf" = "yes"; then
4298 dnl yes it is -- now check if it is in the headers
4299 AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl,
4300 [
b5887a83
VZ
4301 dnl our troubles are not over: HP-UX 11 prototypes vsnprintf() as
4302 dnl taking "char *" and not "const char *" while Metrowerks does
4303 dnl provide a correct vsnprintf declaration but in C++ mode it's
4304 dnl always in std namespace and so we have to bring it in scope
ec0d6da3
VZ
4305 AC_TRY_COMPILE(
4306 [
4307 #include <stdio.h>
4308 #include <stdarg.h>
b5887a83
VZ
4309 #ifdef __MSL__
4310 #if __MSL__ >= 0x6000
4311 namespace std {}
4312 using namespace std;
4313 #endif
4314 #endif
ec0d6da3
VZ
4315 ],
4316 [
4317 char *buf;
4318 va_list ap;
62fa8b3a 4319 vsnprintf(buf, 10u, "%s", ap);
ec0d6da3
VZ
4320 ],
4321 wx_cv_func_vsnprintf_decl=yes,
b5887a83 4322 wx_cv_func_vsnprintf_decl=no
ec0d6da3
VZ
4323 )
4324 ]
4325 )
4326
4327 if test "$wx_cv_func_vsnprintf_decl" = "yes"; then
4328 AC_DEFINE(HAVE_VSNPRINTF_DECL)
62fa8b3a
MW
4329
4330 dnl we know there is a vsnprintf declaration, but some old headers
4331 dnl may have one taking a "char *" format instead of "const char *"
4332 AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl,
4333 [
4334 AC_TRY_COMPILE(
4335 [
4336 #include <stdio.h>
4337 #include <stdarg.h>
4338 #ifdef __MSL__
4339 #if __MSL__ >= 0x6000
4340 namespace std {}
4341 using namespace std;
4342 #endif
4343 #endif
4344 ],
4345 [
4346 char *buf;
4347 va_list ap;
4348 const char *fmt = "%s";
4349 vsnprintf(buf, 10u, fmt, ap);
4350 ],
4351 wx_cv_func_broken_vsnprintf_decl=no,
4352 wx_cv_func_broken_vsnprintf_decl=yes
4353 )
4354 ]
4355 )
4356
4357 if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then
4358 AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL)
4359 fi
ec0d6da3
VZ
4360 fi
4361fi
4362
4a767dd5
VZ
4363dnl the same as above but for snprintf() now: it's not present in at least AIX
4364dnl 4.2 headers
4365if test "$ac_cv_func_snprintf" = "yes"; then
4366 AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl,
4367 [
4368 AC_TRY_COMPILE(
4369 [
4370 #include <stdio.h>
4371 #include <stdarg.h>
4372 #ifdef __MSL__
4373 #if __MSL__ >= 0x6000
4374 namespace std {}
4375 using namespace std;
4376 #endif
4377 #endif
4378 ],
4379 [
4380 char *buf;
62fa8b3a 4381 snprintf(buf, 10u, "%s", "wx");
4a767dd5
VZ
4382 ],
4383 wx_cv_func_snprintf_decl=yes,
4384 wx_cv_func_snprintf_decl=no
4385 )
4386 ]
4387 )
4388
4389 if test "$wx_cv_func_snprintf_decl" = "yes"; then
4390 AC_DEFINE(HAVE_SNPRINTF_DECL)
4391 fi
7b4eedf6
VZ
4392
4393 if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
4394
4395 dnl check if snprintf() has support for positional arguments
4396 dnl NB: if snprintf() has positional support we can safely suppose that also
4397 dnl other *printf() functions support them as they all belong to the same
4398 dnl family and they all fallback to the same implementation
4399 AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params,
4400 [
4401 AC_TRY_RUN(
4402 [
4403 #include <stdio.h>
4404
4405 int main (void)
4406 {
4407 char buffer[128];
9fea3325 4408 snprintf (buffer, 128, "%2$d %3$d %1$d", 1, 2, 3);
7b4eedf6
VZ
4409 if (strcmp ("2 3 1", buffer) == 0)
4410 exit (0);
4411 exit (1);
4412 }
4413 ],
4414 wx_cv_func_snprintf_pos_params=no,
5039a2df
VZ
4415 wx_cv_func_snprintf_pos_params=yes,
4416 dnl be pessimistic when cross-compiling
4417 [
4418 AC_MSG_WARN([Assuming Unix98 printf() is not available,
4419define HAVE_UNIX98_PRINTF as 1 in setup.h if it is available.])
4420 wx_cv_func_snprintf_pos_params=no
4421 ]
7b4eedf6
VZ
4422 )
4423 ]
4424 )
4425
4426 if test "$wx_cv_func_snprintf_pos_params" = "yes"; then
4427 AC_DEFINE(HAVE_UNIX98_PRINTF)
4428 fi
4429 fi
4a767dd5
VZ
4430fi
4431
a93cf225
SN
4432dnl the same as above but for vsscanf() now: it's not present in at least
4433dnl Solaris 9 headers for gcc-3.4 (due to fixinclude's processing of stdio.h)
4434if test "$ac_cv_func_vsscanf" = "yes"; then
4435 AC_CACHE_CHECK([for vsscanf declaration], wx_cv_func_vsscanf_decl,
4436 [
4437 AC_TRY_COMPILE(
4438 [
4439 #include <stdio.h>
4440 #include <stdarg.h>
4441 #ifdef __MSL__
4442 #if __MSL__ >= 0x6000
4443 namespace std {}
4444 using namespace std;
4445 #endif
4446 #endif
4447 ],
4448 [
efce184b
VZ
4449 char *buf;
4450 va_list args;
4451 vsscanf(buf, "%s", args);
a93cf225
SN
4452 ],
4453 wx_cv_func_vsscanf_decl=yes,
4454 wx_cv_func_vsscanf_decl=no
4455 )
4456 ]
4457 )
4458
4459 if test "$wx_cv_func_vsscanf_decl" = "yes"; then
4460 AC_DEFINE(HAVE_VSSCANF_DECL)
4461 fi
4462fi
e203535f 4463AC_LANG_POP()
a93cf225 4464
d74f4b5a 4465if test "$wxUSE_UNICODE" = yes; then
6a5c9b3f 4466
a49ffb32
VZ
4467 dnl also look if we have wide char IO functions, notice that [f]putws are
4468 dnl declared in special widec.h under Solaris
4469 wchar_headers="#include <stdio.h>
4470#include <wchar.h>"
4471 case "${host}" in
4472 *-*-solaris2* )
be2ad872 4473 AC_CHECK_HEADERS(widec.h,,, [AC_INCLUDES_DEFAULT()])
a49ffb32
VZ
4474 if test "$ac_cv_header_widec_h" = "yes"; then
4475 wchar_headers="$wchar_headers
4476#include <widec.h>"
4477 fi
4478 esac
4479
ccd96bfe 4480 WX_CHECK_FUNCS(putws fputws wprintf vswprintf vswscanf,,,
a49ffb32 4481 [$wchar_headers])
ec0d6da3 4482
79668cae
MB
4483 dnl MinGW has a vswprintf with a different prototype, and
4484 dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
4485 dnl finds it even if it is not declared in some versions...
4486 AC_MSG_CHECKING([for _vsnwprintf])
4487 AC_TRY_COMPILE([#include <wchar.h>],
4488 [&_vsnwprintf;],
4489 [AC_MSG_RESULT([yes])
4490 AC_DEFINE(HAVE__VSNWPRINTF)],
4491 [AC_MSG_RESULT([no])]);
d74f4b5a
VZ
4492fi
4493
6ebeb4c7 4494if test "$wxUSE_FILE" = "yes"; then
fd5199d6 4495 WX_CHECK_FUNCS(fsync)
b34497d8
PC
4496fi
4497
371bc2f7
VZ
4498dnl at least under IRIX with mipsPro the C99 round() function is available when
4499dnl building using the C compiler but not when using C++ one
4500AC_LANG_PUSH(C++)
fd5199d6 4501WX_CHECK_FUNCS(round,,,[#include <math.h>])
371bc2f7 4502AC_LANG_POP()
247f5006 4503
f6bcfd97 4504dnl the following tests are for Unix(like) systems only
b089607b 4505if test "$TOOLKIT" != "MSW"; then
a0c79abb 4506
95c8801c 4507dnl check for available version of iconv()
dab9a60f
SC
4508if test "$wxUSE_LIBICONV" != "no" ; then
4509 AM_ICONV
4510 LIBS="$LIBICONV $LIBS"
4511fi
95c8801c 4512
eb4efbdc
VZ
4513dnl check for POSIX signals if we need them
4514if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
4515 AC_CHECK_FUNCS(sigaction)
4516
4517 if test "$ac_cv_func_sigaction" = "no"; then
4518 AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called])
4519 wxUSE_ON_FATAL_EXCEPTION=no
4520 fi
f6bcfd97
BP
4521
4522 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
f6bcfd97
BP
4523 AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
4524 [
224d4f6d
VZ
4525 dnl C compiler happily compiles the code even if there is type mismatch
4526 AC_LANG_PUSH(C++)
f6bcfd97
BP
4527 AC_TRY_COMPILE([#include <signal.h>],
4528 [
4529 extern void testSigHandler(int);
4530
4531 struct sigaction sa;
4532 sa.sa_handler = testSigHandler;
4533 ], [
4534 wx_cv_type_sa_handler=int
4535 ], [
4536 wx_cv_type_sa_handler=void
4537 ])
224d4f6d 4538 AC_LANG_POP()
f6bcfd97
BP
4539 ])
4540
f6bcfd97
BP
4541 AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
4542 fi
eb4efbdc
VZ
4543fi
4544
eaff0f0d
VZ
4545dnl backtrace() and backtrace_symbols() for wxStackWalker
4546if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
493c499e
RR
4547 AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
4548 [
4549 AC_LANG_PUSH(C++)
4550 AC_TRY_COMPILE([#include <execinfo.h>],
eaff0f0d
VZ
4551 [
4552 void *trace[1];
4553 char **messages;
493c499e 4554
eaff0f0d
VZ
4555 backtrace(trace, 1);
4556 messages = backtrace_symbols(trace, 1);
4557 ],
4558 wx_cv_func_backtrace=yes,
4559 wx_cv_func_backtrace=no
493c499e
RR
4560 )
4561 AC_LANG_POP()
4562 ]
4563 )
4564
eaff0f0d
VZ
4565
4566 if test "$wx_cv_func_backtrace" = "no"; then
4567 AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available])
4568 wxUSE_STACKWALKER=no
4569 else
4570 AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
4571 [
493c499e 4572 AC_LANG_PUSH(C++)
dfe0c803 4573 AC_TRY_LINK([#include <cxxabi.h>],
eaff0f0d
VZ
4574 [
4575 int rc;
4576 __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
4577 ],
4578 wx_cv_func_cxa_demangle=yes,
4579 wx_cv_func_cxa_demangle=no
4580 )
493c499e 4581 AC_LANG_POP()
eaff0f0d
VZ
4582 ]
4583 )
4584
4585 if test "$wx_cv_func_cxa_demangle" = "yes"; then
4586 AC_DEFINE(HAVE_CXA_DEMANGLE)
4587 fi
4588 fi
eaff0f0d
VZ
4589fi
4590
4216d21f 4591if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != 1 -a "$USE_UNIX" != 1; then
898beab1
DE
4592 AC_MSG_WARN([wxStackWalker is only available on Win32 and UNIX... disabled])
4593 wxUSE_STACKWALKER=no
4594fi
4595
4596
ade35f11
VZ
4597dnl check for the function for temp files creation
4598AC_CHECK_FUNCS(mkstemp mktemp, break)
4599
9952adac
VZ
4600dnl get the library function to use for wxGetDiskSpace(): it is statfs() under
4601dnl Linux and *BSD and statvfs() under Solaris
52e8b690
VZ
4602AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
4603 AC_TRY_COMPILE(
4604 [
9952adac 4605 #if defined(__BSD__)
84ae7ca4
VZ
4606 #include <sys/param.h>
4607 #include <sys/mount.h>
d08b457b 4608 #else
84ae7ca4 4609 #include <sys/vfs.h>
d08b457b 4610 #endif
52e8b690
VZ
4611 ],
4612 [
4613 long l;
4614 struct statfs fs;
4615 statfs("/", &fs);
4616 l = fs.f_bsize;
4617 l += fs.f_blocks;
4618 l += fs.f_bavail;
4619 ],
84ae7ca4
VZ
4620 wx_cv_func_statfs=yes,
4621 wx_cv_func_statfs=no
4622 )
4623)
4624
4625if test "$wx_cv_func_statfs" = "yes"; then
4626 dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
84ae7ca4 4627 AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
224d4f6d 4628 AC_LANG_PUSH(C++)
0683aca6
VZ
4629 AC_TRY_COMPILE(
4630 [
4631 #if defined(__BSD__)
4632 #include <sys/param.h>
4633 #include <sys/mount.h>
4634 #else
4635 #include <sys/vfs.h>
4636 #endif
4637 ],
4638 [
4639 struct statfs fs;
4640 statfs("", &fs);
4641 ],
4642 wx_cv_func_statfs_decl=yes,
4643 wx_cv_func_statfs_decl=no
4644 )
224d4f6d 4645 AC_LANG_POP()
52e8b690 4646 )
84ae7ca4
VZ
4647
4648 if test "$wx_cv_func_statfs_decl" = "yes"; then
4649 AC_DEFINE(HAVE_STATFS_DECL)
4650 fi
52e8b690 4651
54ab82b3 4652 wx_cv_type_statvfs_t="struct statfs"
52e8b690
VZ
4653 AC_DEFINE(HAVE_STATFS)
4654else
9952adac
VZ
4655 AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs,
4656 AC_TRY_COMPILE(
4657 [
54ab82b3
VZ
4658 #include <stddef.h>
4659 #include <sys/statvfs.h>
9952adac
VZ
4660 ],
4661 [
54ab82b3 4662 statvfs("/", NULL);
9952adac 4663 ],
54ab82b3
VZ
4664 wx_cv_func_statvfs=yes,
4665 wx_cv_func_statvfs=no
9952adac 4666 )
af15babd 4667 )
9952adac
VZ
4668
4669 if test "$wx_cv_func_statvfs" = "yes"; then
54ab82b3
VZ
4670 dnl we also have to check whether we should use statvfs_t (works under
4671 dnl Solaris 8, doesn't work under Solaris 7) or "struct statvfs" (vice
4672 dnl versa) as the argument for statvfs in 64 bit off_t mode (in 32 bit
4673 dnl mode both work fine)
4674 dnl
4675 dnl for this check C++ compiler has to be used as passing incompatible
4676 dnl pointers is just a warning and not an error in C
54ab82b3 4677 AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
224d4f6d 4678 AC_LANG_PUSH(C++)
54ab82b3
VZ
4679 AC_TRY_COMPILE(
4680 [
4681 #include <sys/statvfs.h>
4682 ],
4683 [
4684 long l;
4685 statvfs_t fs;
4686 statvfs("/", &fs);
4687 l = fs.f_bsize;
4688 l += fs.f_blocks;
4689 l += fs.f_bavail;
4690 ],
4691 wx_cv_type_statvfs_t=statvfs_t,
4692 [
4693 AC_TRY_COMPILE(
4694 [
4695 #include <sys/statvfs.h>
4696 ],
4697 [
4698 long l;
e107213f 4699 struct statvfs fs;
54ab82b3
VZ
4700 statvfs("/", &fs);
4701 l = fs.f_bsize;
4702 l += fs.f_blocks;
4703 l += fs.f_bavail;
4704 ],
4705 wx_cv_type_statvfs_t="struct statvfs",
4706 wx_cv_type_statvfs_t="unknown"
4707 )
4708 ]
4709 )
224d4f6d 4710 AC_LANG_POP()
54ab82b3
VZ
4711 )
4712
54ab82b3
VZ
4713 if test "$wx_cv_type_statvfs_t" != "unknown"; then
4714 AC_DEFINE(HAVE_STATVFS)
4715 fi
9952adac 4716 else
54ab82b3
VZ
4717 dnl set it for the test below
4718 wx_cv_type_statvfs_t="unknown"
9952adac 4719 fi
52e8b690
VZ
4720fi
4721
54ab82b3
VZ
4722if test "$wx_cv_type_statvfs_t" != "unknown"; then
4723 AC_DEFINE_UNQUOTED(WX_STATFS_T, $wx_cv_type_statvfs_t)
4724else
4725 AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
4726fi
4727
4f3c5f06
VZ
4728dnl check for fcntl() or at least flock() needed by Unix implementation of
4729dnl wxSingleInstanceChecker
4730if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
4731 AC_CHECK_FUNCS(fcntl flock, break)
4732
4733 if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then
4734 AC_MSG_WARN(wxSingleInstanceChecker not available)
4735 wxUSE_SNGLINST_CHECKER=no
4736 fi
4737fi
4738
4f3c5f06 4739dnl look for a function to modify the environment
c225b981 4740AC_CHECK_FUNCS(setenv putenv, break)
a1353ea4
VZ
4741if test "$ac_cv_func_setenv" = "yes"; then
4742 AC_CHECK_FUNCS(unsetenv)
4743fi
8fd0d89b 4744
b12915c1
VZ
4745HAVE_SOME_SLEEP_FUNC=0
4746if test "$USE_BEOS" = 1; then
4747 dnl BeOS has its own (wonder where did they get it from) sleep() function
4748 dnl in unistd.h
4749 AC_DEFINE(HAVE_SLEEP)
4750 HAVE_SOME_SLEEP_FUNC=1
4751fi
4752
f11bdd03 4753if test "$USE_DARWIN" = 1; then
b2fee376 4754 dnl Mac OS X/Darwin has both nanosleep and usleep
b4085ce6
GD
4755 dnl but only usleep is defined in unistd.h
4756 AC_DEFINE(HAVE_USLEEP)
4757 HAVE_SOME_SLEEP_FUNC=1
4758fi
4759
b12915c1
VZ
4760if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
4761 dnl try nanosleep() in libc and libposix4, if this fails - usleep()
4762 POSIX4_LINK=
4763 AC_CHECK_FUNCS(nanosleep,
4764 AC_DEFINE(HAVE_NANOSLEEP),
4765 [
4766 AC_CHECK_LIB(posix4, nanosleep,
4767 [
4768 AC_DEFINE(HAVE_NANOSLEEP)
3d63bc3a 4769 POSIX4_LINK=" -lposix4"
b12915c1
VZ
4770 ],
4771 [
fd5199d6
VZ
4772 WX_CHECK_FUNCS(usleep,,
4773 AC_MSG_WARN([wxSleep() function will not work])
4f3c5f06 4774 )
b12915c1
VZ
4775 ]
4776 )
4777 ]
4778 )
4779fi
9a98a854
VZ
4780
4781dnl check for uname (POSIX) and gethostname (BSD)
d0dec913
VZ
4782WX_CHECK_FUNCS(uname,,,[#include <sys/utsname.h>])
4783if test "$wx_cv_func_uname" != yes; then
bd630206 4784 WX_CHECK_FUNCS(gethostname)
d0dec913 4785fi
9a98a854 4786
56632e81 4787WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
e90c1d2a 4788
c63c7106 4789dnl check for inet_addr and inet_aton (these may live either in libc, or in
c6712985 4790dnl libnsl or libresolv or libsocket)
c63c7106
VZ
4791INET_LINK=
4792AC_CHECK_FUNCS(inet_addr,
4793 AC_DEFINE(HAVE_INET_ADDR),
4794 [
4795 AC_CHECK_LIB(nsl, inet_addr,
270a909e 4796 INET_LINK="nsl",
4c15b7af
SN
4797 [
4798 AC_CHECK_LIB(resolv, inet_addr,
4799 INET_LINK="resolv",
4800 [
4801 AC_CHECK_LIB(socket, inet_addr,
4802 INET_LINK="socket"
4803 )
4804 ]
c6712985 4805 )
4c15b7af 4806 ]
c63c7106
VZ
4807 )
4808 ]
4809)
4810
4811AC_CHECK_FUNCS(inet_aton,
4812 AC_DEFINE(HAVE_INET_ATON),
4813 [
4814 dnl only check it in the same lib
4815 AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
4816 ])
4817
4818if test "x$INET_LINK" != "x"; then
4819 AC_DEFINE(HAVE_INET_ADDR)
3d63bc3a 4820 INET_LINK=" -l$INET_LINK"
c63c7106 4821fi
e96ac54e 4822
c06469f6
MW
4823WX_CHECK_FUNCS(fdopen)
4824
f2e582dd
MW
4825if test "$wxUSE_TARSTREAM" = "yes"; then
4826 WX_CHECK_FUNCS(sysconf)
85d2919f
MW
4827
4828 WX_CHECK_FUNCS(getpwuid_r, [], [],
4829 [
4830 #define _REENTRANT
4831 #include <pwd.h>
4832 ],
4833 [[
4834 struct passwd pw, *ppw;
4835 char buf[1024];
4836 getpwuid_r(0, &pw, buf, sizeof(buf), &ppw)
4837 ]])
4838
4839 WX_CHECK_FUNCS(getgrgid_r, [], [],
4840 [
4841 #define _REENTRANT
4842 #include <grp.h>
4843 ],
4844 [[
4845 struct group grp, *pgrp;
4846 char buf[1024];
4847 getgrgid_r(0, &grp, buf, sizeof(buf), &pgrp)
4848 ]])
f2e582dd 4849fi
2f46438b 4850
a0c79abb 4851fi
c06469f6 4852
e6cc62c6 4853
9a98a854
VZ
4854dnl ===========================================================================
4855dnl Now we have all the info we need - use it!
4856dnl ===========================================================================
4857
4858dnl flush the cache
4859AC_CACHE_SAVE
4860
4861dnl ---------------------------------------------------------------------------
5cc55caf
SN
4862dnl thread support for Unix (for Win32 and OS/2 see past
4863dnl the next matching "else")
9a98a854
VZ
4864dnl ---------------------------------------------------------------------------
4865
a0b9e27f 4866dnl under MSW (except mingw32) we always have thread support
5cc55caf 4867if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
a9b5e89f 4868
7274f1c7 4869 dnl the code below:
009fead0 4870 dnl
d0dec913 4871 dnl defines THREADS_LINK and THREADS_CFLAGS which are the options
009fead0
VZ
4872 dnl necessary to build the MT programs for the linker and compiler
4873 dnl respectively
4874 dnl
4875 dnl sets wxUSE_THREADS=1 if thread support is activated
7274f1c7
RL
4876
4877 THREADS_LINK=
d0dec913 4878 THREADS_CFLAGS=
7274f1c7
RL
4879
4880 if test "$wxUSE_THREADS" = "yes" ; then
d1188635 4881 if test "$USE_BEOS" = 1; then
156b2523 4882 AC_MSG_WARN([BeOS threads are not yet supported... disabled])
7274f1c7
RL
4883 wxUSE_THREADS="no"
4884 fi
77c85c2b 4885 fi
39c9d5ac 4886
7274f1c7
RL
4887 if test "$wxUSE_THREADS" = "yes" ; then
4888 dnl find if POSIX threads are available
009fead0
VZ
4889 dnl
4890 dnl the tests here are based on ACX_PTHREAD macro from autoconf macro
4891 dnl archive from http://ac-archive.sourceforge.net/
4892 dnl
4893 dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro
4894 dnl Forero Cuervo <bachue@bachue.com> for the original code
4895
4896 dnl TODO: cache the result
4897
4898 dnl define the list of the thread options to try in the loop below
4899 dnl with the convention that anything starting with '-' is a cpp flag
4900 dnl while anything else is a library (i.e. there is an implicit "-l")
4901 THREAD_OPTS="-pthread"
8802d332
VZ
4902 if test "x$SUNCXX" = xyes; then
4903 THREAD_OPTS="-mt lthread $THREAD_OPTS"
4904 fi
4905
009fead0
VZ
4906 case "${host}" in
4907 *-*-solaris2* | *-*-sunos4* )
4908 if test "x$GCC" = "xyes"; then
126be6b4
VZ
4909 dnl Solaris/gcc combination use this one for some reason
4910 THREAD_OPTS="-pthreads $THREAD_OPTS"
009fead0
VZ
4911 fi
4912 ;;
4913 *-*-freebsd*)
4914 dnl look, in order, for the kernel threads, then Linux threads
4915 dnl and finally the userland threads
4916 THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
4917 ;;
17234b26 4918 *-*-darwin* | *-*-cygwin* )
4101db81 4919 dnl Darwin / Mac OS X just uses -lpthread tested below
17234b26 4920 dnl and so does Cygwin
4101db81
GD
4921 THREAD_OPTS=""
4922 ;;
4923 *-*-aix*)
009fead0
VZ
4924 dnl AIX calls the library libpthreads - thanks IBM!
4925 THREAD_OPTS="pthreads"
4926 ;;
4f5a7f74 4927 *-hp-hpux* )
00421666
MW
4928 if test "x$GCC" = "xyes"; then
4929 dnl g++ versions before 3.3.2 don't support -pthread.
4930 $CXX -dumpspecs | grep 'pthread:' >/dev/null ||
5ff751d6 4931 THREAD_OPTS=""
00421666 4932 else
54770337
VZ
4933 dnl HP-UX aCC (tested with version B3910B A.06.05 [Jul 25
4934 dnl 2005]) supports -mt
4935 THREAD_OPTS="-mt"
4f5a7f74 4936 fi
89e3b3e4 4937 ;;
260d6849
VZ
4938
4939 *-*-irix* )
4940 dnl gcc under IRIX doesn't seem to like -pthread, but it
4941 dnl doesn't give an error for it neither, just a warning
4942 dnl message -- but this is still very annoying
4943 if test "x$GCC" = "xyes"; then
4944 THREAD_OPTS=""
4945 fi
4946 ;;
4947
229251af
VZ
4948 *-*-qnx*)
4949 dnl under QNX thread functions are in libc so we don't need any
4950 dnl special options to link with them
4951 THREAD_OPTS=""
4952 ;;
4953
260d6849
VZ
4954 *-*-*UnixWare*)
4955 dnl flying by man pages here: Caldera online docs use this
4956 if test "x$GCC" != "xyes"; then
4957 THREAD_OPTS="-Ethread"
4958 fi
4959 ;;
009fead0 4960 esac
c596875e 4961
229251af
VZ
4962 case "${host}" in
4963 *-*-qnx*)
4964 dnl -lpthread works, i.e. AC_TRY_LINK() would pass, but results
4965 dnl in warnings and is not needed under QNX so try without it
4966 dnl first
4967 THREAD_OPTS="none pthread"
4968 ;;
4969
4970 *)
4971 dnl simply linking with libpthread should make the test below
4972 dnl work but it's far from certain that the threaded programs
4973 dnl compiled without any special switches actually work, so try
4974 dnl it after all the others
4975 THREAD_OPTS="$THREAD_OPTS pthread none"
4976 ;;
4977 esac
595e0e44 4978
009fead0
VZ
4979 dnl now test for all possibilities
4980 THREADS_OK=no
4981 for flag in $THREAD_OPTS; do
4982 case $flag in
4983 none)
4984 AC_MSG_CHECKING([whether pthreads work without any flags])
4985 ;;
f6bcfd97 4986
009fead0
VZ
4987 -*)
4988 AC_MSG_CHECKING([whether pthreads work with $flag])
d0dec913 4989 THREADS_CFLAGS="$flag"
009fead0 4990 ;;
9a98a854 4991
009fead0
VZ
4992 *)
4993 AC_MSG_CHECKING([for the pthreads library -l$flag])
4994 THREADS_LINK="-l$flag"
4995 ;;
4996 esac
4997
4998 save_LIBS="$LIBS"
d0dec913 4999 save_CFLAGS="$CFLAGS"
009fead0 5000 LIBS="$THREADS_LINK $LIBS"
d0dec913 5001 CFLAGS="$THREADS_CFLAGS $CFLAGS"
009fead0
VZ
5002
5003 AC_TRY_LINK([#include <pthread.h>],
5004 [pthread_create(0,0,0,0);],
5005 THREADS_OK=yes)
5006
5007 LIBS="$save_LIBS"
d0dec913 5008 CFLAGS="$save_CFLAGS"
009fead0
VZ
5009
5010 AC_MSG_RESULT($THREADS_OK)
5011 if test "x$THREADS_OK" = "xyes"; then
5012 break;
5013 fi
5014
5015 THREADS_LINK=""
d0dec913 5016 THREADS_CFLAGS=""
009fead0
VZ
5017 done
5018
5019 if test "x$THREADS_OK" != "xyes"; then
5020 wxUSE_THREADS=no
5021 AC_MSG_WARN([No thread support on this system... disabled])
5022 else
fe5a9cab
VZ
5023 dnl yes, these special compiler flags should be used with the
5024 dnl linker as well
d4fbe1d8
VZ
5025 dnl
5026 dnl NB: add them to LDFLAGS immediately because we need them to be
5027 dnl used for the subsequent tests some of which can fail without
5028 dnl MT support, hence the reason for the duplication below:
5029 dnl adding them just to WXCONFIG_LDFLAGS and adding the entire
5030 dnl contents of the latter to LDFLAGS in the end is not enough.
d0dec913 5031 LDFLAGS="$THREADS_CFLAGS $LDFLAGS"
d4fbe1d8 5032 WXCONFIG_LDFLAGS="$THREADS_CFLAGS $WXCONFIG_LDFLAGS"
db82f09e 5033 LIBS="$THREADS_LINK $LIBS"
fe5a9cab 5034
009fead0
VZ
5035 AC_MSG_CHECKING([if more special flags are required for pthreads])
5036 flag=no
5037 case "${host}" in
2b5f62a0
VZ
5038 *-aix*)
5039 dnl again quoting from
5040 dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html:
5041 dnl
5042 dnl When compiling and linking with -pthread, the library
5043 dnl search path should include -L/usr/lib/threads at the
5044 dnl beginning of the path.
5045 LDFLAGS="-L/usr/lib/threads $LDFLAGS"
d4fbe1d8 5046 WXCONFIG_LDFLAGS="-L/usr/lib/threads $WXCONFIG_LDFLAGS"
2b5f62a0
VZ
5047 flag="-D_THREAD_SAFE"
5048 ;;
5049 *-freebsd*)
009fead0
VZ
5050 flag="-D_THREAD_SAFE"
5051 ;;
06313569
GD
5052 *-hp-hpux* )
5053 flag="-D_REENTRANT"
4f5a7f74
VZ
5054 if test "x$GCC" != "xyes"; then
5055 dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm
5056 flag="$flag -D_RWSTD_MULTI_THREAD"
5057 fi
06313569 5058 ;;
009fead0
VZ
5059 *solaris* | alpha*-osf*)
5060 flag="-D_REENTRANT"
5061 ;;
5062 esac
5063 AC_MSG_RESULT(${flag})
5064 if test "x$flag" != xno; then
d0dec913 5065 THREADS_CFLAGS="$THREADS_CFLAGS $flag"
009fead0
VZ
5066 fi
5067
5ff751d6 5068 dnl don't add these options to CPPFLAGS as cpp might not know them
d0dec913 5069 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS $THREADS_CFLAGS"
009fead0 5070 fi
aea02638 5071 fi
9a98a854 5072
7274f1c7
RL
5073 dnl do other tests only if we are using threads
5074 if test "$wxUSE_THREADS" = "yes" ; then
5075 AC_CHECK_FUNCS(thr_setconcurrency)
5076
6ebeb4c7
VZ
5077 dnl can't use AC_CHECK_FUNCS for this one as it's usually a macro and so
5078 dnl wouldn't be found by it
5079 AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup,
5080 [
ab595566
VZ
5081 dnl C compiler may treat pthread_cleanup_push() as an undeclared
5082 dnl function and not give a warning even if it's unavailable, so use
5083 dnl the C++ one for this test
5084 AC_LANG_PUSH(C++)
6ebeb4c7
VZ
5085 AC_TRY_COMPILE([#include <pthread.h>
5086 void ThreadCleanupFunc(void *p);
5087 ],
5088 [
5089 void *p;
5090 pthread_cleanup_push(ThreadCleanupFunc, p);
5091 pthread_cleanup_pop(0);
5092 ], [
5093 wx_cv_func_pthread_cleanup=yes
5094 ], [
5095 wx_cv_func_pthread_cleanup=no
5096 ]
5097 )
ab595566 5098 AC_LANG_POP()
6ebeb4c7
VZ
5099 ])
5100 if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
5101 AC_DEFINE(wxHAVE_PTHREAD_CLEANUP)
5102 fi
5103
1f7e12cc 5104 AC_CHECK_HEADERS(sched.h,,, [AC_INCLUDES_DEFAULT()])
009fead0
VZ
5105 if test "$ac_cv_header_sched_h" = "yes"; then
5106 AC_CHECK_FUNC(sched_yield,
5107 AC_DEFINE(HAVE_SCHED_YIELD),
5108 [
5109 AC_CHECK_LIB(posix4,
5110 sched_yield,
5111 [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
5112 AC_MSG_WARN(wxThread::Yield will not work properly)
5113 )
5114 ]
5115 )
5116 fi
9a98a854 5117
7274f1c7
RL
5118 dnl to be able to set the thread priority, we need to have all of the
5119 dnl following functions:
5120 dnl 1. pthread_attr_getschedpolicy
5121 dnl 2. sched_get_priority_min and sched_get_priority_max
5122 dnl (this one can be in either libpthread or libposix4 (under Solaris))
5123 dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
5124 HAVE_PRIOR_FUNCS=0
009fead0 5125 AC_CHECK_FUNC(pthread_attr_getschedpolicy,
ef33c576
VZ
5126 [AC_CHECK_FUNC(pthread_attr_setschedparam,
5127 [AC_CHECK_FUNC(sched_get_priority_max,
7274f1c7 5128 HAVE_PRIOR_FUNCS=1,
ef33c576 5129 [AC_CHECK_LIB([posix4], sched_get_priority_max,
7274f1c7
RL
5130 [
5131 HAVE_PRIOR_FUNCS=1
5132 POSIX4_LINK=" -lposix4"
5133 ],
ef33c576
VZ
5134 )]
5135 )]
5136 )]
7274f1c7 5137 )
f6bcfd97 5138
7274f1c7
RL
5139 if test "$HAVE_PRIOR_FUNCS" = 1; then
5140 AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
5141 else
5142 AC_MSG_WARN(Setting thread priority will not work)
5143 fi
9a98a854 5144
009fead0
VZ
5145 AC_CHECK_FUNC(pthread_cancel,
5146 AC_DEFINE(HAVE_PTHREAD_CANCEL),
5147 AC_MSG_WARN([wxThread::Kill() will not work properly]))
9a98a854 5148
e55a667c
VZ
5149 AC_CHECK_FUNC(pthread_mutex_timedlock,
5150 AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK),
5151 AC_MSG_WARN([wxMutex::LockTimeout() will not work]))
5152
219577d0
SN
5153 AC_CHECK_FUNC(pthread_attr_setstacksize,
5154 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE))
ab252f7b 5155
7274f1c7
RL
5156 dnl mutexattr_t initialization is done in quite different ways on different
5157 dnl platforms, so check for a few things:
5158 dnl
5159 dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
5160 dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
5161 dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
5162 dnl defined, we do it by directly assigned
5163 dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
5164
7274f1c7
RL
5165 AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
5166 [
d9b9876f
VZ
5167 AC_TRY_COMPILE([#include <pthread.h>],
5168 [
7274f1c7
RL
5169 pthread_mutexattr_t attr;
5170 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
123dca7d
VZ
5171 ],
5172 wx_cv_type_pthread_mutexattr_t=yes,
5173 wx_cv_type_pthread_mutexattr_t=no
d9b9876f 5174 )
7274f1c7 5175 ])
d9b9876f 5176
7274f1c7
RL
5177 if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
5178 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
123dca7d
VZ
5179
5180 dnl check if we already have the declaration we need, it is not
5181 dnl present in some systems' headers
5182 AC_CACHE_CHECK([for pthread_mutexattr_settype declaration],
5183 wx_cv_func_pthread_mutexattr_settype_decl, [
5184 AC_TRY_COMPILE([#include <pthread.h>],
5185 [
5186 pthread_mutexattr_t attr;
5187 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
5188 ],
5189 wx_cv_func_pthread_mutexattr_settype_decl=yes,
5190 wx_cv_func_pthread_mutexattr_settype_decl=no
5191 )
5192 ])
5193 if test "$wx_cv_func_pthread_mutexattr_settype_decl" = "yes"; then
5194 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL)
5195 fi
7274f1c7
RL
5196 else
5197 dnl don't despair, there may be another way to do it
5198 AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
5199 wx_cv_type_pthread_rec_mutex_init,
5200 [
5201 AC_TRY_COMPILE([#include <pthread.h>],
5202 [
5203 pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
5204 ], [
5205 wx_cv_type_pthread_rec_mutex_init=yes
5206 ], [
5207 wx_cv_type_pthread_rec_mutex_init=no
5208 ]
5209 )
5210 ])
5211 if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
5212 AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
5213 else
5214 dnl this may break code working elsewhere, so at least warn about it
5215 AC_MSG_WARN([wxMutex won't be recursive on this platform])
5216 fi
5217 fi
b0b81bc9 5218
7beff712
VZ
5219 if test "$wxUSE_COMPILER_TLS" = "auto"; then
5220 if test "$USE_NETBSD" = 1; then
5221 AC_MSG_WARN([Disabling TLS under NetBSD, please contact wx-dev if it works now])
5222 wxUSE_COMPILER_TLS=no
5223 else
5224 wxUSE_COMPILER_TLS=yes
d3dcef01 5225 fi
eb6a8d69 5226 fi
64a044d5 5227
7beff712
VZ
5228 if test "$wxUSE_COMPILER_TLS" = "yes"; then
5229 dnl test for compiler thread-specific variables support
5230 AC_CACHE_CHECK([for __thread keyword],
5231 wx_cv_cc___thread,
5232 [
5233 AC_TRY_COMPILE([#include <pthread.h>],
5234 [
5235 static __thread int n = 0;
5236 static __thread int *p = 0;
5237 ],
5238 wx_cv_cc___thread=yes,
5239 wx_cv_cc___thread=no
5240 )
5241 ]
5242 )
5243
5244 if test "$wx_cv_cc___thread" = "yes"; then
5245 AX_GXX_VERSION
5246 if test -n "$ax_cv_gxx_version"; then
5247 dnl g++ supports __thread since at least version 3.3 but its support
5248 dnl seems to be broken until 4.1, see
5249 dnl http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/108388
5250 dnl
5251 dnl NB: we still need to test __thread support with
5252 dnl AC_TRY_COMPILE above even for g++ 4 as it doesn't
5253 dnl support it for all architectures (e.g. it doesn't
5254 dnl work under OS X)
5255 AC_MSG_CHECKING([whether __thread support in g++ is usable])
5256 case "$ax_cv_gxx_version" in
5257 1.* | 2.* | 3.* )
5258 AC_MSG_RESULT([no, it's broken])
5259 wx_cv_cc___thread=no
5260 ;;
5261 *)
5262 AC_MSG_RESULT([yes, it works])
5263 ;;
5264 esac
5265 fi
5266 fi
5267
5268 if test "$wx_cv_cc___thread" = "yes"; then
5269 AC_DEFINE(HAVE___THREAD_KEYWORD)
5270 fi
5271 fi
7274f1c7 5272 fi
9a98a854 5273
b089607b 5274dnl from if !MSW
a0b9e27f
MB
5275else
5276 if test "$wxUSE_THREADS" = "yes" ; then
5277 case "${host}" in
64a044d5 5278 x86_64-*-mingw32* )
b152ff67 5279 ;;
a0b9e27f 5280 *-*-mingw32* )
ca8e52b3
VZ
5281 dnl check if the compiler accepts -mthreads
5282 AC_CACHE_CHECK([if compiler supports -mthreads],
5283 wx_cv_cflags_mthread,
5284 [
d0dec913
VZ
5285 CFLAGS_OLD="$CFLAGS"
5286 CFLAGS="-mthreads $CFLAGS"
ca8e52b3
VZ
5287 AC_TRY_COMPILE([], [],
5288 wx_cv_cflags_mthread=yes,
5289 wx_cv_cflags_mthread=no
5290 )
5291 ]
5292 )
5293
5294 if test "$wx_cv_cflags_mthread" = "yes"; then
5295 dnl it does, use it
d0dec913 5296 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mthreads"
ca8e52b3
VZ
5297 LDFLAGS="$LDFLAGS -mthreads"
5298 else
5299 dnl it doesn't
d0dec913 5300 CFLAGS="$CFLAGS_OLD"
ca8e52b3 5301 fi
a0b9e27f 5302 ;;
5cc55caf 5303 *-pc-os2*emx )
5ff751d6 5304 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -Zmt -D__ST_MT_ERRNO__"
5cc55caf
SN
5305 LDFLAGS="$LDFLAGS -Zmt"
5306 ;;
a0b9e27f
MB
5307 esac
5308 fi
a9b5e89f
VZ
5309fi
5310
bebf40d5 5311AC_CHECK_FUNC(localtime_r, [ AC_DEFINE(HAVE_LOCALTIME_R) ])
bebf40d5 5312AC_CHECK_FUNC(gmtime_r, [ AC_DEFINE(HAVE_GMTIME_R) ])
b41e7f68
SN
5313dnl By preference, we probably should use getaddrinfo which avoids thread
5314dnl safety issues and supports IPv6, however there currently is no code
5315dnl for it, so testing for it is temporarily disabled and we are restricted
5316dnl to gethostbyname_r/gethostbyaddr_r and getservbyname_r
5317
5318dnl AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO), [
bebf40d5
SN
5319 dnl no getaddrinfo, so check for gethostbyname_r and
5320 dnl related functions (taken from python's configure.in)
5321 dnl sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments
b41e7f68 5322 AX_FUNC_WHICH_GETHOSTBYNAME_R
bebf40d5 5323 if test "x$ac_cv_func_which_gethostbyname_r" = "xno" -o \
1e613d22 5324 "x$ac_cv_func_which_gethostbyname_r" = "xunknown" ; then
bebf40d5
SN
5325 AC_CHECK_FUNC(gethostbyname, [ AC_DEFINE(HAVE_GETHOSTBYNAME) ])
5326 fi
bebf40d5
SN
5327 dnl A similar test for getservbyname_r
5328 dnl I'm tempted to just not do this test which is taking much time and
5329 dnl do something similar as for gethostbyaddr_r, but OTOH the macro
5330 dnl doing the test already exists, so using it is easy enough. - SN
5331 AC_raf_FUNC_WHICH_GETSERVBYNAME_R
5332 if test "x$ac_cv_func_which_getservbyname_r" = "xno" -o \
1e613d22 5333 "x$ac_cv_func_which_getservbyname_r" = "xunknown" ; then
bebf40d5
SN
5334 AC_CHECK_FUNCS(getservbyname,[ AC_DEFINE(HAVE_GETSERVBYNAME) ])
5335 fi
bebf40d5
SN
5336 dnl For gethostbyaddr_r, we currently do no separate test, instead, we
5337 dnl silently assume it's available exactly if gethostbyname_r is
5338 dnl available and always requires two more arguments than
5339 dnl gethostbyname_r.
5340 dnl (also, I'm lazy and there no m4 file that's ready for use for this
5341 dnl function, although it should be easy to rewrite the gethostbyname_r
5342 dnl check to fit this case, if it's really needed. - SN )
b41e7f68
SN
5343dnl ]
5344dnl )
bebf40d5 5345
a9b5e89f
VZ
5346if test "$wxUSE_THREADS" = "yes"; then
5347 AC_DEFINE(wxUSE_THREADS)
5348
a9b5e89f 5349 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
d64af447 5350else
b12915c1 5351 dnl on some systems, _REENTRANT should be defined if we want to use any _r()
d64af447 5352 dnl functions - add tests for other functions here as well
56632e81 5353 if test "$wx_cv_func_strtok_r" = "yes"; then
ab9b9eab
VZ
5354 AC_MSG_CHECKING(if -D_REENTRANT is needed)
5355 if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
5ff751d6 5356 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT"
ab9b9eab
VZ
5357 AC_MSG_RESULT(yes)
5358 else
5359 AC_MSG_RESULT(no)
ee31c269 5360 fi
d64af447 5361 fi
a9b5e89f
VZ
5362fi
5363
88262190
VZ
5364if test "$WXGTK2" = 1 ; then
5365 AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK2)
13111b2a
VZ
5366 WXGTK12=1
5367fi
5368
9a98a854
VZ
5369if test "$WXGTK12" = 1 ; then
5370 AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
5371fi
5372
f6bcfd97
BP
5373if test "$WXGTK127" = 1 ; then
5374 AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
5375fi
5376
16bd311d
RR
5377if test "$WXGPE" = 1 ; then
5378 AC_DEFINE_UNQUOTED(__WXGPE__,$WXGPE)
5379fi
5380
8aeeb05c
VZ
5381dnl DEBUG_CFLAGS contains debugging options (supposed to be the same for C and C++
5382dnl compilers: we'd need a separate DEBUG_CXXFLAGS if this is ever not the case)
5383DEBUG_CFLAGS=
6ad6ba21
FM
5384if `echo $CXXFLAGS $CFLAGS | grep " -g" >/dev/null`; then
5385 dnl the CXXFLAGS or the CFLAGS variable already contains the -g flag
5386 dnl (e.g. it was specified by the user before running configure); since
5387 dnl later they will be merged with DEBUG_CFLAGS, don't set the -g option
5388 dnl in DEBUG_CFLAGS to avoid (possibly different) flag duplicates
5389 AC_MSG_WARN([CXXFLAGS/CFLAGS already contains -g flag; ignoring the --enable-debug_info option])
5390elif test "$wxUSE_DEBUG_INFO" = "yes" ; then
8aeeb05c 5391 DEBUG_CFLAGS="-g"
9a98a854
VZ
5392fi
5393
5586805b
RR
5394if test "$wxUSE_DEBUG_GDB" = "yes" ; then
5395 wxUSE_DEBUG_INFO=yes
ab7704fd 5396 if test "$GCC" = yes; then
8aeeb05c 5397 DEBUG_CFLAGS="-ggdb"
ab7704fd 5398 fi
5586805b
RR
5399fi
5400
89b1afb4 5401if test "$wxUSE_DEBUG_FLAG" = "no" ; then
f5d5adf8
VZ
5402 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -DwxDEBUG_LEVEL=0"
5403
04338f96 5404 if test "$wxUSE_GTK" = 1 ; then
0c897818
MR
5405 if test "x$wxGTK_VERSION" = "x1" ; then
5406 CPPFLAGS="-DGTK_NO_CHECK_CASTS $CPPFLAGS"
5407 fi
04338f96 5408 fi
9a98a854
VZ
5409fi
5410
5411if test "$wxUSE_MEM_TRACING" = "yes" ; then
77c85c2b
RR
5412 AC_DEFINE(wxUSE_MEMORY_TRACING)
5413 AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
47c13eb7 5414 AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS)
77c85c2b 5415 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
9a98a854
VZ
5416fi
5417
5418if test "$wxUSE_DMALLOC" = "yes" ; then
4cfa7abe 5419 DMALLOC_LIBS="-ldmallocthcxx"
9a98a854
VZ
5420fi
5421
5ff751d6 5422dnl cc/cxx/ld option for profiling
8aeeb05c 5423PROFILE_FLAGS=
9a98a854 5424if test "$wxUSE_PROFILE" = "yes" ; then
8aeeb05c 5425 PROFILE_FLAGS=" -pg"
9a98a854
VZ
5426fi
5427
88e30f2b 5428if test "$GCC" = "yes" ; then
f7bdcdd7 5429 if test "$wxUSE_NO_RTTI" = "yes" ; then
3017880e
VZ
5430 dnl Define wxNO_RTTI on the command line because only g++ 4.3 and later
5431 dnl define __GXX_RTTI which allows us to detect the use of -fno-rtti
5432 dnl switch but we need to do it manually for the older versions.
5433 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -DwxNO_RTTI -fno-rtti"
f7bdcdd7
RR
5434 fi
5435 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
5ff751d6 5436 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions"
f7bdcdd7 5437 fi
5586805b 5438 if test "$wxUSE_PERMISSIVE" = "yes" ; then
5ff751d6 5439 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -fpermissive"
5586805b 5440 fi
1d1b75ac
VZ
5441
5442 dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before
5443 dnl 3.0 overflow the table of contents on rs6000 as they create an entry
5444 dnl for each subroutine by default -- using the switch below only creates
5445 dnl one entry per file instead at the price of minor performance penalty
5446 dnl
2b5f62a0
VZ
5447 dnl As of wx2.4 a bug in the hppa gcc compiler causes a similar problem
5448 dnl without -ffunction-sections. No idea how long we'll need to maintain
5449 dnl this, or even the extent of gcc/wx version combinations affected, but
5450 dnl also as above, this 'fix' does not come without side effects.
5451 dnl
1d1b75ac
VZ
5452 dnl TODO: test for the gcc version here (how?)
5453 case "${host}" in
5454 powerpc*-*-aix* )
5ff751d6 5455 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mminimal-toc"
1d1b75ac 5456 ;;
2b5f62a0 5457 *-hppa* )
5ff751d6 5458 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -ffunction-sections"
2b5f62a0 5459 ;;
1d1b75ac 5460 esac
c596875e
RD
5461fi
5462
5ff751d6 5463dnl C/C++ compiler option for optimization (supposed to be the same for both)
8aeeb05c 5464OPTIMISE_CFLAGS=
6ad6ba21
FM
5465if `echo $CXXFLAGS $CFLAGS | grep " -O" >/dev/null`; then
5466 dnl the CXXFLAGS or the CFLAGS variable already contains -O optimization flag
5467 dnl (e.g. it was specified by the user before running configure); since
5468 dnl later they will be merged with OPTIMISE_CFLAGS, don't set the -O option
5469 dnl in OPTIMISE_CFLAGS to avoid (possibly different) flag duplicates
5470 AC_MSG_WARN([CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option])
9a98a854 5471else
6ad6ba21
FM
5472 if test "$wxUSE_OPTIMISE" = "no" ; then
5473 if test "$GCC" = yes ; then
5474 dnl use -O0 because compiling with it is faster than compiling with no
5475 dnl optimization options at all (at least with g++ 3.2)
5476 OPTIMISE_CFLAGS="-O0"
5477 fi
77c85c2b 5478 else
6ad6ba21
FM
5479 if test "$GCC" = yes ; then
5480 case "${host}" in
5481 *-pc-os2_emx | *-pc-os2-emx )
5482 dnl Not all of the supported gcc versions understand
5483 dnl -fstrict-aliasing and none actually needs it (yet).
5484 OPTIMISE_CFLAGS="-O2"
5485 ;;
5486 *)
5487 dnl Switch on optimisation but keep strict-aliasing off for
5488 dnl now (see -fstrict-aliasing in the gcc manual). When it is
5489 dnl switched back on consider using -Wstrict-aliasing=2.
5490 OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
5491 ;;
5492 esac
5493 else
5494 OPTIMISE_CFLAGS="-O"
5495 fi
77c85c2b 5496 fi
9a98a854
VZ
5497fi
5498
677eb52d
VZ
5499dnl ---------------------------------------------------------------------------
5500dnl compatibility level
5501dnl ---------------------------------------------------------------------------
5502
abb6edd1 5503if test "x$WXWIN_COMPATIBILITY_2_6" = "xyes"; then
dee1a63f 5504 AC_DEFINE(WXWIN_COMPATIBILITY_2_6)
abb6edd1
VS
5505
5506 WXWIN_COMPATIBILITY_2_8="yes"
5507fi
5508
5509if test "x$WXWIN_COMPATIBILITY_2_8" != "xno"; then
5510 AC_DEFINE(WXWIN_COMPATIBILITY_2_8)
65d8ef1e
VS
5511fi
5512
9a98a854
VZ
5513dnl ---------------------------------------------------------------------------
5514dnl the library may be built without GUI classes at all
5515dnl ---------------------------------------------------------------------------
5516
5517if test "$wxUSE_GUI" = "yes"; then
881bfcd6
VZ
5518 AC_DEFINE(wxUSE_GUI)
5519
5520 dnl the things we always pull in the GUI version of the library:
5521 dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
5522 dnl library really can't be built without those)
5523 dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
5524 dnl almost any program and the first 2 are needed to show a message box
5525 dnl which want to be always able to do)
5526 dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
5527 dnl to compile without them (if the app doesn't do any drawing, it doesn't
5528 dnl need the dcs, pens, brushes, ...), this just can't be done now
5529 dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
5530 dnl 5. misc stuff: timers, settings, message box
9a98a854
VZ
5531fi
5532
5533dnl ---------------------------------------------------------------------------
5534dnl Unix/Windows
5535dnl ---------------------------------------------------------------------------
5536
5537if test "$wxUSE_UNIX" = "yes"; then
5538 AC_DEFINE(wxUSE_UNIX)
9a98a854
VZ
5539fi
5540
f93ca9fd
VS
5541dnl ------------------------------------------------------------------------
5542dnl DLL support
5543dnl ------------------------------------------------------------------------
5544
5545dnl under MSW we always have LoadLibrary/GetProcAddress
5546if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
5547
5548 HAVE_DL_FUNCS=0
5549 HAVE_SHL_FUNCS=0
5550 if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
3e654768 5551 if test "$USE_DOS" = 1; then
3af30018 5552 HAVE_DL_FUNCS=0
f93ca9fd
VS
5553 else
5554 dnl the test is a bit complicated because we check for dlopen() both with
5555 dnl and without -ldl and we also try to find shl_load() if there is no
5556 dnl dlopen() on this system
5557 AC_CHECK_FUNCS(dlopen,
5558 [
5559 AC_DEFINE(HAVE_DLOPEN)
5560 HAVE_DL_FUNCS=1
5561 ],
5562 [
5563 AC_CHECK_LIB(dl, dlopen,
5564 [
5565 AC_DEFINE(HAVE_DLOPEN)
5566 HAVE_DL_FUNCS=1
5567 DL_LINK=" -ldl$DL_LINK"
5568 ],
5569 [
5570 AC_CHECK_FUNCS(shl_load,
5571 [
5572 AC_DEFINE(HAVE_SHL_LOAD)
5573 HAVE_SHL_FUNCS=1
5574 ],
5575 [
5576 AC_CHECK_LIB(shl_load, dld,
5577 [
5578 HAVE_SHL_FUNCS=1
5579 DL_LINK=" -ldld$DL_LINK"
5580 ])
5581 ])
5582 ])
5583 ])
5584
3e654768
DE
5585 dnl check also for dlerror()
5586 if test "$HAVE_DL_FUNCS" = 1; then
5587 AC_CHECK_FUNCS(dlerror,
5588 AC_DEFINE(HAVE_DLERROR),
5589 [
5590 AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))
5591 ]
5592 )
5593 fi
f93ca9fd 5594 fi
3e654768
DE
5595
5596 dnl Force HAVE_DL_FUNCS on for Darwin, even if the tests failed (e.g. pre-10.3)
5597 if test "$USE_DARWIN" = 1; then
5598 dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
5599 HAVE_DL_FUNCS=1
f93ca9fd
VS
5600 fi
5601
5602 if test "$HAVE_DL_FUNCS" = 0; then
5603 if test "$HAVE_SHL_FUNCS" = 0; then
3af30018 5604 if test "$USE_UNIX" = 1 -o "$USE_DOS" = 1; then
f93ca9fd
VS
5605 AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
5606 wxUSE_DYNAMIC_LOADER=no
5607 wxUSE_DYNLIB_CLASS=no
5608 else
5609 AC_MSG_WARN([Assuming wxLibrary class works on this platform])
5610 fi
5611 fi
5612 fi
5613 fi
5614fi
5615
5616if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
5617 AC_DEFINE(wxUSE_DYNAMIC_LOADER)
5618fi
5619if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
5620 AC_DEFINE(wxUSE_DYNLIB_CLASS)
5621fi
5622
5623
5624dnl ---------------------------------------------------------------------------
5625dnl Verify consistency of plugins/monolithic/shared settings:
5626dnl ---------------------------------------------------------------------------
5627
5628if test "$wxUSE_PLUGINS" = "yes" ; then
5629 if test "$wxUSE_SHARED" = "no" ; then
5630 AC_MSG_WARN([plugins supported only in shared build, disabling])
5631 wxUSE_PLUGINS=no
5632 fi
5633 if test "$wxUSE_MONOLITHIC" = "yes" ; then
5634 AC_MSG_WARN([plugins not supported monolithic build, disabling])
5635 wxUSE_PLUGINS=no
5636 fi
5637 if test "$wxUSE_DYNLIB_CLASS" = "no" ; then
5638 AC_MSG_WARN([plugins require wxDynamicLibrary, disabling])
5639 wxUSE_PLUGINS=no
5640 fi
5641 if test "$wxUSE_PLUGINS" = "yes" ; then
5642 AC_DEFINE(wxUSE_PLUGINS)
5643 fi
5644fi
5645
9a98a854 5646dnl ---------------------------------------------------------------------------
6b8ef0b3
VZ
5647dnl File system watcher checks
5648dnl ---------------------------------------------------------------------------
5649
5650if test "$wxUSE_FSWATCHER" = "yes"; then
96e790a5
VZ
5651 dnl wxFileSystemWatcher is always available under MSW but we need either
5652 dnl inotify or kqueue support in the system for it under Unix (this
5653 dnl includes OS X which does have kqueue but no other platforms)
5654 if test "$wxUSE_MSW" != "1"; then
5655 if test "$wxUSE_UNIX" = "yes"; then
5656 AC_CHECK_HEADERS(sys/inotify.h,,, [AC_INCLUDES_DEFAULT()])
5657 if test "$ac_cv_header_sys_inotify_h" = "yes"; then
5658 AC_DEFINE(wxHAS_INOTIFY)
6b8ef0b3 5659 else
96e790a5
VZ
5660 AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()])
5661 if test "$ac_cv_header_sys_event_h" = "yes"; then
5662 AC_DEFINE(wxHAS_KQUEUE)
5663 else
5664 wxUSE_FSWATCHER=no
5665 fi
6b8ef0b3 5666 fi
96e790a5
VZ
5667 else
5668 wxUSE_FSWATCHER=no
6b8ef0b3
VZ
5669 fi
5670 fi
96e790a5
VZ
5671
5672 if test "$wxUSE_FSWATCHER" = "yes"; then
5673 AC_DEFINE(wxUSE_FSWATCHER)
5674 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
5675 else
5676 AC_MSG_WARN([wxFileSystemWatcher won't be available on this platform])
5677 fi
6b8ef0b3
VZ
5678fi
5679
5680dnl ---------------------------------------------------------------------------
9a98a854
VZ
5681dnl Register non-GUI class options for makefiles and setup.h
5682dnl ---------------------------------------------------------------------------
5683
df5168c4
MB
5684if test "$wxUSE_STL" = "yes"; then
5685 AC_DEFINE(wxUSE_STL)
5686fi
5687
afc89ff4
MB
5688if test "$wxUSE_EXTENDED_RTTI" = "yes"; then
5689 AC_DEFINE(wxUSE_EXTENDED_RTTI)
5690fi
5691
178c7760
JS
5692if test "$wxUSE_ANY" = "yes"; then
5693 AC_DEFINE(wxUSE_ANY)
5694fi
5695
9a98a854
VZ
5696if test "$wxUSE_APPLE_IEEE" = "yes"; then
5697 AC_DEFINE(wxUSE_APPLE_IEEE)
9a98a854
VZ
5698fi
5699
1e6feb95
VZ
5700if test "$wxUSE_TIMER" = "yes"; then
5701 AC_DEFINE(wxUSE_TIMER)
5702fi
5703
9c112555
MW
5704dnl Unix implementation needs additional checks because audio support
5705dnl comes in many favours:
4216d21f 5706if test "$USE_UNIX" = 1 ; then
a1b1cf33
VZ
5707 dnl mmedia doesn't compile with wxMGL, remove this if this is ever fixed
5708 if test "$wxUSE_MGL" != 1; then
5709 dnl it's not enough to check for just the header because OSS under NetBSD
5710 dnl redefines ioctl as oss_ioctrl inside it and so we also need to test
5711 dnl whether we need -lossaudio at link-time
5712 AC_CACHE_CHECK([for SNDCTL_DSP_SPEED in sys/soundcard.h], ac_cv_header_sys_soundcard, [
5713 AC_TRY_LINK([
5714 #include <sys/ioctl.h>
5715 #include <sys/soundcard.h>
5716 ],
5717 [
5718 ioctl(0, SNDCTL_DSP_SPEED, 0);
5719 ],
5720 ac_cv_header_sys_soundcard=yes,
5721 [
5722 saveLibs="$LIBS"
5723 LIBS="$saveLibs -lossaudio"
5724 AC_TRY_LINK([
5725 #include <sys/ioctl.h>
5726 #include <sys/soundcard.h>
5727 ],
5728 [
5729 ioctl(0, SNDCTL_DSP_SPEED, 0);
5730 ],
5731 ac_cv_header_sys_soundcard=yes,
5732 [
5733 LIBS="$saveLibs"
5734 ac_cv_header_sys_soundcard=no
5735 ]
5736 )
5737 ]
5738 )
5739 ])
5740 fi
aca2d2de
VZ
5741
5742 if test "$ac_cv_header_sys_soundcard" = "yes"; then
5743 AC_DEFINE(HAVE_SYS_SOUNDCARD_H)
aca2d2de 5744 fi
9c112555 5745fi
a1b1cf33 5746
f93ca9fd 5747WITH_PLUGIN_SDL=0
002ed9af 5748if test "$wxUSE_SOUND" = "yes"; then
4216d21f 5749 if test "$USE_UNIX" = 1 ; then
f93ca9fd
VS
5750 if test "$wxUSE_LIBSDL" != "no"; then
5751 AM_PATH_SDL([1.2.0],
5752 [
5753 EXTRALIBS_SDL="$SDL_LIBS"
d0dec913 5754 CFLAGS="$SDL_CFLAGS $CFLAGS"
c92ad099 5755 CXXFLAGS="$SDL_CFLAGS $CXXFLAGS"
f93ca9fd
VS
5756 AC_DEFINE(wxUSE_LIBSDL)
5757 ],
5758 [wxUSE_LIBSDL="no"])
5759 if test "$wxUSE_LIBSDL" = "yes" -a "$wxUSE_PLUGINS" = "yes" ; then
5760 WITH_PLUGIN_SDL=1
5761 fi
5762 fi
480b9f18
VZ
5763 else
5764 dnl wxMGL doesn't support sound under DOS, only under Unix
5765 if test "$wxUSE_MGL" = 1; then
5766 AC_MSG_WARN([wxSound not supported in MGL under DOS... disabled])
5767 wxUSE_SOUND="no"
5768 fi
f93ca9fd 5769 fi
480b9f18 5770fi
5ff751d6 5771
480b9f18 5772if test "$wxUSE_SOUND" = "yes"; then
002ed9af 5773 AC_DEFINE(wxUSE_SOUND)
f93ca9fd 5774 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sound"
2749089a
KB
5775fi
5776
88262190 5777if test "$WXGTK2" = 1; then
d6fb5527
VZ
5778 PKG_PROG_PKG_CONFIG()
5779
7c72311f 5780 if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
bd8a7646
RR
5781
5782 if test "$wxUSE_GTKPRINT" = "yes" ; then
5783
5784 PKG_CHECK_MODULES(GTKPRINT,
5785 [gtk+-unix-print-2.0 >= 2.10],
5786 [
5787 CFLAGS="$GTKPRINT_CFLAGS $CFLAGS"
5788 CXXFLAGS="$GTKPRINT_CFLAGS $CXXFLAGS"
5789 AC_DEFINE(wxUSE_GTKPRINT)
5790 ],
5791 [
5792 AC_MSG_WARN([GTK printing support not found (GTK+ >= 2.10), library will use GNOME printing support or standard PostScript printing])
5793 wxUSE_GTKPRINT="no"
5794 ]
5795 )
5796 fi
5797
7c72311f 5798 if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then
5ff751d6
VZ
5799
5800 PKG_CHECK_MODULES(LIBGNOMEPRINTUI,
ffa762ff 5801 [libgnomeprintui-2.2 >= 2.8],
7c72311f 5802 [
d0dec913 5803 CFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CFLAGS"
c92ad099 5804 CXXFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CXXFLAGS"
45fb81e5 5805 AC_DEFINE(wxUSE_LIBGNOMEPRINT)
7c72311f
RR
5806 ],
5807 [
5808 AC_MSG_WARN([libgnomeprintui not found, library will use standard PostScript printing])
5809 wxUSE_LIBGNOMEPRINT="no"
5810 ]
5811 )
5812 fi
5813 fi
7c72311f 5814
2b850ae1
RR
5815 if test "$wxUSE_MIMETYPE" = "yes" ; then
5816 if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
5817
5818 PKG_CHECK_MODULES(GNOMEVFS,
5819 [gnome-vfs-2.0 >= 2.0],
5820 [
d0dec913 5821 CFLAGS="$GNOMEVFS_CFLAGS $CFLAGS"
2b850ae1
RR
5822 CXXFLAGS="$GNOMEVFS_CFLAGS $CXXFLAGS"
5823 AC_DEFINE(wxUSE_LIBGNOMEVFS)
5824 ],
5825 [
5826 AC_MSG_WARN([libgnomevfs not found, library won't be able to associate MIME type])
5827 wxUSE_LIBGNOMEVFS="no"
5828 ]
5829 )
5830 fi
5831 fi
2b850ae1 5832
3565d135 5833 if test "$wxUSE_LIBHILDON" = "yes" ; then
912c3932 5834 PKG_CHECK_MODULES(HILDON,
3565d135
RR
5835 [hildon-lgpl >= 0.9],
5836 [
5837 EXTRALIBS_HILDON="$HILDON_LIBS"
d0dec913 5838 CFLAGS="$CFLAGS $HILDON_CFLAGS"
3565d135
RR
5839 CXXFLAGS="$CXXFLAGS $HILDON_CFLAGS"
5840 AC_DEFINE(wxUSE_LIBHILDON)
426d19f1 5841 ac_hildon_lgpl=1
3565d135
RR
5842 ],
5843 [
5844 AC_MSG_WARN([libhildon_lgpl not found])
5845 wxUSE_LIBHILDON="no"
426d19f1 5846 ac_hildon_lgpl=0
3565d135
RR
5847 ]
5848 )
426d19f1
JS
5849
5850 if test "$ac_hildon_lgpl" = 0 ; then
5851 PKG_CHECK_MODULES(HILDON2,
5852 [hildon-1 >= 1.99],
5853 [
5854 EXTRALIBS_HILDON="$HILDON2_LIBS"
5855 CFLAGS="$CFLAGS $HILDON2_CFLAGS"
5856 CXXFLAGS="$CXXFLAGS $HILDON2_CFLAGS"
5857 AC_DEFINE(wxUSE_LIBHILDON2)
5858 ],
5859 [
5860 AC_MSG_WARN([libhildon_1 not found])
5861 wxUSE_LIBHILDON2="no"
5862 ]
5863 )
5864 fi
3565d135
RR
5865 fi
5866fi
7c72311f 5867
1e6feb95
VZ
5868if test "$wxUSE_CMDLINE_PARSER" = "yes"; then
5869 AC_DEFINE(wxUSE_CMDLINE_PARSER)
5870fi
5871
5872if test "$wxUSE_STOPWATCH" = "yes"; then
5873 AC_DEFINE(wxUSE_STOPWATCH)
5874fi
5875
5876if test "$wxUSE_DATETIME" = "yes"; then
5877 AC_DEFINE(wxUSE_DATETIME)
5878fi
5879
9a98a854
VZ
5880if test "$wxUSE_FILE" = "yes"; then
5881 AC_DEFINE(wxUSE_FILE)
9a98a854
VZ
5882fi
5883
1e6feb95
VZ
5884if test "$wxUSE_FFILE" = "yes"; then
5885 AC_DEFINE(wxUSE_FFILE)
5886fi
5887
9e8e867f 5888if test "$wxUSE_ARCHIVE_STREAMS" = "yes"; then
26e422a9
MW
5889 if test "$wxUSE_STREAMS" != yes; then
5890 AC_MSG_WARN(wxArchive requires wxStreams... disabled)
916af76f 5891 wxUSE_ARCHIVE_STREAMS=no
26e422a9
MW
5892 else
5893 AC_DEFINE(wxUSE_ARCHIVE_STREAMS)
5894 fi
81f90336
MW
5895fi
5896
d78b3d64 5897if test "$wxUSE_ZIPSTREAM" = "yes"; then
9e8e867f 5898 if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
81f90336
MW
5899 AC_MSG_WARN(wxZip requires wxArchive... disabled)
5900 elif test "$wxUSE_ZLIB" = "no"; then
5901 AC_MSG_WARN(wxZip requires wxZlib... disabled)
5902 else
5903 AC_DEFINE(wxUSE_ZIPSTREAM)
5904 fi
d78b3d64
VS
5905fi
5906
26e422a9
MW
5907if test "$wxUSE_TARSTREAM" = "yes"; then
5908 if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
5909 AC_MSG_WARN(wxTar requires wxArchive... disabled)
5910 else
5911 AC_DEFINE(wxUSE_TARSTREAM)
5912 fi
5913fi
5914
a0219e45
VS
5915if test "$wxUSE_FILE_HISTORY" = "yes"; then
5916 AC_DEFINE(wxUSE_FILE_HISTORY)
5917fi
5918
916af76f 5919if test "$wxUSE_FILESYSTEM" = "yes"; then
f8f6c91a 5920 if test "$wxUSE_STREAMS" != yes -o \( "$wxUSE_FILE" != yes -a "$wxUSE_FFILE" != yes \); then
916af76f
MW
5921 AC_MSG_WARN(wxFileSystem requires wxStreams and wxFile or wxFFile... disabled)
5922 wxUSE_FILESYSTEM=no
f8f6c91a 5923 else
916af76f 5924 AC_DEFINE(wxUSE_FILESYSTEM)
f8f6c91a
MW
5925 fi
5926fi
5927
26e422a9 5928if test "$wxUSE_FS_ARCHIVE" = "yes"; then
916af76f
MW
5929 if test "$wxUSE_FILESYSTEM" != yes -o "$wxUSE_ARCHIVE_STREAMS" != yes; then
5930 AC_MSG_WARN(wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled)
26e422a9
MW
5931 else
5932 AC_DEFINE(wxUSE_FS_ARCHIVE)
5933 fi
5934fi
5935
916af76f
MW
5936if test "$wxUSE_FS_ZIP" = "yes"; then
5937 if test "$wxUSE_FS_ARCHIVE" != yes; then
5938 AC_MSG_WARN(wxZipFSHandler requires wxArchiveFSHandler... disabled)
5939 else
5940 AC_DEFINE(wxUSE_FS_ZIP)
5941 fi
5942fi
5943
eb4efbdc 5944if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
18228ab4
MW
5945 if test "$USE_UNIX" != 1; then
5946 AC_MSG_WARN([Catching fatal exceptions not currently supported on this system, wxApp::OnFatalException will not be called])
5947 wxUSE_ON_FATAL_EXCEPTION=no
5948 else
5949 AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION)
5950 fi
eb4efbdc 5951fi
eaff0f0d
VZ
5952
5953if test "$wxUSE_STACKWALKER" = "yes"; then
5954 AC_DEFINE(wxUSE_STACKWALKER)
5955fi
eb4efbdc 5956
36b6448c 5957if test "$wxUSE_DEBUGREPORT" = "yes"; then
4216d21f 5958 if test "$USE_UNIX" != 1 -a "$USE_WIN32" != 1; then
18228ab4 5959 AC_MSG_WARN([Creating debug reports not currently supported on this system, disabled])
bec7df87
SN
5960 wxUSE_DEBUGREPORT=no
5961 else
5962 AC_DEFINE(wxUSE_DEBUGREPORT)
21dfc162
MW
5963 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
5964 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt"
5965 fi
bec7df87 5966 fi
36b6448c
VZ
5967fi
5968
4f3c5f06
VZ
5969if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
5970 AC_DEFINE(wxUSE_SNGLINST_CHECKER)
5971fi
5972
d78b3d64
VS
5973if test "$wxUSE_BUSYINFO" = "yes"; then
5974 AC_DEFINE(wxUSE_BUSYINFO)
5975fi
5976
01871bf6
VZ
5977if test "$wxUSE_STD_CONTAINERS" = "yes"; then
5978 AC_DEFINE(wxUSE_STD_CONTAINERS)
5979fi
5980
fd15d8f1
RR
5981if test "$wxUSE_STD_IOSTREAM" = "yes"; then
5982 AC_DEFINE(wxUSE_STD_IOSTREAM)
5983fi
5984
668d55c9
RR
5985if test "$wxUSE_STD_STRING" = "yes"; then
5986 AC_DEFINE(wxUSE_STD_STRING)
5987fi
5988
01871bf6
VZ
5989if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
5990 AC_DEFINE(wxUSE_STD_STRING_CONV_IN_WXSTRING)
5991fi
5992
07158944
VZ
5993if test "$wxUSE_STDPATHS" = "yes"; then
5994 AC_DEFINE(wxUSE_STDPATHS)
5995fi
5996
a3a584a7
VZ
5997if test "$wxUSE_TEXTBUFFER" = "yes"; then
5998 AC_DEFINE(wxUSE_TEXTBUFFER)
5999fi
6000
9a98a854 6001if test "$wxUSE_TEXTFILE" = "yes"; then
a3a584a7 6002 if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then
156b2523 6003 AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled)
9a98a854
VZ
6004 else
6005 AC_DEFINE(wxUSE_TEXTFILE)
9a98a854
VZ
6006 fi
6007fi
6008
6009if test "$wxUSE_CONFIG" = "yes" ; then
6010 if test "$wxUSE_TEXTFILE" != "yes"; then
156b2523 6011 AC_MSG_WARN(wxConfig requires wxTextFile... disabled)
9a98a854
VZ
6012 else
6013 AC_DEFINE(wxUSE_CONFIG)
89be85c2 6014 AC_DEFINE(wxUSE_CONFIG_NATIVE)
9a98a854
VZ
6015 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
6016 fi
6017fi
6018
6019if test "$wxUSE_INTL" = "yes" ; then
6020 if test "$wxUSE_FILE" != "yes"; then
156b2523 6021 AC_MSG_WARN(I18n code requires wxFile... disabled)
9a98a854
VZ
6022 else
6023 AC_DEFINE(wxUSE_INTL)
9a98a854 6024 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
f6bcfd97 6025 GUIDIST="$GUIDIST INTL_DIST"
9a98a854
VZ
6026 fi
6027fi
6028
29faf9c6 6029if test "$wxUSE_XLOCALE" = "yes" ; then
6e4ae332
VZ
6030 AC_DEFINE(wxUSE_XLOCALE)
6031 AC_CHECK_TYPES(locale_t,,,
6032 [#include <xlocale.h>
6033 #include <locale.h>])
6034fi
6035
9a98a854
VZ
6036if test "$wxUSE_LOG" = "yes"; then
6037 AC_DEFINE(wxUSE_LOG)
d73be714
VZ
6038
6039 if test "$wxUSE_LOGGUI" = "yes"; then
6040 AC_DEFINE(wxUSE_LOGGUI)
6041 fi
6042
6043 if test "$wxUSE_LOGWINDOW" = "yes"; then
6044 AC_DEFINE(wxUSE_LOGWINDOW)
6045 fi
69d27ff7
MB
6046
6047 if test "$wxUSE_LOGDIALOG" = "yes"; then
6048 AC_DEFINE(wxUSE_LOG_DIALOG)
6049 fi
0b78747f
MW
6050
6051 dnl the keyboard sample requires wxUSE_LOG
6052 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
9a98a854
VZ
6053fi
6054
6055if test "$wxUSE_LONGLONG" = "yes"; then
6056 AC_DEFINE(wxUSE_LONGLONG)
9a98a854
VZ
6057fi
6058
e8f65ba6
RR
6059if test "$wxUSE_GEOMETRY" = "yes"; then
6060 AC_DEFINE(wxUSE_GEOMETRY)
6061fi
6062
4db03d26
VZ
6063if test "$wxUSE_BASE64" = "yes"; then
6064 AC_DEFINE(wxUSE_BASE64)
6065fi
6066
9a98a854
VZ
6067if test "$wxUSE_STREAMS" = "yes" ; then
6068 AC_DEFINE(wxUSE_STREAMS)
9a98a854
VZ
6069fi
6070
7b4eedf6
VZ
6071if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
6072 AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
6073fi
6074
931d7698
DE
6075if test "$wxUSE_OBJC_UNIQUIFYING" = "yes"; then
6076 AC_DEFINE(wxUSE_OBJC_UNIQUIFYING)
6077fi
7b4eedf6 6078
a1873279
VZ
6079dnl ---------------------------------------------------------------------------
6080dnl console event loop stuff
6081dnl ---------------------------------------------------------------------------
6082
6083if test "$wxUSE_CONSOLE_EVENTLOOP" = "yes"; then
6084 AC_DEFINE(wxUSE_CONSOLE_EVENTLOOP)
6085
6086 if test "$wxUSE_UNIX" = "yes"; then
6087 if test "$wxUSE_SELECT_DISPATCHER" = "yes"; then
a9639e76 6088 AC_DEFINE(wxUSE_SELECT_DISPATCHER)
a1873279
VZ
6089 fi
6090
6091 if test "$wxUSE_EPOLL_DISPATCHER" = "yes"; then
bb351eab 6092 AC_CHECK_HEADERS(sys/epoll.h,,, [AC_INCLUDES_DEFAULT()])
a1873279
VZ
6093 if test "$ac_cv_header_sys_epoll_h" = "yes"; then
6094 AC_DEFINE(wxUSE_EPOLL_DISPATCHER)
6095 else
6096 AC_MSG_WARN([sys/epoll.h not available, wxEpollDispatcher disabled])
6097 fi
6098 fi
6099 fi
6100fi
6101
52e8b690 6102dnl ---------------------------------------------------------------------------
afc31813 6103dnl time/date functions
f536f005 6104dnl ---------------------------------------------------------------------------
afc31813 6105
5f6cafd1
VZ
6106dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the
6107dnl function to be used for high resolution timers
6108AC_CHECK_FUNCS(gettimeofday ftime, break)
6109
6110if test "$ac_cv_func_gettimeofday" = "yes"; then
6111 AC_CACHE_CHECK([whether gettimeofday takes two arguments],
6112 wx_cv_func_gettimeofday_has_2_args,
6113 [
6114 dnl on some _really_ old systems it takes only 1 argument
6115 AC_TRY_COMPILE(
6116 [
6117 #include <sys/time.h>
6118 #include <unistd.h>
6119 ],
6120 [
6121 struct timeval tv;
6122 gettimeofday(&tv, NULL);
6123 ],
6124 wx_cv_func_gettimeofday_has_2_args=yes,
6125 AC_TRY_COMPILE(
6126 [
6127 #include <sys/time.h>
6128 #include <unistd.h>
6129 ],
6130 [
6131 struct timeval tv;
6132 gettimeofday(&tv);
6133 ],
6134 wx_cv_func_gettimeofday_has_2_args=no,
6135 [
6136 AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
6137 wx_cv_func_gettimeofday_has_2_args=unknown
6138 ]
6139 )
6140 )
6141 ])
6142
6143 if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
6144 AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
6145 fi
6146fi
6147
1e6feb95 6148if test "$wxUSE_DATETIME" = "yes"; then
360d6699 6149 dnl check for timezone variable
62cc730f 6150 dnl doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
360d6699
VZ
6151 AC_CACHE_CHECK(for timezone variable in <time.h>,
6152 wx_cv_var_timezone,
6153 [
715d53e4 6154 AC_LANG_PUSH(C++)
360d6699
VZ
6155 AC_TRY_COMPILE(
6156 [
6157 #include <time.h>
6158 ],
6159 [
6160 int tz;
4f11a343 6161 tz = timezone;
360d6699
VZ
6162 ],
6163 [
4f11a343 6164 wx_cv_var_timezone=timezone
360d6699
VZ
6165 ],
6166 [
6167 AC_TRY_COMPILE(
6168 [
6169 #include <time.h>
6170 ],
6171 [
6172 int tz;
6173 tz = _timezone;
6174 ],
6175 [
6176 wx_cv_var_timezone=_timezone
6177 ],
5357c8e8
VZ
6178 [
6179 AC_TRY_COMPILE(
6180 [
6181 #include <time.h>
6182 ],
6183 [
6184 int tz;
4f11a343 6185 tz = __timezone;
5357c8e8
VZ
6186 ],
6187 [
4f11a343 6188 wx_cv_var_timezone=__timezone
5357c8e8 6189 ],
f9bc1684
VS
6190 [
6191 if test "$USE_DOS" = 0 ; then
62cc730f 6192 AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
f9bc1684
VS
6193 fi
6194 ]
5357c8e8
VZ
6195 )
6196 ]
360d6699
VZ
6197 )
6198 ]
6199 )
715d53e4 6200 AC_LANG_POP()
360d6699
VZ
6201 ]
6202 )
6203
6204 dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
f9bc1684
VS
6205 if test "x$wx_cv_var_timezone" != x ; then
6206 AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
6207 fi
360d6699 6208
3fcdd07b
VZ
6209 dnl check for localtime (it's POSIX, but the check can do no harm...)
6210 AC_CHECK_FUNCS(localtime)
afc31813 6211
0470b1e6
VZ
6212 if test "$ac_cv_func_localtime" = "yes"; then
6213 AC_CACHE_CHECK(for tm_gmtoff in struct tm,
6214 wx_cv_struct_tm_has_gmtoff,
6215 [
6216 AC_TRY_COMPILE(
6217 [
6218 #include <time.h>
6219 ],
6220 [
6221 struct tm tm;
6222 tm.tm_gmtoff++;
6223 ],
6224 [
f03a98d8 6225 wx_cv_struct_tm_has_gmtoff=yes
0470b1e6
VZ
6226 ],
6227 wx_cv_struct_tm_has_gmtoff=no
6228 )
6229 ])
3fcdd07b
VZ
6230 fi
6231
6232543b
VS
6232 if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
6233 AC_DEFINE(WX_GMTOFF_IN_TM)
6234 fi
6235
afc31813
VZ
6236 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
6237fi
6238
9a98a854
VZ
6239dnl ------------------------------------------------------------------------
6240dnl wxSocket
6241dnl ------------------------------------------------------------------------
6242
3879ecda 6243dnl VZ: the GUI hooks wxSocket needs are not implemented yet in some toolkits
0feee163 6244if test "$wxUSE_SOCKETS" = "yes"; then
4216d21f 6245 if test "$wxUSE_MGL" = 1; then
6c657b52
VS
6246 AC_MSG_WARN([wxSocket not yet supported under MGL... disabled])
6247 wxUSE_SOCKETS="no"
6248 fi
0feee163 6249fi
b089607b 6250
0feee163
VZ
6251if test "$wxUSE_SOCKETS" = "yes"; then
6252 dnl under MSW we always have sockets
6253 if test "$TOOLKIT" != "MSW"; then
590b1a4d 6254 dnl under Solaris and OS/2, socket functions live in -lsocket
3a922bb4 6255 AC_CHECK_FUNC(socket,,
4c15b7af
SN
6256 [
6257 AC_CHECK_LIB(socket, socket,
6258 if test "$INET_LINK" != " -lsocket"; then
6259 INET_LINK="$INET_LINK -lsocket"
6260 fi,
6261 [
6262 AC_MSG_WARN([socket library not found - sockets will be disabled])
6263 wxUSE_SOCKETS=no
6264 ]
6265 )
6266 ]
afc31813 6267 )
3a922bb4 6268 fi
0feee163 6269fi
afc31813 6270
0feee163 6271if test "$wxUSE_SOCKETS" = "yes" ; then
3a922bb4
RL
6272 dnl this test may be appropriate if building under cygwin
6273 dnl right now I'm assuming it also uses the winsock stuff
6274 dnl like mingw does.. -- RL
0feee163 6275 if test "$TOOLKIT" != "MSW"; then
3a922bb4 6276 dnl determine the type of third argument for getsockname
6944b203
SN
6277 dnl This test needs to be done in C++ mode since gsocket.cpp now
6278 dnl is C++ code and pointer cast that are possible even without
6279 dnl warning in C still fail in C++.
3a922bb4
RL
6280 AC_CACHE_CHECK([what is the type of the third argument of getsockname],
6281 wx_cv_type_getsockname3,
6282 [
224d4f6d 6283 AC_LANG_PUSH(C++)
51a9faba
VZ
6284 AC_TRY_COMPILE(
6285 [
4370c5b2 6286 #include <sys/types.h>
51a9faba
VZ
6287 #include <sys/socket.h>
6288 ],
6289 [
3a922bb4 6290 socklen_t len;
51a9faba
VZ
6291 getsockname(0, 0, &len);
6292 ],
3a922bb4 6293 wx_cv_type_getsockname3=socklen_t,
210c92a3
VZ
6294 [
6295 dnl the compiler will compile the version with size_t
6296 dnl even if the real type of the last parameter is int
6297 dnl but it should give at least a warning about
6298 dnl converting between incompatible pointer types, so
6299 dnl try to use it to get the correct behaviour at
6300 dnl least with gcc (otherwise we'd always use size_t)
d0dec913 6301 CFLAGS_OLD="$CFLAGS"
210c92a3 6302 if test "$GCC" = yes ; then
d0dec913 6303 CFLAGS="-Werror $CFLAGS"
210c92a3
VZ
6304 fi
6305
3a922bb4
RL
6306 AC_TRY_COMPILE(
6307 [
6308 #include <sys/types.h>
6309 #include <sys/socket.h>
6310 ],
6311 [
210c92a3 6312 size_t len;
3a922bb4
RL
6313 getsockname(0, 0, &len);
6314 ],
210c92a3
VZ
6315 wx_cv_type_getsockname3=size_t,
6316 AC_TRY_COMPILE(
6317 [
6318 #include <sys/types.h>
6319 #include <sys/socket.h>
6320 ],
6321 [
6322 int len;
6323 getsockname(0, 0, &len);
6324 ],
6325 wx_cv_type_getsockname3=int,
6326 wx_cv_type_getsockname3=unknown
6327 )
3a922bb4 6328 )
c63c7106 6329
d0dec913 6330 CFLAGS="$CFLAGS_OLD"
210c92a3
VZ
6331 ]
6332 )
224d4f6d 6333 AC_LANG_POP()
3a922bb4 6334 ])
51a9faba 6335
3a922bb4
RL
6336 if test "$wx_cv_type_getsockname3" = "unknown"; then
6337 wxUSE_SOCKETS=no
6338 AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
6339 else
9e03e02d 6340 AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3)
3a922bb4 6341 fi
ddc1a35f
DE
6342 dnl Do this again for getsockopt as it may be different
6343 AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt],
6344 wx_cv_type_getsockopt5,
6345 [
6daba577 6346 dnl Note that the rules for compatibility of pointers
bd630206 6347 dnl are somewhat different between C and C++, so code
6daba577
VZ
6348 dnl that fails in C++ may not even give a warning about
6349 dnl converting between incompatible pointer types in C.
6350 dnl So this test needs to be done in C++ mode.
6351 AC_LANG_PUSH(C++)
ddc1a35f
DE
6352 AC_TRY_COMPILE(
6353 [
6354 #include <sys/types.h>
6355 #include <sys/socket.h>
6356 ],
6357 [
6358 socklen_t len;
6359 getsockopt(0, 0, 0, 0, &len);
6360 ],
6361 wx_cv_type_getsockopt5=socklen_t,
6362 [
ddc1a35f
DE
6363 AC_TRY_COMPILE(
6364 [
6365 #include <sys/types.h>
6366 #include <sys/socket.h>
6367 ],
6368 [
6369 size_t len;
6370 getsockopt(0, 0, 0, 0, &len);
6371 ],
6372 wx_cv_type_getsockopt5=size_t,
6373 AC_TRY_COMPILE(
6374 [
6375 #include <sys/types.h>
6376 #include <sys/socket.h>
6377 ],
6378 [
6379 int len;
6380 getsockopt(0, 0, 0, 0, &len);
6381 ],
6382 wx_cv_type_getsockopt5=int,
6383 wx_cv_type_getsockopt5=unknown
6384 )
6385 )
ddc1a35f
DE
6386 ]
6387 )
6daba577 6388 AC_LANG_POP()
ddc1a35f
DE
6389 ])
6390
6391 if test "$wx_cv_type_getsockopt5" = "unknown"; then
6392 wxUSE_SOCKETS=no
6393 AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
6394 else
6395 AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5)
6396 fi
51a9faba
VZ
6397 fi
6398fi
c521c494 6399
51a9faba 6400if test "$wxUSE_SOCKETS" = "yes" ; then
8575ff50
VZ
6401 if test "$wxUSE_IPV6" = "yes"; then
6402 AC_CACHE_CHECK(
6403 [whether we have sockaddr_in6],
6404 [wx_cv_type_sockaddr_in6],
6405 [
6406 AC_TRY_COMPILE(
6407 [
6408 #include <sys/types.h>
6409 #include <sys/socket.h>
6410 #include <netinet/in.h>
6411 ],
6412 [
6413 struct sockaddr_in6 sa6;
6414 ],
6415 wx_cv_type_sockaddr_in6=yes,
6416 wx_cv_type_sockaddr_in6=no
6417 )
6418 ]
6419 )
6420
6421 if test "$wx_cv_type_sockaddr_in6"="yes"; then
6422 AC_DEFINE(wxUSE_IPV6)
6423 else
6424 AC_MSG_WARN([IPv6 support not available... disabled])
6425 fi
6426 fi
6427
afc31813 6428 AC_DEFINE(wxUSE_SOCKETS)
70f7a477 6429 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
9a98a854
VZ
6430fi
6431
3879ecda
VZ
6432if test "$wxUSE_PROTOCOL" = "yes"; then
6433 if test "$wxUSE_SOCKETS" != "yes"; then
6434 AC_MSG_WARN(Protocol classes require sockets... disabled)
6435 wxUSE_PROTOCOL=no
6436 fi
6437fi
6438
6439if test "$wxUSE_PROTOCOL" = "yes"; then
6440 AC_DEFINE(wxUSE_PROTOCOL)
6441
6442 if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then
6443 AC_DEFINE(wxUSE_PROTOCOL_HTTP)
6444 fi
6445 if test "$wxUSE_PROTOCOL_FTP" = "yes"; then
6446 AC_DEFINE(wxUSE_PROTOCOL_FTP)
6447 fi
6448 if test "$wxUSE_PROTOCOL_FILE" = "yes"; then
6449 AC_DEFINE(wxUSE_PROTOCOL_FILE)
6450 fi
6451else
6452 if test "$wxUSE_FS_INET" = "yes"; then
5ff751d6 6453 AC_MSG_WARN([HTTP filesystem require protocol classes... disabled])
3879ecda
VZ
6454 wxUSE_FS_INET="no"
6455 fi
6456fi
6457
6458if test "$wxUSE_URL" = "yes"; then
6459 if test "$wxUSE_PROTOCOL" != "yes"; then
6460 AC_MSG_WARN(wxURL class requires wxProtocol... disabled)
6461 wxUSE_URL=no
6462 fi
6463 if test "$wxUSE_URL" = "yes"; then
6464 AC_DEFINE(wxUSE_URL)
6465 fi
6466fi
6467
ca5c6ac3
VZ
6468if test "$wxUSE_VARIANT" = "yes"; then
6469 AC_DEFINE(wxUSE_VARIANT)
6470fi
6471
3879ecda
VZ
6472if test "$wxUSE_FS_INET" = "yes"; then
6473 AC_DEFINE(wxUSE_FS_INET)
6474fi
6475
9a98a854
VZ
6476dnl ---------------------------------------------------------------------------
6477dnl Joystick support
6478dnl ---------------------------------------------------------------------------
6479
ee45c548
MW
6480if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
6481 wxUSE_JOYSTICK=no
9a98a854 6482
ee45c548
MW
6483 dnl under MSW we always have joystick support
6484 if test "$TOOLKIT" = "MSW"; then
6485 wxUSE_JOYSTICK=yes
4cb1d3da 6486
ee45c548 6487 dnl mac only available on darwin
4a693a9b 6488 elif test "$TOOLKIT" = "OSX" -o "$TOOLKIT" = "COCOA"; then
ee45c548
MW
6489 if test "$USE_DARWIN" = 1; then
6490 dnl check for a bug in the headers, some have bad setEventCallout
6491 AC_MSG_CHECKING([headers have declarations needed for joystick support])
224d4f6d 6492 AC_LANG_PUSH(C++)
ee45c548
MW
6493 AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
6494 [ IOHIDQueueInterface *qi = NULL;
6495 IOHIDCallbackFunction cb = NULL;
6496 qi->setEventCallout(NULL, cb, NULL, NULL); ],
6497 [ wxUSE_JOYSTICK=yes ]
6498 )
224d4f6d 6499 AC_LANG_POP()
ee45c548 6500 AC_MSG_RESULT($wxUSE_JOYSTICK)
4cb1d3da 6501 fi
ee45c548
MW
6502
6503 dnl joystick support is only for Linux 2.1.x or greater
6504 else
b6814e24 6505 dnl wxJoystick not supported by wxMGL at all
4216d21f 6506 if test "$wxUSE_MGL" != 1; then
ddbd3cd5
VZ
6507 dnl notice the dummy includes argument: without it, AC_CHECK_HEADER
6508 dnl checks only whether the header can be preprocessed, not that it
6509 dnl can be compiled and in Linux 2.6.16 joystick.h is present but
6510 dnl can't be compiled because of an error and with the default
6511 dnl AC_CHECK_HEADER semantics we'd still detect it in this case and
6512 dnl build would fail later
1f7e12cc 6513 AC_CHECK_HEADERS([linux/joystick.h], [wxUSE_JOYSTICK=yes],, [AC_INCLUDES_DEFAULT()])
b6814e24 6514 fi
ee45c548
MW
6515 fi
6516
6517 if test "$wxUSE_JOYSTICK" = "yes"; then
6518 AC_DEFINE(wxUSE_JOYSTICK)
6519 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
6520 else
5ff751d6 6521 AC_MSG_WARN(Joystick not supported by this system... disabled)
3a922bb4 6522 fi
dc3d889d 6523fi
dc3d889d 6524
9a98a854 6525
9a98a854 6526dnl ---------------------------------------------------------------------------
ced859c3 6527dnl String stuff
9a98a854
VZ
6528dnl ---------------------------------------------------------------------------
6529
9795e0db
VZ
6530if test "$wxUSE_FONTENUM" = "yes" ; then
6531 AC_DEFINE(wxUSE_FONTENUM)
6532fi
6533
1e6feb95
VZ
6534if test "$wxUSE_FONTMAP" = "yes" ; then
6535 AC_DEFINE(wxUSE_FONTMAP)
6536fi
6537
9a98a854
VZ
6538if test "$wxUSE_UNICODE" = "yes" ; then
6539 AC_DEFINE(wxUSE_UNICODE)
3bd8fb5f 6540
eb854003 6541 if test "$USE_WIN32" != 1; then
bbc3925a
VS
6542 wxUSE_UNICODE_MSLU=no
6543 fi
a72a4bfa 6544
eb854003 6545 if test "$USE_WIN32" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
a72a4bfa
VS
6546 AC_CHECK_LIB(unicows,main,
6547 [
6548 AC_DEFINE(wxUSE_UNICODE_MSLU)
6549 ],
6550 [
6551 AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled.
6552 Applications will only run on Windows NT/2000/XP!])
6553 wxUSE_UNICODE_MSLU=no
6554 ])
6555 fi
9a98a854
VZ
6556fi
6557
81727065
VS
6558if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_UTF8" = "yes"; then
6559 AC_DEFINE(wxUSE_UNICODE_UTF8)
111d9948
VS
6560
6561 if test "$wxUSE_UNICODE_UTF8_LOCALE" = "yes"; then
6562 AC_DEFINE(wxUSE_UTF8_LOCALE_ONLY)
6563 fi
81727065
VS
6564fi
6565
9a98a854
VZ
6566dnl ---------------------------------------------------------------------------
6567dnl big GUI components: MDI, doc/view, printing, help, ...
6568dnl ---------------------------------------------------------------------------
6569
6570if test "$wxUSE_CONSTRAINTS" = "yes"; then
ce4169a4
RR
6571 AC_DEFINE(wxUSE_CONSTRAINTS)
6572 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
9a98a854
VZ
6573fi
6574
efd17a1d
VZ
6575if test "$wxUSE_MDI" = "yes"; then
6576 AC_DEFINE(wxUSE_MDI)
6577
6578 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
6579 AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
6580 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
6581 fi
9a98a854
VZ
6582fi
6583
6584if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
6585 AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
6586 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
9a98a854
VZ
6587fi
6588
6589if test "$wxUSE_HELP" = "yes"; then
ce4169a4
RR
6590 AC_DEFINE(wxUSE_HELP)
6591 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
3379ed37 6592
77e13408 6593 if test "$wxUSE_MSW" = 1; then
031d8228 6594 if test "$wxUSE_MS_HTML_HELP" = "yes"; then
3b7bc64a 6595 AC_DEFINE(wxUSE_MS_HTML_HELP)
29fd3c0c 6596 fi
3379ed37 6597 fi
031d8228
VS
6598
6599 if test "$wxUSE_WXHTML_HELP" = "yes"; then
6600 if test "$wxUSE_HTML" = "yes"; then
6601 AC_DEFINE(wxUSE_WXHTML_HELP)
6602 else
6603 AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled)
6604 wxUSE_WXHTML_HELP=no
6605 fi
6606 fi
9a98a854
VZ
6607fi
6608
6609if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
b0b81bc9 6610 AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
ce4169a4 6611 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
9a98a854
VZ
6612fi
6613
b0fc907f
VZ
6614if test "$wxUSE_POSTSCRIPT" = "yes" ; then
6615 AC_DEFINE(wxUSE_POSTSCRIPT)
6616fi
6617
6618AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
6619
b0fc907f
VZ
6620if test "$wxUSE_SVG" = "yes"; then
6621 AC_DEFINE(wxUSE_SVG)
6622fi
9a98a854 6623
f2555abd
MW
6624dnl ---------------------------------------------------------------------------
6625dnl wxMetafile availability
6626dnl ---------------------------------------------------------------------------
6627
6628if test "$wxUSE_METAFILE" = "yes"; then
6629 if test "$wxUSE_MSW" != 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_PM" != 1; then
6630 AC_MSG_WARN([wxMetafile is not available on this system... disabled])
6631 wxUSE_METAFILE=no
6632 fi
6633fi
6634
9a98a854 6635dnl ---------------------------------------------------------------------------
77c85c2b 6636dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
9a98a854
VZ
6637dnl ---------------------------------------------------------------------------
6638
2b9bdf71
VZ
6639dnl check for ole headers and disable a few features requiring it if not
6640dnl present (earlier versions of mingw32 don't have ole2.h)
f95e4495 6641if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
77e13408 6642 -o "$wxUSE_CLIPBOARD" = "yes" \
3bce6687 6643 -o "$wxUSE_OLE" = "yes" \
77e13408 6644 -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then
6e7b8bcb 6645 AC_CHECK_HEADER(ole2.h,,, [ ])
2b9bdf71
VZ
6646
6647 if test "$ac_cv_header_ole2_h" = "yes" ; then
6648 if test "$GCC" = yes ; then
8284b0c5
MB
6649 AC_MSG_CHECKING([if g++ requires -fvtable-thunks])
6650 AC_TRY_COMPILE([#include <windows.h>
6651 #include <ole2.h>],
6652 [],
6653 [AC_MSG_RESULT(no)],
6654 [AC_MSG_RESULT(yes)
5ff751d6 6655 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fvtable-thunks"])
3d63bc3a 6656 LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
f95e4495
VS
6657 if test "$wxUSE_OLE" = "yes" ; then
6658 AC_DEFINE(wxUSE_OLE)
6f1fb1ac 6659 AC_DEFINE(wxUSE_OLE_AUTOMATION)
9c49977b 6660 AC_DEFINE(wxUSE_ACTIVEX)
0b78747f 6661 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS oleauto"
f95e4495 6662 fi
2b9bdf71
VZ
6663 fi
6664
6665 dnl for OLE clipboard and dnd
f95e4495
VS
6666 if test "$wxUSE_DATAOBJ" = "yes" ; then
6667 AC_DEFINE(wxUSE_DATAOBJ)
6668 fi
2b9bdf71
VZ
6669 else
6670 AC_MSG_WARN([Some features disabled because OLE headers not found])
6671
6672 wxUSE_CLIPBOARD=no
6673 wxUSE_DRAG_AND_DROP=no
6674 wxUSE_DATAOBJ=no
3bce6687
JS
6675 wxUSE_OLE=no
6676 fi
6677
6678 if test "$wxUSE_METAFILE" = "yes"; then
6679 AC_DEFINE(wxUSE_METAFILE)
6680
6681 dnl this one should probably be made separately configurable
6682 AC_DEFINE(wxUSE_ENH_METAFILE)
6683 fi
6684fi
6685
9a98a854 6686if test "$wxUSE_IPC" = "yes"; then
0b78747f 6687 if test "$wxUSE_SOCKETS" != "yes" -a "$USE_WIN32" != 1; then
77ffb593 6688 AC_MSG_WARN(wxWidgets IPC classes require sockets... disabled)
0b78747f 6689 wxUSE_IPC=no
eb4efbdc
VZ
6690 fi
6691
0b78747f
MW
6692 if test "$wxUSE_IPC" = "yes"; then
6693 AC_DEFINE(wxUSE_IPC)
6694 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc"
6695 fi
9a98a854
VZ
6696fi
6697
90cf46d9 6698if test "$wxUSE_DATAOBJ" = "yes"; then
f321ab7f
VS
6699 if test "$wxUSE_MGL" = 1 -o "$wxUSE_DFB" = 1; then
6700 AC_MSG_WARN([wxDataObject not yet supported under $TOOLKIT... disabled])
b468fab2
MW
6701 wxUSE_DATAOBJ=no
6702 else
6703 AC_DEFINE(wxUSE_DATAOBJ)
6704 fi
90cf46d9
VZ
6705else
6706 AC_MSG_WARN([Clipboard and drag-and-drop require wxDataObject -- disabled])
6707 wxUSE_CLIPBOARD=no
6708 wxUSE_DRAG_AND_DROP=no
6709fi
6710
9a98a854 6711if test "$wxUSE_CLIPBOARD" = "yes"; then
f321ab7f
VS
6712 if test "$wxUSE_MGL" = 1 -o "$wxUSE_DFB" = 1; then
6713 AC_MSG_WARN([Clipboard not yet supported under $TOOLKIT... disabled])
6c657b52
VS
6714 wxUSE_CLIPBOARD=no
6715 fi
178572bb 6716
6c657b52
VS
6717 if test "$wxUSE_CLIPBOARD" = "yes"; then
6718 AC_DEFINE(wxUSE_CLIPBOARD)
6c657b52 6719 fi
9a98a854
VZ
6720fi
6721
39c9d5ac 6722if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
ce4169a4
RR
6723 if test "$wxUSE_GTK" = 1; then
6724 if test "$WXGTK12" != 1; then
156b2523 6725 AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2... disabled])
e90c1d2a 6726 wxUSE_DRAG_AND_DROP=no
ce4169a4 6727 fi
a9b5e89f 6728 fi
a9b5e89f 6729
f321ab7f
VS
6730 if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_MGL" = 1 -o \
6731 "$wxUSE_DFB" = 1; then
6732 AC_MSG_WARN([Drag and drop not yet supported under $TOOLKIT... disabled])
6c657b52
VS
6733 wxUSE_DRAG_AND_DROP=no
6734 fi
6735
ce4169a4
RR
6736 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
6737 AC_DEFINE(wxUSE_DRAG_AND_DROP)
ce4169a4 6738 fi
4882bf1b 6739
9a98a854
VZ
6740fi
6741
08938fe1
MB
6742if test "$wxUSE_DRAG_AND_DROP" = "yes" -o "$wxUSE_CLIPBOARD" = "yes"; then
6743 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
6744fi
6745
2cdaa1dc
RR
6746if test "$wxUSE_CLIPBOARD" = "yes"; then
6747 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS clipboard"
6748fi
6749
9a98a854
VZ
6750if test "$wxUSE_SPLINES" = "yes" ; then
6751 AC_DEFINE(wxUSE_SPLINES)
6752fi
6753
060e10d9
RR
6754if test "$wxUSE_MOUSEWHEEL" = "yes" ; then
6755 AC_DEFINE(wxUSE_MOUSEWHEEL)
6756fi
6757
9b7e0226
VZ
6758if test "$wxUSE_UIACTIONSIMULATOR" = "yes" ; then
6759 AC_DEFINE(wxUSE_UIACTIONSIMULATOR)
c24309da 6760 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS uiaction"
9b7e0226
VZ
6761fi
6762
e71508e1
VZ
6763if test "$wxUSE_DC_TRANSFORM_MATRIX" = "yes" ; then
6764 AC_DEFINE(wxUSE_DC_TRANSFORM_MATRIX)
6765fi
6766
9a98a854
VZ
6767dnl ---------------------------------------------------------------------------
6768dnl GUI controls
6769dnl ---------------------------------------------------------------------------
6770
1e6feb95
VZ
6771USES_CONTROLS=0
6772if test "$wxUSE_CONTROLS" = "yes"; then
6773 USES_CONTROLS=1
6774fi
6775
f5bdfc69
VZ
6776if test "$wxUSE_MARKUP" = "yes"; then
6777 AC_DEFINE(wxUSE_MARKUP)
6778fi
6779
9a98a854
VZ
6780if test "$wxUSE_ACCEL" = "yes"; then
6781 AC_DEFINE(wxUSE_ACCEL)
1e6feb95
VZ
6782 USES_CONTROLS=1
6783fi
6784
7067783d 6785if test "$wxUSE_ANIMATIONCTRL" = "yes"; then
72045d57
VZ
6786 AC_DEFINE(wxUSE_ANIMATIONCTRL)
6787 USES_CONTROLS=1
6788 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate"
6789fi
6790
1e6feb95
VZ
6791if test "$wxUSE_BUTTON" = "yes"; then
6792 AC_DEFINE(wxUSE_BUTTON)
6793 USES_CONTROLS=1
6794fi
6795
6796if test "$wxUSE_BMPBUTTON" = "yes"; then
6797 AC_DEFINE(wxUSE_BMPBUTTON)
6798 USES_CONTROLS=1
6799fi
6800
6801if test "$wxUSE_CALCTRL" = "yes"; then
6802 AC_DEFINE(wxUSE_CALENDARCTRL)
6803 USES_CONTROLS=1
6804 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar"
9a98a854
VZ
6805fi
6806
6807if test "$wxUSE_CARET" = "yes"; then
6808 AC_DEFINE(wxUSE_CARET)
1e6feb95 6809 USES_CONTROLS=1
9a98a854
VZ
6810 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
6811fi
6812
912c3932
VZ
6813if test "$wxUSE_COLLPANE" = "yes"; then
6814 AC_DEFINE(wxUSE_COLLPANE)
6815 USES_CONTROLS=1
6816 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS collpane"
6817fi
6818
9a98a854
VZ
6819if test "$wxUSE_COMBOBOX" = "yes"; then
6820 AC_DEFINE(wxUSE_COMBOBOX)
1e6feb95 6821 USES_CONTROLS=1
9a98a854
VZ
6822fi
6823
a57d600f
VZ
6824if test "$wxUSE_COMBOCTRL" = "yes"; then
6825 AC_DEFINE(wxUSE_COMBOCTRL)
642bcba9
VZ
6826 USES_CONTROLS=1
6827fi
6828
3571e1ad
VZ
6829if test "$wxUSE_COMMANDLINKBUTTON" = "yes"; then
6830 AC_DEFINE(wxUSE_COMMANDLINKBUTTON)
6831 USES_CONTROLS=1
6832fi
6833
ce4169a4
RR
6834if test "$wxUSE_CHOICE" = "yes"; then
6835 AC_DEFINE(wxUSE_CHOICE)
1e6feb95 6836 USES_CONTROLS=1
9a98a854
VZ
6837fi
6838
92bbdbcd
WS
6839if test "$wxUSE_CHOICEBOOK" = "yes"; then
6840 AC_DEFINE(wxUSE_CHOICEBOOK)
6841 USES_CONTROLS=1
6842fi
6843
9a98a854
VZ
6844if test "$wxUSE_CHECKBOX" = "yes"; then
6845 AC_DEFINE(wxUSE_CHECKBOX)
1e6feb95 6846 USES_CONTROLS=1
9a98a854
VZ
6847fi
6848
6849if test "$wxUSE_CHECKLST" = "yes"; then
6850 AC_DEFINE(wxUSE_CHECKLISTBOX)
1e6feb95 6851 USES_CONTROLS=1
9a98a854
VZ
6852fi
6853
ec376c8f
VZ
6854if test "$wxUSE_COLOURPICKERCTRL" = "yes"; then
6855 AC_DEFINE(wxUSE_COLOURPICKERCTRL)
6856 USES_CONTROLS=1
6857fi
6858
da98e9be
VZ
6859if test "$wxUSE_DATEPICKCTRL" = "yes"; then
6860 AC_DEFINE(wxUSE_DATEPICKCTRL)
6861 USES_CONTROLS=1
6862fi
6863
ec376c8f
VZ
6864if test "$wxUSE_DIRPICKERCTRL" = "yes"; then
6865 AC_DEFINE(wxUSE_DIRPICKERCTRL)
6866 USES_CONTROLS=1
6867fi
6868
0cf3e587
VZ
6869if test "$wxUSE_FILECTRL" = "yes"; then
6870 AC_DEFINE(wxUSE_FILECTRL)
6871 USES_CONTROLS=1
6872fi
6873
ec376c8f
VZ
6874if test "$wxUSE_FILEPICKERCTRL" = "yes"; then
6875 AC_DEFINE(wxUSE_FILEPICKERCTRL)
6876 USES_CONTROLS=1
6877fi
6878
6879if test "$wxUSE_FONTPICKERCTRL" = "yes"; then
6880 AC_DEFINE(wxUSE_FONTPICKERCTRL)
6881 USES_CONTROLS=1
6882fi
6883
ddb4769e 6884if test "$wxUSE_DISPLAY" = "yes"; then
f321ab7f
VS
6885 if test "$wxUSE_DFB" = 1 -o "$wxUSE_MGL" = 1; then
6886 AC_MSG_WARN([wxDisplay not yet supported under $TOOLKIT... disabled])
6887 wxUSE_DISPLAY=no
6888 else
6889 AC_DEFINE(wxUSE_DISPLAY)
39d66339 6890 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS display"
f321ab7f 6891 fi
ddb4769e
VZ
6892fi
6893
88bbc332
RR
6894if test "$wxUSE_DETECT_SM" = "yes"; then
6895 AC_DEFINE(wxUSE_DETECT_SM)
6896fi
6897
9a98a854
VZ
6898if test "$wxUSE_GAUGE" = "yes"; then
6899 AC_DEFINE(wxUSE_GAUGE)
1e6feb95 6900 USES_CONTROLS=1
9a98a854
VZ
6901fi
6902
d6a55c4b
VZ
6903if test "$wxUSE_GRID" = "yes"; then
6904 AC_DEFINE(wxUSE_GRID)
1e6feb95 6905 USES_CONTROLS=1
d6a55c4b
VZ
6906 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
6907fi
6908
e721a2a2
VZ
6909if test "$wxUSE_HEADERCTRL" = "yes"; then
6910 AC_DEFINE(wxUSE_HEADERCTRL)
6911 USES_CONTROLS=1
6912fi
6913
17e91437
VZ
6914if test "$wxUSE_HYPERLINKCTRL" = "yes"; then
6915 AC_DEFINE(wxUSE_HYPERLINKCTRL)
6916 USES_CONTROLS=1
6917fi
6918
95a46303
RR
6919if test "$wxUSE_BITMAPCOMBOBOX" = "yes"; then
6920 AC_DEFINE(wxUSE_BITMAPCOMBOBOX)
6921 USES_CONTROLS=1
6922fi
6923
20e34ecc
RR
6924if test "$wxUSE_DATAVIEWCTRL" = "yes"; then
6925 AC_DEFINE(wxUSE_DATAVIEWCTRL)
6926 USES_CONTROLS=1
6927 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview"
6928fi
6929
9a98a854 6930if test "$wxUSE_IMAGLIST" = "yes"; then
ce4169a4 6931 AC_DEFINE(wxUSE_IMAGLIST)
9a98a854
VZ
6932fi
6933
a92b5dfe
VZ
6934if test "$wxUSE_INFOBAR" = "yes"; then
6935 AC_DEFINE(wxUSE_INFOBAR)
6936fi
6937
e9c0df38
VZ
6938if test "$wxUSE_LISTBOOK" = "yes"; then
6939 AC_DEFINE(wxUSE_LISTBOOK)
6940 USES_CONTROLS=1
6941fi
6942
9a98a854 6943if test "$wxUSE_LISTBOX" = "yes"; then
ce4169a4 6944 AC_DEFINE(wxUSE_LISTBOX)
1e6feb95 6945 USES_CONTROLS=1
9a98a854
VZ
6946fi
6947
6948if test "$wxUSE_LISTCTRL" = "yes"; then
ce4169a4
RR
6949 if test "$wxUSE_IMAGLIST" = "yes"; then
6950 AC_DEFINE(wxUSE_LISTCTRL)
1e6feb95 6951 USES_CONTROLS=1
ce4169a4
RR
6952 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
6953 else
6954 AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
6955 fi
9a98a854
VZ
6956fi
6957
23575150
RR
6958if test "$wxUSE_EDITABLELISTBOX" = "yes"; then
6959 AC_DEFINE(wxUSE_EDITABLELISTBOX)
6960 USES_CONTROLS=1
23575150
RR
6961fi
6962
9a98a854 6963if test "$wxUSE_NOTEBOOK" = "yes"; then
ce4169a4 6964 AC_DEFINE(wxUSE_NOTEBOOK)
1e6feb95 6965 USES_CONTROLS=1
ce4169a4 6966 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
9a98a854
VZ
6967fi
6968
e36a1739
VZ
6969if test "$wxUSE_NOTIFICATION_MESSAGE" = "yes"; then
6970 AC_DEFINE(wxUSE_NOTIFICATION_MESSAGE)
6971fi
6972
a57d600f
VZ
6973if test "$wxUSE_ODCOMBOBOX" = "yes"; then
6974 AC_DEFINE(wxUSE_ODCOMBOBOX)
642bcba9
VZ
6975 USES_CONTROLS=1
6976 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS combo"
6977fi
6978
9a98a854 6979if test "$wxUSE_RADIOBOX" = "yes"; then
ce4169a4 6980 AC_DEFINE(wxUSE_RADIOBOX)
1e6feb95 6981 USES_CONTROLS=1
9a98a854
VZ
6982fi
6983
6984if test "$wxUSE_RADIOBTN" = "yes"; then
ce4169a4 6985 AC_DEFINE(wxUSE_RADIOBTN)
1e6feb95 6986 USES_CONTROLS=1
9a98a854
VZ
6987fi
6988
f0bb342f
VZ
6989if test "$wxUSE_REARRANGECTRL" = "yes"; then
6990 AC_DEFINE(wxUSE_REARRANGECTRL)
6991fi
6992
a1bdd4ab
VZ
6993if test "$wxUSE_RICHMSGDLG" = "yes"; then
6994 AC_DEFINE(wxUSE_RICHMSGDLG)
6995fi
6996
79b00c62 6997if test "$wxUSE_SASH" = "yes"; then
ce4169a4
RR
6998 AC_DEFINE(wxUSE_SASH)
6999 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
9a98a854
VZ
7000fi
7001
7002if test "$wxUSE_SCROLLBAR" = "yes"; then
ce4169a4 7003 AC_DEFINE(wxUSE_SCROLLBAR)
1e6feb95 7004 USES_CONTROLS=1
6a5a7fba 7005 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll"
9a98a854
VZ
7006fi
7007
3f7f284d
RD
7008if test "$wxUSE_SEARCHCTRL" = "yes"; then
7009 AC_DEFINE(wxUSE_SEARCHCTRL)
7010 USES_CONTROLS=1
7011fi
7012
9a98a854 7013if test "$wxUSE_SLIDER" = "yes"; then
ce4169a4 7014 AC_DEFINE(wxUSE_SLIDER)
1e6feb95 7015 USES_CONTROLS=1
9a98a854
VZ
7016fi
7017
7018if test "$wxUSE_SPINBTN" = "yes"; then
ce4169a4 7019 AC_DEFINE(wxUSE_SPINBTN)
1e6feb95 7020 USES_CONTROLS=1
9a98a854
VZ
7021fi
7022
66f38406
RR
7023if test "$wxUSE_SPINCTRL" = "yes"; then
7024 AC_DEFINE(wxUSE_SPINCTRL)
1e6feb95 7025 USES_CONTROLS=1
66f38406
RR
7026fi
7027
9a98a854 7028if test "$wxUSE_SPLITTER" = "yes"; then
ce4169a4
RR
7029 AC_DEFINE(wxUSE_SPLITTER)
7030 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
9a98a854
VZ
7031fi
7032
7033if test "$wxUSE_STATBMP" = "yes"; then
ce4169a4 7034 AC_DEFINE(wxUSE_STATBMP)
1e6feb95 7035 USES_CONTROLS=1
9a98a854
VZ
7036fi
7037
7038if test "$wxUSE_STATBOX" = "yes"; then
ce4169a4 7039 AC_DEFINE(wxUSE_STATBOX)
1e6feb95
VZ
7040 USES_CONTROLS=1
7041fi
7042
7043if test "$wxUSE_STATTEXT" = "yes"; then
7044 AC_DEFINE(wxUSE_STATTEXT)
7045 USES_CONTROLS=1
9a98a854
VZ
7046fi
7047
7048if test "$wxUSE_STATLINE" = "yes"; then
d1188635
JS
7049 AC_DEFINE(wxUSE_STATLINE)
7050 USES_CONTROLS=1
9a98a854
VZ
7051fi
7052
7053if test "$wxUSE_STATUSBAR" = "yes"; then
da4486fb
VZ
7054 dnl this will get undefined in wx/chkconf.h if it's not supported
7055 AC_DEFINE(wxUSE_NATIVE_STATUSBAR)
ce4169a4 7056 AC_DEFINE(wxUSE_STATUSBAR)
1e6feb95 7057 USES_CONTROLS=1
2286341c
VZ
7058
7059 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar"
9a98a854
VZ
7060fi
7061
1e6feb95
VZ
7062if test "$wxUSE_TEXTCTRL" = "yes"; then
7063 AC_DEFINE(wxUSE_TEXTCTRL)
7064 USES_CONTROLS=1
7065 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text"
5cfbef2a
VZ
7066
7067 dnl we don't have special switches to disable wxUSE_RICHEDIT[2], it doesn't
7068 dnl seem useful to allow disabling them
7069 AC_DEFINE(wxUSE_RICHEDIT)
7070 AC_DEFINE(wxUSE_RICHEDIT2)
1e6feb95
VZ
7071fi
7072
1db8dc4a 7073if test "$wxUSE_TOGGLEBTN" = "yes"; then
f10f4c87 7074 if test "$wxUSE_OLD_COCOA" = 1 ; then
156b2523
GD
7075 AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled])
7076 wxUSE_TOGGLEBTN=no
7077 fi
a45d7ab7
GD
7078
7079 if test "$wxUSE_TOGGLEBTN" = "yes"; then
7080 AC_DEFINE(wxUSE_TOGGLEBTN)
1e6feb95 7081 USES_CONTROLS=1
a45d7ab7 7082 fi
1db8dc4a
VZ
7083fi
7084
9a98a854 7085if test "$wxUSE_TOOLBAR" = "yes"; then
ce4169a4 7086 AC_DEFINE(wxUSE_TOOLBAR)
1e6feb95 7087 USES_CONTROLS=1
360d6699 7088
452b6243
VS
7089 if test "$wxUSE_UNIVERSAL" = "yes"; then
7090 wxUSE_TOOLBAR_NATIVE="no"
7091 else
7092 wxUSE_TOOLBAR_NATIVE="yes"
1e6feb95 7093 AC_DEFINE(wxUSE_TOOLBAR_NATIVE)
1e6feb95 7094 fi
9a98a854 7095
1e6feb95 7096 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
360d6699
VZ
7097fi
7098
39c9d5ac 7099if test "$wxUSE_TOOLTIPS" = "yes"; then
ced859c3 7100 if test "$wxUSE_MOTIF" = 1; then
156b2523 7101 AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled])
9a98a854 7102 else
d1188635
JS
7103 if test "$wxUSE_UNIVERSAL" = "yes"; then
7104 AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled])
ce4169a4 7105 else
d1188635 7106 AC_DEFINE(wxUSE_TOOLTIPS)
ce4169a4 7107 fi
9a98a854
VZ
7108 fi
7109fi
7110
eca15c0d
VZ
7111if test "$wxUSE_TREEBOOK" = "yes"; then
7112 AC_DEFINE(wxUSE_TREEBOOK)
7113 USES_CONTROLS=1
7114fi
7115
7dcea26b
JS
7116if test "$wxUSE_TOOLBOOK" = "yes"; then
7117 AC_DEFINE(wxUSE_TOOLBOOK)
7118 USES_CONTROLS=1
7119fi
7120
9a98a854 7121if test "$wxUSE_TREECTRL" = "yes"; then
ce4169a4
RR
7122 if test "$wxUSE_IMAGLIST" = "yes"; then
7123 AC_DEFINE(wxUSE_TREECTRL)
1e6feb95 7124 USES_CONTROLS=1
ce4169a4
RR
7125 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
7126 else
7127 AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
7128 fi
9a98a854
VZ
7129fi
7130
9f41d601 7131if test "$wxUSE_POPUPWIN" = "yes"; then
f10f4c87 7132 if test "$wxUSE_OLD_COCOA" = 1 ; then
156b2523 7133 AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
6abe4b65 7134 else
833a51f6
MB
7135 if test "$wxUSE_PM" = 1; then
7136 AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
485cf710 7137 else
833a51f6 7138 AC_DEFINE(wxUSE_POPUPWIN)
0b78747f 7139 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup"
0b01706f 7140
833a51f6 7141 USES_CONTROLS=1
485cf710 7142 fi
6abe4b65 7143 fi
9f41d601
RR
7144fi
7145
0dcd06dd 7146if test "$wxUSE_DIALUP_MANAGER" = "yes"; then
f10f4c87 7147 if test "$wxUSE_MAC" = 1 -o "$wxUSE_OLD_COCOA" = 1 -o "$wxUSE_MGL" = 1; then
480b9f18 7148 AC_MSG_WARN([Dialup manager not supported on this platform... disabled])
b843b628
MB
7149 else
7150 AC_DEFINE(wxUSE_DIALUP_MANAGER)
7151 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup"
7152 fi
7153fi
7154
dd964dcc 7155if test "$wxUSE_TIPWINDOW" = "yes"; then
c6712985
SN
7156 if test "$wxUSE_PM" = 1; then
7157 AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled])
3bd8fb5f 7158 else
c6712985
SN
7159 AC_DEFINE(wxUSE_TIPWINDOW)
7160 fi
dd964dcc
VZ
7161fi
7162
1e6feb95
VZ
7163if test "$USES_CONTROLS" = 1; then
7164 AC_DEFINE(wxUSE_CONTROLS)
7165fi
7166
9a98a854
VZ
7167dnl ---------------------------------------------------------------------------
7168dnl misc options
7169dnl ---------------------------------------------------------------------------
7170
4199367e
VZ
7171dnl please keep the settings below in alphabetical order
7172if test "$wxUSE_ACCESSIBILITY" = "yes"; then
7173 AC_DEFINE(wxUSE_ACCESSIBILITY)
7174 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access"
7175fi
9a98a854 7176
2e9b5717
VZ
7177if test "$wxUSE_ARTPROVIDER_STD" = "yes"; then
7178 AC_DEFINE(wxUSE_ARTPROVIDER_STD)
7179fi
7180
c1d2466a
VZ
7181if test "$wxUSE_ARTPROVIDER_TANGO" = "auto"; then
7182 dnl Tango-based art provider is not needed in GTK-based ports as the
7183 dnl native art provider completely replaces it.
7184 if test "$wxUSE_GTK" != 1; then
7185 dnl It also requires support for memory-mapped PNG images.
7186 if test "$wxUSE_LIBPNG" != no -a \
7187 "$wxUSE_IMAGE" = yes -a \
7188 "$wxUSE_STREAMS" = yes; then
7189 wxUSE_ARTPROVIDER_TANGO="yes"
7190 fi
7191 fi
7192fi
7193
7194if test "$wxUSE_ARTPROVIDER_TANGO" = "yes"; then
7195 AC_DEFINE(wxUSE_ARTPROVIDER_TANGO)
7196fi
7197
24fd6d87
VZ
7198if test "$wxUSE_DRAGIMAGE" = "yes"; then
7199 AC_DEFINE(wxUSE_DRAGIMAGE)
7200 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag"
7201fi
7202
4199367e 7203if test "$wxUSE_EXCEPTIONS" = "yes"; then
2ad50b4f
VZ
7204 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
7205 AC_MSG_WARN([--enable-exceptions can't be used with --enable-no_exceptions])
7206 else
7207 AC_DEFINE(wxUSE_EXCEPTIONS)
7208 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS except"
7209 fi
4199367e
VZ
7210fi
7211
7212USE_HTML=0
7213if test "$wxUSE_HTML" = "yes"; then
7214 AC_DEFINE(wxUSE_HTML)
7215 USE_HTML=1
7216 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox"
7bb2947d 7217fi
ec9f9256 7218if test "$wxUSE_WEBKIT" = "yes"; then
031e9160 7219 if test "$wxUSE_MAC" = 1 -a "$USE_DARWIN" = 1; then
07bea8f0 7220 old_CPPFLAGS="$CPPFLAGS"
c92ad099 7221 CPPFLAGS="-x objective-c++ $CPPFLAGS"
07bea8f0
VS
7222 AC_CHECK_HEADER([WebKit/HIWebView.h],
7223 [
7224 AC_DEFINE(wxUSE_WEBKIT)
7225 WEBKIT_LINK="-framework WebKit"
7226 ],
7227 [
7228 AC_MSG_WARN([WebKit headers not found; disabling wxWebKit])
7229 wxUSE_WEBKIT=no
7230 ],
bde1da6d
VZ
7231 [
7232 #include <Carbon/Carbon.h>
7233 #include <WebKit/WebKit.h>
7234 ])
07bea8f0 7235 CPPFLAGS="$old_CPPFLAGS"
f10f4c87 7236 elif test "$wxUSE_OLD_COCOA" = 1; then
07bea8f0
VS
7237 AC_DEFINE(wxUSE_WEBKIT)
7238 else
7239 wxUSE_WEBKIT=no
7240 fi
2ea057f9
SC
7241 if test "$wxUSE_WEBKIT" = "yes"; then
7242 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/htmlctrl"
7243 fi
ec9f9256
JS
7244fi
7245
9a8f0513
VS
7246USE_XRC=0
7247if test "$wxUSE_XRC" = "yes"; then
d2ebf0b7
VS
7248 if test "$wxUSE_XML" != "yes"; then
7249 AC_MSG_WARN([XML library not built, XRC resources disabled])
7250 wxUSE_XRC=no
7251 else
7252 AC_DEFINE(wxUSE_XRC)
7253 USE_XRC=1
7254 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS xrc"
7255 fi
9a8f0513 7256fi
07bea8f0 7257
50acee04
JS
7258USE_AUI=0
7259if test "$wxUSE_AUI" = "yes"; then
7260 AC_DEFINE(wxUSE_AUI)
7261 USE_AUI=1
7262 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS aui"
7263fi
7264
1c4293cb
VZ
7265USE_PROPGRID=0
7266if test "$wxUSE_PROPGRID" = "yes"; then
7267 AC_DEFINE(wxUSE_PROPGRID)
7268 USE_PROPGRID=1
7269 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS propgrid"
7270fi
7271
3c3ead1d
PC
7272USE_RIBBON=0
7273if test "$wxUSE_RIBBON" = "yes"; then
7274 AC_DEFINE(wxUSE_RIBBON)
7275 USE_RIBBON=1
7276 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ribbon"
7277fi
7278
54429bb3
RD
7279USE_STC=0
7280if test "$wxUSE_STC" = "yes"; then
7281 AC_DEFINE(wxUSE_STC)
7282 USE_STC=1
7283 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS stc"
d84e6f50
VZ
7284
7285 dnl python is used to update src/stc.h (see build/bakefiles/scintilla.bkl)
7286 AC_PATH_PROG(PYTHON, python)
7287 if test "x$PYTHON" = "x"; then
7288 COND_PYTHON="#"
7289 fi
7290 AC_SUBST(COND_PYTHON)
54429bb3
RD
7291fi
7292
1e6feb95
VZ
7293if test "$wxUSE_MENUS" = "yes"; then
7294 AC_DEFINE(wxUSE_MENUS)
7295 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu"
ce4169a4 7296fi
9a98a854 7297
1e6feb95
VZ
7298if test "$wxUSE_METAFILE" = "yes"; then
7299 AC_DEFINE(wxUSE_METAFILE)
c11584af
RR
7300fi
7301
1e6feb95
VZ
7302if test "$wxUSE_MIMETYPE" = "yes"; then
7303 AC_DEFINE(wxUSE_MIMETYPE)
9a98a854
VZ
7304fi
7305
7306if test "$wxUSE_MINIFRAME" = "yes"; then
ce4169a4 7307 AC_DEFINE(wxUSE_MINIFRAME)
9a98a854
VZ
7308fi
7309
4199367e
VZ
7310if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
7311 AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
4f167b46
VZ
7312fi
7313
7314if test "$wxUSE_TASKBARICON" = "yes"; then
7315 AC_DEFINE(wxUSE_TASKBARICON)
7316 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar"
5526e819
VS
7317fi
7318
4199367e 7319
9a98a854 7320if test "$wxUSE_VALIDATORS" = "yes"; then
ce4169a4
RR
7321 AC_DEFINE(wxUSE_VALIDATORS)
7322 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
9a98a854
VZ
7323fi
7324
d275c7eb 7325if test "$wxUSE_PALETTE" = "yes" ; then
f321ab7f
VS
7326 if test "$wxUSE_DFB" = 1; then
7327 AC_MSG_WARN([wxPalette not yet supported under DFB... disabled])
7328 wxUSE_PALETTE=no
7329 else
7330 AC_DEFINE(wxUSE_PALETTE)
7331 fi
d275c7eb
VZ
7332fi
7333
4199367e
VZ
7334if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then
7335 dnl Must be done this late because -lunicows must be before all the other libs
7336 LIBS=" -lunicows $LIBS"
0046ff7c
VS
7337fi
7338
5d7836c4
JS
7339USE_RICHTEXT=0
7340if test "$wxUSE_RICHTEXT" = "yes"; then
7341 AC_DEFINE(wxUSE_RICHTEXT)
7342 USE_RICHTEXT=1
7343 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS richtext"
7344fi
7345
3544f421
SL
7346USE_WEB=0
7347if test "$wxUSE_WEB" = "yes"; then
7348 AC_DEFINE(wxUSE_WEB)
7349 USE_WEB=1
7350 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS web"
ea179539
SL
7351
7352 if test "$wxUSE_WEBVIEW_WEBKIT" = "yes" -a "$wxUSE_GTK" = 1; then
7353 AC_DEFINE(wxUSE_WEBVIEW_WEBKIT)
7354 AC_MSG_CHECKING([for webkitgtk libraries])
7355 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],webkitgtk-1.0)
7356 if test "$ac_find_libraries" != "" ; then
7357 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
7358 if test "$ac_path_to_link" != " -L/usr/lib" ; then
7359 LDFLAGS="$LDFLAGS $ac_path_to_link"
7360 fi
7361 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lwebkitgtk-1.0"
7362 AC_MSG_RESULT([yes])
7363 else
7364 AC_MSG_RESULT([no])
7365 AC_MSG_WARN([libwebkitgtk-1.0 not found; disabling webkit backend])
7366 wxUSE_WEBVIEW_WEBKIT="no"
7367 fi
7368
7369 AC_MSG_CHECKING(for webkitgtk includes)
7370 WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /usr/include/webkit-1.0], webkit/webkit.h)
7371 if test "$ac_find_includes" != "" ; then
7372 AC_MSG_RESULT(found in $ac_find_includes)
7373 WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
7374 CPPFLAGS="$ac_path_to_include $CPPFLAGS"
7375 else
7376 AC_MSG_RESULT([not found])
7377 fi
7378 dnl we also depend on libsoup
7379 AC_MSG_CHECKING(for libsoup includes)
7380 WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /usr/include/libsoup-2.4], libsoup/soup.h)
7381 if test "$ac_find_includes" != "" ; then
7382 AC_MSG_RESULT(found in $ac_find_includes)
7383 WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
7384 CPPFLAGS="$ac_path_to_include $CPPFLAGS"
7385 else
7386 AC_MSG_RESULT([not found])
7387 fi
7388 fi
66243a8e
SL
7389
7390 if test "$wxUSE_WEBVIEW_WEBKIT" = "yes" -a "$wxUSE_MAC" = 1 -a "$USE_DARWIN" = 1; then
7391 old_CPPFLAGS="$CPPFLAGS"
7392 CPPFLAGS="-x objective-c++ $CPPFLAGS"
7393 AC_CHECK_HEADER([WebKit/HIWebView.h],
7394 [
7395 AC_DEFINE(wxUSE_WEBVIEW_WEBKIT)
7396 WEBKIT_LINK="-framework WebKit"
7397 ],
7398 [
7399 AC_MSG_WARN([WebKit headers not found; disabling wxWebView WebKit])
7400 wxUSE_WEBVIEW_WEBKIT=no
7401 ],
7402 [
7403 #include <Carbon/Carbon.h>
7404 #include <WebKit/WebKit.h>
7405 ])
7406 CPPFLAGS="$old_CPPFLAGS"
7407 elif test "$wxUSE_OLD_COCOA" = 1; then
7408 AC_DEFINE(wxUSE_WEBVIEW_WEBKIT)
7409 else
7410 wxUSE_WEBVIEW_WEBKIT=no
7411 fi
3544f421
SL
7412fi
7413
4199367e
VZ
7414dnl ---------------------------------------------------------------------------
7415dnl wxImage options
7416dnl ---------------------------------------------------------------------------
0940bcf7 7417
4199367e
VZ
7418if test "$wxUSE_IMAGE" = "yes" ; then
7419 AC_DEFINE(wxUSE_IMAGE)
0940bcf7 7420
4199367e
VZ
7421 if test "$wxUSE_GIF" = "yes" ; then
7422 AC_DEFINE(wxUSE_GIF)
7423 fi
4b6b4dfc 7424
4199367e
VZ
7425 if test "$wxUSE_PCX" = "yes" ; then
7426 AC_DEFINE(wxUSE_PCX)
7427 fi
0940bcf7 7428
bb9e79c0
VZ
7429 if test "$wxUSE_TGA" = "yes" ; then
7430 AC_DEFINE(wxUSE_TGA)
7431 fi
7432
4199367e
VZ
7433 if test "$wxUSE_IFF" = "yes" ; then
7434 AC_DEFINE(wxUSE_IFF)
7435 fi
0046ff7c 7436
4199367e
VZ
7437 if test "$wxUSE_PNM" = "yes" ; then
7438 AC_DEFINE(wxUSE_PNM)
7439 fi
658974ae 7440
4199367e
VZ
7441 if test "$wxUSE_XPM" = "yes" ; then
7442 AC_DEFINE(wxUSE_XPM)
7443 fi
7444
7445 if test "$wxUSE_ICO_CUR" = "yes" ; then
7446 AC_DEFINE(wxUSE_ICO_CUR)
7447 fi
a72a4bfa
VS
7448fi
7449
1e6feb95 7450dnl ---------------------------------------------------------------------------
4199367e 7451dnl common dialogs
1e6feb95
VZ
7452dnl ---------------------------------------------------------------------------
7453
319c5ed4
VZ
7454if test "$wxUSE_ABOUTDLG" = "yes"; then
7455 AC_DEFINE(wxUSE_ABOUTDLG)
7456fi
7457
1e6feb95
VZ
7458if test "$wxUSE_CHOICEDLG" = "yes"; then
7459 AC_DEFINE(wxUSE_CHOICEDLG)
7460fi
7461
7462if test "$wxUSE_COLOURDLG" = "yes"; then
7463 AC_DEFINE(wxUSE_COLOURDLG)
7464fi
7465
7466if test "$wxUSE_FILEDLG" = "yes"; then
7467 AC_DEFINE(wxUSE_FILEDLG)
7468fi
7469
8db37e06
VZ
7470if test "$wxUSE_FINDREPLDLG" = "yes"; then
7471 AC_DEFINE(wxUSE_FINDREPLDLG)
7472fi
7473
1e6feb95
VZ
7474if test "$wxUSE_FONTDLG" = "yes"; then
7475 AC_DEFINE(wxUSE_FONTDLG)
7476fi
7477
7478if test "$wxUSE_DIRDLG" = "yes"; then
ae1daed0
JS
7479 if test "$wxUSE_TREECTRL" != "yes"; then
7480 AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
1e6feb95 7481 else
ae1daed0 7482 AC_DEFINE(wxUSE_DIRDLG)
1e6feb95
VZ
7483 fi
7484fi
7485
7486if test "$wxUSE_MSGDLG" = "yes"; then
7487 AC_DEFINE(wxUSE_MSGDLG)
7488fi
7489
7490if test "$wxUSE_NUMBERDLG" = "yes"; then
7491 AC_DEFINE(wxUSE_NUMBERDLG)
7492fi
7493
7494if test "$wxUSE_PROGRESSDLG" = "yes"; then
b0b81bc9 7495 AC_DEFINE(wxUSE_PROGRESSDLG)
1e6feb95
VZ
7496fi
7497
cbca9943
VZ
7498if test "$wxUSE_SPLASH" = "yes"; then
7499 AC_DEFINE(wxUSE_SPLASH)
2057db16 7500 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splash"
cbca9943
VZ
7501fi
7502
1e6feb95 7503if test "$wxUSE_STARTUP_TIPS" = "yes"; then
b0b81bc9 7504 AC_DEFINE(wxUSE_STARTUP_TIPS)
1e6feb95
VZ
7505fi
7506
7507if test "$wxUSE_TEXTDLG" = "yes"; then
7508 AC_DEFINE(wxUSE_TEXTDLG)
7509fi
7510
b1f5d087
VZ
7511if test "$wxUSE_WIZARDDLG" = "yes"; then
7512 AC_DEFINE(wxUSE_WIZARDDLG)
7513 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard"
7514fi
7515
6517fa86
VZ
7516dnl ---------------------------------------------------------------------------
7517dnl options used under wxMSW and wxPM
7518dnl ---------------------------------------------------------------------------
7519
7520if test "$wxUSE_MSW" = 1 -o "$wxUSE_PM" = 1; then
7521 if test "$wxUSE_OWNER_DRAWN" = "yes"; then
7522 AC_DEFINE(wxUSE_OWNER_DRAWN)
7523 fi
7524fi
7525
5d18e029
VZ
7526dnl ---------------------------------------------------------------------------
7527dnl wxMSW-only options
7528dnl ---------------------------------------------------------------------------
7529
7530if test "$wxUSE_MSW" = 1 ; then
7531
91a5e00c
VS
7532 if test "$wxUSE_DC_CACHEING" = "yes"; then
7533 AC_DEFINE(wxUSE_DC_CACHEING)
7534 fi
5d18e029 7535
91a5e00c
VS
7536 if test "$wxUSE_DIB" = "yes"; then
7537 AC_DEFINE(wxUSE_WXDIB)
7538 fi
508d12b2 7539
91a5e00c
VS
7540 if test "$wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW" = "yes"; then
7541 AC_DEFINE(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
7542 fi
6fdf2acc 7543
91a5e00c
VS
7544 if test "$wxUSE_UXTHEME" = "yes"; then
7545 AC_DEFINE(wxUSE_UXTHEME)
7546 fi
f77c0fe3 7547
0295153c 7548fi
91a5e00c 7549dnl wxUSE_MSW = 1
75a29ef1
VZ
7550
7551dnl not quite MSW-only although mostly useful to disable this under MSW
7552if test "$wxUSE_AUTOID_MANAGEMENT" = "yes"; then
7553 AC_DEFINE(wxUSE_AUTOID_MANAGEMENT)
7554fi
0295153c 7555
91a5e00c
VS
7556if test "$USE_WIN32" = 1 ; then
7557 if test "$wxUSE_INICONF" = "yes"; then
7558 AC_DEFINE(wxUSE_INICONF)
7559 fi
f77c0fe3 7560
91a5e00c
VS
7561 if test "$wxUSE_REGKEY" = "yes"; then
7562 AC_DEFINE(wxUSE_REGKEY)
7563 fi
5d18e029 7564fi
91a5e00c 7565dnl USE_WIN32 = 1
5d18e029 7566
64b75e64
RD
7567dnl ---------------------------------------------------------------------------
7568dnl wxGraphicsContext
7569dnl ---------------------------------------------------------------------------
7570
a12bd55b
VZ
7571dnl Under Mac we don't even provide --enable-graphics_ctx switch as we always
7572dnl need it -- but because we don't have the option, wxUSE_GRAPHICS_CONTEXT is
7573dnl not defined automatically and we need to do it ourselves
84b20415 7574if test "$wxUSE_MAC" = 1; then
a12bd55b 7575 wxUSE_GRAPHICS_CONTEXT="yes"
84b20415
SC
7576fi
7577
64b75e64 7578if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then
a12bd55b
VZ
7579 wx_has_graphics=0
7580 if test "$wxUSE_MSW" = 1; then
7581 AC_CACHE_CHECK([if GDI+ is available], wx_cv_lib_gdiplus,
7582 [
7583 dnl we need just the header, not the library, as we load the
7584 dnl GDI+ DLL dynamically anyhow during run-time
7585 AC_LANG_PUSH(C++)
7586 AC_TRY_COMPILE(
cde23b64
VZ
7587 [#include <windows.h>
7588 #include <gdiplus.h>],
a12bd55b
VZ
7589 [
7590 using namespace Gdiplus;
7591 ],
7592 wx_cv_lib_gdiplus=yes,
7593 wx_cv_lib_gdiplus=no
7594 )
7595 AC_LANG_POP()
7596 ]
7597 )
7598 if test "$wx_cv_lib_gdiplus" = "yes"; then
7599 wx_has_graphics=1
7600 fi
711a4812 7601 elif test "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
a12bd55b
VZ
7602 PKG_CHECK_MODULES(CAIRO, cairo,
7603 [wx_has_graphics=1],
7604 [AC_MSG_WARN([Cairo library not found])]
7605 )
711a4812 7606 if test "$wx_has_graphics" = 1; then
6d2139e8
VZ
7607 dnl Check that Cairo library is new enough: wxGraphicsContext
7608 dnl won't compile without cairo_push_group() and
7609 dnl cairo_pop_group_to_source() which are new in 1.2.
7610 save_LIBS="$LIBS"
7611 LIBS="$LIBS $CAIRO_LIBS"
7612 AC_CHECK_FUNCS([cairo_push_group])
7613 LIBS="$save_LIBS"
7614 if test "$ac_cv_func_cairo_push_group" = "no"; then
7615 wx_has_graphics=0
7616 AC_MSG_WARN([Cairo library is too old and misses cairo_push_group()])
7617 else
7618 AC_DEFINE(wxUSE_CAIRO)
711a4812 7619
6d2139e8
VZ
7620 dnl We don't need to do this for wxGTK as we already get Cairo
7621 dnl flags as part of GTK+ ones.
7622 if test "$wxUSE_GTK" != 1; then
7623 CPPFLAGS="$CAIRO_CFLAGS $CPPFLAGS"
7624 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $CAIRO_LIBS"
7625 fi
711a4812
VZ
7626 fi
7627 fi
a12bd55b
VZ
7628 else
7629 dnl assume it's ok, add more checks here if needed
7630 wx_has_graphics=1
7631 fi
7632
7633 if test "$wx_has_graphics" = 1; then
7634 AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)
7635 else
7636 AC_MSG_WARN([wxGraphicsContext won't be available])
7637 fi
64b75e64
RD
7638fi
7639
ce756cb0 7640dnl ---------------------------------------------------------------------------
5ff751d6 7641dnl wxMediaCtrl
ce756cb0
RN
7642dnl ---------------------------------------------------------------------------
7643
557002cf
VZ
7644USE_MEDIA=0
7645
f03637a2 7646if test "$wxUSE_MEDIACTRL" = "yes" -o "$wxUSE_MEDIACTRL" = "auto"; then
2f6c5bb5
VZ
7647 USE_MEDIA=1
7648
ce756cb0 7649 dnl -----------------------------------------------------------------------
5ff751d6 7650 dnl GStreamer
ce756cb0
RN
7651 dnl -----------------------------------------------------------------------
7652 if test "$wxUSE_GTK" = 1; then
122ff921 7653 wxUSE_GSTREAMER="no"
5ff751d6 7654
dae87f93 7655 dnl -------------------------------------------------------------------
557002cf
VZ
7656 dnl Test for at least 0.8 gstreamer module from pkg-config
7657 dnl Even totem doesn't accept 0.9 evidently.
7658 dnl
7659 dnl So, we first check to see if 0.10 if available - if not we
7660 dnl try the older 0.8 version
dae87f93 7661 dnl -------------------------------------------------------------------
557002cf
VZ
7662 GST_VERSION_MAJOR=0
7663 GST_VERSION_MINOR=10
2f6c5bb5 7664 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
557002cf
VZ
7665
7666 if test "$wxUSE_GSTREAMER8" = "no"; then
2f6c5bb5
VZ
7667 PKG_CHECK_MODULES(GST,
7668 [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION gconf-2.0],
7669 [
7670 wxUSE_GSTREAMER="yes"
7671 GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
7672 ],
7673 [
7674 AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
557002cf 7675 GST_VERSION_MINOR=8
2f6c5bb5
VZ
7676 ]
7677 )
7678 else
7679 dnl check only for 0.8
557002cf 7680 GST_VERSION_MINOR=8
dae87f93 7681 fi
5ff751d6 7682
2f6c5bb5
VZ
7683 if test $GST_VERSION_MINOR = "8"; then
7684 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
7685 PKG_CHECK_MODULES(GST,
7686 [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION],
7687 wxUSE_GSTREAMER="yes",
557002cf 7688 [
2f6c5bb5 7689 AC_MSG_WARN([GStreamer 0.8/0.10 not available.])
557002cf 7690 ])
ce756cb0 7691 fi
5ff751d6 7692
557002cf 7693
ce756cb0 7694 if test "$wxUSE_GSTREAMER" = "yes"; then
122ff921 7695 CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
105a81f3 7696 EXTRALIBS_MEDIA="$GST_LIBS"
122ff921 7697
dae87f93 7698 AC_DEFINE(wxUSE_GSTREAMER)
2f6c5bb5
VZ
7699 else
7700 USE_MEDIA=0
ce756cb0
RN
7701 fi
7702 fi
2f6c5bb5
VZ
7703
7704 if test $USE_MEDIA = 1; then
7705 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
7706 AC_DEFINE(wxUSE_MEDIACTRL)
f03637a2
FM
7707 else
7708 if test "$wxUSE_MEDIACTRL" = "yes"; then
7709 AC_MSG_ERROR([GStreamer not available])
7710 else
7711 dnl was set to 'auto'
7712 AC_MSG_WARN([GStreamer not available... disabling wxMediaCtrl])
7713 fi
2f6c5bb5 7714 fi
ce756cb0
RN
7715fi
7716
bdc72a22 7717dnl ---------------------------------------------------------------------------
db1d0193 7718dnl get the string with OS info - used by wxGetOsDescription() on MacOS X
bdc72a22
VZ
7719dnl ---------------------------------------------------------------------------
7720
6ab6fc6e 7721if test "$cross_compiling" != "no"; then
32832908
VZ
7722 dnl Use best guess from host as we can't use uname when cross compiling
7723 OSINFO="\"$host\""
7724else
7725 dnl attualy work out OS version
7726 OSINFO=`uname -s -r -m`
7727 OSINFO="\"$OSINFO\""
7728fi
7729
bdc72a22
VZ
7730AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
7731
7e67ed0d
VZ
7732dnl ---------------------------------------------------------------------------
7733dnl define the variable containing the installation prefix (used in dcpsg.cpp)
7734dnl ---------------------------------------------------------------------------
7735
06dda230
VZ
7736if test "x$prefix" != "xNONE"; then
7737 wxPREFIX=$prefix
7738else
7739 wxPREFIX=$ac_default_prefix
7740fi
7741
7742AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
7e67ed0d 7743
edd891e2
VS
7744
7745dnl ---------------------------------------------------------------------------
7746dnl define variables with all built libraries for wx-config
7747dnl ---------------------------------------------------------------------------
7748
bd630206
VZ
7749STD_BASE_LIBS="base"
7750STD_GUI_LIBS=""
7751BUILT_WX_LIBS="base"
1e6b2edf 7752ALL_WX_LIBS="xrc stc gl media qa html adv core xml net base"
edd891e2 7753
bd630206
VZ
7754if test "$wxUSE_SOCKETS" = "yes" ; then
7755 STD_BASE_LIBS="net $STD_BASE_LIBS"
7756 BUILT_WX_LIBS="net $BUILT_WX_LIBS"
edd891e2 7757fi
bd630206
VZ
7758if test "$wxUSE_XML" = "yes" ; then
7759 STD_BASE_LIBS="xml $STD_BASE_LIBS"
7760 BUILT_WX_LIBS="xml $BUILT_WX_LIBS"
54429bb3 7761fi
edd891e2 7762
bd630206
VZ
7763if test "$wxUSE_GUI" = "yes"; then
7764 STD_GUI_LIBS="adv core"
6534efcf 7765 BUILT_WX_LIBS="$STD_GUI_LIBS $BUILT_WX_LIBS"
bd630206
VZ
7766
7767 if test "$wxUSE_DEBUGREPORT" = "yes" ; then
7768 STD_GUI_LIBS="qa $STD_GUI_LIBS"
7769 BUILT_WX_LIBS="qa $BUILT_WX_LIBS"
7770 fi
bd630206
VZ
7771 if test "$wxUSE_HTML" = "yes" ; then
7772 STD_GUI_LIBS="html $STD_GUI_LIBS"
7773 BUILT_WX_LIBS="html $BUILT_WX_LIBS"
7774 fi
7775 if test "$wxUSE_MEDIACTRL" = "yes" ; then
7776 BUILT_WX_LIBS="media $BUILT_WX_LIBS"
7777 fi
7778 if test "$wxUSE_OPENGL" = "yes" ; then
7779 BUILT_WX_LIBS="gl $BUILT_WX_LIBS"
7780 fi
7781 if test "$wxUSE_AUI" = "yes" ; then
7782 BUILT_WX_LIBS="aui $BUILT_WX_LIBS"
7783 fi
1c4293cb
VZ
7784 if test "$wxUSE_PROPGRID" = "yes" ; then
7785 BUILT_WX_LIBS="propgrid $BUILT_WX_LIBS"
7786 fi
3c3ead1d
PC
7787 if test "$wxUSE_RIBBON" = "yes" ; then
7788 BUILT_WX_LIBS="ribbon $BUILT_WX_LIBS"
7789 fi
d8a4a85e
VZ
7790 if test "$wxUSE_RICHTEXT" = "yes" ; then
7791 BUILT_WX_LIBS="richtext $BUILT_WX_LIBS"
7792 fi
bd630206
VZ
7793 if test "$wxUSE_STC" = "yes" ; then
7794 BUILT_WX_LIBS="stc $BUILT_WX_LIBS"
7795 fi
3544f421
SL
7796 if test "$wxUSE_WEB" = "yes" ; then
7797 STD_GUI_LIBS="web $STD_GUI_LIBS"
7798 BUILT_WX_LIBS="web $BUILT_WX_LIBS"
7799 fi
bd630206
VZ
7800 if test "$wxUSE_XRC" = "yes" ; then
7801 STD_GUI_LIBS="xrc $STD_GUI_LIBS"
7802 BUILT_WX_LIBS="xrc $BUILT_WX_LIBS"
7803 fi
57e7d4ac
VS
7804fi
7805
bd630206
VZ
7806AC_SUBST(ALL_WX_LIBS)
7807AC_SUBST(BUILT_WX_LIBS)
7808AC_SUBST(STD_BASE_LIBS)
7809AC_SUBST(STD_GUI_LIBS)
edd891e2 7810
9a98a854
VZ
7811dnl ---------------------------------------------------------------------------
7812dnl Output the makefiles and such from the results found above
7813dnl ---------------------------------------------------------------------------
7814
8006bf3c 7815dnl all additional libraries (except wxWidgets itself) we link with
d4fbe1d8 7816EXTRA_FRAMEWORKS=
f11bdd03 7817if test "$wxUSE_MAC" = 1 ; then
5dcf30a0 7818 if test "$USE_DARWIN" = 1; then
2c90dc31 7819 if test "$wxUSE_OSX_IPHONE" = 1; then
32d246ce 7820 EXTRA_FRAMEWORKS="-framework IOKit -framework UIKit -framework CFNetwork -framework AudioToolbox -framework CoreFoundation -framework CoreGraphics -framework OpenGLES -framework Foundation -framework QuartzCore"
2c90dc31
JS
7821 else
7822 EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime"
7823 fi
5dcf30a0 7824 fi
b4085ce6 7825fi
f10f4c87 7826if test "$wxUSE_OLD_COCOA" = 1 ; then
d4fbe1d8 7827 EXTRA_FRAMEWORKS="-framework IOKit -framework Cocoa"
4fc81cbc 7828 if test "$wxUSE_MEDIACTRL" = "yes"; then
d4fbe1d8 7829 EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework QuickTime"
4fc81cbc 7830 fi
ac0c4cc3 7831fi
f10f4c87 7832if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_OLD_COCOA" != 1 ; then
d4fbe1d8 7833 EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices"
19b27e78 7834fi
3a922bb4 7835
d4fbe1d8
VZ
7836LDFLAGS="$LDFLAGS $EXTRA_FRAMEWORKS"
7837WXCONFIG_LDFLAGS="$WXCONFIG_LDFLAGS $EXTRA_FRAMEWORKS"
7838
2b5f62a0
VZ
7839LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS"
7840
e90c1d2a 7841if test "$wxUSE_GUI" = "yes"; then
3d63bc3a 7842
3a922bb4
RL
7843 dnl TODO add checks that these samples will really compile (i.e. all the
7844 dnl library features they need are present)
7845
8bce5cda
MW
7846 dnl TODO some samples are never built so far: mfc (requires VC++)
7847 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs drawing \
840b9ff5 7848 erase event exec font image minimal render \
6f58b8f4 7849 shaped svg taborder vscroll widgets wrapsizer"
b625909c
VS
7850
7851 if test "$wxUSE_MONOLITHIC" != "yes"; then
7852 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console"
7853 fi
0b78747f 7854 if test "$TOOLKIT" = "MSW"; then
8bce5cda
MW
7855 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS regtest"
7856 if test "$wxUSE_UNIVERSAL" != "yes"; then
61aba460 7857 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw nativdlg dll"
8bce5cda
MW
7858 fi
7859 fi
7860 if test "$TOOLKIT" = "PM" -a "$wxUSE_UNIVERSAL" != "yes"; then
7861 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw"
0b78747f 7862 fi
3a922bb4
RL
7863else
7864 SAMPLES_SUBDIRS="console"
2804f77d
VZ
7865 if test "$wxUSE_SOCKETS" = "yes" ; then
7866 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
7867 fi
ebe887ed
VZ
7868 if test "$wxUSE_IPC" = "yes" ; then
7869 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc"
7870 fi
e90c1d2a 7871fi
9a98a854 7872
8e877c19 7873
77ffb593 7874dnl C/C++ compiler options used to compile wxWidgets
17a1ebd1
VZ
7875dnl
7876dnl check for icc before gcc as icc is also recognized as gcc
48f625bc 7877if test "x$INTELCC" = "xyes" ; then
17a1ebd1
VZ
7878 dnl Warnings which can't be easily suppressed in C code are disabled:
7879 dnl
5c69ef61
VZ
7880 dnl #810: conversion from "x" to "y" may lose significant bits
7881 dnl #869: parameter "foo" was never referenced
7882 dnl #1572: floating-point equality and inequality comparisons
7883 dnl are unreliable
7884 dnl #1684: conversion from pointer to same-sized integral type
7885 dnl #2259: non-pointer conversion from "x" to "y" may lose significant
7886 dnl bits
7887 CWARNINGS="-Wall -wd810,869,981,1418,1572,1684,2259"
17a1ebd1 7888elif test "$GCC" = yes ; then
6ebeb4c7 7889 CWARNINGS="-Wall -Wundef"
17a1ebd1
VZ
7890fi
7891
48f625bc 7892if test "x$INTELCXX" = "xyes" ; then
17a1ebd1
VZ
7893 dnl Intel compiler gives some warnings which simply can't be worked
7894 dnl around or of which we have too many (810, 869) so it's impractical to
7895 dnl keep them enabled even if in theory it would be nice and some others
7896 dnl (279) are generated for standard macros and so there is nothing we can
7897 dnl do about them
7898 dnl
5c69ef61
VZ
7899 dnl #279: controlling expression is constant
7900 dnl #383: value copied to temporary, reference to temporary used
7901 dnl #444: destructor for base class "xxx" is not virtual
7902 dnl #981: operands are evaluated in unspecified order
7903 dnl #1418: external definition with no prior declaration
7904 dnl #1419: external declaration in primary source file
7905 dnl #1881: argument must be a constant null pointer value
7906 dnl
7907 dnl (for others see CWARNINGS above)
7908 CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419,1881,2259"
17a1ebd1 7909elif test "$GXX" = yes ; then
e4161a2a 7910 CXXWARNINGS="-Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy"
41148443 7911 AX_CXXFLAGS_GCC_OPTION(-Woverloaded-virtual, CXXWARNINGS)
2ad61b03
VZ
7912
7913 dnl when building under Mac we currently get hundreds of deprecation
7914 dnl warnings for Carbon symbols from the standard headers -- disable them
7915 dnl as we already know that they're deprecated and nothing else can be seen
7916 dnl with these warnings on
7917 if test "$wxUSE_MAC" = 1 ; then
7918 CXXWARNINGS="$CXXWARNINGS -Wno-deprecated-declarations"
7919 fi
fddeb06b
VS
7920fi
7921
fddeb06b 7922
5ff751d6
VZ
7923dnl combine everything together and remove the extra white space while doing it
7924WXCONFIG_CFLAGS=`echo $WXCONFIG_CFLAGS`
7925WXCONFIG_CXXFLAGS=`echo $WXCONFIG_CFLAGS $WXCONFIG_CXXFLAGS`
7926
7927
7928dnl add -I options we use during library compilation
7929dnl
7930dnl note that the order is somewhat important: wxWidgets headers should
7931dnl come first and the one with setup.h should be before $(top_srcdir)/include
7932dnl in case the latter contains setup.h used by non-autoconf makefiles (e.g.
7933dnl CodeWarrior):
c92ad099 7934CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \
6589dc98 7935 -I\\${wx_top_builddir}/lib/wx/include/${TOOLCHAIN_FULLNAME} \
c92ad099
VZ
7936 -I\\${top_srcdir}/include $TOOLKIT_INCLUDE \
7937 $CPPFLAGS `
5ff751d6 7938
8aeeb05c 7939C_AND_CXX_FLAGS="$DEBUG_CFLAGS $PROFILE_FLAGS $OPTIMISE_CFLAGS"
c92ad099 7940CFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $CFLAGS `
b1b592ad 7941CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $C_AND_CXX_FLAGS $CXXFLAGS `
584f0a5d
DE
7942OBJCFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $OBJCFLAGS `
7943OBJCXXFLAGS=`echo $WXCONFIG_CXXFLAGS $C_AND_CXX_FLAGS $OBJCXXFLAGS `
5ff751d6
VZ
7944
7945dnl now that we added WXCONFIG_CPPFLAGS to CPPFLAGS we can add the wx-config
7946dnl only stuff to it
7947WXCONFIG_CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $WXCONFIG_ONLY_CPPFLAGS`
7948
6ebeb4c7 7949
95986553
DE
7950if test "x$MWCC" = "xyes"; then
7951 dnl Correct MW 8.3 to be more similar to GCC. In particular we
7952 dnl must use <regex.h> from system not our local copy on OS X,
7953 dnl but must use local not system on OS 9.
7954 dnl The following should make all -I paths usable for <> includes
7955 dnl while first checking in real system paths. With 8.3 using
7956 dnl -gccincludes it will actually check local paths before system
7957 dnl even for <> which is totally wrong.
7958
7959 dnl Note that because this absolutely needs to be before any -I
7960 dnl that we have to tack it on to the end of the compiler commandline.
7961 CC="$CC -cwd source -I-"
7962 CXX="$CXX -cwd source -I-"
7963fi
7964
fddeb06b 7965
0c3c69fc 7966LIBS=`echo $LIBS`
c74dc163 7967EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS"
672abd7a 7968EXTRALIBS_XML="$EXPAT_LINK"
3527f29c 7969EXTRALIBS_HTML="$MSPACK_LINK"
2f8711ed 7970EXTRALIBS_MEDIA="$GST_LIBS"
89b1afb4 7971EXTRALIBS_STC="-lwxscintilla${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
c74dc163 7972if test "$wxUSE_GUI" = "yes"; then
2f8711ed 7973 EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $WEBKIT_LINK $EXTRALIBS_HILDON $EXTRALIBS_GNOMEVFS $EXTRALIBS_GNOMEPRINT`
c74dc163 7974fi
34b08d2c
VS
7975if test "$wxUSE_OPENGL" = "yes"; then
7976 EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS"
7977fi
fddeb06b 7978
8aeeb05c 7979LDFLAGS="$LDFLAGS $PROFILE_FLAGS"
f6bcfd97 7980
5ff751d6 7981WXCONFIG_LIBS="$LIBS"
67c13b6c
VS
7982
7983dnl wx-config must output builtin 3rd party libs in --libs in static build:
7984if test "$wxUSE_REGEX" = "builtin" ; then
74802184 7985 wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty"
67c13b6c
VS
7986fi
7987if test "$wxUSE_EXPAT" = "builtin" ; then
74802184 7988 wxconfig_3rdparty="expat $wxconfig_3rdparty"
67c13b6c 7989fi
67c13b6c 7990if test "$wxUSE_LIBTIFF" = "builtin" ; then
74802184 7991 wxconfig_3rdparty="tiff $wxconfig_3rdparty"
67c13b6c
VS
7992fi
7993if test "$wxUSE_LIBJPEG" = "builtin" ; then
74802184 7994 wxconfig_3rdparty="jpeg $wxconfig_3rdparty"
67c13b6c
VS
7995fi
7996if test "$wxUSE_LIBPNG" = "builtin" ; then
74802184 7997 wxconfig_3rdparty="png $wxconfig_3rdparty"
67c13b6c
VS
7998fi
7999if test "$wxUSE_ZLIB" = "builtin" ; then
74802184 8000 wxconfig_3rdparty="zlib $wxconfig_3rdparty"
bb41dcbe 8001fi
67c13b6c
VS
8002
8003for i in $wxconfig_3rdparty ; do
89b1afb4 8004 WXCONFIG_LIBS="-lwx${i}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS"
67c13b6c
VS
8005done
8006
8007
fe0895cf
VS
8008if test "x$wxUSE_UNIVERSAL" = "xyes" ; then
8009 WXUNIV=1
4353a8df
VZ
8010
8011 case "$wxUNIV_THEMES" in
8012 ''|all)
8013 AC_DEFINE(wxUSE_ALL_THEMES)
8014 ;;
8015
8016 *)
435a5ad0 8017 for t in `echo $wxUNIV_THEMES | tr , ' ' | tr '[[a-z]]' '[[A-Z]]'`; do
4353a8df
VZ
8018 AC_DEFINE_UNQUOTED(wxUSE_THEME_$t)
8019 done
8020 esac
fe0895cf
VS
8021else
8022 WXUNIV=0
8023fi
8024
8025AC_SUBST(wxUSE_ZLIB)
8026AC_SUBST(wxUSE_REGEX)
672abd7a 8027AC_SUBST(wxUSE_EXPAT)
fe0895cf
VS
8028AC_SUBST(wxUSE_LIBJPEG)
8029AC_SUBST(wxUSE_LIBPNG)
8030AC_SUBST(wxUSE_LIBTIFF)
8031
08b3ac36
VS
8032if test $wxUSE_MONOLITHIC = "yes" ; then
8033 MONOLITHIC=1
8034else
8035 MONOLITHIC=0
8036fi
fe0895cf 8037
f93ca9fd
VS
8038if test $wxUSE_PLUGINS = "yes" ; then
8039 USE_PLUGINS=1
8040else
8041 USE_PLUGINS=0
8042fi
8043
16358932
VZ
8044if test "$wxUSE_DEBUGREPORT" = "yes" ; then
8045 USE_QA=1
8046else
8047 USE_QA=0
8048fi
8049
029b47ad
VS
8050if test $wxUSE_OFFICIAL_BUILD = "yes" ; then
8051 OFFICIAL_BUILD=1
8052else
8053 OFFICIAL_BUILD=0
8054fi
8055
8ee2dd05
VS
8056AC_SUBST(VENDOR)
8057AC_SUBST(OFFICIAL_BUILD)
ceec2216
RL
8058AC_SUBST(WX_FLAVOUR)
8059AC_SUBST(WX_LIB_FLAVOUR)
8ee2dd05 8060
fe0895cf
VS
8061AC_SUBST(WXUNIV)
8062AC_SUBST(MONOLITHIC)
f93ca9fd 8063AC_SUBST(USE_PLUGINS)
cf615ebb 8064AC_SUBST(LIBS)
b1b592ad 8065AC_SUBST(CXXWARNINGS)
fe0895cf 8066AC_SUBST(EXTRALIBS)
672abd7a 8067AC_SUBST(EXTRALIBS_XML)
3527f29c 8068AC_SUBST(EXTRALIBS_HTML)
2f8711ed 8069AC_SUBST(EXTRALIBS_MEDIA)
c74dc163 8070AC_SUBST(EXTRALIBS_GUI)
34b08d2c 8071AC_SUBST(EXTRALIBS_OPENGL)
f93ca9fd 8072AC_SUBST(EXTRALIBS_SDL)
c1e81021 8073AC_SUBST(EXTRALIBS_STC)
f93ca9fd 8074AC_SUBST(WITH_PLUGIN_SDL)
bd8a7646 8075AC_SUBST(EXTRALIBS_GTKPRINT)
7c72311f 8076AC_SUBST(EXTRALIBS_GNOMEPRINT)
2b850ae1 8077AC_SUBST(EXTRALIBS_GNOMEVFS)
3565d135 8078AC_SUBST(EXTRALIBS_HILDON)
fe0895cf 8079AC_SUBST(UNICODE)
6c67131a
VS
8080AC_SUBST(DEBUG_INFO)
8081AC_SUBST(DEBUG_FLAG)
03773e40 8082TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr '[[A-Z]]' '[[a-z]]'`
fe0895cf
VS
8083AC_SUBST(TOOLKIT_LOWERCASE)
8084AC_SUBST(TOOLKIT_VERSION)
19beefa6
KO
8085AC_SUBST(DYLIB_RPATH_INSTALL)
8086AC_SUBST(DYLIB_RPATH_POSTLINK)
fe0895cf 8087AC_SUBST(SAMPLES_RPATH_FLAG)
516cf181 8088AC_SUBST(HEADER_PAD_OPTION)
ea66c762 8089AC_SUBST(HOST_SUFFIX)
670ec357
VS
8090AC_SUBST(CPPUNIT_CFLAGS)
8091AC_SUBST(CPPUNIT_LIBS)
fe0895cf 8092
4d4ff94c
VZ
8093case "$TOOLKIT" in
8094 GTK)
c2e9ada4 8095 TOOLKIT_DESC="GTK+"
88262190 8096 if test "$WXGTK2" = 1; then
c2e9ada4 8097 TOOLKIT_DESC="$TOOLKIT_DESC 2"
bd8a7646
RR
8098 if test "$wxUSE_GTKPRINT" = "yes" ; then
8099 TOOLKIT_EXTRA="$TOOLKIT_EXTRA GTK+ printing";
8100 fi
c2e9ada4
VZ
8101 if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then
8102 TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomeprint";
8103 fi
8104 if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
8105 TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomevfs"
8106 fi
8107 if test "$wxUSE_LIBHILDON" = "yes"; then
8108 TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon"
8109 fi
426d19f1
JS
8110 if test "$wxUSE_LIBHILDON2" = "yes"; then
8111 TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon"
8112 fi
c2e9ada4
VZ
8113
8114 if test "$TOOLKIT_EXTRA" != ""; then
8115 TOOLKIT_DESC="$TOOLKIT_DESC with support for `echo $TOOLKIT_EXTRA | tr -s ' '`"
8116 fi
4d4ff94c
VZ
8117 fi
8118 ;;
8119
c2e9ada4
VZ
8120 ?*)
8121 TOOLKIT_DESC=$TOOLKIT_LOWERCASE
8122 ;;
8123
4d4ff94c 8124 *)
c2e9ada4 8125 TOOLKIT_DESC="base only"
4d4ff94c
VZ
8126 ;;
8127esac
8128
fb00f58d
JS
8129if test "$wxUSE_WINE" = "yes"; then
8130 BAKEFILE_FORCE_PLATFORM=win32
8131fi
8132
a81d5bb6
MW
8133dnl gcc 3.4 has a pch bug which truncates wide character constants in headers.
8134dnl Hopefully for a non-unicode build there aren't any wide constants in
8135dnl headers, but for a unicode build it's best to disable pch.
8136if test "$wxUSE_UNICODE" = yes -a "$GCC" = yes -a "$bk_use_pch" != no
8137then
8138 AC_CACHE_CHECK(
8139 [for gcc precompiled header bug],
8140 [wx_cv_gcc_pch_bug],
8141 [[
6d952fd7
MW
8142 echo '#include <stdio.h>
8143 const wchar_t test_var[] = L"awidetest";' > conftest.h
8144
8145 echo '#include "conftest.h"
8146 int main()
8147 {
be49c6ec 8148 printf("%ls", test_var);
6d952fd7
MW
8149 return 0;
8150 }' > conftest.cpp
8151
8152 wx_cv_gcc_pch_bug="pch not supported"
a81d5bb6 8153
b2983f42 8154 if $CXX conftest.h >/dev/null 2>&1
a81d5bb6 8155 then
6d952fd7 8156 wx_cv_gcc_pch_bug=
a81d5bb6 8157
6c7f5e56 8158 if $CXX -o conftest$PROGRAM_EXT conftest.cpp >/dev/null 2>&1
a81d5bb6 8159 then
435a5ad0 8160 if tr -dc '[a-z]' < conftest$PROGRAM_EXT |
6c7f5e56 8161 grep awidetest >/dev/null
6d952fd7
MW
8162 then
8163 wx_cv_gcc_pch_bug=no
8164 else
a81d5bb6 8165 wx_cv_gcc_pch_bug=yes
6d952fd7 8166 fi
a81d5bb6
MW
8167 fi
8168 fi
8169
6c7f5e56 8170 rm -f conftest.h conftest.gch conftest.cpp conftest$PROGRAM_EXT
a81d5bb6
MW
8171 ]])
8172
8173 if test "$wx_cv_gcc_pch_bug" = yes; then
8174 dnl make the default for pch 'no'
8175 dnl further below check whether the user overrode and warn them
8176 bk_use_pch=no
8177 fi
8178fi
8179
564872cf 8180AC_BAKEFILE([m4_include(autoconf_inc.m4)])
fe0895cf 8181
ebda9490
VZ
8182dnl make install path absolute (if not already);
8183dnl will fail with (some) MSDOS paths
8184case ${INSTALL} in
8185 /* ) # Absolute
8186 ;;
8187 ?:* ) # Drive letter, considered as absolute.
8188 ;;
8189 *)
8190 INSTALL=`pwd`/${INSTALL} ;;
8191esac
8192
ecac5b81
VZ
8193if test "$wxUSE_GUI" = "yes"; then
8194
8195if test "$wxUSE_MSW" = 1 ; then
8196 if test "x$WINDRES" = "x"; then
8197 AC_MSG_ERROR([Required windres program not found])
8198 fi
8199
ef5dbede 8200 RESCOMP="$WINDRES"
ecac5b81
VZ
8201fi
8202
f10f4c87 8203if test "$wxUSE_MAC" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
ecac5b81
VZ
8204 dnl base name of the resource file for wxMac must be the same
8205 dnl as library installation base name (-install_name)
8206 WX_RESOURCES_MACOSX_ASCII="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.r"
8207 WX_RESOURCES_MACOSX_DATA="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.rsrc"
8208
8209 dnl add the resources target for wxMac
8210 LIBWXMACRES="\$(wx_top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}"
8211
8212 AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
8213
8214 MACSETFILE="\$(SETFILE)"
8215
8216 dnl resources are bundled both with shared library and applications
8217 dnl since the carb resource *must* be included in the application
2ea057f9 8218 if test "$wxUSE_OSX_CARBON" = 1; then
ecac5b81
VZ
8219 POSTLINK_COMMAND="\$(REZ) -d __DARWIN__ -t APPL Carbon.r -o"
8220 RESCOMP="$REZ"
8221 WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL Carbon.r -o"
8222 else
8223 POSTLINK_COMMAND="cat /dev/null | \$(REZ) -d __DARWIN__ -t APPL ${LIBWXMACRES}"
8224 RESCOMP="cat /dev/null \| $REZ"
8225 WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL \$libdir/$WX_RESOURCES_MACOSX_ASCII"
8226 fi
8227
8228else
8229 dnl default value is to (silently) do nothing in the makefile
8230 MACSETFILE="@true"
8231
8232 if test "$wxUSE_PM" = 1; then
8233 RESCOMP="emxbind"
8234 WXCONFIG_RESFLAGS="-ep"
8235
8236 dnl Is this one really used anywhere for pm?
8237 POSTLINK_COMMAND="$RESCOMP $WXCONFIG_RESFLAGS"
8238 else
8239 POSTLINK_COMMAND="@true"
8240 fi
8241fi
8242
8243fi
8244dnl wxUSE_GUI = 1
8245
8246
a81d5bb6
MW
8247dnl find out if the compiler supports PCH
8248dnl
8249dnl TODO: this should be in bakefile
8250if test $GCC_PCH = 1
8251then
8252 if test "$wx_cv_gcc_pch_bug" = yes; then
8253 AC_MSG_WARN([*** Precompiled header support is broken on this compiler])
8254 AC_MSG_WARN([*** --enable-precomp-headers is not recommended])
8255 AC_MSG_WARN([*** see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13361])
8256 fi
8257
584f0a5d
DE
8258 # Our WX_PRECOMP flag does not make sense for any language except C++ because
8259 # the headers that benefit from precompilation are mostly C++ headers.
8260 CXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
8261 # When Bakefile can do multi-language PCH (e.g. C++ and Objective-C++) enable this:
8262 #OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
a81d5bb6
MW
8263fi
8264
912c3932 8265dnl HACK ALERT!!
7afc46ab
KO
8266dnl For now, we need to alter bk-deps not to generate deps
8267dnl when we've configured a Universal binary build.
8268dnl The next version of Bakefile will have the correct fix for this
8269dnl at which time, this hack can be removed.
8270
8271if test "$wxUSE_MAC" = 1 ; then
95768535 8272 if test "x$wxUSE_UNIVERSAL_BINARY" != "xno" ; then
7afc46ab
KO
8273 sed "s/DEPSMODE=gcc/DEPSMODE=none/" < bk-deps > temp
8274 mv temp bk-deps
8275 chmod +x bk-deps
8276 fi
8277fi
8278
ceec2216 8279if test "$wxUSE_SHARED" = "yes"; then
73213bc3
SN
8280 dnl Need addtional flag on OS/2, so override bakefiles value
8281 dnl (there currently is no suitable variable to which the
8282 dnl missing flags could be added, AFAICS. SN, 18.12.2004. )
8283 case "${host}" in
8284 *-pc-os2_emx | *-pc-os2-emx )
8285 SHARED_LD_CC="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
8286 SHARED_LD_CXX="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
1e613d22
VZ
8287 cp -p ${srcdir}/src/os2/dllnames.sh .
8288 cp -p ${srcdir}/src/os2/dllar.sh .
73213bc3
SN
8289 ;;
8290 esac
ceec2216 8291fi
f47af52b
SN
8292if test "$wxUSE_OMF" = "yes"; then
8293 case "${host}" in
8294 *-pc-os2_emx | *-pc-os2-emx )
8295 LDFLAGS="$LDFLAGS -Zlinker /EXEPACK"
8296 LDFLAGS_GUI="-Zlinker /PMTYPE:PM"
8297 WXCONFIG_LDFLAGS_GUI="-Zlinker /PMTYPE:PM"
8298 ;;
8299 esac
8300fi
88e30f2b 8301
5ff751d6
VZ
8302dnl TOOLCHAIN_DEFS should be used for both wx and client code
8303WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS"
e694c22c 8304
8802d332
VZ
8305
8306dnl Sun cc is compatible with gcc and so either of them can use the C
8307dnl libraries built with the other, i.e. gcc can be used to build wxGTK under
8308dnl Solaris where GTK+ is compiled using cc and cc can be used under Linux
8309dnl where GTK+ is built with gcc
8310dnl
8311dnl However the compiler options are not compatible at all and in particular
8312dnl gcc doesn't like cc -mt option and cc doesn't like -pthread. We simply
8313dnl filter them out as we already have the correct options for multithreaded
8314dnl programs if we're using threads (and if we don't, it shouldn't matter)
8315case "${host}" in
8316 *-*-solaris2* )
8317 dnl system packages are compiled with Sun CC and so pkg-config outputs
8318 dnl CC-specific "-mt" flag, remove it when using gcc
efb8d630 8319 if test "$GCC" = yes; then
8802d332
VZ
8320 CPPFLAGS=`echo $CPPFLAGS | sed 's/-mt//'`
8321 LIBS=`echo $LIBS | sed 's/-mt//'`
8322 EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-mt//'`
8323 fi
8324 ;;
8325
8326 *-*-linux* )
8327 dnl OTOH when using Sun CC under Linux, the flags contain gcc-specific
8328 dnl -pthreads which Sun CC doesn't know about
8329 if test "x$SUNCXX" = xyes; then
8330 CPPFLAGS=`echo $CPPFLAGS | sed 's/-pthread//'`
8331 LIBS=`echo $LIBS | sed 's/-pthread//'`
8332 EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-pthread//'`
8333 fi
8334 ;;
8335esac
8336
0ff20b9f
VS
8337dnl Add visibility support flags to CFLAGS/CXXFLAGS - do it this late so that
8338dnl it doesn't affect compilation checks above
8339CFLAGS="$CFLAGS $CFLAGS_VISIBILITY"
8340CXXFLAGS="$CXXFLAGS $CXXFLAGS_VISIBILITY"
08f20edc
VZ
8341OBJCFLAGS="$OBJCFLAGS $CFLAGS_VISIBILITY"
8342OBJCXXFLAGS="$OBJCXXFLAGS $CXXFLAGS_VISIBILITY"
0ff20b9f 8343
70d1b3cf
VZ
8344dnl for convenience, sort the samples in alphabetical order
8345dnl
8346dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
8347dnl in this list - hence uniq. But normally, this shouldn't be needed!
d6a55c4b
VZ
8348dnl
8349dnl Unfortunately, there is a bug in OS/2's tr, such that
d51e8205
SN
8350dnl tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' '
8351dnl only removes the Unix-like part of the introduced line break.
8352SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`"
8353
ceec2216
RL
8354dnl subtle bakefile goop.
8355dnl Used in wx-config now too, as its STATIC_FLAG with different makeup.
8356dnl I wish we would have called it something less likely to clash with
8357dnl things though.
8358AC_SUBST(SHARED)
70d1b3cf 8359
9a98a854 8360dnl global options
cf615ebb
VS
8361AC_SUBST(WX_LIBRARY_BASENAME_NOGUI)
8362AC_SUBST(WX_LIBRARY_BASENAME_GUI)
2bffed64 8363
9a98a854 8364dnl toolkit options
dad6c0ea
VZ
8365AC_SUBST(USE_GUI)
8366AC_SUBST(AFMINSTALL)
2b5f62a0 8367AC_SUBST(WIN32INSTALL)
9a98a854 8368AC_SUBST(TOOLKIT)
9a98a854 8369AC_SUBST(TOOLKIT_DIR)
3a922bb4 8370AC_SUBST(TOOLCHAIN_NAME)
ceec2216 8371AC_SUBST(TOOLCHAIN_FULLNAME)
3a922bb4
RL
8372
8373dnl wx-config options
77e13408 8374AC_SUBST(host_alias)
3a922bb4 8375AC_SUBST(cross_compiling)
ceec2216
RL
8376AC_SUBST(WIDGET_SET)
8377AC_SUBST(WX_RELEASE)
8378AC_SUBST(WX_VERSION)
8379AC_SUBST(WX_SUBVERSION)
8380AC_SUBST(WX_CHARTYPE)
5ff751d6
VZ
8381
8382dnl note that in addition to the usual CPP/C/CXXFLAGS which are used for
8383dnl building the library itself, we also have WXCONFIG_-prefixed variants which
8384dnl are used when building the libraries using the library
8385dnl
8386dnl so put anything which should be used only during the library build in, e.g.
8387dnl CXXFLAGS, but put everything else (by default) into WXCONFIG_CXXFLAGS
8388dnl
8389dnl and, finally, for some things which should be only used by wx-config but
8390dnl not during the library compilation, use WXCONFIG_ONLY_CPPFLAGS which is
8391dnl added to WXCONFIG_CPPFLAGS after adding the latter to CPPFLAGS
8392AC_SUBST(WXCONFIG_CPPFLAGS)
8393AC_SUBST(WXCONFIG_CFLAGS)
8394AC_SUBST(WXCONFIG_CXXFLAGS)
8395
8396AC_SUBST(WXCONFIG_LIBS)
3bd8fb5f 8397AC_SUBST(WXCONFIG_RPATH)
d4fbe1d8 8398AC_SUBST(WXCONFIG_LDFLAGS)
ffef10f6 8399AC_SUBST(WXCONFIG_LDFLAGS_GUI)
004ee6da 8400AC_SUBST(WXCONFIG_RESFLAGS)
2224580a
VZ
8401
8402dnl distribution vars
a4aad961 8403AC_SUBST(GUIDIST)
2224580a 8404AC_SUBST(DISTDIR)
073478b3 8405
9a98a854 8406dnl additional subdirectories where we will build
9a98a854 8407AC_SUBST(SAMPLES_SUBDIRS)
9a98a854 8408
e694c22c
VZ
8409dnl additional libraries and linker settings
8410AC_SUBST(LDFLAGS)
62d0491b 8411AC_SUBST(LDFLAGS_GL)
f6bcfd97 8412AC_SUBST(OPENGL_LIBS)
3d63bc3a 8413AC_SUBST(DMALLOC_LIBS)
2b5f62a0 8414AC_SUBST(WX_VERSION_TAG)
9a98a854 8415
32832908 8416dnl additional resurces settings
004ee6da 8417AC_SUBST(RESCOMP)
891ace05
DE
8418AC_SUBST(WINDRES)
8419AC_SUBST(REZ)
32832908 8420AC_SUBST(RESFLAGS)
3a922bb4 8421AC_SUBST(RESPROGRAMOBJ)
e95edd8d
GD
8422AC_SUBST(WX_RESOURCES_MACOSX_ASCII)
8423AC_SUBST(WX_RESOURCES_MACOSX_DATA)
3a922bb4 8424
2f51a9ec 8425dnl additional for Mac OS X
2f51a9ec 8426AC_SUBST(DEREZ)
2f51a9ec 8427AC_SUBST(LIBWXMACRES)
891ace05 8428AC_SUBST(POSTLINK_COMMAND)
36825681 8429AC_SUBST(MACSETFILE)
32832908 8430
2b5f62a0
VZ
8431dnl other tools
8432AC_SUBST(GCC)
32832908 8433AC_SUBST(DLLTOOL)
885d4bf5 8434
e6cc62c6 8435
9a98a854 8436dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
156b2523 8437dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am
9a98a854
VZ
8438dnl - and we do use it)
8439AC_PROG_MAKE_SET
8440
014e19de 8441
ceec2216 8442AC_CONFIG_HEADERS([lib/wx/include/${TOOLCHAIN_FULLNAME}/wx/setup.h:setup.h.in])
2aa88730 8443
c8d58531 8444if test "$USE_WIN32" = 1; then
d589327a 8445 AC_CONFIG_COMMANDS([rcdefs.h],
c8d58531
MW
8446 [
8447 mkdir -p $outdir &&
8448 $CPP $infile | sed 's/^# *[1-9].*//;s/^ *//;/./,/^$/!d' > $outdir/rcdefs.h
8449 ],
8450 [
8451 CPP="$CPP"
8452 infile="$srcdir/include/wx/msw/genrcdefs.h"
8453 outdir="lib/wx/include/$TOOLCHAIN_FULLNAME/wx/msw"
8454 ]
8455 )
8456fi
8457
ceec2216
RL
8458AC_CONFIG_FILES([ lib/wx/config/${TOOLCHAIN_FULLNAME}:wx-config.in ],
8459 [ chmod +x lib/wx/config/${TOOLCHAIN_FULLNAME} ],
8460 [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ])
e6cc62c6 8461
ceec2216
RL
8462AC_CONFIG_FILES([ lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}:wx-config-inplace.in ],
8463 [ chmod +x lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} ],
8464 [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ])
8465
2f46438b
FM
8466dnl this is used to run ifacecheck with the same flags used by the compiler
8467dnl for the real compilation:
8468AC_CONFIG_FILES([ utils/ifacecheck/rungccxml.sh ],
8469 [ chmod +x utils/ifacecheck/rungccxml.sh ])
8470
2dbd07cb
VZ
8471if test "$wx_cv_version_script" = "yes"; then
8472 AC_CONFIG_FILES(version-script)
8473fi
8474AC_CONFIG_FILES(Makefile)
ceec2216 8475
f9f75df7 8476AC_CONFIG_COMMANDS([wx-config],
ceec2216
RL
8477 [ rm -f wx-config
8478 ${LN_S} lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} wx-config
8479 ],
8480 [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}"
8481 LN_S="${LN_S}"
8482 ])
9a98a854 8483
0506bbbf
RL
8484dnl This would give us us build dir that in every significant way
8485dnl resembles an installed wx in prefix=$builddir. It is troublesome
8486dnl though in this form because AC_CONFIG_LINKS will fail for directories
8487dnl on platforms that do not have symlinks.
8488dnl AC_CONFIG_LINKS([ include/wx-$WX_RELEASE$WX_FLAVOUR:include ])
9103d280 8489
1c14217d 8490if test "$wxWITH_SUBDIRS" != "no"; then
cf63f3d3 8491dnl Configure samples, demos etc. directories, but only if they are present:
6c3e36af 8492if test "$wxUSE_GUI" = "yes"; then
cf63f3d3 8493 SUBDIRS="samples demos utils"
bef5e9e5
PC
8494else
8495 dnl we build wxBase only
cf63f3d3 8496 dnl there are no wxBase programs in demos
6c3e36af
VZ
8497 SUBDIRS="samples utils"
8498fi
670ec357 8499dnl Add tests to the list of subdirs if cppunit 1.8.0+ is detected
c2218763 8500AM_PATH_CPPUNIT(1.8.0, [SUBDIRS="$SUBDIRS tests"])
6c3e36af 8501
bef5e9e5 8502for subdir in $SUBDIRS; do
08b3ac36 8503 if test -d ${srcdir}/${subdir} ; then
6c3e36af 8504 if test "$wxUSE_GUI" = "yes"; then
166263e6
VZ
8505 if test ${subdir} = "samples"; then
8506 dnl only take those samples which compile in the current
8507 dnl configuration and which exist
8772a1a7 8508 makefiles="samples/Makefile.in $makefiles"
bef5e9e5 8509 for sample in $SAMPLES_SUBDIRS; do
166263e6
VZ
8510 if test -d $srcdir/samples/$sample; then
8511 makefiles="samples/$sample/Makefile.in $makefiles"
8512 fi
8513 done
9c112555
MW
8514 else
8515 dnl assume that everything compiles for utils &c
8516 dnl any that shouldn't be built can be added to
cf63f3d3 8517 dnl DISABLED_UTILS, DISABLED_DEMOS
435a5ad0 8518 disabled_var=DISABLED_`echo $subdir | tr '[[a-z]]' '[[A-Z]]'`
9c112555
MW
8519 eval "disabled=\$$disabled_var"
8520 disabled=/`echo X $disabled | sed 's@ @/|/@g'`/
252a5022 8521 makefiles=`(cd $srcdir ; find $subdir -name Makefile.in) | $EGREP -v "$disabled"`
166263e6 8522 fi
bef5e9e5
PC
8523 else
8524 dnl we build wxBase only
eeb67742 8525 dnl don't take all samples/utils, just those which build with wxBase
6c3e36af 8526 if test ${subdir} = "samples"; then
2804f77d
VZ
8527 dnl only take those samples which compile in the current
8528 dnl configuration and which exist
8529 makefiles="samples/Makefile.in $makefiles"
8530 for sample in `echo $SAMPLES_SUBDIRS`; do
8531 if test -d $srcdir/samples/$sample; then
8532 makefiles="samples/$sample/Makefile.in $makefiles"
8533 fi
8534 done
670ec357 8535 elif test ${subdir} = "utils"; then
6537ccf8 8536 makefiles=""
eeb67742 8537 for util in ifacecheck ; do
6537ccf8 8538 if test -d $srcdir/utils/$util ; then
eeb67742 8539 makefiles="utils/$util/src/Makefile.in \
6537ccf8
VS
8540 $makefiles"
8541 fi
8542 done
bef5e9e5
PC
8543 else
8544 dnl assume that everything compiles for tests
670ec357 8545 makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
6c3e36af
VZ
8546 fi
8547 fi
8548
08b3ac36
VS
8549 for mkin in $makefiles ; do
8550 mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'`
8551 AC_CONFIG_FILES([$mk])
8552 done
8553 fi
8554done
1c14217d 8555fi dnl wxWITH_SUBDIRS
e6cc62c6
VS
8556
8557AC_OUTPUT
8558
4d4ff94c 8559dnl report how we have been configured
2b5f62a0 8560echo
77ffb593 8561echo "Configured wxWidgets ${WX_VERSION} for \`${host}'"
2b5f62a0 8562echo ""
c2e9ada4 8563echo " Which GUI toolkit should wxWidgets use? ${TOOLKIT_DESC}"
77ffb593 8564echo " Should wxWidgets be compiled into single library? ${wxUSE_MONOLITHIC:-yes}"
77ffb593 8565echo " Should wxWidgets be linked as a shared library? ${wxUSE_SHARED:-no}"
141fad63 8566echo $ECHO_N " Should wxWidgets support Unicode? ${wxUSE_UNICODE:-no}$ECHO_C"
ca4c9b7e 8567if test "$wxUSE_UNICODE" = "yes"; then
faa5c14f
VZ
8568 if test "$wxUSE_UNICODE_UTF8" = "yes"; then
8569 echo " (using UTF-8)"
8570 else
8571 echo " (using wchar_t)"
8572 fi
8573else
8574 echo
ca4c9b7e 8575fi
2b5f62a0 8576
77ffb593 8577echo " What level of wxWidgets compatibility should be enabled?"
56b1244c 8578echo " wxWidgets 2.6 ${WXWIN_COMPATIBILITY_2_6:-no}"
abb6edd1 8579echo " wxWidgets 2.8 ${WXWIN_COMPATIBILITY_2_8:-yes}"
0c98a14e 8580
77ffb593 8581echo " Which libraries should wxWidgets use?"
b55e1842 8582echo " STL ${wxUSE_STL}"
2b5f62a0
VZ
8583echo " jpeg ${wxUSE_LIBJPEG-none}"
8584echo " png ${wxUSE_LIBPNG-none}"
8585echo " regex ${wxUSE_REGEX}"
8586echo " tiff ${wxUSE_LIBTIFF-none}"
89fe663f
VZ
8587if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
8588echo " xpm ${wxUSE_LIBXPM-none}"
8589fi
2b5f62a0 8590echo " zlib ${wxUSE_ZLIB}"
672abd7a 8591echo " expat ${wxUSE_EXPAT}"
3527f29c 8592echo " libmspack ${wxUSE_LIBMSPACK}"
f93ca9fd 8593echo " sdl ${wxUSE_LIBSDL}"
2b5f62a0
VZ
8594
8595echo ""
8596
8597dnl vi: set et sts=4 sw=4 com=\:dnl: