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