]> git.saurik.com Git - wxWidgets.git/blame - configure.in
try just -lpthread in the thread detection code too
[wxWidgets.git] / configure.in
CommitLineData
9a98a854
VZ
1dnl Process this file with autoconf to produce a configure script.
2AC_REVISION($Id$)dnl
3
4dnl ---------------------------------------------------------------------------
5dnl
3a922bb4
RL
6dnl Top-level configure.in for wxWindows by Robert Roebling, Phil Blecker,
7dnl Vadim Zeitlin and Ron Lee
9a98a854
VZ
8dnl
9dnl This script is under the wxWindows licence.
10dnl
11dnl Version: $Id$
bcd2b961 12dnl ---------------------------------------------------------------------------
9a98a854
VZ
13
14dnl ---------------------------------------------------------------------------
15dnl initialization
16dnl ---------------------------------------------------------------------------
17
a9b5e89f 18dnl the file passed to AC_INIT should be specific to our package
a72a4bfa 19AC_INIT([wx-config.in])
9a98a854 20
e59890c3 21dnl sets build, host, target variables and the same with _alias
7c66a493
VZ
22AC_CANONICAL_SYSTEM
23
24dnl When making releases do:
25dnl
26dnl WX_RELEASE_NUMBER += 1
2b6f061f 27dnl
6426998c
RL
28dnl ..and update WX_CURRENT, WX_RELEASE and WX_AGE according to the
29dnl following rules:
2b6f061f 30dnl
6426998c
RL
31dnl If any changes have been made to the public interface, that is if any
32dnl exported class, method, global or global type has been added, removed
33dnl or changed in any way, then do: WX_CURRENT += 1
34dnl
35dnl If source changes have been made that *do not* alter the public
36dnl interface then do: WX_REVISION += 1
37dnl If WX_CURRENT was incremented (as above) instead do: WX_REVISION = 0
38dnl
39dnl If any public interface was added, do: WX_AGE += 1
40dnl If any public interface was removed (or altered in a way effectively
41dnl removing the previous definition), instead do: WX_AGE = 0
42dnl
43dnl When the major or minor version numbers are incremented, all the above
44dnl variables should be reset to 0.
45dnl
46dnl The resulting library name will be of the form:
47dnl libwx_$(TOOLKIT)-$(WX_RELEASE).so.$(WX_CURRENT).$(WX_REVISION).$(WX_AGE)
9a98a854
VZ
48
49WX_MAJOR_VERSION_NUMBER=2
1d43cb9e 50WX_MINOR_VERSION_NUMBER=3
a0d927d1 51WX_RELEASE_NUMBER=3
9a98a854 52
2b6f061f 53WX_VERSION=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER.$WX_RELEASE_NUMBER
2aa88730 54WX_RELEASE=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER
6426998c 55
978f1259
RL
56WX_MSW_VERSION=$WX_MAJOR_VERSION_NUMBER$WX_MINOR_VERSION_NUMBER$WX_RELEASE_NUMBER
57
a0d927d1 58WX_CURRENT=2
6426998c
RL
59WX_REVISION=0
60WX_AGE=0
61
9a98a854
VZ
62
63dnl ------------------------------------------------------------------------
64dnl Check platform (host system)
65dnl ------------------------------------------------------------------------
66
67dnl assume Unix
68USE_UNIX=1
4882bf1b 69USE_WIN32=0
f9bc1684 70USE_DOS=0
b12915c1 71USE_BEOS=0
1216f52d 72USE_MAC=0
b12915c1 73
9a98a854
VZ
74USE_LINUX=
75USE_SGI=
76USE_HPUX=
77USE_SYSV=
78USE_SVR4=
79USE_AIX=
80USE_SUN=
81USE_SOLARIS=
82USE_SUNOS=
83USE_ALPHA=
84USE_OSF=
85USE_BSD=
f11bdd03 86USE_DARWIN=
9a98a854 87USE_FREEBSD=
1cf8c0a9 88USE_OPENBSD=
f6bcfd97 89USE_NETBSD=
9a98a854
VZ
90USE_VMS=
91USE_ULTRIX=
9a98a854
VZ
92USE_DATA_GENERAL=
93
ab9b9eab
VZ
94dnl on some platforms xxx_r() functions are declared inside "#ifdef
95dnl _REENTRANT" and it's easier to just define this symbol for these platforms
96dnl than checking it during run-time
97NEEDS_D_REENTRANT_FOR_R_FUNCS=0
98
ced859c3 99dnl the list of all available toolkits
1e6feb95
VZ
100dnl
101dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
7f5c07ab 102ALL_TOOLKITS="GTK MAC MGL MICROWIN MOTIF MSW PM WINE X11"
ced859c3 103
9a98a854
VZ
104dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
105dnl which are either yes or no
106DEFAULT_wxUSE_GTK=0
1e6feb95
VZ
107DEFAULT_wxUSE_MAC=0
108DEFAULT_wxUSE_MGL=0
1725144d 109DEFAULT_wxUSE_MICROWIN=0
9a98a854
VZ
110DEFAULT_wxUSE_MOTIF=0
111DEFAULT_wxUSE_MSW=0
e07802fc 112DEFAULT_wxUSE_PM=0
1e6feb95 113DEFAULT_wxUSE_WINE=0
7f5c07ab 114DEFAULT_wxUSE_X11=0
9a98a854 115
143121c5
VZ
116dnl these are the values which are really default for the given platform -
117dnl they're not cached and are only used if no --with-toolkit was given *and*
118dnl nothing was found in the cache
119DEFAULT_DEFAULT_wxUSE_GTK=0
1e6feb95
VZ
120DEFAULT_DEFAULT_wxUSE_MAC=0
121DEFAULT_DEFAULT_wxUSE_MGL=0
1725144d 122DEFAULT_DEFAULT_wxUSE_MICROWIN=0
143121c5
VZ
123DEFAULT_DEFAULT_wxUSE_MOTIF=0
124DEFAULT_DEFAULT_wxUSE_MSW=0
e07802fc 125DEFAULT_DEFAULT_wxUSE_PM=0
1e6feb95 126DEFAULT_DEFAULT_wxUSE_WINE=0
7f5c07ab 127DEFAULT_DEFAULT_wxUSE_X11=0
143121c5 128
d6a55c4b 129PROGRAM_EXT=
3a922bb4 130SO_SUFFIX=so
d6a55c4b 131
b12915c1
VZ
132dnl to support a new system, you need to add its canonical name (as determined
133dnl by config.sub or specified by the configure command line) to this "case"
134dnl and also define the shared library flags below - search for
135dnl SHARED_LIB_SETUP to find the exact place
9a98a854
VZ
136case "${host}" in
137 *-hp-hpux* )
138 USE_HPUX=1
143121c5 139 DEFAULT_DEFAULT_wxUSE_MOTIF=1
ab9b9eab 140 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
3a922bb4 141 SO_SUFFIX=sl
9a98a854
VZ
142 AC_DEFINE(__HPUX__)
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
VZ
153 ;;
154 *-*-irix5* | *-*-irix6* )
155 USE_SGI=1
156 USE_SVR4=1
157 AC_DEFINE(__SGI__)
158 AC_DEFINE(__SVR4__)
143121c5 159 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
160 ;;
161 *-*-solaris2* )
162 USE_SUN=1
163 USE_SOLARIS=1
164 USE_SVR4=1
165 AC_DEFINE(__SUN__)
166 AC_DEFINE(__SOLARIS__)
167 AC_DEFINE(__SVR4__)
143121c5 168 DEFAULT_DEFAULT_wxUSE_MOTIF=1
ab9b9eab 169 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
9a98a854
VZ
170 ;;
171 *-*-sunos4* )
172 USE_SUN=1
173 USE_SUNOS=1
174 USE_BSD=1
175 AC_DEFINE(__SUN__)
176 AC_DEFINE(__SUNOS__)
177 AC_DEFINE(__BSD__)
143121c5 178 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854 179 ;;
f6bcfd97 180 *-*-freebsd*)
9a98a854
VZ
181 USE_BSD=1
182 USE_FREEBSD=1
183 AC_DEFINE(__FREEBSD__)
184 AC_DEFINE(__BSD__)
143121c5 185 DEFAULT_DEFAULT_wxUSE_GTK=1
9a98a854 186 ;;
1cf8c0a9
VZ
187 *-*-openbsd*)
188 USE_BSD=1
189 USE_OPENBSD=1
190 AC_DEFINE(__FREEBSD__)
191 AC_DEFINE(__OPENBSD__)
192 DEFAULT_DEFAULT_wxUSE_GTK=1
193 ;;
f6bcfd97
BP
194 *-*-netbsd*)
195 USE_BSD=1
196 USE_NETBSD=1
197 AC_DEFINE(__FREEBSD__)
198 AC_DEFINE(__NETBSD__)
199 DEFAULT_DEFAULT_wxUSE_GTK=1
200 ;;
9a98a854
VZ
201 *-*-osf* )
202 USE_ALPHA=1
203 USE_OSF=1
204 AC_DEFINE(__ALPHA__)
205 AC_DEFINE(__OSF__)
143121c5 206 DEFAULT_DEFAULT_wxUSE_MOTIF=1
f6bcfd97 207 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
9a98a854
VZ
208 ;;
209 *-*-dgux5* )
210 USE_ALPHA=1
211 USE_SVR4=1
212 AC_DEFINE(__ALPHA__)
213 AC_DEFINE(__SVR4__)
143121c5 214 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
215 ;;
216 *-*-sysv5* )
217 USE_SYSV=1
218 USE_SVR4=1
219 AC_DEFINE(__SYSV__)
220 AC_DEFINE(__SVR4__)
143121c5 221 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
222 ;;
223 *-*-aix* )
224 USE_AIX=1
225 USE_SYSV=1
226 USE_SVR4=1
227 AC_DEFINE(__AIX__)
228 AC_DEFINE(__SYSV__)
229 AC_DEFINE(__SVR4__)
143121c5 230 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854 231 ;;
a9b5e89f 232
1c8183e2 233 *-*-cygwin* | *-*-mingw32* )
4d19d979 234 USE_UNIX=0
4882bf1b 235 USE_WIN32=1
3a922bb4 236 SO_SUFFIX=dll
4d19d979
HH
237 AC_DEFINE(__WIN32__)
238 AC_DEFINE(__WIN95__)
239 AC_DEFINE(__WINDOWS__)
240 AC_DEFINE(__GNUWIN32__)
1db46618 241 AC_DEFINE(STRICT)
4d19d979 242 AC_DEFINE(WINVER, 0x0400)
cf27ef00 243 PROGRAM_EXT=".exe"
7b7a7637 244 RESCOMP=windres
a9b5e89f
VZ
245 DEFAULT_DEFAULT_wxUSE_MSW=1
246 ;;
247
f9bc1684
VS
248 *-pc-msdosdjgpp )
249 USE_UNIX=0
250 USE_DOS=1
251 AC_DEFINE(__DOS__)
252 PROGRAM_EXT=".exe"
253 DEFAULT_DEFAULT_wxUSE_MGL=1
f9bc1684
VS
254 ;;
255
9829f277 256 *-pc-os2_emx | *-pc-os2-emx )
91b8de8d 257 AC_DEFINE(__EMX__)
cf27ef00 258 PROGRAM_EXT=".exe"
e07802fc 259 DEFAULT_DEFAULT_wxUSE_PM=1
590b1a4d 260 LIBS="$LIBS -lstdcpp"
91b8de8d 261 ;;
a9b5e89f 262
d08b457b
GD
263 powerpc-*-darwin* )
264 dnl PowerPC Darwin based distributions (including Mac OS X)
b4085ce6 265 USE_BSD=1
f11bdd03 266 USE_DARWIN=1
3a922bb4 267 SO_SUFFIX=dylib
b4085ce6 268 AC_DEFINE(__BSD__)
f11bdd03 269 AC_DEFINE(__DARWIN__)
d08b457b 270 AC_DEFINE(__POWERPC__)
b4085ce6
GD
271 DEFAULT_DEFAULT_wxUSE_MAC=1
272 ;;
273
b12915c1
VZ
274 *-*-beos* )
275 dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
276 USE_BEOS=1
277 AC_DEFINE(__BEOS__)
278 ;;
279
9a98a854 280 *)
a9b5e89f 281 AC_MSG_ERROR(unknown system type ${host}.)
9a98a854
VZ
282esac
283
284if test "$USE_UNIX" = 1 ; then
b12915c1
VZ
285 wxUSE_UNIX=yes
286 AC_DEFINE(__UNIX__)
9a98a854
VZ
287fi
288
ab252f7b 289dnl check for glibc version
2389f33b 290if test "$USE_LINUX" = 1; then
a72a4bfa 291 AC_CACHE_CHECK([for glibc 2.1 or later], wx_lib_glibc21,[
2389f33b
VZ
292 AC_TRY_COMPILE([#include <features.h>],
293 [
294 #if !__GLIBC_PREREQ(2, 1)
295 #error not glibc2.1
296 #endif
297 ],
298 [
299 wx_lib_glibc21=yes
300 ],
301 [
302 wx_lib_glibc21=no
303 ]
304 )
a72a4bfa 305 ])
2389f33b
VZ
306 if test "$wx_lib_glibc21" = "yes"; then
307 AC_DEFINE(wxHAVE_GLIBC2)
308 fi
309fi
9a98a854 310
9a98a854
VZ
311dnl ---------------------------------------------------------------------------
312dnl command line options for configure
313dnl ---------------------------------------------------------------------------
314
315dnl the default values for all options - we collect them all here to simplify
316dnl modification of the default values (for example, if the defaults for some
317dnl platform should be changed, it can be done here too)
318dnl
319dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
320
143121c5
VZ
321WX_ARG_CACHE_INIT
322
9a98a854
VZ
323dnl useful to test the compilation with minimum options, define as 0 for normal
324dnl usage
325DEBUG_CONFIGURE=0
326if test $DEBUG_CONFIGURE = 1; then
1e6feb95
VZ
327 DEFAULT_wxUSE_UNIVERSAL=no
328
6ec507fd
JS
329 DEFAULT_wxUSE_NANOX=no
330
9a98a854
VZ
331 DEFAULT_wxUSE_THREADS=yes
332
2aa88730 333 DEFAULT_wxUSE_SHARED=yes
3a922bb4 334 DEFAULT_wxUSE_SONAME=no
1e6feb95 335 DEFAULT_wxUSE_OPTIMISE=no
9a98a854 336 DEFAULT_wxUSE_PROFILE=no
5586805b 337 DEFAULT_wxUSE_NO_DEPS=no
f676c7ff
MB
338 DEFAULT_wxUSE_NO_RTTI=yes
339 DEFAULT_wxUSE_NO_EXCEPTIONS=yes
5586805b 340 DEFAULT_wxUSE_PERMISSIVE=no
9a98a854
VZ
341 DEFAULT_wxUSE_DEBUG_FLAG=yes
342 DEFAULT_wxUSE_DEBUG_INFO=yes
343 DEFAULT_wxUSE_DEBUG_GDB=yes
344 DEFAULT_wxUSE_MEM_TRACING=no
143121c5 345 DEFAULT_wxUSE_DEBUG_CONTEXT=no
9a98a854 346 DEFAULT_wxUSE_DMALLOC=no
a7ae7112 347 DEFAULT_wxUSE_PRECOMP=no
9a98a854
VZ
348 DEFAULT_wxUSE_APPLE_IEEE=no
349
350 DEFAULT_wxUSE_LOG=yes
1e6feb95
VZ
351 DEFAULT_wxUSE_LOGWINDOW=no
352 DEFAULT_wxUSE_LOGGUI=no
69d27ff7 353 DEFAULT_wxUSE_LOGDIALOG=no
9a98a854
VZ
354
355 DEFAULT_wxUSE_GUI=yes
1e6feb95 356 DEFAULT_wxUSE_CONTROLS=no
9a98a854 357
3e44f09d 358 DEFAULT_wxUSE_REGEX=no
9a98a854
VZ
359 DEFAULT_wxUSE_ZLIB=no
360 DEFAULT_wxUSE_LIBPNG=no
9a98a854 361 DEFAULT_wxUSE_LIBJPEG=no
c7a2bf27 362 DEFAULT_wxUSE_LIBTIFF=no
9a98a854 363 DEFAULT_wxUSE_ODBC=no
bdad4e7e 364 DEFAULT_wxUSE_OPENGL=no
9a98a854 365
eb4efbdc 366 DEFAULT_wxUSE_ON_FATAL_EXCEPTION=no
4f3c5f06 367 DEFAULT_wxUSE_SNGLINST_CHECKER=no
fd15d8f1 368 DEFAULT_wxUSE_STD_IOSTREAM=no
1e6feb95
VZ
369 DEFAULT_wxUSE_CMDLINE_PARSER=no
370 DEFAULT_wxUSE_DATETIME=no
371 DEFAULT_wxUSE_TIMEDATE=no
372 DEFAULT_wxUSE_TIMER=no
373 DEFAULT_wxUSE_STOPWATCH=no
9a98a854 374 DEFAULT_wxUSE_FILE=no
1e6feb95 375 DEFAULT_wxUSE_FFILE=no
a3a584a7 376 DEFAULT_wxUSE_TEXTBUFFER=no
9a98a854 377 DEFAULT_wxUSE_TEXTFILE=no
2749089a 378 DEFAULT_wxUSE_WAVE=no
9a98a854
VZ
379 DEFAULT_wxUSE_INTL=no
380 DEFAULT_wxUSE_CONFIG=no
1e6feb95 381 DEFAULT_wxUSE_FONTMAP=no
9a98a854
VZ
382 DEFAULT_wxUSE_STREAMS=no
383 DEFAULT_wxUSE_SOCKETS=no
1c8515f9 384 DEFAULT_wxUSE_DIALUP_MANAGER=no
9a98a854 385 DEFAULT_wxUSE_JOYSTICK=no
6bff71f8 386 DEFAULT_wxUSE_DYNLIB_CLASS=no
0b9ab0bd 387 DEFAULT_wxUSE_DYNAMIC_LOADER=no
9a98a854 388 DEFAULT_wxUSE_LONGLONG=no
e8f65ba6 389 DEFAULT_wxUSE_GEOMETRY=no
9a98a854
VZ
390
391 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
392 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
393 DEFAULT_wxUSE_POSTSCRIPT=no
394
395 DEFAULT_wxUSE_X_RESOURCES=no
396 DEFAULT_wxUSE_CLIPBOARD=no
397 DEFAULT_wxUSE_TOOLTIPS=no
398 DEFAULT_wxUSE_DRAG_AND_DROP=no
24fd6d87 399 DEFAULT_wxUSE_DRAGIMAGE=no
9a98a854
VZ
400 DEFAULT_wxUSE_SPLINES=no
401
402 DEFAULT_wxUSE_MDI_ARCHITECTURE=no
403 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
404 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
405
406 DEFAULT_wxUSE_PROLOGIO=no
407 DEFAULT_wxUSE_RESOURCES=no
408 DEFAULT_wxUSE_CONSTRAINTS=no
409 DEFAULT_wxUSE_IPC=no
410 DEFAULT_wxUSE_HELP=no
29fd3c0c 411 DEFAULT_wxUSE_MS_HTML_HELP=no
3379ed37 412 DEFAULT_wxUSE_WXHTML_HELP=no
24176f2c 413 DEFAULT_wxUSE_TREELAYOUT=no
9a98a854 414 DEFAULT_wxUSE_METAFILE=no
1e6feb95 415 DEFAULT_wxUSE_MIMETYPE=no
4cdb0ab0
VS
416 DEFAULT_wxUSE_SYSTEM_OPTIONS=no
417 DEFAULT_wxUSE_PROTOCOL=no
418 DEFAULT_wxUSE_PROTOCOL_HTTP=no
419 DEFAULT_wxUSE_PROTOCOL_FTP=no
420 DEFAULT_wxUSE_PROTOCOL_FILE=no
421 DEFAULT_wxUSE_URL=no
422
9a98a854 423 DEFAULT_wxUSE_COMMONDLGS=no
1e6feb95
VZ
424 DEFAULT_wxUSE_CHOICEDLG=no
425 DEFAULT_wxUSE_COLOURDLG=no
ce4169a4 426 DEFAULT_wxUSE_DIRDLG=no
1e6feb95 427 DEFAULT_wxUSE_FILEDLG=no
8db37e06 428 DEFAULT_wxUSE_FINDREPLDLG=no
1e6feb95
VZ
429 DEFAULT_wxUSE_FONTDLG=no
430 DEFAULT_wxUSE_MSGDLG=no
431 DEFAULT_wxUSE_NUMBERDLG=no
c11584af 432 DEFAULT_wxUSE_TEXTDLG=no
cbca9943 433 DEFAULT_wxUSE_SPLASH=no
a641505f 434 DEFAULT_wxUSE_STARTUP_TIPS=no
ce4169a4 435 DEFAULT_wxUSE_PROGRESSDLG=no
b1f5d087
VZ
436 DEFAULT_wxUSE_WIZARDDLG=no
437
1e6feb95 438 DEFAULT_wxUSE_MENUS=no
9a98a854 439 DEFAULT_wxUSE_MINIFRAME=no
5526e819 440 DEFAULT_wxUSE_HTML=no
24528b0c 441 DEFAULT_wxUSE_FILESYSTEM=no
e3e717ec
VZ
442 DEFAULT_wxUSE_FS_INET=no
443 DEFAULT_wxUSE_FS_ZIP=no
d78b3d64
VS
444 DEFAULT_wxUSE_BUSYINFO=no
445 DEFAULT_wxUSE_ZIPSTREAM=no
1e6feb95 446 DEFAULT_wxUSE_VALIDATORS=no
9a98a854
VZ
447
448 DEFAULT_wxUSE_ACCEL=no
1e6feb95 449 DEFAULT_wxUSE_BUTTON=no
9a98a854 450 DEFAULT_wxUSE_BMPBUTTON=no
1e6feb95
VZ
451 DEFAULT_wxUSE_CALCTRL=no
452 DEFAULT_wxUSE_CARET=no
9a98a854
VZ
453 DEFAULT_wxUSE_CHECKBOX=no
454 DEFAULT_wxUSE_CHECKLST=no
1e6feb95 455 DEFAULT_wxUSE_CHOICE=no
9a98a854
VZ
456 DEFAULT_wxUSE_COMBOBOX=no
457 DEFAULT_wxUSE_GAUGE=no
458 DEFAULT_wxUSE_GRID=no
f85afd4e 459 DEFAULT_wxUSE_NEW_GRID=no
9a98a854
VZ
460 DEFAULT_wxUSE_IMAGLIST=no
461 DEFAULT_wxUSE_LISTBOX=no
462 DEFAULT_wxUSE_LISTCTRL=no
463 DEFAULT_wxUSE_NOTEBOOK=no
24176f2c 464 DEFAULT_wxUSE_PROPSHEET=no
9a98a854
VZ
465 DEFAULT_wxUSE_RADIOBOX=no
466 DEFAULT_wxUSE_RADIOBTN=no
e602002e 467 DEFAULT_wxUSE_SASH=no
9a98a854
VZ
468 DEFAULT_wxUSE_SCROLLBAR=no
469 DEFAULT_wxUSE_SLIDER=no
470 DEFAULT_wxUSE_SPINBTN=no
66f38406 471 DEFAULT_wxUSE_SPINCTRL=no
9a98a854
VZ
472 DEFAULT_wxUSE_SPLITTER=no
473 DEFAULT_wxUSE_STATBMP=no
474 DEFAULT_wxUSE_STATBOX=no
475 DEFAULT_wxUSE_STATLINE=no
1e6feb95 476 DEFAULT_wxUSE_STATTEXT=no
9a98a854
VZ
477 DEFAULT_wxUSE_STATUSBAR=yes
478 DEFAULT_wxUSE_TABDIALOG=no
1e6feb95 479 DEFAULT_wxUSE_TEXTCTRL=no
1db8dc4a 480 DEFAULT_wxUSE_TOGGLEBTN=no
9a98a854 481 DEFAULT_wxUSE_TOOLBAR=no
360d6699
VZ
482 DEFAULT_wxUSE_TOOLBAR_NATIVE=no
483 DEFAULT_wxUSE_TOOLBAR_SIMPLE=no
9a98a854 484 DEFAULT_wxUSE_TREECTRL=no
9f41d601 485 DEFAULT_wxUSE_POPUPWIN=no
0b01706f 486 DEFAULT_wxUSE_TIPWINDOW=no
9a98a854
VZ
487
488 DEFAULT_wxUSE_UNICODE=no
a72a4bfa 489 DEFAULT_wxUSE_UNICODE_MSLU=no
9a98a854 490 DEFAULT_wxUSE_WCSRTOMBS=no
e90c1d2a 491
d275c7eb 492 DEFAULT_wxUSE_PALETTE=no
0046ff7c 493 DEFAULT_wxUSE_IMAGE=no
0940bcf7
HH
494 DEFAULT_wxUSE_GIF=no
495 DEFAULT_wxUSE_PCX=no
496 DEFAULT_wxUSE_PNM=no
4b6b4dfc 497 DEFAULT_wxUSE_IFF=no
0046ff7c 498 DEFAULT_wxUSE_XPM=no
658974ae 499 DEFAULT_wxUSE_ICO_CUR=no
9a98a854 500else
1e6feb95
VZ
501 DEFAULT_wxUSE_UNIVERSAL=no
502
6ec507fd
JS
503 DEFAULT_wxUSE_NANOX=no
504
9a98a854
VZ
505 DEFAULT_wxUSE_THREADS=yes
506
2aa88730 507 DEFAULT_wxUSE_SHARED=yes
3a922bb4 508 DEFAULT_wxUSE_SONAME=no
9a98a854
VZ
509 DEFAULT_wxUSE_OPTIMISE=yes
510 DEFAULT_wxUSE_PROFILE=no
5586805b 511 DEFAULT_wxUSE_NO_DEPS=no
f676c7ff
MB
512 DEFAULT_wxUSE_NO_RTTI=yes
513 DEFAULT_wxUSE_NO_EXCEPTIONS=yes
5586805b 514 DEFAULT_wxUSE_PERMISSIVE=no
9a98a854
VZ
515 DEFAULT_wxUSE_DEBUG_FLAG=no
516 DEFAULT_wxUSE_DEBUG_INFO=no
517 DEFAULT_wxUSE_DEBUG_GDB=no
518 DEFAULT_wxUSE_MEM_TRACING=no
143121c5 519 DEFAULT_wxUSE_DEBUG_CONTEXT=no
9a98a854 520 DEFAULT_wxUSE_DMALLOC=no
a7ae7112 521 DEFAULT_wxUSE_PRECOMP=no
9a98a854
VZ
522 DEFAULT_wxUSE_APPLE_IEEE=yes
523
524 DEFAULT_wxUSE_LOG=yes
d73be714
VZ
525 DEFAULT_wxUSE_LOGWINDOW=yes
526 DEFAULT_wxUSE_LOGGUI=yes
69d27ff7 527 DEFAULT_wxUSE_LOGDIALOG=yes
9a98a854
VZ
528
529 DEFAULT_wxUSE_GUI=yes
530
831b3152 531 DEFAULT_wxUSE_REGEX=yes
9a98a854
VZ
532 DEFAULT_wxUSE_ZLIB=yes
533 DEFAULT_wxUSE_LIBPNG=yes
9a98a854 534 DEFAULT_wxUSE_LIBJPEG=yes
b47c832e 535 DEFAULT_wxUSE_LIBTIFF=yes
16b52fa1 536 DEFAULT_wxUSE_ODBC=no
bdad4e7e 537 DEFAULT_wxUSE_OPENGL=no
9a98a854 538
eb4efbdc 539 DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes
4f3c5f06 540 DEFAULT_wxUSE_SNGLINST_CHECKER=yes
073478b3 541 DEFAULT_wxUSE_STD_IOSTREAM=no
1e6feb95
VZ
542 DEFAULT_wxUSE_CMDLINE_PARSER=yes
543 DEFAULT_wxUSE_DATETIME=yes
544 DEFAULT_wxUSE_TIMEDATE=no
545 DEFAULT_wxUSE_TIMER=yes
546 DEFAULT_wxUSE_STOPWATCH=yes
9a98a854 547 DEFAULT_wxUSE_FILE=yes
1e6feb95 548 DEFAULT_wxUSE_FFILE=yes
a3a584a7 549 DEFAULT_wxUSE_TEXTBUFFER=yes
9a98a854 550 DEFAULT_wxUSE_TEXTFILE=yes
2749089a 551 DEFAULT_wxUSE_WAVE=no
9a98a854
VZ
552 DEFAULT_wxUSE_INTL=yes
553 DEFAULT_wxUSE_CONFIG=yes
1e6feb95 554 DEFAULT_wxUSE_FONTMAP=yes
9a98a854
VZ
555 DEFAULT_wxUSE_STREAMS=yes
556 DEFAULT_wxUSE_SOCKETS=yes
1c8515f9 557 DEFAULT_wxUSE_DIALUP_MANAGER=yes
9a98a854 558 DEFAULT_wxUSE_JOYSTICK=yes
6bff71f8 559 DEFAULT_wxUSE_DYNLIB_CLASS=yes
9337b578 560 DEFAULT_wxUSE_DYNAMIC_LOADER=yes
b685cd9b 561 DEFAULT_wxUSE_LONGLONG=yes
e8f65ba6 562 DEFAULT_wxUSE_GEOMETRY=yes
9a98a854
VZ
563
564 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes
565 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes
566 DEFAULT_wxUSE_POSTSCRIPT=yes
567
568 DEFAULT_wxUSE_X_RESOURCES=no
569 DEFAULT_wxUSE_CLIPBOARD=yes
570 DEFAULT_wxUSE_TOOLTIPS=yes
571 DEFAULT_wxUSE_DRAG_AND_DROP=yes
24fd6d87 572 DEFAULT_wxUSE_DRAGIMAGE=yes
9a98a854
VZ
573 DEFAULT_wxUSE_SPLINES=yes
574
575 DEFAULT_wxUSE_MDI_ARCHITECTURE=yes
576 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes
577 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes
578
579 DEFAULT_wxUSE_PROLOGIO=yes
580 DEFAULT_wxUSE_RESOURCES=yes
581 DEFAULT_wxUSE_CONSTRAINTS=yes
582 DEFAULT_wxUSE_IPC=yes
583 DEFAULT_wxUSE_HELP=yes
29fd3c0c 584 DEFAULT_wxUSE_MS_HTML_HELP=yes
3379ed37 585 DEFAULT_wxUSE_WXHTML_HELP=yes
24176f2c 586 DEFAULT_wxUSE_TREELAYOUT=yes
9a98a854 587 DEFAULT_wxUSE_METAFILE=yes
1e6feb95 588 DEFAULT_wxUSE_MIMETYPE=yes
0cbff120 589 DEFAULT_wxUSE_SYSTEM_OPTIONS=yes
4cdb0ab0
VS
590 DEFAULT_wxUSE_PROTOCOL=yes
591 DEFAULT_wxUSE_PROTOCOL_HTTP=yes
592 DEFAULT_wxUSE_PROTOCOL_FTP=yes
593 DEFAULT_wxUSE_PROTOCOL_FILE=yes
594 DEFAULT_wxUSE_URL=yes
9a98a854
VZ
595
596 DEFAULT_wxUSE_COMMONDLGS=yes
1e6feb95
VZ
597 DEFAULT_wxUSE_CHOICEDLG=yes
598 DEFAULT_wxUSE_COLOURDLG=yes
ce4169a4 599 DEFAULT_wxUSE_DIRDLG=yes
1e6feb95 600 DEFAULT_wxUSE_FILEDLG=yes
8db37e06 601 DEFAULT_wxUSE_FINDREPLDLG=yes
1e6feb95
VZ
602 DEFAULT_wxUSE_FONTDLG=yes
603 DEFAULT_wxUSE_MSGDLG=yes
604 DEFAULT_wxUSE_NUMBERDLG=yes
c11584af 605 DEFAULT_wxUSE_TEXTDLG=yes
cbca9943 606 DEFAULT_wxUSE_SPLASH=yes
a641505f 607 DEFAULT_wxUSE_STARTUP_TIPS=yes
ce4169a4 608 DEFAULT_wxUSE_PROGRESSDLG=yes
f33f19dd
VZ
609 DEFAULT_wxUSE_WIZARDDLG=yes
610
1e6feb95 611 DEFAULT_wxUSE_MENUS=yes
9a98a854 612 DEFAULT_wxUSE_MINIFRAME=yes
d4c241b9 613 DEFAULT_wxUSE_HTML=yes
24528b0c 614 DEFAULT_wxUSE_FILESYSTEM=yes
d4c241b9
RR
615 DEFAULT_wxUSE_FS_INET=yes
616 DEFAULT_wxUSE_FS_ZIP=yes
617 DEFAULT_wxUSE_BUSYINFO=yes
618 DEFAULT_wxUSE_ZIPSTREAM=yes
9a98a854
VZ
619 DEFAULT_wxUSE_VALIDATORS=yes
620
621 DEFAULT_wxUSE_ACCEL=yes
1e6feb95 622 DEFAULT_wxUSE_BUTTON=yes
9a98a854 623 DEFAULT_wxUSE_BMPBUTTON=yes
1e6feb95
VZ
624 DEFAULT_wxUSE_CALCTRL=yes
625 DEFAULT_wxUSE_CARET=yes
9a98a854
VZ
626 DEFAULT_wxUSE_CHECKBOX=yes
627 DEFAULT_wxUSE_CHECKLST=yes
ce4169a4 628 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
629 DEFAULT_wxUSE_COMBOBOX=yes
630 DEFAULT_wxUSE_GAUGE=yes
631 DEFAULT_wxUSE_GRID=yes
cc977e5f 632 DEFAULT_wxUSE_NEW_GRID=yes
9a98a854
VZ
633 DEFAULT_wxUSE_IMAGLIST=yes
634 DEFAULT_wxUSE_LISTBOX=yes
635 DEFAULT_wxUSE_LISTCTRL=yes
636 DEFAULT_wxUSE_NOTEBOOK=yes
24176f2c 637 DEFAULT_wxUSE_PROPSHEET=yes
9a98a854
VZ
638 DEFAULT_wxUSE_RADIOBOX=yes
639 DEFAULT_wxUSE_RADIOBTN=yes
e602002e 640 DEFAULT_wxUSE_SASH=yes
9a98a854
VZ
641 DEFAULT_wxUSE_SCROLLBAR=yes
642 DEFAULT_wxUSE_SLIDER=yes
643 DEFAULT_wxUSE_SPINBTN=yes
66f38406 644 DEFAULT_wxUSE_SPINCTRL=yes
9a98a854
VZ
645 DEFAULT_wxUSE_SPLITTER=yes
646 DEFAULT_wxUSE_STATBMP=yes
647 DEFAULT_wxUSE_STATBOX=yes
648 DEFAULT_wxUSE_STATLINE=yes
1e6feb95 649 DEFAULT_wxUSE_STATTEXT=yes
9a98a854
VZ
650 DEFAULT_wxUSE_STATUSBAR=yes
651 DEFAULT_wxUSE_TABDIALOG=no
1e6feb95 652 DEFAULT_wxUSE_TEXTCTRL=yes
1db8dc4a 653 DEFAULT_wxUSE_TOGGLEBTN=yes
9a98a854 654 DEFAULT_wxUSE_TOOLBAR=yes
360d6699
VZ
655 DEFAULT_wxUSE_TOOLBAR_NATIVE=yes
656 DEFAULT_wxUSE_TOOLBAR_SIMPLE=yes
9a98a854 657 DEFAULT_wxUSE_TREECTRL=yes
9f41d601 658 DEFAULT_wxUSE_POPUPWIN=yes
0b01706f 659 DEFAULT_wxUSE_TIPWINDOW=yes
9a98a854
VZ
660
661 DEFAULT_wxUSE_UNICODE=no
a72a4bfa 662 DEFAULT_wxUSE_UNICODE_MSLU=yes
9a98a854 663 DEFAULT_wxUSE_WCSRTOMBS=no
e90c1d2a 664
d275c7eb 665 DEFAULT_wxUSE_PALETTE=yes
0046ff7c 666 DEFAULT_wxUSE_IMAGE=yes
0940bcf7
HH
667 DEFAULT_wxUSE_GIF=yes
668 DEFAULT_wxUSE_PCX=yes
cc0e8480 669 DEFAULT_wxUSE_IFF=no
0940bcf7 670 DEFAULT_wxUSE_PNM=yes
0046ff7c 671 DEFAULT_wxUSE_XPM=yes
658974ae 672 DEFAULT_wxUSE_ICO_CUR=yes
9a98a854
VZ
673fi
674
143121c5 675dnl WX_ARG_WITH should be used to select whether an external package will be
9a98a854 676dnl used or not, to configure compile-time features of this package itself,
143121c5 677dnl use WX_ARG_ENABLE instead
9a98a854
VZ
678
679dnl ============================
680dnl external package dependecies
681dnl ============================
682
143121c5
VZ
683dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache
684dnl these values manually
ced859c3 685for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
686 LINE=`grep "wxUSE_$toolkit" ${wx_arg_cache_file}`
687 if test "x$LINE" != x ; then
688 has_toolkit_in_cache=1
689 eval "DEFAULT_$LINE"
ced859c3 690 eval "CACHE_$toolkit=1"
143121c5
VZ
691 fi
692done
693
e90c1d2a
VZ
694dnl ---------------------------------------------------------------------------
695dnl --disable-gui will build only non-GUI part of wxWindows: check for this
696dnl first to disable many other switches if it's given
697dnl
698dnl NB: this is still in testing stage, don't use if you don't know what you're
699dnl doing
700dnl ---------------------------------------------------------------------------
701
702WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
703
b12915c1 704if test "$wxUSE_GUI" = "yes"; then
e90c1d2a 705
1e6feb95 706WX_ARG_ENABLE(universal, [ --enable-universal use wxWindows GUI controls instead of native ones], wxUSE_UNIVERSAL)
ced859c3
VZ
707AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
708AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
b4085ce6 709AC_ARG_WITH(mac, [ --with-mac use Mac OS X], [wxUSE_MAC="$withval" TOOLKIT_GIVEN=1])
ced859c3 710AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
77e13408 711AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW TOOLKIT_GIVEN=1])
e07802fc 712AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
b3e8d00a 713AC_ARG_WITH(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" CACHE_MGL=1 TOOLKIT_GIVEN=1])
1725144d 714AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
3c011993 715AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
ba875e66 716WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX)
143121c5 717
9e691f46 718AC_ARG_ENABLE(gtk2, [ --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)],wxUSE_GTK2="yes",wxUSE_GTK2="no")
a9b5e89f 719
422107f9
VZ
720WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
721WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
0dcf9893 722WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF)
143121c5 723WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
b12915c1
VZ
724
725fi
726dnl for GUI only
727
d0e9b150 728WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC)
3e44f09d 729WX_ARG_SYS_WITH(regex, [ --with-regex enable support for wxRegEx class], wxUSE_REGEX)
422107f9 730WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
143121c5 731WX_ARG_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC)
9a98a854 732
9a98a854
VZ
733dnl ---------------------------------------------------------------------------
734dnl compile options
735dnl ---------------------------------------------------------------------------
736
2aa88730 737WX_ARG_ENABLE(shared, [ --enable-shared create shared library code], wxUSE_SHARED)
3a922bb4 738WX_ARG_ENABLE(soname, [ --enable-soname set the DT_SONAME field in ELF shared libraries], wxUSE_SONAME)
143121c5 739WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE)
143121c5 740WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG)
70d1b3cf 741
683dccda
GD
742dnl allow the precompiled header option to be disabled under Mac OS X
743WX_ARG_ENABLE(precomp, [ --enable-precomp enable use of precompiled headers (Mac OS X)], wxUSE_PRECOMP)
744
70d1b3cf
VZ
745if test "$wxUSE_DEBUG" = "yes"; then
746 DEFAULT_wxUSE_DEBUG_FLAG=yes
747 DEFAULT_wxUSE_DEBUG_INFO=yes
748elif test "$wxUSE_DEBUG" = "no"; then
749 DEFAULT_wxUSE_DEBUG_FLAG=no
750 DEFAULT_wxUSE_DEBUG_INFO=no
751fi
752
f7bdcdd7
RR
753WX_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG)
754WX_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], wxUSE_DEBUG_INFO)
755WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
756WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT)
757WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING)
758WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
759WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
b3e8d00a 760WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS)
5586805b
RR
761WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
762WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
9a98a854 763
b3e8d00a 764WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2)
0c9a1c32 765WX_ARG_ENABLE(compat22, [ --disable-compat22 disable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2)
54276ccf 766
9a98a854
VZ
767dnl ---------------------------------------------------------------------------
768dnl (small) optional non GUI classes
769dnl ---------------------------------------------------------------------------
770
fd15d8f1
RR
771WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
772WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
b12915c1 773
a5d46b73
VZ
774WX_ARG_ENABLE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL)
775WX_ARG_ENABLE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP)
776WX_ARG_ENABLE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP)
777WX_ARG_ENABLE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE)
fd15d8f1 778WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
b12915c1 779
fd15d8f1 780WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
eb4efbdc 781
1e6feb95
VZ
782WX_ARG_ENABLE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER)
783WX_ARG_ENABLE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME)
784WX_ARG_ENABLE(timedate, [ --enable-timedate use obsolete wxDate/wxTime classes], wxUSE_TIMEDATE)
785WX_ARG_ENABLE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH)
eb4efbdc 786WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
fd15d8f1 787WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
1e6feb95 788WX_ARG_ENABLE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER)
fd15d8f1
RR
789WX_ARG_ENABLE(wave, [ --enable-wave use wxWave class], wxUSE_WAVE)
790WX_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], wxUSE_FRACTION)
791WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
0b9ab0bd 792WX_ARG_ENABLE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
fd15d8f1 793WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
e8f65ba6 794WX_ARG_ENABLE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
fd15d8f1
RR
795WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG)
796WX_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS)
797WX_ARG_ENABLE(file, [ --enable-file use wxFile classes], wxUSE_FILE)
1e6feb95 798WX_ARG_ENABLE(ffile, [ --enable-ffile use wxFFile classes], wxUSE_FFILE)
a3a584a7
VZ
799WX_ARG_ENABLE(textbuf, [ --enable-textbuf use wxTextBuffer class], wxUSE_TEXTBUFFER)
800WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE)
1e6feb95 801WX_ARG_ENABLE(fontmap, [ --enable-fontmap use font encodings conversion classes], wxUSE_FONTMAP)
fd15d8f1 802WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE)
a72a4bfa 803WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (win32 only)], wxUSE_UNICODE_MSLU)
fd15d8f1 804WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWindows implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
fd15d8f1 805WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
24528b0c 806WX_ARG_ENABLE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM)
e3e717ec
VZ
807WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
808WX_ARG_ENABLE(fs_zip, [ --enable-fs_zip use virtual ZIP filesystems], wxUSE_FS_ZIP)
d78b3d64 809WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZipInputStream], wxUSE_ZIPSTREAM)
9a98a854 810
eb4efbdc 811WX_ARG_ENABLE(catch_segvs, [ --enable-catch_segvs catch signals and pass them to wxApp::OnFatalException], wxUSE_ON_FATAL_EXCEPTION)
4f3c5f06 812WX_ARG_ENABLE(snglinst, [ --enable-snglinst use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER)
eb4efbdc 813
69d27ff7 814WX_ARG_ENABLE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE)
b3e8d00a 815WX_ARG_ENABLE(system_options,[ --enable-sysoptions use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
1e6feb95 816
4cdb0ab0
VS
817WX_ARG_ENABLE(url, [ --enable-url use wxURL class], wxUSE_URL)
818WX_ARG_ENABLE(protocol, [ --enable-protocol use wxProtocol class], wxUSE_PROTOCOL)
819WX_ARG_ENABLE(protocol_http, [ --enable-protocol-http HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP)
820WX_ARG_ENABLE(protocol_ftp, [ --enable-protocol-ftp FTP support in wxProtocol], wxUSE_PROTOCOL_FTP)
821WX_ARG_ENABLE(protocol_file, [ --enable-protocol-file FILE support in wxProtocol], wxUSE_PROTOCOL_FILE)
822
823
9a98a854
VZ
824dnl ---------------------------------------------------------------------------
825dnl "big" options (i.e. those which change a lot of things throughout the library)
826dnl ---------------------------------------------------------------------------
827
143121c5 828WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS)
9a98a854 829
b12915c1
VZ
830if test "$wxUSE_GUI" = "yes"; then
831
9a98a854
VZ
832dnl ---------------------------------------------------------------------------
833dnl "big" GUI options
834dnl ---------------------------------------------------------------------------
835
143121c5 836WX_ARG_ENABLE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
3379ed37 837WX_ARG_ENABLE(help, [ --enable-help use help subsystem], wxUSE_HELP)
29fd3c0c 838WX_ARG_ENABLE(mshtmlhelp, [ --enable-mshtmlhelp use MS HTML Help (win32)], wxUSE_MS_HTML_HELP)
3379ed37
VZ
839WX_ARG_ENABLE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML)
840WX_ARG_ENABLE(htmlhelp, [ --enable-htmlhelp use wxHTML-based help], wxUSE_WXHTML_HELP)
143121c5
VZ
841WX_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS)
842WX_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
843WX_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI_ARCHITECTURE)
1e6feb95
VZ
844WX_ARG_ENABLE(loggui, [ --enable-loggui use standard GUI logger], wxUSE_LOGGUI)
845WX_ARG_ENABLE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_LOGWINDOW)
69d27ff7 846WX_ARG_ENABLE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG)
9a98a854
VZ
847
848dnl ---------------------------------------------------------------------------
849dnl PostScript options
850dnl ---------------------------------------------------------------------------
143121c5 851WX_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
9a98a854
VZ
852
853dnl VZ: these options seem to be always on, if someone wants to change it please do
143121c5
VZ
854dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS)
855dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT)
9a98a854
VZ
856
857dnl ---------------------------------------------------------------------------
858dnl resources
859dnl ---------------------------------------------------------------------------
1e6feb95 860
143121c5
VZ
861WX_ARG_ENABLE(prologio, [ --enable-prologio use Prolog IO library], wxUSE_PROLOGIO)
862WX_ARG_ENABLE(resources, [ --enable-resources use wxWindows resources], wxUSE_RESOURCES)
863
864WX_ARG_ENABLE(xresources, [ --enable-xresources use X resources for save (default for gtk+)], wxUSE_X_RESOURCES)
9a98a854 865
9a98a854
VZ
866dnl ---------------------------------------------------------------------------
867dnl IPC &c
868dnl ---------------------------------------------------------------------------
9a98a854 869
143121c5
VZ
870WX_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard classes], wxUSE_CLIPBOARD)
871WX_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
b64f0a5f 872WX_ARG_ENABLE(metafile, [ --enable-metafile use win32 metafiles], wxUSE_METAFILE)
143121c5 873
24176f2c 874WX_ARG_ENABLE(treelayout, [ --enable-treelayout use wxTreeLayout classes], wxUSE_TREELAYOUT)
9a98a854
VZ
875
876dnl ---------------------------------------------------------------------------
877dnl optional GUI controls (in alphabetical order except the first one)
878dnl ---------------------------------------------------------------------------
879
143121c5 880WX_ARG_ENABLE(controls, [ --enable-controls use all usual controls], wxUSE_CONTROLS)
9a98a854
VZ
881
882dnl even with --enable-controls, some may be disabled by giving
883dnl --disable-<control> later on the command line - but by default all will be
884dnl used (and vice versa)
885if test "$wxUSE_CONTROLS" = "yes"; then
886 DEFAULT_wxUSE_ACCEL=yes
1e6feb95
VZ
887 DEFAULT_wxUSE_BMPBUTTON=yes
888 DEFAULT_wxUSE_BUTTON=yes
889 DEFAULT_wxUSE_CALCTRL=no
9a98a854
VZ
890 DEFAULT_wxUSE_CARET=yes
891 DEFAULT_wxUSE_COMBOBOX=yes
9a98a854
VZ
892 DEFAULT_wxUSE_CHECKBOX=yes
893 DEFAULT_wxUSE_CHECKLISTBOX=yes
ce4169a4 894 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
895 DEFAULT_wxUSE_GAUGE=yes
896 DEFAULT_wxUSE_GRID=yes
cc977e5f 897 DEFAULT_wxUSE_NEW_GRID=yes
9a98a854
VZ
898 DEFAULT_wxUSE_IMAGLIST=yes
899 DEFAULT_wxUSE_LISTBOX=yes
900 DEFAULT_wxUSE_LISTCTRL=yes
901 DEFAULT_wxUSE_NOTEBOOK=yes
24176f2c 902 DEFAULT_wxUSE_PROPSHEET=yes
9a98a854
VZ
903 DEFAULT_wxUSE_RADIOBOX=yes
904 DEFAULT_wxUSE_RADIOBTN=yes
905 DEFAULT_wxUSE_SASH=yes
906 DEFAULT_wxUSE_SCROLLBAR=yes
907 DEFAULT_wxUSE_SLIDER=yes
908 DEFAULT_wxUSE_SPINBTN=yes
66f38406 909 DEFAULT_wxUSE_SPINCTRL=yes
9a98a854
VZ
910 DEFAULT_wxUSE_SPLITTER=yes
911 DEFAULT_wxUSE_STATBMP=yes
912 DEFAULT_wxUSE_STATBOX=yes
913 DEFAULT_wxUSE_STATLINE=yes
914 DEFAULT_wxUSE_STATUSBAR=yes
915 DEFAULT_wxUSE_TAB_DIALOG=yes
1db8dc4a 916 DEFAULT_wxUSE_TOGGLEBTN=yes
9a98a854 917 DEFAULT_wxUSE_TOOLBAR=yes
360d6699
VZ
918 DEFAULT_wxUSE_TOOLBAR_NATIVE=yes
919 DEFAULT_wxUSE_TOOLBAR_SIMPLE=yes
9a98a854
VZ
920 DEFAULT_wxUSE_TOOLTIPS=yes
921 DEFAULT_wxUSE_TREECTRL=yes
9f41d601 922 DEFAULT_wxUSE_POPUPWIN=yes
0b01706f 923 DEFAULT_wxUSE_TIPWINDOW=yes
9a98a854
VZ
924elif test "$wxUSE_CONTROLS" = "no"; then
925 DEFAULT_wxUSE_ACCEL=no
1e6feb95
VZ
926 DEFAULT_wxUSE_BMPBUTTON=no
927 DEFAULT_wxUSE_BUTTON=no
928 DEFAULT_wxUSE_CALCTRL=no
9a98a854
VZ
929 DEFAULT_wxUSE_CARET=no
930 DEFAULT_wxUSE_COMBOBOX=no
9a98a854
VZ
931 DEFAULT_wxUSE_CHECKBOX=no
932 DEFAULT_wxUSE_CHECKLISTBOX=no
ce4169a4 933 DEFAULT_wxUSE_CHOICE=no
9a98a854
VZ
934 DEFAULT_wxUSE_GAUGE=no
935 DEFAULT_wxUSE_GRID=no
f85afd4e 936 DEFAULT_wxUSE_NEW_GRID=no
9a98a854
VZ
937 DEFAULT_wxUSE_IMAGLIST=no
938 DEFAULT_wxUSE_LISTBOX=no
939 DEFAULT_wxUSE_LISTCTRL=no
940 DEFAULT_wxUSE_NOTEBOOK=no
24176f2c 941 DEFAULT_wxUSE_PROPSHEET=no
9a98a854
VZ
942 DEFAULT_wxUSE_RADIOBOX=no
943 DEFAULT_wxUSE_RADIOBTN=no
944 DEFAULT_wxUSE_SASH=no
945 DEFAULT_wxUSE_SCROLLBAR=no
946 DEFAULT_wxUSE_SLIDER=no
947 DEFAULT_wxUSE_SPINBTN=no
66f38406 948 DEFAULT_wxUSE_SPINCTRL=no
9a98a854
VZ
949 DEFAULT_wxUSE_SPLITTER=no
950 DEFAULT_wxUSE_STATBMP=no
951 DEFAULT_wxUSE_STATBOX=no
952 DEFAULT_wxUSE_STATLINE=no
953 DEFAULT_wxUSE_STATUSBAR=no
954 DEFAULT_wxUSE_TAB_DIALOG=no
1db8dc4a 955 DEFAULT_wxUSE_TOGGLEBTN=no
9a98a854 956 DEFAULT_wxUSE_TOOLBAR=no
360d6699
VZ
957 DEFAULT_wxUSE_TOOLBAR_NATIVE=no
958 DEFAULT_wxUSE_TOOLBAR_SIMPLE=no
9a98a854
VZ
959 DEFAULT_wxUSE_TOOLTIPS=no
960 DEFAULT_wxUSE_TREECTRL=no
9f41d601 961 DEFAULT_wxUSE_POPUPWIN=no
0b01706f 962 DEFAULT_wxUSE_TIPWINDOW=no
9a98a854
VZ
963fi
964
143121c5 965WX_ARG_ENABLE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
1e6feb95 966WX_ARG_ENABLE(button, [ --enable-button use wxButton class], wxUSE_BUTTON)
143121c5 967WX_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
1e6feb95
VZ
968WX_ARG_ENABLE(calendar, [ --enable-calendar use wxCalendarCtrl class], wxUSE_CALCTRL)
969WX_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET)
143121c5
VZ
970WX_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX)
971WX_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
ce4169a4
RR
972WX_ARG_ENABLE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE)
973WX_ARG_ENABLE(combobox, [ --enable-combobox use wxComboBox classes], wxUSE_COMBOBOX)
143121c5
VZ
974WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
975WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
f85afd4e 976WX_ARG_ENABLE(newgrid, [ --enable-newgrid use new wxGrid class], wxUSE_NEW_GRID)
143121c5
VZ
977WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
978WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
979WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
980WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
24176f2c 981WX_ARG_ENABLE(propsheet, [ --enable-propsheet use wxPropertySheet class], wxUSE_PROPSHEET)
143121c5
VZ
982WX_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX)
983WX_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN)
984WX_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH)
985WX_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
986WX_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER)
987WX_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN)
66f38406 988WX_ARG_ENABLE(spinctrl, [ --enable-spinctrl use wxSpinCtrl class], wxUSE_SPINCTRL)
143121c5
VZ
989WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER)
990WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
991WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
992WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
1e6feb95 993WX_ARG_ENABLE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT)
143121c5
VZ
994WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
995WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TABDIALOG)
1e6feb95 996WX_ARG_ENABLE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL)
1db8dc4a 997WX_ARG_ENABLE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN)
143121c5 998WX_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR)
360d6699
VZ
999WX_ARG_ENABLE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE)
1000WX_ARG_ENABLE(tbarsmpl, [ --enable-tbarsmpl use wxToolBarSimple class], wxUSE_TOOLBAR_SIMPLE)
143121c5 1001WX_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL)
0b01706f 1002WX_ARG_ENABLE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW)
9f41d601 1003WX_ARG_ENABLE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN)
9a98a854
VZ
1004
1005dnl ---------------------------------------------------------------------------
b1f5d087 1006dnl common dialogs
9a98a854
VZ
1007dnl ---------------------------------------------------------------------------
1008
b3e8d00a 1009WX_ARG_ENABLE(commondlg, [ --enable-commondlg use all common dialogs], wxUSE_COMMONDLGS)
1e6feb95
VZ
1010WX_ARG_ENABLE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG)
1011WX_ARG_ENABLE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG)
1012WX_ARG_ENABLE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG)
69d27ff7 1013WX_ARG_ENABLE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG)
1e6feb95 1014WX_ARG_ENABLE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG)
ce4169a4 1015WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG)
1e6feb95
VZ
1016WX_ARG_ENABLE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG)
1017WX_ARG_ENABLE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG)
cbca9943 1018WX_ARG_ENABLE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH)
c11584af 1019WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG)
a641505f 1020WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS)
ce4169a4 1021WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG)
b1f5d087
VZ
1022WX_ARG_ENABLE(wizarddlg, [ --enable-wizarddlg use wxWizard], wxUSE_WIZARDDLG)
1023
1024dnl ---------------------------------------------------------------------------
1025dnl misc GUI options
1026dnl ---------------------------------------------------------------------------
1027
1e6feb95 1028WX_ARG_ENABLE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS)
143121c5
VZ
1029WX_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME)
1030WX_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS)
1031WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES)
1032WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
d78b3d64 1033WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
b3e8d00a 1034WX_ARG_ENABLE(joystick, [ --enable-joystick use wxJoystick (Linux only)], wxUSE_JOYSTICK)
1e6feb95 1035WX_ARG_ENABLE(metafile, [ --enable-metafiles use wxMetaFile (Windows only)], wxUSE_METAFILE)
24fd6d87 1036WX_ARG_ENABLE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE)
143121c5 1037
0940bcf7
HH
1038dnl ---------------------------------------------------------------------------
1039dnl support for image formats that do not rely on external library
1040dnl ---------------------------------------------------------------------------
1041
d275c7eb 1042WX_ARG_ENABLE(palette, [ --enable-palette use wxPalette class], wxUSE_PALETTE)
0046ff7c 1043WX_ARG_ENABLE(image, [ --enable-image use wxImage class], wxUSE_IMAGE)
6b5286d1
HH
1044WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF)
1045WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX)
4b6b4dfc 1046WX_ARG_ENABLE(iff, [ --enable-iff use iff images (IFF file format)], wxUSE_IFF)
6b5286d1 1047WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM)
69d27ff7 1048WX_ARG_ENABLE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM)
c7206e64 1049WX_ARG_ENABLE(ico_cur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR)
0940bcf7 1050
b12915c1 1051fi
590b1a4d
SN
1052
1053dnl General settings (needed for GUI and non-GUI compilations alike).
1054dnl Path separator; ':' for unix, ';' for OS/2
1055dnl Stem for flex output; lexyy for OS/2, lex.yy otherwise
1056case "${host}" in
1057 *-pc-os2_emx | *-pc-os2-emx )
1058 dnl PATH_IFS is autodetected by OS/2's configure (usually ';')
1059 LEX_STEM="lexyy"
1060 ;;
1061 *)
1062 PATH_IFS=':'
1063 LEX_STEM="lex.yy"
1064 ;;
1065esac
1066
b12915c1
VZ
1067dnl for GUI only
1068
143121c5
VZ
1069dnl cache the options values before (may be) aborting below
1070WX_ARG_CACHE_FLUSH
9a98a854
VZ
1071
1072dnl check that no more than one toolkit is given and that if none are given that
1073dnl we have a default one
efeb0365 1074
143121c5
VZ
1075AC_MSG_CHECKING(for toolkit)
1076
e90c1d2a
VZ
1077if test "$wxUSE_GUI" = "yes"; then
1078
3a922bb4
RL
1079 if test "$USE_BEOS" = 1; then
1080 AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
1081 fi
b12915c1 1082
3a922bb4
RL
1083 if test "$TOOLKIT_GIVEN" = 1; then
1084 dnl convert "yes" to 1 and "no" to 0
1085 for toolkit in `echo $ALL_TOOLKITS`; do
1086 var=wxUSE_$toolkit
1087 eval "value=\$${var}"
1088 eval "$var=`echo \$value | sed -e "s/yes/1/" -e "s/no/0/"`"
1089 done
143121c5 1090 else
3a922bb4
RL
1091 dnl try to guess the most apropriate toolkit for this platform
1092 for toolkit in `echo $ALL_TOOLKITS`; do
1093 if test "$has_toolkit_in_cache" != 1; then
1094 var=DEFAULT_DEFAULT_wxUSE_$toolkit
1095 else
1096 var=DEFAULT_wxUSE_$toolkit
1097 fi
1098 eval "wxUSE_$toolkit=\$${var}"
1099 done
143121c5 1100 fi
4c0ed911 1101
3a922bb4
RL
1102 dnl we suppose that expr is available (maybe there is a better way to do
1103 dnl this? what about using ALL_TOOLKITS? TODO)
1104 NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MAC:-0} \
f79bd02d 1105 + ${wxUSE_WINE:-0} + ${wxUSE_MSW:-0} + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0} + ${wxUSE_X11:-0}`
9a98a854 1106
3a922bb4 1107 dnl Allow wxUSE_PM only for OS/2 with EMX.
3a922bb4 1108 case "${host}" in
9829f277 1109 *-pc-os2_emx | *-pc-os2-emx )
3a922bb4 1110 NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}`
3a922bb4 1111 esac
9a98a854 1112
3a922bb4
RL
1113 case "$NUM_TOOLKITS" in
1114 1)
1115 ;;
1116 0)
1117 AC_MSG_ERROR(Please specify a toolkit - cannot determine the default for ${host})
1118 ;;
1119 *)
1120 AC_MSG_ERROR(Please specify at most one toolkit (may be some are cached?))
1121 esac
143121c5 1122
3a922bb4
RL
1123 dnl cache the wxUSE_<TOOLKIT> values too
1124 for toolkit in `echo $ALL_TOOLKITS`; do
1125 var=wxUSE_$toolkit
1126 eval "value=\$${var}"
1127 if test "x$value" != x; then
1128 cache_var=CACHE_$toolkit
1129 eval "cache=\$${cache_var}"
1130 if test "$cache" = 1; then
1131 echo "$var=$value" >> ${wx_arg_cache_file}
1132 fi
1133 if test "$value" = 1; then
1134 toolkit_echo=`echo $toolkit | tr [[A-Z]] [[a-z]]`
1135 AC_MSG_RESULT($toolkit_echo)
1136 fi
1137 fi
1138 done
e90c1d2a 1139else
3a922bb4 1140 AC_MSG_RESULT(base ($host_alias hosted) only)
e90c1d2a
VZ
1141fi
1142
9a98a854
VZ
1143dnl ---------------------------------------------------------------------------
1144dnl Checks for programs
1145dnl ---------------------------------------------------------------------------
1146
1147dnl flush the cache because checking for programs might abort
1148AC_CACHE_SAVE
1149
1150dnl cross-compiling support: we're cross compiling if the build system is
1151dnl different from the target one (assume host and target be always the same)
e59890c3 1152if test "$build" != "$host" ; then
9d353d4a 1153 if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 -o "$USE_UNIX"; then
3a922bb4
RL
1154 CC=$host_alias-gcc
1155 CXX=$host_alias-c++
1156 AR=$host_alias-ar
1157 RANLIB=$host_alias-ranlib
1158 DLLTOOL=$host_alias-dlltool
1159 RESCOMP=$host_alias-windres
1160 LD=$host_alias-ld
1161 NM=$host_alias-nm
1162 STRIP=$host_alias-strip
1163 else
1164 AC_MSG_ERROR($build_alias -> $host_alias cross compilation not supported yet.)
1165 fi
9a98a854
VZ
1166fi
1167
1168dnl C-compiler checks
1169dnl defines CC with the compiler to use
1170dnl defines GCC with yes if using gcc
1171dnl defines GCC empty if not using gcc
1172dnl defines CFLAGS
1173AC_PROG_CC
1174
9a98a854
VZ
1175dnl is -traditional needed for correct compilations
1176dnl adds -traditional for gcc if needed
1177AC_PROG_GCC_TRADITIONAL
1178
1179AC_LANG_SAVE
1180AC_LANG_CPLUSPLUS
1181
1182dnl C++-compiler checks
1183dnl defines CXX with the compiler to use
1184dnl defines GXX with yes if using gxx
1185dnl defines GXX empty if not using gxx
1186dnl defines CXXFLAGS
1187AC_PROG_CXX
1188
9a98a854
VZ
1189AC_LANG_RESTORE
1190
1191dnl ranlib command
1192dnl defines RANLIB with the appropriate command
1193AC_PROG_RANLIB
1194
1195dnl ar command
1196dnl defines AR with the appropriate command
1197AC_CHECK_PROG(AR, ar, ar, ar)
1198
1199dnl install checks
1200dnl defines INSTALL with the appropriate command
6054113a 1201AC_PROG_INSTALL
d6853540
RL
1202case "${host}" in
1203
b5853384
GD
1204 dnl The other BSD's should probably go in here too, since this is
1205 dnl to workaround a strange static lib BSDism.
1206 dnl Mac OS X install seems to ignore -p option...
d6853540 1207 powerpc-*-darwin* )
eb99ae0b
GD
1208 INSTALL_PROGRAM="cp -fp"
1209 INSTALL_DATA="cp -fp"
d6853540
RL
1210 ;;
1211 *)
6054113a 1212 ;;
d6853540 1213esac
9a98a854 1214
9a98a854
VZ
1215dnl strip command
1216dnl defines STRIP as strip or nothing if not found
1217AC_CHECK_PROG(STRIP, strip, strip, true)
1218
414eab6d
VZ
1219dnl does make support "-include" (only GNU make does AFAIK)?
1220AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu,
1221[
1222 if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
c13b1125 1223 egrep -s GNU > /dev/null); then
414eab6d
VZ
1224 wx_cv_prog_makeisgnu="yes"
1225 else
1226 wx_cv_prog_makeisgnu="no"
1227 fi
1228])
1229
1230if test "x$wx_cv_prog_makeisgnu" = "xyes"; then
1231 IF_GNU_MAKE=""
1232else
1233 IF_GNU_MAKE="#"
1234fi
1235
1236AC_SUBST(IF_GNU_MAKE)
1237
1238dnl we don't need to check for VPATH support in GNU make - it does have it
1239if test "x$wx_cv_prog_makeisgnu" != "xyes"; then
9a98a854 1240dnl check if VPATH works
04e7a216 1241AC_CACHE_CHECK([if make supports VPATH], wx_cv_prog_makevpath, [
9a98a854
VZ
1242dnl create Makefile
1243cat - << EOF > confMake
1244check : file
1245 cp \$? \$@
1246 cp \$? final_file
1247EOF
1248
1249if test ! -d sub ; then
1250 mkdir sub
1251fi
1252echo dummy > sub/file
f6bcfd97 1253${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null
9a98a854
VZ
1254RESULT=$?
1255rm -f sub/file check final_file confMake
1256rmdir sub
1257if test "$RESULT" = 0; then
04e7a216 1258 wx_cv_prog_makevpath="yes"
9a98a854 1259else
04e7a216
VZ
1260 wx_cv_prog_makevpath="no"
1261fi
1262])
1263
1264if test "x$wx_cv_prog_makevpath" != "xyes"; then
1265AC_MSG_ERROR([
9a98a854
VZ
1266You need a make-utility that is able to use the variable
1267VPATH correctly.
1268If your version of make does not support VPATH correctly,
1269please install GNU-make (possibly as gmake), and start
1270configure with the following command:
1271export MAKE=gmake; ./configure for sh-type shells
1272setenv MAKE gmake; ./configure for csh-type shells
1273Also please do remember to use gmake in this case every time
1274you are trying to compile.
1e487827 1275])
414eab6d
VZ
1276fi dnl make without VPATH
1277fi dnl not GNU make
613d0995 1278
9a98a854
VZ
1279dnl YACC checks
1280dnl defines YACC with the appropriate command
1281AC_PROG_YACC
1282
1283dnl LEX checks
1284dnl defines LEX with the appropriate command
1285dnl defines LEXLIB with the appropriate library
2aa88730 1286AC_PROG_LEX
9a98a854 1287
c7114f59
VZ
1288dnl needed for making link to setup.h
1289AC_PROG_LN_S
1290
9a98a854
VZ
1291dnl ---------------------------------------------------------------------------
1292dnl Define search path for includes and libraries: all headers and libs will be
1293dnl looked for in all directories of this path
1294dnl ---------------------------------------------------------------------------
1295
ee31c269
VZ
1296dnl notice that /usr/include should not be in this list, otherwise it breaks
1297dnl compilation on Solaris/gcc because standard headers are included instead
928b5c08
VZ
1298dnl of the gcc ones (correction: it *is* needed for broken AIX compiler - but
1299dnl do put it last!)
afc31813
VZ
1300dnl
1301dnl Also try to put all directories which may contain X11R6 before those which
1302dnl may contain X11R5/4 - we want to use R6 on machines which have both!
9a98a854 1303SEARCH_INCLUDE="\
ee31c269
VZ
1304 /usr/local/include \
1305 \
9a98a854
VZ
1306 /usr/Motif-1.2/include \
1307 /usr/Motif-2.1/include \
1308 \
1309 /usr/include/Motif1.2 \
1310 /opt/xpm/include/X11 \
8636aed8
RR
1311 /opt/GBxpm/include/ \
1312 /opt/GBxpm/X11/include/ \
9a98a854
VZ
1313 \
1314 /usr/Motif1.2/include \
1315 /usr/dt/include \
afc31813
VZ
1316 /usr/openwin/include \
1317 \
9a98a854
VZ
1318 /usr/include/Xm \
1319 \
1320 /usr/X11R6/include \
afc31813 1321 /usr/X11R6.4/include \
9a98a854
VZ
1322 /usr/X11R5/include \
1323 /usr/X11R4/include \
1324 \
9a98a854
VZ
1325 /usr/include/X11R6 \
1326 /usr/include/X11R5 \
1327 /usr/include/X11R4 \
1328 \
1329 /usr/local/X11R6/include \
1330 /usr/local/X11R5/include \
1331 /usr/local/X11R4/include \
1332 \
1333 /usr/local/include/X11R6 \
1334 /usr/local/include/X11R5 \
1335 /usr/local/include/X11R4 \
1336 \
1337 /usr/X11/include \
1338 /usr/include/X11 \
1339 /usr/local/X11/include \
1340 /usr/local/include/X11 \
1341 \
1342 /usr/X386/include \
1343 /usr/x386/include \
1344 /usr/XFree86/include/X11 \
1345 \
4c0ed911 1346 X:/XFree86/include \
d51e8205
SN
1347 X:/XFree86/include/X11 \
1348 \
9a98a854 1349 /usr/include/gtk \
5a92d200 1350 /usr/local/include/gtk \
9a98a854 1351 /usr/include/glib \
5a92d200
RR
1352 /usr/local/include/glib \
1353 \
1354 /usr/include/qt \
1355 /usr/local/include/qt \
1356 \
a9b5e89f 1357 /usr/include/windows \
5a92d200
RR
1358 /usr/include/wine \
1359 /usr/local/include/wine \
1360 \
9a98a854
VZ
1361 /usr/unsupported/include \
1362 /usr/athena/include \
1363 /usr/local/x11r5/include \
1364 /usr/lpp/Xamples/include \
1365 \
9a98a854 1366 /usr/openwin/share/include \
928b5c08
VZ
1367 \
1368 /usr/include"
9a98a854
VZ
1369
1370SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
1371
1372dnl ------------------------------------------------------------------------
1373dnl Check for libraries
1374dnl ------------------------------------------------------------------------
1375
143121c5 1376dnl flush the cache because checking for libraries below might abort
9a98a854
VZ
1377AC_CACHE_SAVE
1378
4f14bcd8
GD
1379dnl ---------------------------------------------------------------------------
1380dnl Optional libraries
1381dnl
1382dnl --with-<lib>=sys
1383dnl looks for system library and fails if not found
1384dnl
1385dnl --with-<lib>
1386dnl --with-<lib>=yes
1387dnl looks for system library and, if not found, prints a warning,
1388dnl falls back to the builtin wx version, and continues configuration
1389dnl
1390dnl --with-<lib>=builtin
1391dnl uses builtin wx version without searching for system library
1392dnl
1393dnl --with-<lib>=no
1394dnl --without-<lib>
1395dnl do not use library (neither system nor builtin wx version)
1396dnl
1397dnl ---------------------------------------------------------------------------
1398
18dbb1f6
VZ
1399dnl ------------------------------------------------------------------------
1400dnl Check for regex libraries
1401dnl ------------------------------------------------------------------------
1402
1403REGEX_INCLUDE=
1404if test "$wxUSE_REGEX" != "no"; then
4f14bcd8
GD
1405 AC_DEFINE(wxUSE_REGEX)
1406
1407 if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then
1408 dnl according to Unix 98 specs, regcomp() is in libc but I believe that
1409 dnl on some old systems it may be in libregex - check for it too?
1410 AC_CHECK_HEADER(regex.h, AC_CHECK_FUNCS(regcomp))
1411
1412 if test "x$ac_cv_func_regcomp" != "xyes"; then
1413 if test "$wxUSE_REGEX" = "sys" ; then
1414 AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version])
1415 else
a3df447d 1416 AC_MSG_WARN([system regex library not found, will use built-in instead])
4f14bcd8
GD
1417 wxUSE_REGEX=builtin
1418 fi
1419 else
1420 dnl we are using the system library
1421 wxUSE_REGEX=sys
18dbb1f6 1422 fi
4f14bcd8 1423 fi
18dbb1f6 1424
4f14bcd8 1425 if test "$wxUSE_REGEX" = "builtin" ; then
18dbb1f6
VZ
1426 REGEX_INCLUDE="-I\${top_srcdir}/src/regex"
1427 fi
4f14bcd8 1428fi
18dbb1f6 1429
4f14bcd8
GD
1430dnl ------------------------------------------------------------------------
1431dnl Check for zlib compression library
1432dnl ------------------------------------------------------------------------
1433
1434ZLIB_INCLUDE=
1435ZLIB_LINK=
1436if test "$wxUSE_ZLIB" != "no" ; then
1437 AC_DEFINE(wxUSE_ZLIB)
1438
1439 if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then
3d63bc3a 1440 AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz"))
4f14bcd8
GD
1441
1442 if test "x$ZLIB_LINK" = "x" ; then
1443 if test "$wxUSE_ZLIB" = "sys" ; then
1444 AC_MSG_ERROR([system zlib compression library not found! Use --with-zlib=builtin to use built-in version])
1445 else
a3df447d 1446 AC_MSG_WARN([system zlib compression library not found, will use built-in instead])
4f14bcd8
GD
1447 wxUSE_ZLIB=builtin
1448 fi
1449 else
1450 dnl we are using the system library
1451 wxUSE_ZLIB=sys
1452 fi
1453 fi
1454
1455 if test "$wxUSE_ZLIB" = "builtin" ; then
1456 ZLIB_INCLUDE="-I\${top_srcdir}/src/zlib"
1457 fi
1458fi
1459
1460dnl ------------------------------------------------------------------------
1461dnl Check for png library
1462dnl ------------------------------------------------------------------------
1463
1464PNG_INCLUDE=
1465PNG_LINK=
1466if test "$wxUSE_LIBPNG" != "no" ; then
1467 AC_DEFINE(wxUSE_LIBPNG)
81809c07
VS
1468
1469 if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then
1470 AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead])
1471 wxUSE_LIBPNG=sys
1472 fi
4f14bcd8
GD
1473
1474 dnl for the check below to have a chance to succeed, we must already have
81809c07
VS
1475 dnl libz somewhere (don't do this when bulding wxMGL since its libpng
1476 dnl doesn't depend on zlib)
1477 if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then
a3df447d 1478 AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead])
4f14bcd8
GD
1479 wxUSE_LIBPNG=builtin
1480 fi
1481
81809c07
VS
1482 if test "$wxUSE_MGL" != 1 ; then
1483 dnl Don't check for libpng when building wxMGL, libmgl contains it
1484 if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then
1485 AC_CHECK_HEADER(png.h,
1486 AC_CHECK_LIB(png, png_check_sig,
1487 PNG_LINK=" -lpng",
1488 ,
1489 [-lz -lm])
1490 )
1491
1492 if test "x$PNG_LINK" = "x" ; then
1493 if test "$wxUSE_LIBPNG" = "sys" ; then
1494 AC_MSG_ERROR([system png library not found! Use --with-libpng=builtin to use built-in version])
1495 else
1496 AC_MSG_WARN([system png library not found, will use built-in instead])
1497 wxUSE_LIBPNG=builtin
1498 fi
4f14bcd8 1499 else
81809c07
VS
1500 dnl we are using the system library
1501 wxUSE_LIBPNG=yes
4f14bcd8 1502 fi
4f14bcd8
GD
1503 fi
1504 fi
1505
1506 if test "$wxUSE_LIBPNG" = "builtin" ; then
1507 PNG_INCLUDE="-I\${top_srcdir}/src/png"
1508 fi
1509
1510 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png"
1511fi
1512
1513dnl ------------------------------------------------------------------------
1514dnl Check for jpeg library
1515dnl ------------------------------------------------------------------------
1516
1517JPEG_INCLUDE=
1518JPEG_LINK=
1519if test "$wxUSE_LIBJPEG" != "no" ; then
1520 AC_DEFINE(wxUSE_LIBJPEG)
1521
81809c07
VS
1522 if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then
1523 AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead])
1524 wxUSE_LIBJPEG=sys
1525 fi
1526
1527 if test "$wxUSE_MGL" != 1 ; then
1528 dnl Don't check for libjpeg when building wxMGL, libmgl contains it
1529 if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then
1530 dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
1531 dnl HAVE_STDLIB_H which are already defined and this provokes
1532 dnl a compiler warning which configure considers as an error...
1533 AC_MSG_CHECKING(for jpeglib.h)
1534 AC_CACHE_VAL(ac_cv_header_jpeglib_h,
1535 AC_TRY_COMPILE(
1536 [
1537 #undef HAVE_STDLIB_H
1538 #include <stdio.h>
1539 #include <jpeglib.h>
1540 ],
1541 [
1542 ],
1543 ac_cv_header_jpeglib_h=yes,
1544 ac_cv_header_jpeglib_h=no
1545 )
4f14bcd8 1546 )
81809c07 1547 AC_MSG_RESULT($ac_cv_header_jpeglib_h)
4f14bcd8 1548
81809c07
VS
1549 if test "$ac_cv_header_jpeglib_h" = "yes"; then
1550 AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg")
1551 fi
4f14bcd8 1552
81809c07
VS
1553 if test "x$JPEG_LINK" = "x" ; then
1554 if test "$wxUSE_LIBJPEG" = "sys" ; then
1555 AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version])
1556 else
1557 AC_MSG_WARN([system jpeg library not found, will use built-in instead])
1558 wxUSE_LIBJPEG=builtin
1559 fi
4f14bcd8 1560 else
81809c07
VS
1561 dnl we are using the system library
1562 wxUSE_LIBJPEG=sys
4f14bcd8 1563 fi
4f14bcd8
GD
1564 fi
1565 fi
1566
1567 if test "$wxUSE_LIBJPEG" = "builtin" ; then
1568 JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
1569 fi
1570fi
1571
1572dnl ------------------------------------------------------------------------
1573dnl Check for tiff library
1574dnl ------------------------------------------------------------------------
1575
1576TIFF_INCLUDE=
1577TIFF_LINK=
1578if test "$wxUSE_LIBTIFF" != "no" ; then
1579 AC_DEFINE(wxUSE_LIBTIFF)
1580
1581 if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then
1582 AC_CHECK_HEADER(tiffio.h,
1583 AC_CHECK_LIB(tiff, TIFFError,
3d63bc3a 1584 TIFF_LINK=" -ltiff",
4f14bcd8
GD
1585 ,
1586 -lm)
1587 )
1588
1589 if test "x$TIFF_LINK" = "x" ; then
1590 if test "$wxUSE_LIBTIFF" = "sys" ; then
1591 AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version])
1592 else
a3df447d 1593 AC_MSG_WARN([system tiff library not found, will use built-in instead])
4f14bcd8
GD
1594 wxUSE_LIBTIFF=builtin
1595 fi
1596 else
1597 dnl we are using the system library
1598 wxUSE_LIBTIFF=sys
1599 fi
1600 fi
1601
1602 if test "$wxUSE_LIBTIFF" = "builtin" ; then
1603 TIFF_INCLUDE="-I\${top_srcdir}/src/tiff"
1604 fi
1605fi
1606
9a98a854
VZ
1607dnl ----------------------------------------------------------------
1608dnl search for toolkit (widget sets)
1609dnl ----------------------------------------------------------------
1610
dad6c0ea
VZ
1611AFMINSTALL=
1612
3a922bb4
RL
1613TOOLKIT=
1614TOOLKIT_INCLUDE=
1615WIDGET_SET=
e90c1d2a 1616
3a922bb4
RL
1617dnl are we building for a win32 target environment?
1618dnl If so, setup common stuff needed for both GUI and Base libs.
1619if test "$USE_WIN32" = 1 ; then
1620 AC_CHECK_HEADERS(w32api.h)
1621 AC_CHECK_HEADER(windows.h, [],
1622 [
1623 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
1624 ])
dad6c0ea 1625
ea7682f0
VS
1626 dnl check if can use _WIN32_IE macro
1627 AC_CACHE_CHECK([if w32api has good enough MSIE support], wx_cv_w32api_win32_ie,
3a922bb4
RL
1628 [
1629 AC_TRY_COMPILE([#include <w32api.h>],
1630 [
1631 #define wxCHECK_W32API_VERSION( major, minor ) \
1632 ( defined( __W32API_MAJOR_VERSION ) && defined( __W32API_MINOR_VERSION ) \
1633 && ( ( __W32API_MAJOR_VERSION > (major) ) \
1634 || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor))))
1635
1636 #if !wxCHECK_W32API_VERSION(1,1)
1637 #error You need w32api 1.1 or newer
1638 #endif
1639 ], [
ea7682f0 1640 wx_cv_w32api_win32_ie=yes
3a922bb4 1641 ], [
ea7682f0 1642 wx_cv_w32api_win32_ie=no
3a922bb4
RL
1643 ])
1644 ])
ea7682f0
VS
1645 if test "$wx_cv_w32api_win32_ie" = "yes" ; then
1646 CPPFLAGS="$CPPFLAGS -D_WIN32_IE=0x400"
1647 fi
9a98a854 1648
3a922bb4
RL
1649 dnl --- FIXME: This is still a somewhat random list of libs,
1650 dnl --- some of them should probably be included conditionally.
1651 LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32"
9a98a854 1652
77e13408
RL
1653 case "${host}" in
1654 *-*-cygwin* )
1655 dnl Cygwin doesn't include these by default
1656 LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32"
1657 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WIN95__"
1658 esac
7b7a7637 1659
3a922bb4
RL
1660 dnl add extra odbc libs if we have compiled in odbc
1661 if test "$wxUSE_ODBC" = "yes" ; then
a72a4bfa 1662 LIBS=" -lodbc32 -lole32 -loleaut32 $LIBS"
3a922bb4 1663 fi
9a98a854 1664
3a922bb4
RL
1665 RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__"
1666 RESPROGRAMOBJ="\$(PROGRAM)_resources.o"
1667fi
3f0f0161 1668
3a922bb4
RL
1669if test "$wxUSE_GUI" = "yes"; then
1670 USE_GUI=1
a9b5e89f 1671
3a922bb4 1672 GUI_TK_LIBRARY=
32832908 1673
3a922bb4
RL
1674 WXGTK12=
1675 WXGTK127=
1676 WXGTK20=
32832908 1677
77e13408 1678 if test "$wxUSE_MSW" = 1 ; then
1e6feb95
VZ
1679 TOOLKIT=MSW
1680 GUIDIST=MSW_DIST
77e13408
RL
1681
1682 dnl -mwindows causes a heap of other default gui libs to be linked in.
1683 dnl FIXME: If cygwin needs this, please push it above, if not, please
1684 dnl remove this comment :-)
1685 case "${host}" in
1686 *-*-mingw32* )
3d63bc3a 1687 LDFLAGS="$LDFLAGS -Wl,--subsystem,windows -mwindows"
77e13408 1688 esac
7e99ad86
VZ
1689 fi
1690
1e6feb95 1691 if test "$wxUSE_GTK" = 1; then
8168de4c 1692 AC_MSG_CHECKING([for GTK+ version])
b9fa850d 1693
8168de4c
VZ
1694 gtk_version_cached=1
1695 AC_CACHE_VAL(wx_cv_lib_gtk,
1696 [
1697 dnl stupid GTK+ AM macros produce their own messages, so we
1698 dnl have to pass to the next line
1699 gtk_version_cached=0
d48ad9bd 1700 AC_MSG_RESULT()
8168de4c 1701
3f345b47
VZ
1702 dnl we must link against lgthread unless the user
1703 dnl used --disable-threads
1704 GTK_MODULES=
1705 if test "$wxUSE_THREADS" = "yes"; then
1706 GTK_MODULES=gthread
1707 fi
1708
8168de4c
VZ
1709 wx_cv_lib_gtk=
1710 if test "x$wxUSE_GTK2" = "xyes"; then
1ae7bd02 1711 AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
8168de4c
VZ
1712 fi
1713
1714 if test -z "$wx_cv_lib_gtk"; then
3f345b47 1715 AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
8168de4c
VZ
1716 fi
1717
1718 if test -z "$wx_cv_lib_gtk"; then
3f345b47 1719 AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
8168de4c
VZ
1720 fi
1721
1722 if test -z "$wx_cv_lib_gtk"; then
1723 dnl looks better in AC_MSG_RESULT
1724 wx_cv_lib_gtk=none
138be253
VZ
1725 else
1726 dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
1727 dnl subsequent runs
1728 wx_cv_cflags_gtk=$GTK_CFLAGS
1729 wx_cv_libs_gtk=$GTK_LIBS
8168de4c
VZ
1730 fi
1731 ]
1732 )
b9fa850d 1733
8168de4c
VZ
1734 dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
1735 dnl enough
1736 if test "$gtk_version_cached" = 1; then
1737 AC_MSG_RESULT($wx_cv_lib_gtk)
1738 fi
b9fa850d 1739
8168de4c
VZ
1740 case "$wx_cv_lib_gtk" in
1741 2.0) WXGTK20=1
1742 ;;
1743 1.2.7) WXGTK127=1
d1a8d972 1744 WXGTK12=1
8168de4c
VZ
1745 ;;
1746 1.2.3) WXGTK12=1
1747 ;;
1748 *) AC_MSG_ERROR([
1749Please check that gtk-config is in path, the directory
1750where GTK+ libraries are installed (returned by
1751'gtk-config --libs' command) is in LD_LIBRARY_PATH or
1752equivalent variable and GTK+ is version 1.2.3 or above.
1753 ])
1754 ;;
1755 esac
c596875e 1756
138be253 1757 TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
11dfaa5f 1758 GUI_TK_LIBRARY="$wx_cv_libs_gtk"
7799a2d7 1759
1e6feb95
VZ
1760 AFMINSTALL=afminstall
1761 TOOLKIT=GTK
1762 GUIDIST=GTK_DIST
9a98a854 1763
1e6feb95
VZ
1764 dnl test for XIM support in libgdk
1765 AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
5a92d200
RR
1766 fi
1767
1e6feb95 1768 if test "$wxUSE_MGL" = 1; then
1e6feb95
VZ
1769 AC_MSG_CHECKING(for SciTech MGL library)
1770 if test "x$MGL_ROOT" = x ; then
1771 AC_MSG_RESULT(not found)
1772 AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.])
1773 else
1774 AC_MSG_RESULT($MGL_ROOT)
1775 fi
5a92d200 1776
f9bc1684
VS
1777 dnl Find MGL library that we want
1778 dnl FIXME_MGL - test for MGL variants for freebsd etc.
1779 case "${host}" in
1780 *-*-linux* )
1781 mgl_os=linux/gcc/glibc
1782 ;;
1783 *-pc-msdosdjgpp )
1784 mgl_os=dos32/dj2
1785 ;;
1786 *)
1787 AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
1788 esac
1789
3a922bb4 1790 mgl_lib_type=""
5a92d200 1791
1e6feb95 1792 if test "$wxUSE_DEBUG_FLAG" = yes ; then
223e7fbf
VS
1793 if test -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.a -o \
1794 -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.so; then
3a922bb4 1795 mgl_lib_type=debug
1e6feb95
VZ
1796 fi
1797 fi
3a922bb4 1798 if test "x$mgl_lib_type" = x ; then
223e7fbf
VS
1799 if test -f $MGL_ROOT/lib/release/$mgl_os/libmgl.a -o \
1800 -f $MGL_ROOT/lib/release/$mgl_os/libmgl.so; then
3a922bb4 1801 mgl_lib_type=release
1e6feb95
VZ
1802 else
1803 AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
1804 fi
1805 fi
264de0cc 1806
1e6feb95 1807 TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
3a922bb4 1808 GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
d607e6c3 1809
1e6feb95
VZ
1810 AFMINSTALL=afminstall
1811 TOOLKIT=MGL
1812 GUIDIST=MGL_DIST
d607e6c3 1813 fi
143121c5 1814
1725144d
RR
1815 if test "$wxUSE_MICROWIN" = 1; then
1816 AC_MSG_CHECKING(for MicroWindows)
1817 if test "x$MICROWINDOWS" = x ; then
1818 AC_MSG_RESULT(not found)
1819 AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
1820 else
1821 AC_MSG_RESULT($MICROWINDOWS)
1822 fi
1823
1824 if test -f $MICROWINDOWS/lib/libmwin.a; then
1825 AC_MSG_RESULT(MicroWindows' libraries found.)
1826 else
1827 AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
1828 fi
1829
1830 TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
1831 GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
1832
1833 AFMINSTALL=afminstall
1834 TOOLKIT=MICROWIN
1835 GUIDIST=MICROWIN_DIST
1836
1837 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__ -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
1838 fi
1839
7f5c07ab
JS
1840 if test "$wxUSE_X11" = 1; then
1841 dnl use standard macros to check for X headers/libs, this brings support
1842 dnl for the standard configure options --x-includes and --x-libraries
1843 AC_PATH_XTRA
1844
1845 if test "$no_x" = "yes"; then
1846 AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
1847 fi
1848
1849 GUI_TK_LIBRARY="$X_LIBS"
1850 TOOLKIT_INCLUDE="$X_CFLAGS"
1851 AFMINSTALL=afminstall
1852 COMPILED_X_PROGRAM=0
1853
256d631a 1854 if test "$wxUSE_NANOX" = "yes"; then
6ec507fd
JS
1855 AC_MSG_CHECKING(for MicroWindows/NanoX distribution)
1856 if test "x$MICROWIN" = x ; then
1857 AC_MSG_RESULT(not found)
1858 AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.])
1859 else
1860 AC_MSG_RESULT($MICROWIN)
c79a329d 1861 AC_DEFINE(wxUSE_NANOX)
6ec507fd
JS
1862 fi
1863 fi
1864
7f5c07ab
JS
1865 xpm_link=
1866 AC_MSG_CHECKING(for Xpm library)
1867 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
1868 if test "$ac_find_libraries" != "" ; then
1869 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
1870 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
1871 xpm_link=" -lXpm"
1872 AC_DEFINE(wxHAVE_LIB_XPM)
1873 AC_MSG_RESULT(found at $ac_find_libraries)
1874 else
1875 AC_TRY_COMPILE(
1876 [
1877 #include <X11/xpm.h>
1878 ],
1879 [
1880 int version;
1881 version = XpmLibraryVersion();
1882 ],
1883 [
1884 xpm_link=" -lXpm"
1885 AC_DEFINE(wxHAVE_LIB_XPM)
1886 AC_MSG_RESULT(found in default search path)
1887 COMPILED_X_PROGRAM=0
1888 ],
1889 [
1890 AC_MSG_RESULT(no)
1891 AC_MSG_WARN(library will be compiled without support for images in XPM format)
1892 ]
1893 )
1894 fi
1895
256d631a 1896 if test "$wxUSE_NANOX" = "yes"; then
4e5a4800 1897 TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
0b5c0e1a 1898 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 -DLINUX=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
461e93f9 1899 GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
6ec507fd 1900 else
0feee163 1901 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link"
6ec507fd
JS
1902 fi
1903
3c011993 1904 TOOLKIT_VPATH="\${top_srcdir}/src/x11"
7f5c07ab
JS
1905 TOOLKIT=X11
1906 GUIDIST=X11_DIST
7f5c07ab
JS
1907 fi
1908
1e6feb95 1909 if test "$wxUSE_WINE" = 1; then
3a922bb4
RL
1910 AC_CHECK_HEADER(windows.h, [],
1911 [
1e6feb95 1912 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
3a922bb4 1913 ])
788deba1 1914
3d63bc3a 1915 xpm_link=
1e6feb95
VZ
1916 AC_MSG_CHECKING(for Xpm library)
1917 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
1918 if test "$ac_find_libraries" != "" ; then
1919 GUI_TK_LIBRARY="-L$ac_find_libraries"
3d63bc3a 1920 xpm_link=" -lXpm"
1e6feb95
VZ
1921 AC_DEFINE(wxHAVE_LIB_XPM)
1922 AC_MSG_RESULT(found at $ac_find_libraries)
1923 else
1924 AC_MSG_RESULT(no)
1925 AC_MSG_WARN(library will be compiled without support for images in XPM format)
1926 fi
dad6c0ea 1927
3d63bc3a 1928 mesa_link=
1e6feb95
VZ
1929 AC_MSG_CHECKING(for Mesa library)
1930 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
1931 if test "$ac_find_libraries" != "" ; then
1932 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -L$ac_find_libraries"
3d63bc3a 1933 mesa_link=" -lMesaGL"
1e6feb95
VZ
1934 AC_MSG_RESULT(found at $ac_find_libraries)
1935 else
1936 AC_MSG_ERROR(no)
1937 fi
cd6d6d5b 1938
3d63bc3a 1939 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lwine$mesa_link$xpm_link -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses"
1e6feb95
VZ
1940 TOOLKIT=MSW
1941 GUIDIST=MSW_DIST
3a922bb4 1942 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXWINE__"
9a98a854
VZ
1943 fi
1944
1e6feb95 1945 if test "$wxUSE_MOTIF" = 1; then
d714471b
VZ
1946 dnl use standard macros to check for X headers/libs, this brings support
1947 dnl for the standard configure options --x-includes and --x-libraries
1948 AC_PATH_XTRA
1949
1e6feb95
VZ
1950 if test "$no_x" = "yes"; then
1951 AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
1952 fi
1953
1954 GUI_TK_LIBRARY="$X_LIBS"
1955 TOOLKIT_INCLUDE="$X_CFLAGS"
1e6feb95 1956 AFMINSTALL=afminstall
1e6feb95
VZ
1957 COMPILED_X_PROGRAM=0
1958
1959 AC_MSG_CHECKING(for Motif/Lesstif headers)
1960 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
1961 if test "$ac_find_includes" != "" ; then
1962 AC_MSG_RESULT(found $ac_find_includes)
cd6d6d5b 1963 else
cd6d6d5b
VZ
1964 AC_TRY_COMPILE(
1965 [
1966 #include <Xm/Xm.h>
1967 ],
1968 [
1969 int version;
cd6d6d5b
VZ
1970 version = xmUseVersion;
1971 ],
1972 [
1973 AC_MSG_RESULT(found in default search path)
1974 COMPILED_X_PROGRAM=1
1975 ],
1976 [
1977 AC_MSG_RESULT(no)
1e6feb95 1978 AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
cd6d6d5b
VZ
1979 ]
1980 )
1981 fi
9a98a854 1982
1e6feb95
VZ
1983 if test "$COMPILED_X_PROGRAM" = 0; then
1984 AC_MSG_CHECKING(for Motif/Lesstif library)
1985 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
1986 if test "$ac_find_libraries" != "" ; then
1987 WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
1988 WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
1989
62d0491b
RL
1990 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
1991 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
1e6feb95
VZ
1992 AC_MSG_RESULT(found at $ac_find_libraries)
1993 else
1994 dnl it might happen that we found headers in one of the standard
1995 dnl paths but the libs are elsewhere - we do need to try to
1996 dnl compile a sample program then here
1997 AC_TRY_COMPILE(
1998 [
1999 #include <Xm/Xm.h>
2000 ],
2001 [
2002 int version;
1e6feb95
VZ
2003 version = xmUseVersion;
2004 ],
2005 [
2006 AC_MSG_RESULT(found in default search path)
2007 COMPILED_X_PROGRAM=1
2008 ],
2009 [
2010 AC_MSG_RESULT(no)
2011 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
2012 ]
2013 )
2014 fi
2015 fi
2016
3d63bc3a 2017 xpm_link=
1e6feb95
VZ
2018 AC_MSG_CHECKING(for Xpm library)
2019 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
2020 if test "$ac_find_libraries" != "" ; then
2021 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
62d0491b 2022 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
3d63bc3a 2023 xpm_link=" -lXpm"
f6bcfd97 2024 AC_DEFINE(wxHAVE_LIB_XPM)
1e6feb95
VZ
2025 AC_MSG_RESULT(found at $ac_find_libraries)
2026 else
2027 AC_TRY_COMPILE(
2028 [
2029 #include <X11/xpm.h>
2030 ],
2031 [
2032 int version;
1e6feb95
VZ
2033 version = XpmLibraryVersion();
2034 ],
2035 [
3d63bc3a 2036 xpm_link=" -lXpm"
3a922bb4 2037 AC_DEFINE(wxHAVE_LIB_XPM)
1e6feb95
VZ
2038 AC_MSG_RESULT(found in default search path)
2039 COMPILED_X_PROGRAM=0
2040 ],
2041 [
2042 AC_MSG_RESULT(no)
2043 AC_MSG_WARN(library will be compiled without support for images in XPM format)
2044 ]
2045 )
2046 fi
9a98a854 2047
3d63bc3a 2048 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link -lXmu -lXext -lXt -lX11"
334f0d2c 2049 TOOLKIT_VPATH="\${top_srcdir}/src/motif${PATH_IFS}\${top_srcdir}/src/motif/xmcombo"
1e6feb95
VZ
2050 TOOLKIT=MOTIF
2051 GUIDIST=MOTIF_DIST
2052 fi
b4085ce6 2053
1e6feb95 2054 if test "$wxUSE_MAC" = 1; then
683dccda 2055 if test "$wxUSE_PRECOMP" = "yes"; then
3d63bc3a 2056 CPPFLAGS="$CPPFLAGS -cpp-precomp"
683dccda 2057 fi
3d63bc3a
RL
2058 CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile"
2059 CFLAGS="$CFLAGS -fpascal-strings"
2060 CXXFLAGS="$CXXFLAGS -fpascal-strings"
d08b457b 2061
13c0541d 2062 TOOLKIT_VPATH="\${top_srcdir}/src/mac${PATH_IFS}\${top_srcdir}/src/mac/morefile"
1e6feb95 2063 TOOLKIT=MAC
683dccda 2064 dnl we can't call this MAC_DIST or autoconf thinks its a macro
1e6feb95
VZ
2065 GUIDIST=MACX_DIST
2066 fi
e07802fc 2067
1e6feb95
VZ
2068 if test "$wxUSE_PM" = 1; then
2069 TOOLKIT=PM
2070 GUIDIST=GTK_DIST
2071 fi
2072
2073 dnl the name of the directory where the files for this toolkit live
3a922bb4 2074 if test "$TOOLKIT" = "PM" ; then
1e6feb95 2075 TOOLKIT_DIR="os2"
f6bcfd97 2076 else
3a922bb4 2077 TOOLKIT_DIR=`echo ${TOOLKIT} | tr "[[A-Z]]" "[[a-z]]"`
1e6feb95 2078 fi
9a98a854 2079
3a922bb4
RL
2080 dnl misc other files depending on the port
2081 PORT_FILES="\${top_srcdir}/src/\$(TOOLKITDIR)/files.lst"
517a619d 2082
1e6feb95
VZ
2083 if test "$wxUSE_UNIVERSAL" = "yes"; then
2084 ALL_OBJECTS="\$(GUI_LOWLEVEL_OBJS) \${UNIVOBJS}"
9b695262
VZ
2085
2086 dnl ALL_SOURCES and ALL_HEADERS shouldn't include really all sources
2087 dnl and headers as some/most are not needed for wxUniv but I don't
2088 dnl have time to add GUI_LOWLEVEL_SOURCES/HEADERS stuff now (TODO!)
2089 ALL_SOURCES="\$(ALL_SOURCES) \${UNIV_SOURCES}"
2090 ALL_HEADERS="\$(ALL_HEADERS) \${UNIV_HEADERS}"
2091
3a922bb4 2092 PORT_FILES="${PORT_FILES} \${top_srcdir}/src/univ/files.lst"
4175e952
RR
2093 if test "$wxUSE_X11" = 1; then
2094 TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}${PATH_IFS}\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes"
2095 else
2096 TOOLKIT_VPATH="\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes${PATH_IFS}\${top_srcdir}/src/${TOOLKIT_DIR}"
2097 fi
3a922bb4
RL
2098 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__"
2099 WIDGET_SET=univ
1e6feb95
VZ
2100 else
2101 ALL_OBJECTS="\$(GUIOBJS)"
9b695262
VZ
2102 ALL_SOURCES="\$(ALL_SOURCES)"
2103 ALL_HEADERS="\$(ALL_HEADERS)"
1e6feb95
VZ
2104 fi
2105
ba0e650c 2106 ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)"
1e6feb95 2107
f9bc1684 2108 if test "$TOOLKIT" != "MSW" -a "$USE_DOS" != 1; then
1e6feb95
VZ
2109 ALL_OBJECTS="${ALL_OBJECTS} \$(UNIXOBJS)"
2110 fi
2111
2112 if test "$wxUSE_HTML" = "yes"; then
2113 ALL_OBJECTS="${ALL_OBJECTS} \$(HTMLOBJS)"
2114 fi
3fcdd07b 2115
4f14bcd8 2116 if test "$wxUSE_LIBJPEG" = "builtin" ; then
2224580a 2117 ALL_OBJECTS="${ALL_OBJECTS} \$(JPEGOBJS)"
d9d8273d 2118 fi
4f14bcd8 2119 if test "$wxUSE_LIBTIFF" = "builtin" ; then
d9d8273d
RR
2120 ALL_OBJECTS="${ALL_OBJECTS} \$(TIFFOBJS)"
2121 fi
4f14bcd8 2122 if test "$wxUSE_LIBPNG" = "builtin" ; then
d9d8273d
RR
2123 ALL_OBJECTS="${ALL_OBJECTS} \$(PNGOBJS)"
2124 fi
2224580a 2125
2224580a
VZ
2126 dnl distribute samples/demos/utils with GUI versions
2127 GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST"
2128 DISTDIR="wx\$(TOOLKIT)"
e90c1d2a 2129else
dad6c0ea
VZ
2130 USE_GUI=0
2131
3a922bb4
RL
2132 dnl this doesn't quite work right for wxBase, but the places
2133 dnl where it is wrong aren't fatal (yet) though.
07eb77a6 2134 TOOLKIT_DIR="base"
f6bcfd97 2135
e90c1d2a 2136 dnl the sources, their dependenices and the headers
3a922bb4
RL
2137 if test "$USE_WIN32" = 1 ; then
2138 ALL_OBJECTS="\${BASE_OBJS} \${BASE_MSW_OBJS}"
2139 TOOLKIT_VPATH="\${top_srcdir}/src/msw"
e90c1d2a 2140
3a922bb4
RL
2141 dnl yes, the toolkit for wxBase on win32 is actually MSW
2142 dnl wxBase on unix does not need a 'TOOLKIT' defined.
2143 TOOLKIT="MSW"
2144 else
2145 ALL_OBJECTS="\${BASE_OBJS} \${BASE_UNIX_OBJS}"
2146 TOOLKIT_VPATH="\${top_srcdir}/src/unix"
a20b6d3a
VZ
2147 fi
2148
d8356fa3
VZ
2149 ALL_SOURCES="\$(ALL_SOURCES)"
2150 ALL_HEADERS="\$(ALL_HEADERS)"
2151
831b3152 2152 PORT_FILES="\${top_srcdir}/src/files.lst"
2224580a
VZ
2153
2154 dnl distribute only wxBase sources/headers
2155 GUIDIST="BASE_DIST"
2156 DISTDIR="wxBase"
e90c1d2a
VZ
2157fi
2158
4f14bcd8
GD
2159dnl ---------------------------------------------------------------------------
2160dnl Optional libraries included when system library is not used
2161dnl ---------------------------------------------------------------------------
e45387bf
VZ
2162
2163dnl ODBC objects are Unix only
2164if test "$TOOLKIT" != "MSW" -a "$wxUSE_ODBC" = "yes" ; then
2165 ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)"
2166fi
2167
4f14bcd8 2168if test "$wxUSE_REGEX" = "builtin" ; then
3a922bb4
RL
2169 ALL_OBJECTS="${ALL_OBJECTS} \$(REGEXOBJS)"
2170fi
4f14bcd8 2171if test "$wxUSE_ZLIB" = "builtin" ; then
3a922bb4
RL
2172 ALL_OBJECTS="${ALL_OBJECTS} \$(ZLIBOBJS)"
2173fi
2174
4f14bcd8
GD
2175dnl ---------------------------------------------------------------------------
2176dnl OpenGL libraries
2177dnl ---------------------------------------------------------------------------
3a922bb4 2178if test "$wxUSE_OPENGL" = "yes"; then
62d0491b
RL
2179 if test "$wxUSE_MAC" = 1; then
2180 OPENGL_LIBS="-framework OpenGL -framework AGL"
2181 else
2182
2183 AC_CHECK_HEADER(GL/gl.h,
2184 [
1352efdf 2185 AC_MSG_CHECKING([for -lGL])
62d0491b
RL
2186 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],[GL])
2187 if test "$ac_find_libraries" != "" ; then
2188 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
4b6b4dfc
RR
2189 if test "$ac_path_to_link" = " -L/usr/lib" ; then
2190 LDFLAGS_GL="$LDFLAGS"
2191 else
2192 LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
2193 fi
62d0491b 2194 OPENGL_LIBS="-lGL -lGLU"
1352efdf 2195 AC_MSG_RESULT([yes])
62d0491b 2196 else
1352efdf
RL
2197 AC_MSG_RESULT([no])
2198 AC_MSG_CHECKING([for -lMesaGL])
62d0491b
RL
2199 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],[MesaGL])
2200 if test "$ac_find_libraries" != "" ; then
2201 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
2202 LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
2203 OPENGL_LIBS="-lMesaGL -lMesaGLU"
1352efdf
RL
2204 AC_MSG_RESULT([yes])
2205 else
2206 AC_MSG_RESULT([no])
62d0491b
RL
2207 fi
2208 fi
2209 ])
fb56368a 2210
6f754473 2211 dnl check for OpenGL libs availability first
57964555
RL
2212 dnl -lGL requires -lm with soem OpenGL versions
2213
62d0491b
RL
2214# AC_CHECK_HEADER(GL/gl.h,
2215# [
2216# AC_CHECK_LIB(GL, glFlush,
2217# [
2218# OPENGL_LIBS="-lGL -lGLU"
2219# ],
2220# [
2221# AC_CHECK_LIB(MesaGL, glFlush,
2222# [
2223# OPENGL_LIBS="-lMesaGL -lMesaGLU"
2224# ],
2225# [],
2226# [-lm])
2227# ],
2228# [-lm])
2229# ])
2230
2231 if test "x$OPENGL_LIBS" = "x"; then
2232 dnl it should be an error and not a warning because OpenGL is not on
2233 dnl by default and so if it had been explicitely requested, we
2234 dnl shouldn't just fall back to compiling the library without it
2235 AC_MSG_ERROR(OpenGL libraries not available)
2236 fi
6f754473 2237 fi
6f754473 2238
62d0491b
RL
2239 if test "$wxUSE_OPENGL" = "yes"; then
2240 AC_DEFINE(wxUSE_OPENGL)
2241 AC_DEFINE(wxUSE_GLCANVAS)
2242 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl"
2243 fi
3a922bb4
RL
2244fi
2245
2246if test -z "$TOOLKIT_VPATH" ; then
2247 TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}"
2248fi
2249
2250dnl the symbol which allows conditional compilation for the given toolkit
2251if test -n "$TOOLKIT" ; then
2252 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__"
2253fi
2254
f676c7ff
MB
2255lib_unicode_suffix=
2256if test "$wxUSE_UNICODE" = "yes"; then
2257 lib_unicode_suffix=u
2258fi
2259
3a922bb4
RL
2260lib_debug_suffix=
2261if test "$wxUSE_DEBUG_FLAG" = "yes"; then
2262 lib_debug_suffix=d
3a922bb4
RL
2263fi
2264
f676c7ff
MB
2265TOOLCHAIN_NAME="${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}-${WX_RELEASE}"
2266TOOLCHAIN_NAME_GL="${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}_gl-${WX_RELEASE}"
3a922bb4
RL
2267
2268if test "$cross_compiling" = "yes"; then
2269 TOOLCHAIN_NAME="${TOOLCHAIN_NAME}-${host_alias}"
2270 TOOLCHAIN_NAME_GL="${TOOLCHAIN_NAME_GL}-${host_alias}"
2271fi
2272
2273dnl library link name
2274WX_LIBRARY="wx_${TOOLCHAIN_NAME}"
2275WX_LIBRARY_GL="wx_${TOOLCHAIN_NAME_GL}"
2276
3a922bb4
RL
2277dnl the name of the shared library
2278WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
2279WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
b12915c1 2280
3a922bb4
RL
2281dnl the name of the links to the shared library
2282WX_LIBRARY_LINK1="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}"
2283WX_LIBRARY_LINK2="lib${WX_LIBRARY}.${SO_SUFFIX}"
2284WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}"
2285WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
55e80573 2286
d08b457b
GD
2287dnl the name of the resources file for wxMac
2288WX_RESOURCES_MACOSX="lib${WX_LIBRARY}.rsrc"
e23081de 2289WX_RESOURCES_MACOSX_COMPILED="lib${WX_LIBRARY}.r"
55e80573 2290
978f1259
RL
2291case "${host}" in
2292 *-*-cygwin* | *-*-mingw32* )
2293
2294 dnl If we are cross compiling we want to use the 'full' unix type name for the
2295 dnl lib, but for a native install use the windows style naming convention.
2da4f892 2296 dnl (excepting again that we strip the ELF style version numbers off it).
978f1259
RL
2297
2298 dnl FIXME: is this GL stuff actually even used for wxMSW? should it be??
2299
2300 if test "$cross_compiling" != "yes"; then
2301 WX_LIBRARY="wxmsw${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}"
2302 WX_LIBRARY_GL="wxmsw_gl${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}"
2303 WX_LIBRARY_NAME_SHARED="${WX_LIBRARY}.${SO_SUFFIX}"
2304 WX_LIBRARY_NAME_SHARED_GL="${WX_LIBRARY_GL}.${SO_SUFFIX}"
2da4f892
RL
2305 else
2306 WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}"
2307 WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
978f1259
RL
2308 fi
2309
2310esac
2311
2312dnl the name of the static library
2313WX_LIBRARY_NAME_STATIC="lib${WX_LIBRARY}.a"
2314WX_LIBRARY_NAME_STATIC_GL="lib${WX_LIBRARY_GL}.a"
2315
2316dnl define which libs wx-config should link.
2317WXCONFIG_LIBS="-l${WX_LIBRARY}"
885d4bf5 2318WXCONFIG_LIBS_STATIC="lib${WX_LIBRARY}.a"
978f1259
RL
2319
2320if test "$wxUSE_OPENGL" = "yes"; then
885d4bf5
VS
2321 WXCONFIG_LIBS_GL="-l${WX_LIBRARY_GL} ${OPENGL_LIBS}"
2322 WXCONFIG_LIBS_STATIC_GL="lib${WX_LIBRARY_GL}.a ${OPENGL_LIBS}"
978f1259
RL
2323fi
2324
2325
3a922bb4 2326dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
55e80573 2327
4222829b
VS
2328if test "$wxUSE_SHARED" = "yes"; then
2329 case "${host}" in
2330 *-pc-os2_emx | *-pc-os2-emx | \
2331 *-pc-msdosdjgpp )
2332 dnl only static for now
2333 wxUSE_SHARED=no
2334 AC_MSG_WARN([Host system doesn't support shared libraries, disabling])
2335 ;;
2336 esac
2337fi
2338
3a922bb4 2339if test "$wxUSE_SHARED" = "yes"; then
55e80573
VZ
2340
2341 dnl install targets
2342 if test "$wxUSE_OPENGL" = "yes"; then
2343 WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS CREATE_INSTALLED_LINKS_GL"
3a922bb4 2344 WX_ALL="\$(build_libdir)/${WX_LIBRARY_LINK1} \$(build_libdir)/${WX_LIBRARY_LINK1_GL}"
55e80573
VZ
2345 else
2346 WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
3a922bb4 2347 WX_ALL="\$(build_libdir)/${WX_LIBRARY_LINK1}"
55e80573
VZ
2348 fi
2349
2350 dnl the extra compiler flags needed for compilation of shared library
dd4f7467
VZ
2351 if test "$GCC" = "yes"; then
2352 dnl the switch for gcc is the same under all platforms
2353 PIC_FLAG="-fPIC"
2354 fi
55e80573
VZ
2355
2356 dnl the command to use for creating the shared library
2357 SHARED_LD="${CXX} -shared -o"
2358
2359 case "${host}" in
2360 *-hp-hpux* )
2361 dnl default settings are good for gcc but not for the native HP-UX
d569ea8d
GD
2362 if test "$GCC" == "yes"; then
2363 SHARED_LD="${SHARED_LD} ${PIC_FLAG}"
2364 else
f6bcfd97 2365 dnl no idea why it wants it, but it does
3d63bc3a 2366 LDFLAGS="$LDFLAGS -L/usr/lib"
f6bcfd97 2367
be087207
RR
2368 SHARED_LD="${CXX} -b -o"
2369 PIC_FLAG="+Z"
2370 fi
55e80573 2371
7b7a7637
RL
2372 dnl install shared libs without symlinks
2373 if test "$wxUSE_OPENGL" = "yes"; then
2374 WX_ALL_INSTALLED="preinstall_gl"
2375 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED} \$(build_libdir)/${WX_LIBRARY_NAME_SHARED_GL}"
2376 else
2377 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED}"
2378 fi
de87c353 2379 ;;
b12915c1 2380
de87c353 2381 *-*-linux* )
55e80573
VZ
2382 if test "$GCC" != "yes"; then
2383 AC_CACHE_CHECK([for Intel compiler], wx_cv_prog_icc,
2384 [
2385 AC_TRY_COMPILE([],
2386 [
2387 #ifndef __INTEL_COMPILER
dd4f7467 2388 #error Not icc
55e80573
VZ
2389 #endif
2390 ],
2391 wx_cv_prog_icc=yes,
2392 wx_cv_prog_icc=no
2393 )
2394 ])
55e80573
VZ
2395 if test "$wx_cv_prog_icc" = "yes"; then
2396 PIC_FLAG="-KPIC"
2397 fi
2398 fi
2399
3a922bb4
RL
2400 if test "$wxUSE_SONAME" = "yes" ; then
2401 SONAME_FLAGS="-Wl,-soname,${WX_LIBRARY_LINK1}"
2402 SONAME_FLAGS_GL="-Wl,-soname,${WX_LIBRARY_LINK1_GL}"
f6bcfd97
BP
2403 dnl substitute this in makelib.env for the contrib libs
2404 WX_TARGET_LIBRARY_SONAME="-Wl,-soname,\$(TARGETLIB_LINK1)"
00cf1208 2405 fi
de87c353 2406 ;;
55e80573 2407
de87c353
RR
2408 *-*-solaris2* )
2409 if test "$GCC" = yes ; then
f6bcfd97
BP
2410 dnl newer versions of gcc need -isystem to compile X headers on
2411 dnl Solaris (which use old style C syntax)
2412 CPPFLAGS="$CPPFLAGS -isystem /usr/openwin/include"
de87c353
RR
2413 else
2414 SHARED_LD="${CXX} -G -o"
10f2d63a 2415 PIC_FLAG="-KPIC"
7b7a7637 2416 SONAME_FLAGS="-h ${WX_LIBRARY_NAME_SHARED}"
471944dc 2417 SONAME_FLAGS_GL="-h ${WX_LIBRARY_NAME_SHARED_GL}"
de87c353 2418 fi
de87c353 2419 ;;
55e80573 2420
b4085ce6 2421 *-*-darwin* )
90f3fe56
GD
2422 dnl For Unix to MacOS X porting instructions, see:
2423 dnl http://fink.sourceforge.net/doc/porting/porting.html
156b2523
GD
2424 CFLAGS="$CFLAGS -fno-common -DDYLIB_INIT"
2425 CXXFLAGS="$CXXFLAGS -fno-common -DDYLIB_INIT"
3010d50a
GD
2426 dnl Executables must necessarily fully bind the wxWindows library at
2427 dnl program launch otherwise lazy binding breaks RTTI class info
2428 LDFLAGS="$LDFLAGS -Wl,-bind_at_load"
156b2523 2429 SHARED_LD="$CXX -dynamiclib -init _wxWindowsDylibInit -o"
ea5999b9 2430 PIC_FLAG="-dynamic -fPIC"
90f3fe56
GD
2431 SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}"
2432 SONAME_FLAGS_GL=${SONAME_FLAGS}
de87c353 2433 ;;
55e80573 2434
de87c353
RR
2435 *-*-aix* )
2436 SHARED_LD="/usr/lpp/xlC/bin/makeC++SharedLib -p 0 -o"
de87c353 2437 ;;
55e80573 2438
7b7a7637 2439 *-*-cygwin* | *-*-mingw32* )
77e13408 2440
2da4f892 2441 WX_LIBRARY_IMPORTLIB="${WX_LIBRARY_NAME_SHARED}.a"
77e13408 2442
77e13408 2443 SHARED_LD="${CXX} -shared -Wl,--out-implib,lib/${WX_LIBRARY_IMPORTLIB} -o"
00c81359 2444 TOOLCHAIN_DLL_DEFS="${TOOLCHAIN_DLL_DEFS} -DWXUSINGDLL=1"
25d0687a
RL
2445
2446 PIC_FLAG="-UWXUSINGDLL -DWXMAKINGDLL=1 -D_DLL=1 -D_WINDLL=1"
7b7a7637
RL
2447
2448 dnl install shared libs without symlinks
f6bcfd97
BP
2449 if test "$wxUSE_OPENGL" = "yes"; then
2450 WX_ALL_INSTALLED="preinstall_gl"
978f1259 2451 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED} \$(build_libdir)/${WX_LIBRARY_NAME_SHARED_GL}"
f6bcfd97 2452 else
978f1259 2453 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED}"
f6bcfd97 2454 fi
de87c353 2455 ;;
55e80573 2456
b12915c1
VZ
2457 *-*-beos* )
2458 dnl can't use gcc under BeOS for shared library creation because it
2459 dnl complains about missing 'main'
2460 SHARED_LD="${LD} -shared -o"
b12915c1 2461 ;;
55e80573
VZ
2462
2463 *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | \
2464 *-*-sunos4* | \
2465 *-*-irix5* | *-*-irix6* | \
2466 *-*-osf* | \
2467 *-*-dgux5* | \
2468 *-*-sysv5* )
2469 dnl defaults are ok
2470 ;;
2471
de87c353 2472 *)
7b7a7637 2473 AC_MSG_ERROR(unknown system type $host.)
de87c353 2474 esac
9a98a854 2475
72dd34b5
VZ
2476 dnl set target to shared if not explicitly chose static before
2477 if test "x$WX_TARGET_LIBRARY" = "x"; then
2478 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
bdad4e7e 2479 WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_SHARED_GL}"
72dd34b5 2480 fi
55e80573 2481
3711412e
RL
2482 dnl do not alter the LIBRARY_TYPE strings "so" and "a", they are magic
2483 WX_TARGET_LIBRARY_TYPE="so"
885d4bf5 2484 INSTALL_LIBRARY='$(INSTALL_PROGRAM)'
3a922bb4 2485fi
f6bcfd97 2486
3a922bb4
RL
2487dnl do not 'else' this, it may be changed in the above conditional.
2488if test "$wxUSE_SHARED" = "no"; then
f6bcfd97 2489
3a922bb4
RL
2490 dnl give static wxBase and wxMSW build a working install target
2491 if test "$wxUSE_GUI" = "no" -o "$USE_WIN32" = 1 ; then
f6bcfd97
BP
2492 dnl we're here because WX_ALL_INSTALLED is empty, but play safe anyway
2493 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall"
2494 fi
2495
6fa882bd
RR
2496 if test "$wxUSE_MAC" = 1; then
2497 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall"
2498 fi
2499
3a922bb4
RL
2500 if test "$wxUSE_OPENGL" = "yes"; then
2501 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_gl"
2502 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_STATIC} \$(build_libdir)/${WX_LIBRARY_NAME_STATIC_GL}"
2503 else
2504 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_STATIC}"
2505 fi
2506
2507 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
2508 WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_STATIC_GL}"
2509
3711412e 2510 WX_TARGET_LIBRARY_TYPE="a"
885d4bf5 2511 INSTALL_LIBRARY='$(INSTALL_DATA)'
517a619d
RR
2512fi
2513
d08b457b
GD
2514if test "$wxUSE_MAC" = 1; then
2515 dnl add the resources target for wxMac
2516 WX_ALL="${WX_ALL} \$(build_libdir)/lib${WX_LIBRARY}.r"
e23081de 2517 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_res"
d08b457b 2518 AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez)
9f8148b1 2519 AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
ef7f2189 2520 MACOSX_BUNDLE="bundle"
d08b457b
GD
2521 LIBWXMACRES="\$(top_builddir)/lib/lib${WX_LIBRARY}.r"
2522 LIBWXMACRESCOMP="\$(RESCOMP) Carbon.r -t APPL ${LIBWXMACRES} -o \$(BIN_PROGRAM)"
e23081de 2523 LIBWXMACRESWXCONFIG="${RESCOMP} Carbon.r -t APPL \${prefix}/lib/${WX_RESOURCES_MACOSX_COMPILED} -o"
590b1a4d
SN
2524else
2525 if test "$wxUSE_PM" = 1; then
2526 LIBWXMACRESCOMP="emxbind -ep \$(BIN_PROGRAM)"
2527 fi
d08b457b
GD
2528fi
2529
9a98a854
VZ
2530dnl ------------------------------------------------------------------------
2531dnl Check for headers
2532dnl ------------------------------------------------------------------------
2533
f0c87536
VZ
2534dnl test for strings.h needed under AIX, but do not check for it wxMac as
2535dnl it exists but is only a simple redirection to string.h and it is in
2536dnl conflict with Strings.h in FlatCarbon headers
13c0541d 2537if test "$wxUSE_MAC" != 1; then
f0c87536 2538 dnl defines HAVE_STRINGS_H
13c0541d
GD
2539 AC_CHECK_HEADERS(strings.h)
2540fi
2541
1f8ae82f
GD
2542dnl defines HAVE_STDLIB_H
2543AC_CHECK_HEADERS(stdlib.h)
9f8148b1
GD
2544dnl defines HAVE_MALLOC_H
2545AC_CHECK_HEADERS(malloc.h)
9a98a854
VZ
2546dnl defines HAVE_UNISTD_H
2547AC_CHECK_HEADERS(unistd.h)
2548dnl defines HAVE_WCHAR_H
0046ff7c 2549AC_CHECK_HEADERS(wchar.h)
f0c87536
VZ
2550
2551dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
2552if test "$ac_cv_header_wchar_h" != "yes"; then
2553 dnl defines HAVE_WCSTR_H
2554 AC_CHECK_HEADERS(wcstr.h)
2555fi
2556
2557dnl checking for wctype.h is useless as we need wcslen(), not just wchar_t and
2558dnl this function is never provided by it
2559dnl AC_CHECK_HEADERS(wctype.h)
2560
9a98a854
VZ
2561dnl defines HAVE_FNMATCH_H
2562AC_CHECK_HEADERS(fnmatch.h)
6f72b082
OK
2563dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
2564AC_CHECK_HEADERS(langinfo.h)
e90c1d2a 2565
73fd4a60
VZ
2566if test "$wxUSE_GUI" = "yes"; then
2567 if test "$wxUSE_UNIX" = "yes"; then
2568 dnl defines HAVE_X11_XKBLIB_H
2569 AC_CHECK_HEADERS(X11/XKBlib.h)
2570 fi
e90c1d2a 2571fi
9a98a854
VZ
2572
2573dnl ---------------------------------------------------------------------------
2574dnl Checks for typedefs
2575dnl ---------------------------------------------------------------------------
2576
2577dnl defines mode_t if not already defined
2578AC_TYPE_MODE_T
2579dnl defines off_t if not already defined
2580AC_TYPE_OFF_T
2581dnl defines pid_t if not already defined
2582AC_TYPE_PID_T
2583dnl defines size_t if not already defined
2584AC_TYPE_SIZE_T
2585dnl defines uid_t and gid_t if not already defined
2586AC_TYPE_UID_T
2587
0046ff7c 2588dnl check for wchar_t
4b42290e 2589dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
0fbb762e 2590dnl on Cygwin wchar.h needs stddef.h to be #included by hand
0046ff7c
VS
2591AC_CACHE_CHECK([for wchar_t], wx_cv_type_wchar_t,
2592[
4b42290e
GD
2593 AC_TRY_COMPILE(
2594 [
2595 #ifdef HAVE_WCHAR_H
0fbb762e
MB
2596 # ifdef __CYGWIN__
2597 # include <stddef.h>
2598 # endif
4b42290e
GD
2599 # include <wchar.h>
2600 #endif
2601 #ifdef HAVE_STDLIB_H
2602 # include <stdlib.h>
2603 #endif
2604 ],
0046ff7c 2605 [
d836ee96
VZ
2606 wchar_t wc, *ws;
2607 wc = L'a';
2608 ws = L"Hello, world!";
0046ff7c 2609 ],
d836ee96 2610 wx_cv_type_wchar_t=yes,
5d6c4365 2611 wx_cv_type_wchar_t=no
d836ee96 2612 )
0046ff7c 2613])
d836ee96
VZ
2614
2615if test "$wx_cv_type_wchar_t" = "yes"; then
0046ff7c
VS
2616 AC_DEFINE(wxUSE_WCHAR_T)
2617fi
2618
d836ee96
VZ
2619dnl check what exactly size_t is on this machine - this is necessary to avoid
2620dnl ambiguos overloads in several places, notably wx/string.h and wx/array.h
19af3b06
VZ
2621AC_LANG_SAVE
2622AC_LANG_CPLUSPLUS
d836ee96
VZ
2623AC_CACHE_CHECK([if size_t is unsigned int],
2624 wx_cv_size_t_is_uint,
dd2c8b7c
VZ
2625 dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
2626 dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
2627 dnl methods in a local class (i.e. class inside a function) declaration
2628 dnl without any objections!!
2629 dnl
2630 dnl hence the hack below: we must have Foo at global scope!
d836ee96
VZ
2631 AC_TRY_COMPILE([#include <stddef.h>],
2632 [
dd2c8b7c
VZ
2633 return 0; }
2634
d836ee96 2635 struct Foo { void foo(size_t); void foo(unsigned int); };
dd2c8b7c
VZ
2636
2637 int bar() {
d836ee96
VZ
2638 ],
2639 wx_cv_size_t_is_uint=no,
2640 wx_cv_size_t_is_uint=yes
2641 )
2642)
2643
2644if test "$wx_cv_size_t_is_uint" = "yes"; then
2645 AC_DEFINE(wxSIZE_T_IS_UINT)
2646else
2647 AC_CACHE_CHECK([if size_t is unsigned long],
2648 wx_cv_size_t_is_ulong,
2649 AC_TRY_COMPILE([#include <stddef.h>],
2650 [
dd2c8b7c
VZ
2651 return 0; }
2652
d836ee96 2653 struct Foo { void foo(size_t); void foo(unsigned long); };
dd2c8b7c
VZ
2654
2655 int bar() {
d836ee96
VZ
2656 ],
2657 wx_cv_size_t_is_ulong=no,
2658 wx_cv_size_t_is_ulong=yes
2659 )
2660 )
2661
2662 if test "$wx_cv_size_t_is_ulong" = "yes"; then
2663 AC_DEFINE(wxSIZE_T_IS_ULONG)
2664 fi
2665fi
2666
19af3b06
VZ
2667AC_LANG_RESTORE
2668
9a98a854
VZ
2669dnl ---------------------------------------------------------------------------
2670dnl Checks for structures
2671dnl ---------------------------------------------------------------------------
2672
b12915c1
VZ
2673dnl does passwd struct has the pw_gecos field?
2674AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
2675 [
2676 AC_TRY_COMPILE([#include <pwd.h>],
2677 [
2678 char *p;
2679 struct passwd *pw;
2680 p = pw->pw_gecos;
2681 ],
2682 [
2683 wx_cv_struct_pw_gecos=yes
b12915c1
VZ
2684 ],
2685 [
2686 wx_cv_struct_pw_gecos=no
2687 ]
2688 )
2689 ]
2690)
2691
bd3277fe
VZ
2692if test "$wx_cv_struct_pw_gecos" = "yes"; then
2693 AC_DEFINE(HAVE_PW_GECOS)
2694fi
2695
9a98a854
VZ
2696dnl ---------------------------------------------------------------------------
2697dnl Checks for compiler characteristics
2698dnl ---------------------------------------------------------------------------
2699
2700dnl defines const to be empty if c-compiler does not support const fully
2701AC_C_CONST
2702dnl defines inline to a sensible value for the c-compiler
2703AC_C_INLINE
2704
2705dnl check the sizes of integral types (give some reasonable default values for
2706dnl cross-compiling)
2707dnl defines the size of certain types of variables in SIZEOF_<TYPE>
d716d967
RR
2708AC_CHECK_SIZEOF(char, 1)
2709AC_CHECK_SIZEOF(short, 2)
17c89ef3 2710AC_CHECK_SIZEOF(void *, 4)
9a98a854
VZ
2711AC_CHECK_SIZEOF(int, 4)
2712AC_CHECK_SIZEOF(long, 4)
9d353d4a
RR
2713
2714case "${host}" in
2715 arm-*-linux* )
2716 AC_CHECK_SIZEOF(long long, 8)
2717 ;;
2718 * )
2719 AC_CHECK_SIZEOF(long long, 0)
2720esac
2721
9a98a854 2722
b93d0d08 2723dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
4b42290e 2724dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h
1f8ae82f 2725dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
b93d0d08
VS
2726AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
2727[
2728 AC_TRY_RUN(
2729 [
1e6feb95 2730 #ifdef HAVE_WCHAR_H
0fbb762e
MB
2731 # ifdef __CYGWIN__
2732 # include <stddef.h>
2733 # endif
1e6feb95
VZ
2734 # include <wchar.h>
2735 #endif
2736 #ifdef HAVE_STDLIB_H
2737 # include <stdlib.h>
2738 #endif
2739 #include <stdio.h>
2740 int main()
2741 {
2742 FILE *f=fopen("conftestval", "w");
2743 if (!f) exit(1);
2744 fprintf(f, "%i", sizeof(wchar_t));
2745 exit(0);
2746 }
b93d0d08 2747 ],
1e6feb95
VZ
2748 wx_cv_sizeof_wchar_t=`cat conftestval`,
2749 wx_cv_sizeof_wchar_t=0,
2750 wx_cv_sizeof_wchar_t=4
2751 )
b93d0d08
VS
2752])
2753
28c6addc 2754AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t)
b93d0d08 2755
bcd2b961
VZ
2756dnl for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
2757WX_C_BIGENDIAN
239bca2e 2758
9a98a854
VZ
2759dnl check for iostream (as opposed to iostream.h) standard header
2760WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
2761
2762dnl check whether C++ compiler supports bool built-in type
2763WX_CPP_BOOL
2764
9a98a854
VZ
2765dnl ---------------------------------------------------------------------------
2766dnl Check for functions
2767dnl ---------------------------------------------------------------------------
2768
2769dnl check for wcslen
2770AC_CHECK_LIB(c, wcslen, [
2771 AC_DEFINE(HAVE_WCSLEN)
3d63bc3a 2772 WCHAR_LINK=
9a98a854
VZ
2773 ], [
2774 AC_CHECK_LIB(w, wcslen, [
2775 AC_DEFINE(HAVE_WCSLEN)
3d63bc3a 2776 WCHAR_LINK=" -lw"
18dbb1f6
VZ
2777 ], [
2778 AC_CHECK_LIB(msvcrt, wcslen, [
2779 AC_DEFINE(HAVE_WCSLEN)
3d63bc3a 2780 WCHAR_LINK=
18dbb1f6 2781 ])
9a98a854
VZ
2782 ])
2783 ])
2784
b3e8d00a
VZ
2785dnl use wcsrtombs instead of wcstombs which is buggy in old GNU libc versions
2786dnl if possible
2787AC_CHECK_FUNCS(wcsrtombs)
2788
9a98a854
VZ
2789dnl check for vprintf/vsprintf() which are GNU extensions
2790AC_FUNC_VPRINTF
2791
f6bcfd97
BP
2792dnl check for vsscanf() and vsnprintf() - on some platforms (Linux, glibc
2793dnl 2.1.1 for the first one, HP-UX for the second) it's available in the
f9bc1684
VS
2794dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS() here,
2795dnl do it manually. We can't use AC_TRY_COMPILE(), either, because it doesn't
2796dnl check if the symbol is available at linking time
f6bcfd97 2797
f9bc1684
VS
2798dnl we use AC_TRY_LINK() here instead of AC_TRY_RUN() to make the checks
2799dnl work for cross-compilation, but AC_TRY_LINK() normally only compiles
f6bcfd97 2800dnl one function while we need at least 2 - hence the ugly hack below. To
f9bc1684 2801dnl understand why it works, remember that AC_TRY_LINK() just prepends
f6bcfd97
BP
2802dnl "int main() {" in the beginning of the code and "; return 0; }" at the
2803dnl end...
2804
c521c494
RL
2805dnl if we fail to find vsnprintf, also try for _vsnprintf as that is what
2806dnl we'll find under MSW if it exists.
2807
f9bc1684 2808dnl final note: AC_TRY_LINK will only be executed if there is nothing in
9d8deca0
VZ
2809dnl the cache so we have to do AC_DEFINE(HAVE_VSNPRINTF) below and not inside
2810dnl it or the symbol wouldn't be defined for the 2nd and subsequent configure
2811dnl runs
2812
f6bcfd97
BP
2813dnl check for vsnprintf() - a safe version of vsprintf()
2814AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
aea02638 2815[
f9bc1684 2816 AC_TRY_LINK([
f6bcfd97
BP
2817 #include <stdio.h>
2818 #include <stdarg.h>
2819 ], [
2820 int wx_test_vsnprintf(const char *, ...);
3a3eed31 2821
f6bcfd97
BP
2822 wx_test_vsnprintf("%s");
2823 return 0;
2824 }
2825
2826 int wx_test_vsnprintf(const char *fmt, ...)
2827 {
2828 char *s;
3a3eed31 2829
f6bcfd97
BP
2830 va_list argp;
2831 va_start(argp, fmt);
2832 vsnprintf(s, 42, fmt, argp);
2833 va_end(argp);
2834 ], [
f6bcfd97
BP
2835 wx_cv_func_vsnprintf=yes
2836 ], [
f9bc1684 2837 AC_TRY_LINK([
c521c494
RL
2838 #include <stdio.h>
2839 #include <stdarg.h>
2840 ], [
2841 int wx_test_vsnprintf(const char *, ...);
2842
2843 wx_test_vsnprintf("%s");
2844 return 0;
2845 }
2846
2847 int wx_test_vsnprintf(const char *fmt, ...)
2848 {
2849 char *s;
2850
2851 va_list argp;
2852 va_start(argp, fmt);
2853 _vsnprintf(s, 42, fmt, argp);
2854 va_end(argp);
2855 ], [
c521c494
RL
2856 wx_cv_func_vsnprintf=yes
2857 ], [
c521c494
RL
2858 wx_cv_func_vsnprintf=no
2859 ])
f6bcfd97
BP
2860 ])
2861])
3a3eed31 2862
9d8deca0
VZ
2863if test "$wx_cv_func_vsnprintf" = yes; then
2864 AC_DEFINE(HAVE_VSNPRINTF)
2865else
f9bc1684 2866 AC_MSG_WARN(unsafe function vsprintf will be used instead of vsnprintf)
9d8deca0
VZ
2867fi
2868
f6bcfd97
BP
2869dnl check for vsscanf()
2870AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
2871[
2872 AC_TRY_COMPILE([
2873 #include <stdio.h>
2874 #include <stdarg.h>
2875 ], [
2876 int wx_test_vsscanf(const char *, ...);
2877
2878 wx_test_vsscanf("%d");
2879 return 0;
3a3eed31
VZ
2880 }
2881
f6bcfd97 2882 int wx_test_vsscanf(const char *fmt, ...)
3a3eed31 2883 {
f6bcfd97
BP
2884 va_list argp;
2885 va_start(argp, fmt);
2886 vsscanf("42", fmt, argp);
2887 va_end(argp);
2888 ], [
f6bcfd97
BP
2889 wx_cv_func_vsscanf=yes
2890 ], [
2891 wx_cv_func_vsscanf=no
2892 ])
aea02638
VZ
2893])
2894
9d8deca0
VZ
2895if test "$wx_cv_func_vsscanf" = yes; then
2896 AC_DEFINE(HAVE_VSSCANF)
2897fi
2898
f6bcfd97 2899dnl the following tests are for Unix(like) systems only
b089607b 2900if test "$TOOLKIT" != "MSW"; then
a0c79abb 2901
95c8801c
VS
2902dnl check for available version of iconv()
2903
2904AC_LANG_SAVE
2905AC_LANG_CPLUSPLUS
b040e242
VS
2906AM_ICONV
2907LIBS="$LIBICONV $LIBS"
95c8801c 2908AC_LANG_RESTORE
95c8801c 2909
eb4efbdc
VZ
2910dnl check for POSIX signals if we need them
2911if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
2912 AC_CHECK_FUNCS(sigaction)
2913
2914 if test "$ac_cv_func_sigaction" = "no"; then
2915 AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called])
2916 wxUSE_ON_FATAL_EXCEPTION=no
2917 fi
f6bcfd97
BP
2918
2919 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
2920 AC_LANG_SAVE
2921 AC_LANG_CPLUSPLUS
2922
2923 AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
2924 [
2925 AC_TRY_COMPILE([#include <signal.h>],
2926 [
2927 extern void testSigHandler(int);
2928
2929 struct sigaction sa;
2930 sa.sa_handler = testSigHandler;
2931 ], [
2932 wx_cv_type_sa_handler=int
2933 ], [
2934 wx_cv_type_sa_handler=void
2935 ])
2936 ])
2937
2938 AC_LANG_RESTORE
2939
2940 AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
2941 fi
eb4efbdc
VZ
2942fi
2943
9a98a854
VZ
2944dnl check for vfork() (even if it's the same as fork() in modern Unices)
2945AC_CHECK_FUNCS(vfork)
2946
ade35f11
VZ
2947dnl check for the function for temp files creation
2948AC_CHECK_FUNCS(mkstemp mktemp, break)
2949
9952adac
VZ
2950dnl get the library function to use for wxGetDiskSpace(): it is statfs() under
2951dnl Linux and *BSD and statvfs() under Solaris
52e8b690
VZ
2952AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
2953 AC_TRY_COMPILE(
2954 [
9952adac 2955 #if defined(__BSD__)
d08b457b
GD
2956 #include <sys/param.h>
2957 #include <sys/mount.h>
2958 #else
2959 #include <sys/vfs.h>
2960 #endif
52e8b690
VZ
2961 ],
2962 [
2963 long l;
2964 struct statfs fs;
2965 statfs("/", &fs);
2966 l = fs.f_bsize;
2967 l += fs.f_blocks;
2968 l += fs.f_bavail;
2969 ],
2970 [
2971 wx_cv_func_statfs=yes
2972 ],
2973 [
2974 wx_cv_func_statfs=no
2975 ]
2976 )
2977)
2978
2979if test "$wx_cv_func_statfs" = "yes"; then
2980 AC_DEFINE(HAVE_STATFS)
2981else
9952adac
VZ
2982 AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs,
2983 AC_TRY_COMPILE(
2984 [
2985 #include <sys/statvfs.h>
2986 ],
2987 [
2988 long l;
2989 struct statvfs fs;
2990 statvfs("/", &fs);
2991 l = fs.f_bsize;
2992 l += fs.f_blocks;
2993 l += fs.f_bavail;
2994 ],
2995 [
2996 wx_cv_func_statvfs=yes
2997 ],
2998 [
2999 wx_cv_func_statvfs=no
3000 ]
3001 )
af15babd 3002 )
9952adac
VZ
3003
3004 if test "$wx_cv_func_statvfs" = "yes"; then
3005 AC_DEFINE(HAVE_STATVFS)
3006 else
3007 AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
3008 fi
52e8b690
VZ
3009fi
3010
4f3c5f06
VZ
3011dnl check for fcntl() or at least flock() needed by Unix implementation of
3012dnl wxSingleInstanceChecker
3013if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
3014 AC_CHECK_FUNCS(fcntl flock, break)
3015
3016 if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then
3017 AC_MSG_WARN(wxSingleInstanceChecker not available)
3018 wxUSE_SNGLINST_CHECKER=no
3019 fi
3020fi
3021
270a909e
VZ
3022dnl check for timegm() used by datetime.cpp
3023AC_CHECK_FUNCS(timegm)
3024
4f3c5f06 3025dnl look for a function to modify the environment
8fd0d89b
VZ
3026AC_CHECK_FUNCS(putenv setenv, break)
3027
b12915c1
VZ
3028HAVE_SOME_SLEEP_FUNC=0
3029if test "$USE_BEOS" = 1; then
3030 dnl BeOS has its own (wonder where did they get it from) sleep() function
3031 dnl in unistd.h
3032 AC_DEFINE(HAVE_SLEEP)
3033 HAVE_SOME_SLEEP_FUNC=1
3034fi
3035
f11bdd03 3036if test "$USE_DARWIN" = 1; then
b4085ce6
GD
3037 dnl Mac OS X has both nanosleep and usleep
3038 dnl but only usleep is defined in unistd.h
3039 AC_DEFINE(HAVE_USLEEP)
3040 HAVE_SOME_SLEEP_FUNC=1
3041fi
3042
b12915c1
VZ
3043if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
3044 dnl try nanosleep() in libc and libposix4, if this fails - usleep()
3045 POSIX4_LINK=
3046 AC_CHECK_FUNCS(nanosleep,
3047 AC_DEFINE(HAVE_NANOSLEEP),
3048 [
3049 AC_CHECK_LIB(posix4, nanosleep,
3050 [
3051 AC_DEFINE(HAVE_NANOSLEEP)
3d63bc3a 3052 POSIX4_LINK=" -lposix4"
b12915c1
VZ
3053 ],
3054 [
b4085ce6 3055 AC_CHECK_FUNCS(usleep,
4f3c5f06
VZ
3056 AC_DEFINE(HAVE_USLEEP),
3057 AC_MSG_WARN([wxSleep() function will not work])
3058 )
b12915c1
VZ
3059 ]
3060 )
3061 ]
3062 )
3063fi
9a98a854
VZ
3064
3065dnl check for uname (POSIX) and gethostname (BSD)
3066AC_CHECK_FUNCS(uname gethostname, break)
3067
6098c7f9
VZ
3068dnl check for MT-safe version of strtok (on DEC Alpha, it's ok for C compiler
3069dnl but not for C++ one - hence change language)
3070AC_LANG_SAVE
3071AC_LANG_CPLUSPLUS
3072
e90c1d2a
VZ
3073AC_CHECK_FUNCS(strtok_r)
3074
6098c7f9
VZ
3075AC_LANG_RESTORE
3076
c63c7106 3077dnl check for inet_addr and inet_aton (these may live either in libc, or in
c6712985 3078dnl libnsl or libresolv or libsocket)
c63c7106
VZ
3079INET_LINK=
3080AC_CHECK_FUNCS(inet_addr,
3081 AC_DEFINE(HAVE_INET_ADDR),
3082 [
3083 AC_CHECK_LIB(nsl, inet_addr,
270a909e 3084 INET_LINK="nsl",
c63c7106 3085 AC_CHECK_LIB(resolv, inet_addr,
c6712985
SN
3086 INET_LINK="resolv",
3087 AC_CHECK_LIB(socket, inet_addr,
3088 INET_LINK="socket"
3089 )
c63c7106
VZ
3090 )
3091 )
3092 ]
3093)
3094
3095AC_CHECK_FUNCS(inet_aton,
3096 AC_DEFINE(HAVE_INET_ATON),
3097 [
3098 dnl only check it in the same lib
3099 AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
3100 ])
3101
3102if test "x$INET_LINK" != "x"; then
3103 AC_DEFINE(HAVE_INET_ADDR)
3d63bc3a 3104 INET_LINK=" -l$INET_LINK"
c63c7106 3105fi
e96ac54e 3106
a0c79abb 3107fi
b089607b 3108dnl if !MSW
a0c79abb 3109
9a98a854
VZ
3110dnl ===========================================================================
3111dnl Now we have all the info we need - use it!
3112dnl ===========================================================================
3113
3114dnl flush the cache
3115AC_CACHE_SAVE
3116
3117dnl ---------------------------------------------------------------------------
a9b5e89f 3118dnl thread support for Unix (always available under Win32)
9a98a854
VZ
3119dnl ---------------------------------------------------------------------------
3120
b089607b 3121dnl under MSW we always have thread support
009fead0 3122CPP_MT_FLAG=
b089607b 3123if test "$TOOLKIT" != "MSW"; then
a9b5e89f 3124
7274f1c7 3125 dnl the code below:
009fead0
VZ
3126 dnl
3127 dnl defines THREADS_LINK and THREADS_CFLAGS which are the options
3128 dnl necessary to build the MT programs for the linker and compiler
3129 dnl respectively
3130 dnl
3131 dnl sets wxUSE_THREADS=1 if thread support is activated
7274f1c7
RL
3132
3133 THREADS_LINK=
009fead0 3134 THREADS_CFLAGS=
7274f1c7
RL
3135
3136 if test "$wxUSE_THREADS" = "yes" ; then
3137 if test "$wxUSE_WINE" = 1 ; then
156b2523 3138 AC_MSG_WARN([Threads are not supported under WINE... disabled])
7274f1c7
RL
3139 wxUSE_THREADS="no"
3140 elif test "$USE_BEOS" = 1; then
156b2523 3141 AC_MSG_WARN([BeOS threads are not yet supported... disabled])
7274f1c7
RL
3142 wxUSE_THREADS="no"
3143 fi
77c85c2b 3144 fi
39c9d5ac 3145
7274f1c7
RL
3146 if test "$wxUSE_THREADS" = "yes" ; then
3147 dnl find if POSIX threads are available
009fead0
VZ
3148 dnl
3149 dnl the tests here are based on ACX_PTHREAD macro from autoconf macro
3150 dnl archive from http://ac-archive.sourceforge.net/
3151 dnl
3152 dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro
3153 dnl Forero Cuervo <bachue@bachue.com> for the original code
3154
3155 dnl TODO: cache the result
3156
3157 dnl define the list of the thread options to try in the loop below
3158 dnl with the convention that anything starting with '-' is a cpp flag
3159 dnl while anything else is a library (i.e. there is an implicit "-l")
3160 THREAD_OPTS="-pthread"
3161 case "${host}" in
3162 *-*-solaris2* | *-*-sunos4* )
3163 if test "x$GCC" = "xyes"; then
3164 dnl apparently some Solaris/gcc combinations use this one
3165 THREAD_OPTS="$THREAD_OPTS -pthreads"
3166 else
3167 THREAD_OPTS="-mt $THREAD_OPTS"
3168 fi
3169 ;;
3170 *-*-freebsd*)
3171 dnl look, in order, for the kernel threads, then Linux threads
3172 dnl and finally the userland threads
3173 THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
3174 ;;
3175 *-*-aix* )
3176 dnl AIX calls the library libpthreads - thanks IBM!
3177 THREAD_OPTS="pthreads"
3178 ;;
009fead0 3179 esac
c596875e 3180
595e0e44
VZ
3181 dnl simply linking with libpthread should make the test below work but
3182 dnl it's far from certain that the threaded programs compiled without
3183 dnl any special switches actually work, so try it after all the others
3184 THREAD_OPTS="$THREAD_OPTS -lpthread none"
3185
009fead0
VZ
3186 dnl now test for all possibilities
3187 THREADS_OK=no
3188 for flag in $THREAD_OPTS; do
3189 case $flag in
3190 none)
3191 AC_MSG_CHECKING([whether pthreads work without any flags])
3192 ;;
f6bcfd97 3193
009fead0
VZ
3194 -*)
3195 AC_MSG_CHECKING([whether pthreads work with $flag])
3196 THREADS_CFLAGS="$flag"
3197 ;;
9a98a854 3198
009fead0
VZ
3199 *)
3200 AC_MSG_CHECKING([for the pthreads library -l$flag])
3201 THREADS_LINK="-l$flag"
3202 ;;
3203 esac
3204
3205 save_LIBS="$LIBS"
3206 save_CFLAGS="$CFLAGS"
3207 LIBS="$THREADS_LINK $LIBS"
3208 CFLAGS="$CFLAGS $THREADS_CFLAGS"
3209
3210 AC_TRY_LINK([#include <pthread.h>],
3211 [pthread_create(0,0,0,0);],
3212 THREADS_OK=yes)
3213
3214 LIBS="$save_LIBS"
3215 CFLAGS="$save_CFLAGS"
3216
3217 AC_MSG_RESULT($THREADS_OK)
3218 if test "x$THREADS_OK" = "xyes"; then
3219 break;
3220 fi
3221
3222 THREADS_LINK=""
3223 THREADS_CFLAGS=""
3224 done
3225
3226 if test "x$THREADS_OK" != "xyes"; then
3227 wxUSE_THREADS=no
3228 AC_MSG_WARN([No thread support on this system... disabled])
3229 else
3230 AC_MSG_CHECKING([if more special flags are required for pthreads])
3231 flag=no
3232 case "${host}" in
3233 *-aix* | *-freebsd*)
3234 flag="-D_THREAD_SAFE"
3235 ;;
3236 *solaris* | alpha*-osf*)
3237 flag="-D_REENTRANT"
3238 ;;
3239 esac
3240 AC_MSG_RESULT(${flag})
3241 if test "x$flag" != xno; then
3242 THREADS_CFLAGS="$flag $THREADS_CFLAGS"
3243 fi
3244
3245 if test "x$THREADS_LINK" != "x"; then
3246 LIBS="$THREADS_LINK $LIBS"
3247 fi
3248
3249 if test "x$THREADS_CFLAGS" != "x"; then
3250 CFLAGS="$CFLAGS $THREADS_CFLAGS"
3251 CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
3252 fi
3253 fi
aea02638 3254 fi
9a98a854 3255
7274f1c7
RL
3256 dnl do other tests only if we are using threads
3257 if test "$wxUSE_THREADS" = "yes" ; then
3258 AC_CHECK_FUNCS(thr_setconcurrency)
3259
7274f1c7 3260 AC_CHECK_HEADERS(sched.h)
009fead0
VZ
3261 if test "$ac_cv_header_sched_h" = "yes"; then
3262 AC_CHECK_FUNC(sched_yield,
3263 AC_DEFINE(HAVE_SCHED_YIELD),
3264 [
3265 AC_CHECK_LIB(posix4,
3266 sched_yield,
3267 [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
3268 AC_MSG_WARN(wxThread::Yield will not work properly)
3269 )
3270 ]
3271 )
3272 fi
9a98a854 3273
7274f1c7
RL
3274 dnl to be able to set the thread priority, we need to have all of the
3275 dnl following functions:
3276 dnl 1. pthread_attr_getschedpolicy
3277 dnl 2. sched_get_priority_min and sched_get_priority_max
3278 dnl (this one can be in either libpthread or libposix4 (under Solaris))
3279 dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
3280 HAVE_PRIOR_FUNCS=0
009fead0
VZ
3281 AC_CHECK_FUNC(pthread_attr_getschedpolicy,
3282 AC_CHECK_FUNC(pthread_attr_setschedparam,
3283 AC_CHECK_FUNC(sched_get_priority_max,
7274f1c7
RL
3284 HAVE_PRIOR_FUNCS=1,
3285 AC_CHECK_LIB([posix4], sched_get_priority_max,
3286 [
3287 HAVE_PRIOR_FUNCS=1
3288 POSIX4_LINK=" -lposix4"
3289 ],
3290 )
3291 )
3292 )
3293 )
f6bcfd97 3294
7274f1c7
RL
3295 if test "$HAVE_PRIOR_FUNCS" = 1; then
3296 AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
3297 else
3298 AC_MSG_WARN(Setting thread priority will not work)
3299 fi
9a98a854 3300
009fead0
VZ
3301 AC_CHECK_FUNC(pthread_cancel,
3302 AC_DEFINE(HAVE_PTHREAD_CANCEL),
3303 AC_MSG_WARN([wxThread::Kill() will not work properly]))
9a98a854 3304
7274f1c7
RL
3305 AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push,
3306 [
3307 AC_TRY_COMPILE([#include <pthread.h>],
3308 [
3309 pthread_cleanup_push(NULL, NULL);
3310 pthread_cleanup_pop(0);
3311 ], [
3312 wx_cv_func_pthread_cleanup_push=yes
3313 ], [
3314 wx_cv_func_pthread_cleanup_push=no
3315 ])
3316 ])
d9b9876f 3317
7274f1c7
RL
3318 if test "$wx_cv_func_pthread_cleanup_push" = "yes"; then
3319 AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS)
3320 fi
ab252f7b 3321
7274f1c7
RL
3322 dnl mutexattr_t initialization is done in quite different ways on different
3323 dnl platforms, so check for a few things:
3324 dnl
3325 dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
3326 dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
3327 dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
3328 dnl defined, we do it by directly assigned
3329 dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
3330
3331 dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+
3332 dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining
3333 dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is
3334 dnl simpler to just define _GNU_SOURCE to get everything)
3335 if test "x$wx_lib_glibc21" = "xyes"; then
3336 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3337 fi
d9b9876f 3338
7274f1c7
RL
3339 AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
3340 [
d9b9876f
VZ
3341 AC_TRY_COMPILE([#include <pthread.h>],
3342 [
7274f1c7
RL
3343 pthread_mutexattr_t attr;
3344 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
d9b9876f 3345 ], [
7274f1c7 3346 wx_cv_type_pthread_mutexattr_t=yes
d9b9876f 3347 ], [
7274f1c7 3348 wx_cv_type_pthread_mutexattr_t=no
d9b9876f
VZ
3349 ]
3350 )
7274f1c7 3351 ])
d9b9876f 3352
7274f1c7
RL
3353 if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
3354 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
3355 else
3356 dnl don't despair, there may be another way to do it
3357 AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
3358 wx_cv_type_pthread_rec_mutex_init,
3359 [
3360 AC_TRY_COMPILE([#include <pthread.h>],
3361 [
3362 pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
3363 ], [
3364 wx_cv_type_pthread_rec_mutex_init=yes
3365 ], [
3366 wx_cv_type_pthread_rec_mutex_init=no
3367 ]
3368 )
3369 ])
3370 if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
3371 AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
3372 else
3373 dnl this may break code working elsewhere, so at least warn about it
3374 AC_MSG_WARN([wxMutex won't be recursive on this platform])
3375 fi
3376 fi
7274f1c7 3377 fi
9a98a854 3378
b089607b 3379dnl from if !MSW
a9b5e89f
VZ
3380fi
3381
3382if test "$wxUSE_THREADS" = "yes"; then
3383 AC_DEFINE(wxUSE_THREADS)
3384
3f345b47 3385 dnl we must define _REENTRANT or something along these lines for MT code
009fead0 3386 TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS $THREADS_CFLAGS"
a9b5e89f
VZ
3387
3388 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
d64af447 3389else
b12915c1 3390 dnl on some systems, _REENTRANT should be defined if we want to use any _r()
d64af447
VZ
3391 dnl functions - add tests for other functions here as well
3392 if test "$ac_cv_func_strtok_r" = "yes"; then
ab9b9eab
VZ
3393 AC_MSG_CHECKING(if -D_REENTRANT is needed)
3394 if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
3a922bb4 3395 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D_REENTRANT"
ab9b9eab
VZ
3396 AC_MSG_RESULT(yes)
3397 else
3398 AC_MSG_RESULT(no)
ee31c269 3399 fi
d64af447 3400 fi
a9b5e89f
VZ
3401fi
3402
6f72b082
OK
3403if test "$WXGTK20" = 1 ; then
3404 AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK20)
13111b2a
VZ
3405 WXGTK12=1
3406fi
3407
9a98a854
VZ
3408if test "$WXGTK12" = 1 ; then
3409 AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
3410fi
3411
f6bcfd97
BP
3412if test "$WXGTK127" = 1 ; then
3413 AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
3414fi
3415
9a98a854 3416WXDEBUG=
9a98a854
VZ
3417
3418if test "$wxUSE_DEBUG_INFO" = "yes" ; then
3419 WXDEBUG="-g"
3420 wxUSE_OPTIMISE=no
3421fi
3422
5586805b
RR
3423if test "$wxUSE_DEBUG_GDB" = "yes" ; then
3424 wxUSE_DEBUG_INFO=yes
3425 WXDEBUG="-ggdb"
3426fi
3427
9a98a854 3428if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
77c85c2b
RR
3429 AC_DEFINE(WXDEBUG)
3430 WXDEBUG_DEFINE="-D__WXDEBUG__"
9a98a854 3431else
04338f96
RR
3432 if test "$wxUSE_GTK" = 1 ; then
3433 WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS"
3434 fi
9a98a854
VZ
3435fi
3436
3437if test "$wxUSE_MEM_TRACING" = "yes" ; then
77c85c2b
RR
3438 AC_DEFINE(wxUSE_MEMORY_TRACING)
3439 AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
47c13eb7 3440 AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS)
77c85c2b 3441 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
9a98a854
VZ
3442fi
3443
3444if test "$wxUSE_DMALLOC" = "yes" ; then
3d63bc3a 3445 DMALLOC_LIBS="-ldmalloc"
9a98a854
VZ
3446fi
3447
3448PROFILE=
3449if test "$wxUSE_PROFILE" = "yes" ; then
3d63bc3a 3450 PROFILE=" -pg"
9a98a854
VZ
3451fi
3452
009fead0
VZ
3453CODE_GEN_FLAGS=
3454CODE_GEN_FLAGS_CXX=
88e30f2b 3455if test "$GCC" = "yes" ; then
f7bdcdd7 3456 if test "$wxUSE_NO_RTTI" = "yes" ; then
3a922bb4 3457 CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-rtti"
f7bdcdd7
RR
3458 fi
3459 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
3a922bb4 3460 CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-exceptions"
f7bdcdd7 3461 fi
5586805b 3462 if test "$wxUSE_PERMISSIVE" = "yes" ; then
d08b457b 3463 CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fpermissive"
5586805b 3464 fi
3a922bb4
RL
3465 if test "$USE_WIN32" = 1 ; then
3466 # I'm not even really sure what this was ever added to solve,
3467 # but someone added it for mingw native builds, so I guess
3468 # they had a reason, right??
3469 CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fno-pcc-struct-return"
5586805b 3470 fi
c596875e
RD
3471fi
3472
3473
9a98a854
VZ
3474CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
3475CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
3476if test "$wxUSE_OPTIMISE" = "no" ; then
77c85c2b 3477 OPTIMISE=
9a98a854 3478else
77c85c2b 3479 if test "$GCC" = yes ; then
04338f96 3480 OPTIMISE="-O2"
77c85c2b
RR
3481 case "${host}" in
3482 i586-*-*|i686-*-* )
3483 OPTIMISE="${OPTIMISE} "
3484 ;;
3485 esac
3486 else
3487 OPTIMISE="-O"
3488 fi
9a98a854
VZ
3489fi
3490
54276ccf
VZ
3491if test "$WXWIN_COMPATIBILITY_2" = "yes"; then
3492 AC_DEFINE(WXWIN_COMPATIBILITY_2)
3493
3494 WXWIN_COMPATIBILITY_2_2="yes"
3495fi
3496
0c9a1c32 3497if test "x$WXWIN_COMPATIBILITY_2_2" != "xno"; then
54276ccf
VZ
3498 AC_DEFINE(WXWIN_COMPATIBILITY_2_2)
3499fi
3500
9a98a854
VZ
3501dnl ---------------------------------------------------------------------------
3502dnl the library may be built without GUI classes at all
3503dnl ---------------------------------------------------------------------------
3504
3505if test "$wxUSE_GUI" = "yes"; then
3506 AC_DEFINE(wxUSE_GUI)
3507
3508 dnl the things we always pull in the GUI version of the library:
3509 dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
3510 dnl library really can't be built without those)
3511 dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
3512 dnl almost any program and the first 2 are needed to show a message box
3513 dnl which want to be always able to do)
3514 dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
3515 dnl to compile without them (if the app doesn't do any drawing, it doesn't
3516 dnl need the dcs, pens, brushes, ...), this just can't be done now
3517 dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
3518 dnl 5. misc stuff: timers, settings, message box
9a98a854
VZ
3519else
3520 AC_DEFINE(wxUSE_NOGUI)
3521fi
3522
3523dnl ---------------------------------------------------------------------------
3524dnl Unix/Windows
3525dnl ---------------------------------------------------------------------------
3526
3527if test "$wxUSE_UNIX" = "yes"; then
3528 AC_DEFINE(wxUSE_UNIX)
9a98a854
VZ
3529fi
3530
3531dnl ---------------------------------------------------------------------------
3532dnl Register non-GUI class options for makefiles and setup.h
3533dnl ---------------------------------------------------------------------------
3534
3535if test "$wxUSE_APPLE_IEEE" = "yes"; then
3536 AC_DEFINE(wxUSE_APPLE_IEEE)
9a98a854
VZ
3537fi
3538
1e6feb95
VZ
3539if test "$wxUSE_TIMER" = "yes"; then
3540 AC_DEFINE(wxUSE_TIMER)
3541fi
3542
2749089a
KB
3543if test "$wxUSE_WAVE" = "yes"; then
3544 AC_DEFINE(wxUSE_WAVE)
3545fi
3546
1e6feb95
VZ
3547if test "$wxUSE_CMDLINE_PARSER" = "yes"; then
3548 AC_DEFINE(wxUSE_CMDLINE_PARSER)
3549fi
3550
3551if test "$wxUSE_STOPWATCH" = "yes"; then
3552 AC_DEFINE(wxUSE_STOPWATCH)
3553fi
3554
3555if test "$wxUSE_DATETIME" = "yes"; then
3556 AC_DEFINE(wxUSE_DATETIME)
3557fi
3558
3559if test "$wxUSE_TIMEDATE" = "yes"; then
3560 AC_DEFINE(wxUSE_TIMEDATE)
3561fi
3562
9a98a854
VZ
3563if test "$wxUSE_FILE" = "yes"; then
3564 AC_DEFINE(wxUSE_FILE)
9a98a854
VZ
3565fi
3566
1e6feb95
VZ
3567if test "$wxUSE_FFILE" = "yes"; then
3568 AC_DEFINE(wxUSE_FFILE)
3569fi
3570
24528b0c
VS
3571if test "$wxUSE_FILESYSTEM" = "yes"; then
3572 AC_DEFINE(wxUSE_FILESYSTEM)
3573fi
3574
e3e717ec
VZ
3575if test "$wxUSE_FS_INET" = "yes"; then
3576 AC_DEFINE(wxUSE_FS_INET)
3577fi
3578
3579if test "$wxUSE_FS_ZIP" = "yes"; then
3580 AC_DEFINE(wxUSE_FS_ZIP)
3581fi
3582
d78b3d64
VS
3583if test "$wxUSE_ZIPSTREAM" = "yes"; then
3584 AC_DEFINE(wxUSE_ZIPSTREAM)
3585fi
3586
eb4efbdc
VZ
3587if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
3588 AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION)
3589fi
3590
4f3c5f06
VZ
3591if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
3592 AC_DEFINE(wxUSE_SNGLINST_CHECKER)
3593fi
3594
d78b3d64
VS
3595if test "$wxUSE_BUSYINFO" = "yes"; then
3596 AC_DEFINE(wxUSE_BUSYINFO)
3597fi
3598
fd15d8f1
RR
3599if test "$wxUSE_STD_IOSTREAM" = "yes"; then
3600 AC_DEFINE(wxUSE_STD_IOSTREAM)
3601fi
3602
a3a584a7
VZ
3603if test "$wxUSE_TEXTBUFFER" = "yes"; then
3604 AC_DEFINE(wxUSE_TEXTBUFFER)
3605fi
3606
9a98a854 3607if test "$wxUSE_TEXTFILE" = "yes"; then
a3a584a7 3608 if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then
156b2523 3609 AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled)
9a98a854
VZ
3610 else
3611 AC_DEFINE(wxUSE_TEXTFILE)
9a98a854
VZ
3612 fi
3613fi
3614
3615if test "$wxUSE_CONFIG" = "yes" ; then
3616 if test "$wxUSE_TEXTFILE" != "yes"; then
156b2523 3617 AC_MSG_WARN(wxConfig requires wxTextFile... disabled)
9a98a854
VZ
3618 else
3619 AC_DEFINE(wxUSE_CONFIG)
9a98a854
VZ
3620 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
3621 fi
3622fi
3623
3624if test "$wxUSE_INTL" = "yes" ; then
3625 if test "$wxUSE_FILE" != "yes"; then
156b2523 3626 AC_MSG_WARN(I18n code requires wxFile... disabled)
9a98a854
VZ
3627 else
3628 AC_DEFINE(wxUSE_INTL)
9a98a854 3629 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
f6bcfd97 3630 GUIDIST="$GUIDIST INTL_DIST"
9a98a854
VZ
3631 fi
3632fi
3633
3634if test "$wxUSE_LOG" = "yes"; then
3635 AC_DEFINE(wxUSE_LOG)
d73be714
VZ
3636
3637 if test "$wxUSE_LOGGUI" = "yes"; then
3638 AC_DEFINE(wxUSE_LOGGUI)
3639 fi
3640
3641 if test "$wxUSE_LOGWINDOW" = "yes"; then
3642 AC_DEFINE(wxUSE_LOGWINDOW)
3643 fi
69d27ff7
MB
3644
3645 if test "$wxUSE_LOGDIALOG" = "yes"; then
3646 AC_DEFINE(wxUSE_LOG_DIALOG)
3647 fi
9a98a854
VZ
3648fi
3649
3650if test "$wxUSE_LONGLONG" = "yes"; then
3651 AC_DEFINE(wxUSE_LONGLONG)
9a98a854
VZ
3652fi
3653
e8f65ba6
RR
3654if test "$wxUSE_GEOMETRY" = "yes"; then
3655 AC_DEFINE(wxUSE_GEOMETRY)
3656fi
3657
1c8515f9
KB
3658if test "$wxUSE_DIALUP_MANAGER" = "yes" ; then
3659 AC_DEFINE(wxUSE_DIALUP_MANAGER)
70f7a477 3660 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup"
1c8515f9
KB
3661fi
3662
9a98a854
VZ
3663if test "$wxUSE_STREAMS" = "yes" ; then
3664 AC_DEFINE(wxUSE_STREAMS)
9a98a854
VZ
3665fi
3666
52e8b690 3667dnl ---------------------------------------------------------------------------
afc31813
VZ
3668dnl time/date functions
3669dnl ------------------------------------------------------------------------
3670
1e6feb95 3671if test "$wxUSE_DATETIME" = "yes"; then
83307f33
VZ
3672 dnl check for strptime
3673 AC_CHECK_FUNCS(strptime)
3674
360d6699
VZ
3675 dnl check for timezone variable
3676 AC_CACHE_CHECK(for timezone variable in <time.h>,
3677 wx_cv_var_timezone,
3678 [
3679 AC_TRY_COMPILE(
3680 [
3681 #include <time.h>
3682 ],
3683 [
3684 int tz;
4f11a343 3685 tz = timezone;
360d6699
VZ
3686 ],
3687 [
4f11a343 3688 wx_cv_var_timezone=timezone
360d6699
VZ
3689 ],
3690 [
3691 AC_TRY_COMPILE(
3692 [
3693 #include <time.h>
3694 ],
3695 [
3696 int tz;
3697 tz = _timezone;
3698 ],
3699 [
3700 wx_cv_var_timezone=_timezone
3701 ],
5357c8e8
VZ
3702 [
3703 AC_TRY_COMPILE(
3704 [
3705 #include <time.h>
3706 ],
3707 [
3708 int tz;
4f11a343 3709 tz = __timezone;
5357c8e8
VZ
3710 ],
3711 [
4f11a343 3712 wx_cv_var_timezone=__timezone
5357c8e8 3713 ],
f9bc1684
VS
3714 [
3715 if test "$USE_DOS" = 0 ; then
3716 AC_MSG_ERROR(no timezone variable)
3717 fi
3718 ]
5357c8e8
VZ
3719 )
3720 ]
360d6699
VZ
3721 )
3722 ]
3723 )
3724 ]
3725 )
3726
3727 dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
f9bc1684
VS
3728 if test "x$wx_cv_var_timezone" != x ; then
3729 AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
3730 fi
360d6699 3731
3fcdd07b
VZ
3732 dnl check for localtime (it's POSIX, but the check can do no harm...)
3733 AC_CHECK_FUNCS(localtime)
afc31813 3734
0470b1e6
VZ
3735 if test "$ac_cv_func_localtime" = "yes"; then
3736 AC_CACHE_CHECK(for tm_gmtoff in struct tm,
3737 wx_cv_struct_tm_has_gmtoff,
3738 [
3739 AC_TRY_COMPILE(
3740 [
3741 #include <time.h>
3742 ],
3743 [
3744 struct tm tm;
3745 tm.tm_gmtoff++;
3746 ],
3747 [
f03a98d8 3748 wx_cv_struct_tm_has_gmtoff=yes
0470b1e6
VZ
3749 ],
3750 wx_cv_struct_tm_has_gmtoff=no
3751 )
3752 ])
3fcdd07b
VZ
3753 fi
3754
6232543b
VS
3755 if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
3756 AC_DEFINE(WX_GMTOFF_IN_TM)
3757 fi
3758
3fcdd07b
VZ
3759 dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the
3760 dnl function to be used for high resolution timers
3761 AC_CHECK_FUNCS(gettimeofday ftime, break)
3762
3763 if test "$ac_cv_func_gettimeofday" = "yes"; then
afc31813
VZ
3764 AC_CACHE_CHECK([whether gettimeofday takes two arguments],
3765 wx_cv_func_gettimeofday_has_2_args,
3766 [
3767 dnl on some _really_ old systems it takes only 1 argument
3768 AC_LANG_SAVE
3769 AC_LANG_CPLUSPLUS
3770
3771 AC_TRY_COMPILE(
3772 [
3773 #include <sys/time.h>
3774 #include <unistd.h>
3775 ],
3776 [
3777 struct timeval tv;
776862b4 3778 gettimeofday(&tv, NULL);
afc31813
VZ
3779 ],
3780 wx_cv_func_gettimeofday_has_2_args=yes,
3781 AC_TRY_COMPILE(
3782 [
3783 #include <sys/time.h>
3784 #include <unistd.h>
3785 ],
3786 [
3787 struct timeval tv;
3788 gettimeofday(&tv);
3789 ],
3790 wx_cv_func_gettimeofday_has_2_args=no,
776862b4
VZ
3791 [
3792 AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
3793 wx_cv_func_gettimeofday_has_2_args=unknown
3794 ]
afc31813
VZ
3795 )
3796 )
3797 AC_LANG_RESTORE
3798 ])
3799
3800 if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
3801 AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
3802 fi
3803 fi
3804
3805 AC_DEFINE(wxUSE_TIMEDATE)
3806 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
3807fi
3808
9a98a854
VZ
3809dnl ------------------------------------------------------------------------
3810dnl wxSocket
3811dnl ------------------------------------------------------------------------
3812
0feee163
VZ
3813dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11
3814if test "$wxUSE_SOCKETS" = "yes"; then
3815 if test "$TOOLKIT" = "X11"; then
3816 AC_MSG_WARN([wxSocket not yet supported under X11... disabled])
3817 wxUSE_SOCKETS="no"
3818 fi
3819fi
b089607b 3820
0feee163
VZ
3821if test "$wxUSE_SOCKETS" = "yes"; then
3822 dnl under MSW we always have sockets
3823 if test "$TOOLKIT" != "MSW"; then
590b1a4d 3824 dnl under Solaris and OS/2, socket functions live in -lsocket
3a922bb4
RL
3825 AC_CHECK_FUNC(socket,,
3826 AC_CHECK_LIB(socket, socket,
590b1a4d 3827 if test "$INET_LINK" != " -lsocket"; then
e5ee4c90
SN
3828 INET_LINK="$INET_LINK -lsocket"
3829 fi,
3a922bb4
RL
3830 [
3831 AC_MSG_WARN([socket library not found - sockets will be disabled])
3832 wxUSE_SOCKETS=no
3833 ]
3834 )
afc31813 3835 )
3a922bb4 3836 fi
0feee163 3837fi
afc31813 3838
0feee163 3839if test "$wxUSE_SOCKETS" = "yes" ; then
3a922bb4
RL
3840 dnl this test may be appropriate if building under cygwin
3841 dnl right now I'm assuming it also uses the winsock stuff
3842 dnl like mingw does.. -- RL
0feee163 3843 if test "$TOOLKIT" != "MSW"; then
3a922bb4
RL
3844 dnl determine the type of third argument for getsockname
3845 AC_CACHE_CHECK([what is the type of the third argument of getsockname],
3846 wx_cv_type_getsockname3,
3847 [
3848 AC_LANG_SAVE
3849 AC_LANG_CPLUSPLUS
51a9faba 3850
51a9faba
VZ
3851 AC_TRY_COMPILE(
3852 [
4370c5b2 3853 #include <sys/types.h>
51a9faba
VZ
3854 #include <sys/socket.h>
3855 ],
3856 [
3a922bb4 3857 socklen_t len;
51a9faba
VZ
3858 getsockname(0, 0, &len);
3859 ],
3a922bb4 3860 wx_cv_type_getsockname3=socklen_t,
51a9faba
VZ
3861 AC_TRY_COMPILE(
3862 [
4370c5b2 3863 #include <sys/types.h>
51a9faba
VZ
3864 #include <sys/socket.h>
3865 ],
3866 [
3a922bb4 3867 size_t len;
51a9faba
VZ
3868 getsockname(0, 0, &len);
3869 ],
3a922bb4
RL
3870 wx_cv_type_getsockname3=size_t,
3871 AC_TRY_COMPILE(
3872 [
3873 #include <sys/types.h>
3874 #include <sys/socket.h>
3875 ],
3876 [
3877 int len;
3878 getsockname(0, 0, &len);
3879 ],
3880 wx_cv_type_getsockname3=int,
3881 wx_cv_type_getsockname3=unknown
3882 )
51a9faba
VZ
3883 )
3884 )
c63c7106 3885
3a922bb4
RL
3886 AC_LANG_RESTORE
3887 ])
51a9faba 3888
3a922bb4
RL
3889 if test "$wx_cv_type_getsockname3" = "unknown"; then
3890 wxUSE_SOCKETS=no
3891 AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
3892 else
3893 AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3)
3894 fi
51a9faba
VZ
3895 fi
3896fi
c521c494 3897
51a9faba 3898if test "$wxUSE_SOCKETS" = "yes" ; then
afc31813 3899 AC_DEFINE(wxUSE_SOCKETS)
70f7a477 3900 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
9a98a854
VZ
3901fi
3902
3903dnl ---------------------------------------------------------------------------
3904dnl Joystick support
3905dnl ---------------------------------------------------------------------------
3906
dc3d889d
VZ
3907if test "$wxUSE_GUI" = "yes"; then
3908
156b2523
GD
3909 if test "$TOOLKIT" = "MAC"; then
3910 AC_MSG_WARN([Joystick not yet supported under Mac OS X... disabled])
3911 wxUSE_JOYSTICK=no
3912 fi
3913 if test "$TOOLKIT" = "MOTIF"; then
3914 AC_MSG_WARN([Joystick not yet supported under Motif... disabled])
3915 wxUSE_JOYSTICK=no
3916 fi
7f5c07ab
JS
3917 if test "$TOOLKIT" = "X11"; then
3918 AC_MSG_WARN([Joystick not yet supported under X11... disabled])
3919 wxUSE_JOYSTICK=no
3920 fi
156b2523 3921
3a922bb4
RL
3922 dnl under MSW we always have joystick support
3923 if test "$TOOLKIT" != "MSW"; then
3924 if test "$wxUSE_JOYSTICK" = "yes"; then
3925 dnl joystick support is only for Linux 2.1.x or greater
3926 AC_CHECK_HEADERS(linux/joystick.h)
3927 if test "$ac_cv_header_linux_joystick_h" != "yes"; then
3928 wxUSE_JOYSTICK=no
156b2523 3929 AC_MSG_WARN(Joystick not supported by this system... disabled)
3a922bb4
RL
3930 fi
3931 fi
3932 fi
9a98a854 3933
3a922bb4
RL
3934 if test "$wxUSE_JOYSTICK" = "yes"; then
3935 AC_DEFINE(wxUSE_JOYSTICK)
3936 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
3937 fi
dc3d889d 3938fi
dc3d889d 3939
9a98a854
VZ
3940dnl ------------------------------------------------------------------------
3941dnl DLL support
3942dnl ------------------------------------------------------------------------
3943
b089607b
VZ
3944dnl under MSW we always have LoadLibrary/GetProcAddress
3945if test "$TOOLKIT" != "MSW"; then
3946
3a922bb4
RL
3947 HAVE_DL_FUNCS=0
3948 HAVE_SHL_FUNCS=0
0b9ab0bd 3949 if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
3a922bb4
RL
3950 if test "$USE_DARWIN" = 1; then
3951 dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
37667812 3952 HAVE_DL_FUNCS=1
3a922bb4
RL
3953 else
3954 dnl the test is a bit complicated because we check for dlopen() both with
3955 dnl and without -ldl and we also try to find shl_load() if there is no
3956 dnl dlopen() on this system
3957 AC_CHECK_FUNCS(dlopen,
3958 [
3959 AC_DEFINE(HAVE_DLOPEN)
3960 HAVE_DL_FUNCS=1
3961 ],
3962 [
3963 AC_CHECK_LIB(dl, dlopen,
3964 [
3965 AC_DEFINE(HAVE_DLOPEN)
3966 HAVE_DL_FUNCS=1
3d63bc3a 3967 DL_LINK=" -ldl$DL_LINK"
3a922bb4
RL
3968 ],
3969 [
3970 AC_CHECK_FUNCS(shl_load,
3971 [
3972 AC_DEFINE(HAVE_SHL_LOAD)
3973 HAVE_SHL_FUNCS=1
3974 ],
3975 [
3976 AC_CHECK_LIB(shl_load, dld,
3977 [
3978 HAVE_SHL_FUNCS=1
3d63bc3a 3979 DL_LINK=" -ldld$DL_LINK"
3a922bb4
RL
3980 ])
3981 ])
3982 ])
3983 ])
9a98a854 3984
3a922bb4
RL
3985 dnl check also for dlerror()
3986 if test "$HAVE_DL_FUNCS" = 1; then
3987 AC_CHECK_FUNCS(dlerror,
3988 AC_DEFINE(HAVE_DLERROR),
3989 AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR)))
3990 fi
3991 fi
f6bcfd97 3992
3a922bb4
RL
3993 if test "$HAVE_DL_FUNCS" = 0; then
3994 if test "$HAVE_SHL_FUNCS" = 0; then
3995 if test "$USE_UNIX" = 1; then
3996 AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
0b9ab0bd 3997 wxUSE_DYNAMIC_LOADER=no
3a922bb4
RL
3998 wxUSE_DYNLIB_CLASS=no
3999 else
4000 AC_MSG_WARN([Assuming wxLibrary class works on this platform])
4001 fi
4002 fi
e90c1d2a 4003 fi
9a98a854
VZ
4004 fi
4005fi
4006
0b9ab0bd
RL
4007if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
4008 AC_DEFINE(wxUSE_DYNAMIC_LOADER)
4009elif test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
b12915c1 4010 AC_DEFINE(wxUSE_DYNLIB_CLASS)
9a98a854
VZ
4011fi
4012
4013dnl ---------------------------------------------------------------------------
ced859c3 4014dnl String stuff
9a98a854
VZ
4015dnl ---------------------------------------------------------------------------
4016
1e6feb95
VZ
4017if test "$wxUSE_FONTMAP" = "yes" ; then
4018 AC_DEFINE(wxUSE_FONTMAP)
4019fi
4020
9a98a854
VZ
4021if test "$wxUSE_UNICODE" = "yes" ; then
4022 AC_DEFINE(wxUSE_UNICODE)
bbc3925a
VS
4023
4024 if test "$wxUSE_MSW" != 1; then
4025 wxUSE_UNICODE_MSLU=no
4026 fi
a72a4bfa
VS
4027
4028 if test "$wxUSE_MSW" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
4029 AC_CHECK_LIB(unicows,main,
4030 [
4031 AC_DEFINE(wxUSE_UNICODE_MSLU)
4032 ],
4033 [
4034 AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled.
4035 Applications will only run on Windows NT/2000/XP!])
4036 wxUSE_UNICODE_MSLU=no
4037 ])
4038 fi
9a98a854
VZ
4039fi
4040
ced859c3
VZ
4041if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
4042 AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
4043fi
4044
b12915c1 4045
9a98a854
VZ
4046dnl ----------------------------------------------------------------
4047dnl iODBC support
4048dnl ----------------------------------------------------------------
4049
4050IODBC_C_SRC=""
4051if test "$wxUSE_ODBC" = "yes" ; then
a0c79abb
VZ
4052 AC_DEFINE(wxUSE_ODBC)
4053 WXODBCFLAG="-D_IODBC_"
4054 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
9a98a854
VZ
4055fi
4056
4057dnl ----------------------------------------------------------------
4058dnl Register PostScript options for makefiles and setup.h
4059dnl ----------------------------------------------------------------
4060
4061if test "$wxUSE_POSTSCRIPT" = "yes" ; then
4062 AC_DEFINE(wxUSE_POSTSCRIPT)
9a98a854
VZ
4063fi
4064
4065AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
4066
4067AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS)
4068
4069dnl ---------------------------------------------------------------------------
4070dnl big GUI components: MDI, doc/view, printing, help, ...
4071dnl ---------------------------------------------------------------------------
4072
4073if test "$wxUSE_CONSTRAINTS" = "yes"; then
ce4169a4
RR
4074 AC_DEFINE(wxUSE_CONSTRAINTS)
4075 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
9a98a854
VZ
4076fi
4077
4078if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
fc26f4ab 4079 if test "$wxUSE_UNIVERSAL" = "yes"; then
3c011993 4080 AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
fc26f4ab
RL
4081 wxUSE_MDI_ARCHITECTURE=no
4082 fi
4083
4084 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
4085 AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
4086 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
4087 fi
9a98a854
VZ
4088fi
4089
4090if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
4091 AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
4092 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
4093 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
4094 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi"
4095 fi
9a98a854
VZ
4096fi
4097
4098if test "$wxUSE_HELP" = "yes"; then
ce4169a4
RR
4099 AC_DEFINE(wxUSE_HELP)
4100 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
3379ed37 4101
77e13408 4102 if test "$wxUSE_MSW" = 1; then
031d8228 4103 if test "$wxUSE_MS_HTML_HELP" = "yes"; then
3b7bc64a 4104 AC_DEFINE(wxUSE_MS_HTML_HELP)
29fd3c0c 4105 fi
3379ed37 4106 fi
031d8228
VS
4107
4108 if test "$wxUSE_WXHTML_HELP" = "yes"; then
4109 if test "$wxUSE_HTML" = "yes"; then
4110 AC_DEFINE(wxUSE_WXHTML_HELP)
4111 else
4112 AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled)
4113 wxUSE_WXHTML_HELP=no
4114 fi
4115 fi
9a98a854
VZ
4116fi
4117
4118if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
4119 if test "$wxUSE_CONSTRAINTS" != "yes"; then
4120 AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it)
4121 else
4122 AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
4123 fi
4124 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
9a98a854
VZ
4125fi
4126
4127if test "$wxUSE_PROLOGIO" = "yes" ; then
ce4169a4 4128 AC_DEFINE(wxUSE_PROLOGIO)
9a98a854
VZ
4129fi
4130
4131if test "$wxUSE_RESOURCES" = "yes" ; then
256d631a
JS
4132 if test "$wxUSE_NANOX" = "yes"; then
4133 AC_MSG_WARN([Cannot use resource database functions in NanoX])
4134 else
4135 AC_DEFINE(wxUSE_RESOURCES)
4136 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource"
4137 fi
9a98a854
VZ
4138fi
4139
4140if test "$wxUSE_X_RESOURCES" = "yes"; then
ce4169a4 4141 AC_DEFINE(wxUSE_X_RESOURCES)
9a98a854
VZ
4142fi
4143
4144dnl ---------------------------------------------------------------------------
77c85c2b 4145dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
9a98a854
VZ
4146dnl ---------------------------------------------------------------------------
4147
2b9bdf71
VZ
4148dnl check for ole headers and disable a few features requiring it if not
4149dnl present (earlier versions of mingw32 don't have ole2.h)
77e13408
RL
4150if test "$wxUSE_MSW" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
4151 -o "$wxUSE_CLIPBOARD" = "yes" \
4152 -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then
2b9bdf71
VZ
4153 AC_CHECK_HEADERS(ole2.h)
4154
4155 if test "$ac_cv_header_ole2_h" = "yes" ; then
4156 if test "$GCC" = yes ; then
4157 ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)"
2b9bdf71 4158 CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"
3d63bc3a 4159 LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
2b9bdf71
VZ
4160 AC_DEFINE(wxUSE_OLE)
4161
4162 fi
4163
4164 dnl for OLE clipboard and dnd
4165 AC_DEFINE(wxUSE_DATAOBJ)
4166 else
4167 AC_MSG_WARN([Some features disabled because OLE headers not found])
4168
4169 wxUSE_CLIPBOARD=no
4170 wxUSE_DRAG_AND_DROP=no
4171 wxUSE_DATAOBJ=no
4172 fi
4173
2b9bdf71
VZ
4174 if test "$wxUSE_METAFILE" = "yes"; then
4175 AC_DEFINE(wxUSE_METAFILE)
4176
4177 dnl this one should probably be made separately configurable
4178 AC_DEFINE(wxUSE_ENH_METAFILE)
4179 fi
4180fi
4181
9a98a854 4182if test "$wxUSE_IPC" = "yes"; then
eb4efbdc 4183 if test "$wxUSE_SOCKETS" != "yes"; then
156b2523 4184 AC_MSG_WARN(wxWindows IPC classes require sockets... disabled)
eb4efbdc
VZ
4185 fi
4186
ce4169a4 4187 AC_DEFINE(wxUSE_IPC)
9a98a854
VZ
4188fi
4189
4190if test "$wxUSE_CLIPBOARD" = "yes"; then
9691c806 4191 AC_DEFINE(wxUSE_CLIPBOARD)
178572bb 4192
9691c806
RR
4193 dnl required by clipboard code in configuration check
4194 AC_DEFINE(wxUSE_DATAOBJ)
9a98a854
VZ
4195fi
4196
39c9d5ac 4197if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
ce4169a4
RR
4198 if test "$wxUSE_GTK" = 1; then
4199 if test "$WXGTK12" != 1; then
156b2523 4200 AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2... disabled])
e90c1d2a 4201 wxUSE_DRAG_AND_DROP=no
ce4169a4 4202 fi
a9b5e89f 4203 fi
a9b5e89f 4204
ce4169a4 4205 if test "$wxUSE_MOTIF" = 1; then
156b2523 4206 AC_MSG_WARN([Drag and drop not yet supported under Motif... disabled])
e90c1d2a 4207 wxUSE_DRAG_AND_DROP=no
ce4169a4 4208 fi
a9b5e89f 4209
7f5c07ab
JS
4210 if test "$wxUSE_X11" = 1; then
4211 AC_MSG_WARN([Drag and drop not yet supported under X11... disabled])
4212 wxUSE_DRAG_AND_DROP=no
4213 fi
4214
ce4169a4
RR
4215 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
4216 AC_DEFINE(wxUSE_DRAG_AND_DROP)
4217 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
4218 fi
4882bf1b 4219
9a98a854
VZ
4220fi
4221
4222if test "$wxUSE_SPLINES" = "yes" ; then
4223 AC_DEFINE(wxUSE_SPLINES)
4224fi
4225
4226dnl ---------------------------------------------------------------------------
4227dnl GUI controls
4228dnl ---------------------------------------------------------------------------
4229
1e6feb95
VZ
4230USES_CONTROLS=0
4231if test "$wxUSE_CONTROLS" = "yes"; then
4232 USES_CONTROLS=1
4233fi
4234
9a98a854
VZ
4235if test "$wxUSE_ACCEL" = "yes"; then
4236 AC_DEFINE(wxUSE_ACCEL)
1e6feb95
VZ
4237 USES_CONTROLS=1
4238fi
4239
4240if test "$wxUSE_BUTTON" = "yes"; then
4241 AC_DEFINE(wxUSE_BUTTON)
4242 USES_CONTROLS=1
4243fi
4244
4245if test "$wxUSE_BMPBUTTON" = "yes"; then
4246 AC_DEFINE(wxUSE_BMPBUTTON)
4247 USES_CONTROLS=1
4248fi
4249
4250if test "$wxUSE_CALCTRL" = "yes"; then
4251 AC_DEFINE(wxUSE_CALENDARCTRL)
4252 USES_CONTROLS=1
4253 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar"
9a98a854
VZ
4254fi
4255
4256if test "$wxUSE_CARET" = "yes"; then
4257 AC_DEFINE(wxUSE_CARET)
1e6feb95 4258 USES_CONTROLS=1
9a98a854
VZ
4259 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
4260fi
4261
4262if test "$wxUSE_COMBOBOX" = "yes"; then
4263 AC_DEFINE(wxUSE_COMBOBOX)
1e6feb95 4264 USES_CONTROLS=1
9a98a854
VZ
4265fi
4266
ce4169a4
RR
4267if test "$wxUSE_CHOICE" = "yes"; then
4268 AC_DEFINE(wxUSE_CHOICE)
1e6feb95 4269 USES_CONTROLS=1
9a98a854
VZ
4270fi
4271
4272if test "$wxUSE_CHECKBOX" = "yes"; then
4273 AC_DEFINE(wxUSE_CHECKBOX)
1e6feb95 4274 USES_CONTROLS=1
9a98a854
VZ
4275fi
4276
4277if test "$wxUSE_CHECKLST" = "yes"; then
4278 AC_DEFINE(wxUSE_CHECKLISTBOX)
1e6feb95 4279 USES_CONTROLS=1
9a98a854
VZ
4280 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst"
4281fi
4282
4283if test "$wxUSE_GAUGE" = "yes"; then
4284 AC_DEFINE(wxUSE_GAUGE)
1e6feb95 4285 USES_CONTROLS=1
9a98a854
VZ
4286fi
4287
f85afd4e 4288if test "$wxUSE_NEW_GRID" = "yes"; then
d6a55c4b 4289 wxUSE_GRID="yes"
f85afd4e 4290 AC_DEFINE(wxUSE_NEW_GRID)
1e6feb95 4291 USES_CONTROLS=1
f85afd4e
MB
4292 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS newgrid"
4293fi
4294
d6a55c4b
VZ
4295if test "$wxUSE_GRID" = "yes"; then
4296 AC_DEFINE(wxUSE_GRID)
1e6feb95 4297 USES_CONTROLS=1
d6a55c4b
VZ
4298 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
4299fi
4300
9a98a854 4301if test "$wxUSE_IMAGLIST" = "yes"; then
ce4169a4 4302 AC_DEFINE(wxUSE_IMAGLIST)
9a98a854
VZ
4303fi
4304
4305if test "$wxUSE_LISTBOX" = "yes"; then
ce4169a4 4306 AC_DEFINE(wxUSE_LISTBOX)
1e6feb95 4307 USES_CONTROLS=1
9a98a854
VZ
4308fi
4309
4310if test "$wxUSE_LISTCTRL" = "yes"; then
ce4169a4
RR
4311 if test "$wxUSE_IMAGLIST" = "yes"; then
4312 AC_DEFINE(wxUSE_LISTCTRL)
1e6feb95 4313 USES_CONTROLS=1
ce4169a4
RR
4314 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
4315 else
4316 AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
4317 fi
9a98a854
VZ
4318fi
4319
4320if test "$wxUSE_NOTEBOOK" = "yes"; then
ce4169a4 4321 AC_DEFINE(wxUSE_NOTEBOOK)
1e6feb95 4322 USES_CONTROLS=1
ce4169a4 4323 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
9a98a854
VZ
4324fi
4325
24176f2c
GD
4326if test "$wxUSE_PROPSHEET" = "yes"; then
4327 AC_DEFINE(wxUSE_PROPSHEET)
4328 USES_CONTROLS=1
4329 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS proplist"
4330fi
4331
9a98a854 4332if test "$wxUSE_RADIOBOX" = "yes"; then
ce4169a4 4333 AC_DEFINE(wxUSE_RADIOBOX)
1e6feb95 4334 USES_CONTROLS=1
9a98a854
VZ
4335fi
4336
4337if test "$wxUSE_RADIOBTN" = "yes"; then
ce4169a4 4338 AC_DEFINE(wxUSE_RADIOBTN)
1e6feb95 4339 USES_CONTROLS=1
9a98a854
VZ
4340fi
4341
79b00c62 4342if test "$wxUSE_SASH" = "yes"; then
ce4169a4
RR
4343 AC_DEFINE(wxUSE_SASH)
4344 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
9a98a854
VZ
4345fi
4346
4347if test "$wxUSE_SCROLLBAR" = "yes"; then
ce4169a4 4348 AC_DEFINE(wxUSE_SCROLLBAR)
1e6feb95 4349 USES_CONTROLS=1
678b92a9 4350 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll scrollsub"
9a98a854
VZ
4351fi
4352
4353if test "$wxUSE_SLIDER" = "yes"; then
ce4169a4 4354 AC_DEFINE(wxUSE_SLIDER)
1e6feb95 4355 USES_CONTROLS=1
9a98a854
VZ
4356fi
4357
4358if test "$wxUSE_SPINBTN" = "yes"; then
ce4169a4 4359 AC_DEFINE(wxUSE_SPINBTN)
1e6feb95 4360 USES_CONTROLS=1
9a98a854
VZ
4361fi
4362
66f38406
RR
4363if test "$wxUSE_SPINCTRL" = "yes"; then
4364 AC_DEFINE(wxUSE_SPINCTRL)
1e6feb95 4365 USES_CONTROLS=1
66f38406
RR
4366fi
4367
9a98a854 4368if test "$wxUSE_SPLITTER" = "yes"; then
ce4169a4
RR
4369 AC_DEFINE(wxUSE_SPLITTER)
4370 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
9a98a854
VZ
4371fi
4372
4373if test "$wxUSE_STATBMP" = "yes"; then
ce4169a4 4374 AC_DEFINE(wxUSE_STATBMP)
1e6feb95 4375 USES_CONTROLS=1
9a98a854
VZ
4376fi
4377
4378if test "$wxUSE_STATBOX" = "yes"; then
ce4169a4 4379 AC_DEFINE(wxUSE_STATBOX)
1e6feb95
VZ
4380 USES_CONTROLS=1
4381fi
4382
4383if test "$wxUSE_STATTEXT" = "yes"; then
4384 AC_DEFINE(wxUSE_STATTEXT)
4385 USES_CONTROLS=1
9a98a854
VZ
4386fi
4387
4388if test "$wxUSE_STATLINE" = "yes"; then
f53561f1
RR
4389 if test "$wxUSE_WINE" = 1 ; then
4390 AC_MSG_WARN([wxStaticLine is not supported under WINE])
4391 else
e90c1d2a 4392 AC_DEFINE(wxUSE_STATLINE)
1e6feb95 4393 USES_CONTROLS=1
f53561f1 4394 fi
9a98a854
VZ
4395fi
4396
4397if test "$wxUSE_STATUSBAR" = "yes"; then
ce4169a4 4398 AC_DEFINE(wxUSE_STATUSBAR)
1e6feb95 4399 USES_CONTROLS=1
2286341c
VZ
4400
4401 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar"
9a98a854
VZ
4402fi
4403
4404if test "$wxUSE_TABDIALOG" = "yes"; then
ce4169a4
RR
4405 AC_DEFINE(wxUSE_TAB_DIALOG)
4406 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS tab"
9a98a854
VZ
4407fi
4408
1e6feb95
VZ
4409if test "$wxUSE_TEXTCTRL" = "yes"; then
4410 AC_DEFINE(wxUSE_TEXTCTRL)
4411 USES_CONTROLS=1
4412 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text"
4413fi
4414
1db8dc4a 4415if test "$wxUSE_TOGGLEBTN" = "yes"; then
156b2523
GD
4416 if test "$wxUSE_MAC" = 1; then
4417 AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled])
4418 wxUSE_TOGGLEBTN=no
4419 fi
4420 if test "$wxUSE_UNIVERSAL" = "yes"; then
3c011993 4421 AC_MSG_WARN([Toggle button not yet supported under wxUniversal... disabled])
a45d7ab7
GD
4422 wxUSE_TOGGLEBTN=no
4423 fi
4424
4425 if test "$wxUSE_TOGGLEBTN" = "yes"; then
4426 AC_DEFINE(wxUSE_TOGGLEBTN)
1e6feb95 4427 USES_CONTROLS=1
a45d7ab7 4428 fi
1db8dc4a
VZ
4429fi
4430
360d6699
VZ
4431if test "$wxUSE_TOOLBAR_SIMPLE" = "yes"; then
4432 AC_DEFINE(wxUSE_TOOLBAR_SIMPLE)
4433 wxUSE_TOOLBAR="yes"
1e6feb95 4434 USES_CONTROLS=1
360d6699
VZ
4435fi
4436
9a98a854 4437if test "$wxUSE_TOOLBAR" = "yes"; then
ce4169a4 4438 AC_DEFINE(wxUSE_TOOLBAR)
1e6feb95 4439 USES_CONTROLS=1
360d6699
VZ
4440
4441 dnl if wxUSE_TOOLBAR and !wxUSE_TOOLBAR_SIMPLE => wxUSE_TOOLBAR_NATIVE
4442 if test "$wxUSE_TOOLBAR_SIMPLE" != "yes"; then
4443 wxUSE_TOOLBAR_NATIVE="yes"
4444 fi
4445
1e6feb95
VZ
4446 if test "$wxUSE_TOOLBAR_NATIVE" = "yes"; then
4447 AC_DEFINE(wxUSE_TOOLBAR_NATIVE)
4448 USES_CONTROLS=1
4449 fi
9a98a854 4450
1e6feb95 4451 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
360d6699
VZ
4452fi
4453
39c9d5ac 4454if test "$wxUSE_TOOLTIPS" = "yes"; then
ced859c3 4455 if test "$wxUSE_MOTIF" = 1; then
156b2523 4456 AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled])
9a98a854 4457 else
ce4169a4 4458 if test "$wxUSE_WINE" = 1; then
156b2523 4459 AC_MSG_WARN([wxTooltip not supported under WINE... disabled])
ce4169a4 4460 else
69d27ff7 4461 if test "$wxUSE_UNIVERSAL" = "yes"; then
3c011993 4462 AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled])
69d27ff7 4463 else
3c011993 4464 AC_DEFINE(wxUSE_TOOLTIPS)
69d27ff7 4465 fi
ce4169a4 4466 fi
9a98a854
VZ
4467 fi
4468fi
4469
4470if test "$wxUSE_TREECTRL" = "yes"; then
ce4169a4
RR
4471 if test "$wxUSE_IMAGLIST" = "yes"; then
4472 AC_DEFINE(wxUSE_TREECTRL)
1e6feb95 4473 USES_CONTROLS=1
ce4169a4
RR
4474 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
4475 else
4476 AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
4477 fi
9a98a854
VZ
4478fi
4479
9f41d601 4480if test "$wxUSE_POPUPWIN" = "yes"; then
6abe4b65 4481 if test "$wxUSE_MAC" = 1; then
156b2523 4482 AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
6abe4b65 4483 else
485cf710
VZ
4484 if test "$wxUSE_MOTIF" = 1; then
4485 AC_MSG_WARN([wxPopupWindow not yet supported under Motif... disabled])
4486 else
c6712985
SN
4487 if test "$wxUSE_PM" = 1; then
4488 AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
4489 else
4490 AC_DEFINE(wxUSE_POPUPWIN)
0b01706f 4491
c6712985
SN
4492 USES_CONTROLS=1
4493 fi
485cf710 4494 fi
6abe4b65 4495 fi
9f41d601
RR
4496fi
4497
dd964dcc 4498if test "$wxUSE_TIPWINDOW" = "yes"; then
c6712985
SN
4499 if test "$wxUSE_PM" = 1; then
4500 AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled])
4501 else
4502 AC_DEFINE(wxUSE_TIPWINDOW)
4503 fi
dd964dcc
VZ
4504fi
4505
1e6feb95
VZ
4506if test "$USES_CONTROLS" = 1; then
4507 AC_DEFINE(wxUSE_CONTROLS)
4508fi
4509
9a98a854
VZ
4510dnl ---------------------------------------------------------------------------
4511dnl misc options
4512dnl ---------------------------------------------------------------------------
4513
24176f2c
GD
4514if test "$wxUSE_TREELAYOUT" = "yes"; then
4515 AC_DEFINE(wxUSE_TREELAYOUT)
4516 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treelay"
4517fi
9a98a854 4518
24fd6d87
VZ
4519if test "$wxUSE_DRAGIMAGE" = "yes"; then
4520 AC_DEFINE(wxUSE_DRAGIMAGE)
4521 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag"
4522fi
4523
1e6feb95
VZ
4524if test "$wxUSE_MENUS" = "yes"; then
4525 AC_DEFINE(wxUSE_MENUS)
4526 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu"
ce4169a4 4527fi
9a98a854 4528
1e6feb95
VZ
4529if test "$wxUSE_METAFILE" = "yes"; then
4530 AC_DEFINE(wxUSE_METAFILE)
c11584af
RR
4531fi
4532
1e6feb95
VZ
4533if test "$wxUSE_MIMETYPE" = "yes"; then
4534 AC_DEFINE(wxUSE_MIMETYPE)
9a98a854
VZ
4535fi
4536
0cbff120
JS
4537if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
4538 AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
4539fi
4540
4cdb0ab0 4541if test "$wxUSE_PROTOCOL" = "yes"; then
3954f9ca
VS
4542 if test "$wxUSE_SOCKETS" != "yes"; then
4543 AC_MSG_WARN(Protocol classes require sockets... disabled)
4544 wxUSE_PROTOCOL=no
4545 fi
4546
4547 if test "$wxUSE_PROTOCOL" = "yes"; then
4548 AC_DEFINE(wxUSE_PROTOCOL)
4cdb0ab0 4549
3954f9ca
VS
4550 if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then
4551 AC_DEFINE(wxUSE_PROTOCOL_HTTP)
4552 fi
4553 if test "$wxUSE_PROTOCOL_FTP" = "yes"; then
4554 AC_DEFINE(wxUSE_PROTOCOL_FTP)
4555 fi
4556 if test "$wxUSE_PROTOCOL_FILE" = "yes"; then
4557 AC_DEFINE(wxUSE_PROTOCOL_FILE)
4558 fi
4cdb0ab0 4559 fi
3954f9ca
VS
4560fi
4561
4562if test "$wxUSE_URL" = "yes"; then
4563 if test "$wxUSE_PROTOCOL" != "yes"; then
4564 AC_MSG_WARN(wxURL class requires wxProtocol... disabled)
4565 wxUSE_URL=no
4cdb0ab0 4566 fi
3954f9ca
VS
4567 if test "$wxUSE_URL" = "yes"; then
4568 AC_DEFINE(wxUSE_URL)
4cdb0ab0
VS
4569 fi
4570fi
4571
9a98a854 4572if test "$wxUSE_MINIFRAME" = "yes"; then
ce4169a4
RR
4573 AC_DEFINE(wxUSE_MINIFRAME)
4574 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram"
9a98a854
VZ
4575fi
4576
5526e819
VS
4577if test "$wxUSE_HTML" = "yes"; then
4578 AC_DEFINE(wxUSE_HTML)
4579 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html"
4580fi
4581
9a98a854 4582if test "$wxUSE_VALIDATORS" = "yes"; then
ce4169a4
RR
4583 AC_DEFINE(wxUSE_VALIDATORS)
4584 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
9a98a854
VZ
4585fi
4586
d275c7eb
VZ
4587if test "$wxUSE_PALETTE" = "yes" ; then
4588 AC_DEFINE(wxUSE_PALETTE)
4589fi
4590
0046ff7c
VS
4591if test "$wxUSE_IMAGE" = "yes" ; then
4592 AC_DEFINE(wxUSE_IMAGE)
4593fi
4594
0940bcf7
HH
4595if test "$wxUSE_GIF" = "yes" ; then
4596 AC_DEFINE(wxUSE_GIF)
4597fi
4598
4599if test "$wxUSE_PCX" = "yes" ; then
4600 AC_DEFINE(wxUSE_PCX)
4601fi
4602
4b6b4dfc
RR
4603if test "$wxUSE_IFF" = "yes" ; then
4604 AC_DEFINE(wxUSE_IFF)
4605fi
4606
0940bcf7
HH
4607if test "$wxUSE_PNM" = "yes" ; then
4608 AC_DEFINE(wxUSE_PNM)
4609fi
4610
0046ff7c
VS
4611if test "$wxUSE_XPM" = "yes" ; then
4612 AC_DEFINE(wxUSE_XPM)
4613fi
4614
658974ae
VS
4615if test "$wxUSE_ICO_CUR" = "yes" ; then
4616 AC_DEFINE(wxUSE_ICO_CUR)
4617fi
4618
a72a4bfa
VS
4619if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then
4620 dnl Must be done this late because -lunicows must be before all the other libs
4621 LIBS=" -lunicows $LIBS"
4622fi
4623
1e6feb95
VZ
4624dnl ---------------------------------------------------------------------------
4625dnl common dialog
4626dnl ---------------------------------------------------------------------------
4627
4628if test "$wxUSE_CHOICEDLG" = "yes"; then
4629 AC_DEFINE(wxUSE_CHOICEDLG)
4630fi
4631
4632if test "$wxUSE_COLOURDLG" = "yes"; then
4633 AC_DEFINE(wxUSE_COLOURDLG)
4634fi
4635
4636if test "$wxUSE_FILEDLG" = "yes"; then
4637 AC_DEFINE(wxUSE_FILEDLG)
4638fi
4639
8db37e06
VZ
4640if test "$wxUSE_FINDREPLDLG" = "yes"; then
4641 AC_DEFINE(wxUSE_FINDREPLDLG)
4642fi
4643
1e6feb95
VZ
4644if test "$wxUSE_FONTDLG" = "yes"; then
4645 AC_DEFINE(wxUSE_FONTDLG)
4646fi
4647
4648if test "$wxUSE_DIRDLG" = "yes"; then
ae1daed0
JS
4649 if test "$wxUSE_TREECTRL" != "yes"; then
4650 AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
1e6feb95 4651 else
ae1daed0 4652 AC_DEFINE(wxUSE_DIRDLG)
1e6feb95
VZ
4653 fi
4654fi
4655
4656if test "$wxUSE_MSGDLG" = "yes"; then
4657 AC_DEFINE(wxUSE_MSGDLG)
4658fi
4659
4660if test "$wxUSE_NUMBERDLG" = "yes"; then
4661 AC_DEFINE(wxUSE_NUMBERDLG)
4662fi
4663
4664if test "$wxUSE_PROGRESSDLG" = "yes"; then
4665 if test "$wxUSE_CONSTRAINTS" != "yes"; then
4666 AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them)
4667 else
4668 AC_DEFINE(wxUSE_PROGRESSDLG)
4669 fi
4670fi
4671
cbca9943
VZ
4672if test "$wxUSE_SPLASH" = "yes"; then
4673 AC_DEFINE(wxUSE_SPLASH)
4674fi
4675
1e6feb95
VZ
4676if test "$wxUSE_STARTUP_TIPS" = "yes"; then
4677 if test "$wxUSE_CONSTRAINTS" != "yes"; then
4678 AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them)
4679 else
4680 AC_DEFINE(wxUSE_STARTUP_TIPS)
4681 fi
4682fi
4683
4684if test "$wxUSE_TEXTDLG" = "yes"; then
4685 AC_DEFINE(wxUSE_TEXTDLG)
4686fi
4687
b1f5d087
VZ
4688if test "$wxUSE_WIZARDDLG" = "yes"; then
4689 AC_DEFINE(wxUSE_WIZARDDLG)
4690 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard"
4691fi
4692
bdc72a22
VZ
4693dnl ---------------------------------------------------------------------------
4694dnl get the string with OS info - used by wxGetOsDescription()
4695dnl ---------------------------------------------------------------------------
4696
32832908
VZ
4697if test "$cross_compiling" = "yes"; then
4698 dnl Use best guess from host as we can't use uname when cross compiling
4699 OSINFO="\"$host\""
4700else
4701 dnl attualy work out OS version
4702 OSINFO=`uname -s -r -m`
4703 OSINFO="\"$OSINFO\""
4704fi
4705
bdc72a22
VZ
4706AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
4707
7e67ed0d
VZ
4708dnl ---------------------------------------------------------------------------
4709dnl define the variable containing the installation prefix (used in dcpsg.cpp)
4710dnl ---------------------------------------------------------------------------
4711
06dda230
VZ
4712if test "x$prefix" != "xNONE"; then
4713 wxPREFIX=$prefix
4714else
4715 wxPREFIX=$ac_default_prefix
4716fi
4717
4718AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
7e67ed0d 4719
9a98a854
VZ
4720dnl ---------------------------------------------------------------------------
4721dnl Output the makefiles and such from the results found above
4722dnl ---------------------------------------------------------------------------
4723
9a98a854 4724dnl all additional libraries (except wxWindows itself) we link with
3d63bc3a 4725
b4085ce6
GD
4726dnl note that we always link with -lm except for Mac OS X
4727dnl extended.c uses floor() and is always linked in
3a922bb4 4728
f11bdd03 4729if test "$wxUSE_MAC" = 1 ; then
3d63bc3a 4730 LDFLAGS="$LDFLAGS -framework Carbon -framework System"
b4085ce6 4731fi
3a922bb4 4732
3d63bc3a
RL
4733dnl FIXME: should this be covered by the conditional above
4734dnl given the -lm comment there? Or should that comment (and
4735dnl this one) be removed.. [ 7 Nov 2001 ]
4736
009fead0 4737LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK -lm $LIBS"
3d63bc3a 4738
e90c1d2a 4739if test "$wxUSE_GUI" = "yes"; then
3d63bc3a 4740
cb61c62d 4741 LIBS="$GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $LIBS"
3a922bb4
RL
4742
4743 dnl TODO add checks that these samples will really compile (i.e. all the
4744 dnl library features they need are present)
4745
4746 dnl TODO some samples are never built so far:
4747 dnl ipc, mfc, nativdlg, oleauto, ownerdrw
867a54b6 4748 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \
3a922bb4
RL
4749 drawing dynamic erase event exec font image \
4750 minimal richedit rotate widgets"
4751
3a922bb4
RL
4752 dnl this is needed to be able to find AFM files
4753 CPPFLAGS="$CPPFLAGS \$(EXTRADEFS) \$(APPEXTRADEFS)"
4754else
4755 SAMPLES_SUBDIRS="console"
e90c1d2a 4756fi
9a98a854 4757
8e877c19 4758
9a98a854 4759dnl all -I options we must pass to the compiler
d714471b 4760INCLUDES="-I\${top_builddir}/lib/wx/include/${TOOLCHAIN_NAME} -I\${top_srcdir}/include \
cb61c62d 4761$REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE"
9a98a854 4762
f6bcfd97 4763dnl wxGTK does not need TOOLKIT includes in wx-config
63e7762e 4764if test "$wxUSE_GTK" = 1; then
3d63bc3a 4765 WXCONFIG_INCLUDE=
f6bcfd97
BP
4766else
4767 WXCONFIG_INCLUDE="$TOOLKIT_INCLUDE"
4768fi
4769
9a98a854 4770dnl C/C++ compiler options used to compile wxWindows
bea74fbb 4771if test "$GXX" = yes ; then
ce4169a4
RR
4772 dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
4773 CXXWARNINGS="-Wall"
d6a55c4b 4774 dnl should enable this one day...
ce4169a4 4775 dnl CXXWARNINGS="-Wall -Werror"
88e30f2b
RL
4776
4777 dnl Add this *after* all compile tests, we don't need or want generated
4778 dnl depfiles until actually building the lib
4779 if test "$wxUSE_NO_DEPS" = "no" ; then
4780 CFLAGS="-MMD $CFLAGS"
4781 CXXFLAGS="-MMD $CXXFLAGS"
4782 fi
9a98a854 4783fi
88e30f2b 4784
1725144d 4785EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
9a98a854 4786
f6bcfd97 4787CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
ee31c269 4788CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
9a98a854 4789
3d63bc3a 4790LDFLAGS="$LDFLAGS$PROFILE"
e694c22c 4791
70d1b3cf
VZ
4792dnl for convenience, sort the samples in alphabetical order
4793dnl
4794dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
4795dnl in this list - hence uniq. But normally, this shouldn't be needed!
d6a55c4b
VZ
4796dnl
4797dnl Unfortunately, there is a bug in OS/2's tr, such that
d51e8205
SN
4798dnl tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' '
4799dnl only removes the Unix-like part of the introduced line break.
4800SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`"
4801
4802dnl makefile variables
4803AC_SUBST(LEX_STEM)
4804AC_SUBST(PATH_IFS)
70d1b3cf 4805
9a98a854
VZ
4806dnl global options
4807AC_SUBST(WX_MAJOR_VERSION_NUMBER)
4808AC_SUBST(WX_MINOR_VERSION_NUMBER)
4809AC_SUBST(WX_RELEASE_NUMBER)
48b1d0ff
RR
4810AC_SUBST(WX_LIBRARY_NAME_STATIC)
4811AC_SUBST(WX_LIBRARY_NAME_SHARED)
77e13408 4812AC_SUBST(WX_LIBRARY_IMPORTLIB)
48b1d0ff
RR
4813AC_SUBST(WX_TARGET_LIBRARY)
4814AC_SUBST(WX_LIBRARY_LINK1)
4815AC_SUBST(WX_LIBRARY_LINK2)
80d895cd 4816AC_SUBST(PROGRAM_EXT)
48b1d0ff 4817
bdad4e7e 4818dnl global gl options
bdad4e7e
RR
4819AC_SUBST(WX_LIBRARY_NAME_STATIC_GL)
4820AC_SUBST(WX_LIBRARY_NAME_SHARED_GL)
bdad4e7e
RR
4821AC_SUBST(WX_TARGET_LIBRARY_GL)
4822AC_SUBST(WX_LIBRARY_LINK1_GL)
4823AC_SUBST(WX_LIBRARY_LINK2_GL)
bdad4e7e 4824
48b1d0ff 4825dnl are we supposed to create the links?
de87c353
RR
4826AC_SUBST(WX_ALL)
4827AC_SUBST(WX_ALL_INSTALLED)
9a98a854 4828
48b1d0ff
RR
4829AC_SUBST(SHARED_LD)
4830AC_SUBST(PIC_FLAG)
caa2c79b 4831AC_SUBST(CODE_GEN_FLAGS)
0f3f1cbc 4832AC_SUBST(CODE_GEN_FLAGS_CXX)
3a922bb4
RL
4833
4834AC_SUBST(SONAME_FLAGS)
4835AC_SUBST(SONAME_FLAGS_GL)
f6bcfd97 4836AC_SUBST(WX_TARGET_LIBRARY_SONAME)
3711412e 4837AC_SUBST(WX_TARGET_LIBRARY_TYPE)
48b1d0ff 4838
9a98a854
VZ
4839dnl debugging options
4840AC_SUBST(WXDEBUG_DEFINE)
4841
4842dnl toolkit options
dad6c0ea
VZ
4843AC_SUBST(USE_GUI)
4844AC_SUBST(AFMINSTALL)
9a98a854 4845AC_SUBST(TOOLKIT)
9a98a854 4846AC_SUBST(TOOLKIT_DIR)
1e6feb95 4847AC_SUBST(TOOLKIT_VPATH)
3a922bb4
RL
4848AC_SUBST(TOOLCHAIN_NAME)
4849AC_SUBST(TOOLCHAIN_DEFS)
00c81359 4850AC_SUBST(TOOLCHAIN_DLL_DEFS)
3a922bb4
RL
4851
4852dnl wx-config options
77e13408 4853AC_SUBST(host_alias)
3a922bb4
RL
4854AC_SUBST(cross_compiling)
4855AC_SUBST(WXCONFIG_LIBS)
4856AC_SUBST(WXCONFIG_LIBS_GL)
885d4bf5
VS
4857AC_SUBST(WXCONFIG_LIBS_STATIC)
4858AC_SUBST(WXCONFIG_LIBS_STATIC_GL)
f6bcfd97 4859AC_SUBST(WXCONFIG_INCLUDE)
9a98a854 4860
9b695262 4861dnl the list of files to compile/install
e90c1d2a 4862AC_SUBST(ALL_OBJECTS)
9b695262
VZ
4863AC_SUBST(ALL_HEADERS)
4864AC_SUBST(ALL_SOURCES)
2224580a
VZ
4865
4866dnl distribution vars
a4aad961 4867AC_SUBST(GUIDIST)
2224580a
VZ
4868AC_SUBST(PORT_FILES)
4869AC_SUBST(DISTDIR)
073478b3 4870
9a98a854 4871dnl additional subdirectories where we will build
9a98a854 4872AC_SUBST(SAMPLES_SUBDIRS)
9a98a854 4873
e694c22c
VZ
4874dnl additional libraries and linker settings
4875AC_SUBST(LDFLAGS)
62d0491b 4876AC_SUBST(LDFLAGS_GL)
f6bcfd97 4877AC_SUBST(OPENGL_LIBS)
3d63bc3a 4878AC_SUBST(DMALLOC_LIBS)
b12915c1 4879AC_SUBST(EXTRADEFS)
9a98a854 4880
32832908 4881dnl additional resurces settings
32832908
VZ
4882AC_SUBST(RESCOMP)
4883AC_SUBST(RESFLAGS)
3a922bb4 4884AC_SUBST(RESPROGRAMOBJ)
d08b457b 4885AC_SUBST(WX_RESOURCES_MACOSX)
e23081de 4886AC_SUBST(WX_RESOURCES_MACOSX_COMPILED)
3a922bb4 4887
2f51a9ec 4888dnl additional for Mac OS X
2f51a9ec 4889AC_SUBST(DEREZ)
ef7f2189 4890AC_SUBST(MACOSX_BUNDLE)
2f51a9ec
GD
4891AC_SUBST(LIBWXMACRES)
4892AC_SUBST(LIBWXMACRESCOMP)
2baaf735 4893AC_SUBST(LIBWXMACRESWXCONFIG)
32832908 4894
3a922bb4 4895dnl These seem to be missing
32832908
VZ
4896AC_SUBST(DLLTOOL)
4897AC_SUBST(AS)
4898AC_SUBST(NM)
4899AC_SUBST(LD)
4900AC_SUBST(MAKEINFO)
885d4bf5
VS
4901AC_SUBST(INSTALL_LIBRARY)
4902
9a98a854 4903dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
156b2523 4904dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am
9a98a854
VZ
4905dnl - and we do use it)
4906AC_PROG_MAKE_SET
4907
00cf1208 4908dnl move setup.h back if available
3a922bb4
RL
4909if test -f lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h; then
4910 mv -f lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h setup.h
00cf1208 4911fi
014e19de 4912
2aa88730
RR
4913AC_CONFIG_HEADER(setup.h:setup.h.in)
4914
2224580a
VZ
4915dnl some more GUI only things
4916if test "$wxUSE_GUI" = "yes"; then
e8482f24 4917 dnl we need to pass SAMPLES_SUBDIRS (and some other) to the configure in
ec90f5e5
VZ
4918 dnl samples and the only way to do it is, again, use the cache
4919 wx_cv_path_samplesubdirs=$SAMPLES_SUBDIRS
22c3fb2b 4920 wx_cv_if_gnu_make=$IF_GNU_MAKE
e8482f24
GL
4921 wx_cv_path_ifs=$PATH_IFS
4922 wx_cv_program_ext=$PROGRAM_EXT
4923 wx_cv_target_library=$WX_TARGET_LIBRARY
7b6058cd 4924 wx_cv_target_library_gl=$WX_TARGET_LIBRARY_GL
3711412e 4925 wx_cv_target_libtype=$WX_TARGET_LIBRARY_TYPE
93a20a27
VS
4926 dnl we need to export them because passing them through cache won't
4927 dnl work when cache=/dev/null (which is default for autoconf 2.50)
22c3fb2b
VZ
4928 export wx_cv_path_samplesubdirs wx_cv_if_gnu_make \
4929 wx_cv_path_ifs wx_cv_program_ext \
7b6058cd 4930 wx_cv_target_library wx_cv_target_library_gl wx_cv_target_libtype
0106a226 4931 AC_CONFIG_SUBDIRS(demos samples utils contrib mobile)
d39356d5 4932fi
2aa88730 4933
9a98a854
VZ
4934dnl create each of the files in the space separated list from the file.in
4935dnl (the original file name may be overriden by appending another name after a
4936dnl colon)
4937AC_OUTPUT([
ff684c98 4938 wx-config
e90c1d2a
VZ
4939 src/make.env
4940 src/makeprog.env
4941 src/makelib.env
bcd2b961 4942 Makefile
9a98a854 4943 ],
a2cddd63 4944 [
3a922bb4
RL
4945 dnl This test is required to make the following idempotent.
4946 dnl Otherwise running config.status or rerunning configure
4947 dnl would stomp the wx-config link or try to move it onto
4948 dnl itself.
652d930d
GD
4949 dnl Use -h instead of -L to test for link (GD)
4950 dnl -h is documented as obsolete under Mac OS X but works
4951 dnl -L is obsolete under Solaris8
4952 if test ! -h wx-config; then
991a5759 4953 chmod +x wx-config
3a922bb4
RL
4954 mv wx-config wx${TOOLCHAIN_NAME}-config
4955 ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config
991a5759 4956 fi
014e19de 4957
00cf1208
RR
4958 if test ! -d lib; then
4959 mkdir lib
4960 fi
4961 if test ! -d lib/wx; then
4962 mkdir lib/wx
4963 fi
4964 if test ! -d lib/wx/include; then
4965 mkdir lib/wx/include
4966 fi
3a922bb4
RL
4967 if test ! -d lib/wx/include/${TOOLCHAIN_NAME}; then
4968 mkdir lib/wx/include/${TOOLCHAIN_NAME}
e90c1d2a 4969 fi
3a922bb4
RL
4970 if test ! -d lib/wx/include/${TOOLCHAIN_NAME}/wx; then
4971 mkdir lib/wx/include/${TOOLCHAIN_NAME}/wx
e90c1d2a 4972 fi
afc31813 4973 if test -f setup.h; then
3a922bb4 4974 mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h
afc31813 4975 fi
a2cddd63
VZ
4976 ],
4977 [
3a922bb4 4978 TOOLCHAIN_NAME="${TOOLCHAIN_NAME}"
07eb77a6 4979 LN_S="${LN_S}"
a2cddd63
VZ
4980 ]
4981 )
9a98a854 4982
3a922bb4 4983dnl vi: set et sts=4 sw=4: