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