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