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