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