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