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