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