1 dnl Process this file with autoconf to produce a configure script.
6 dnl ---------------------------------------------------------------------------
8 dnl Top-level configure.in for wxWidgets by Robert Roebling, Phil Blecker,
9 dnl Vadim Zeitlin and Ron Lee
11 dnl This script is under the wxWidgets licence.
14 dnl ---------------------------------------------------------------------------
16 dnl ---------------------------------------------------------------------------
18 dnl ---------------------------------------------------------------------------
20 AC_INIT([wxWidgets], [2.9.0], [wx-dev@lists.wxwidgets.org])
22 dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package
23 AC_CONFIG_SRCDIR([wx-config.in])
25 dnl sets build, host, target variables and the same with _alias
31 dnl When making releases do:
33 dnl wx_release_number += 1
35 wx_major_version_number=2
36 wx_minor_version_number=9
38 wx_subrelease_number=0
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
44 WX_MSW_VERSION=$wx_major_version_number$wx_minor_version_number$wx_release_number
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)
53 dnl ------------------------------------------------------------------------
54 dnl Check platform (host system)
55 dnl ------------------------------------------------------------------------
68 USE_DARWIN= dnl a.k.a. Mac OS X
75 USE_OSF= dnl OSF/1 (obsolete?)
77 USE_SOLARIS= dnl Solaris ("SunOS" >= 5)
78 USE_SUN= dnl SunOS or Solaris
79 USE_SUNOS= dnl old/real SunOS (obsolete)
81 USE_SYSV= dnl any System V
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
94 dnl the list of all available toolkits
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"
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
105 DEFAULT_wxUSE_MICROWIN=0
106 DEFAULT_wxUSE_MOTIF=0
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
129 SAMPLES_RPATH_POSTLINK=
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
140 DEFAULT_DEFAULT_wxUSE_MOTIF=1
141 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
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"
153 if test "x$TMP" = "xalpha"; then
157 DEFAULT_DEFAULT_wxUSE_GTK=1
159 *-*-gnu* | *-*-k*bsd*-gnu )
162 if test "x$TMP" = "xalpha"; then
166 DEFAULT_DEFAULT_wxUSE_GTK=1
168 *-*-irix5* | *-*-irix6* )
173 DEFAULT_DEFAULT_wxUSE_MOTIF=1
180 AC_DEFINE(__SOLARIS__)
182 DEFAULT_DEFAULT_wxUSE_MOTIF=1
183 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
192 DEFAULT_DEFAULT_wxUSE_MOTIF=1
197 AC_DEFINE(__FREEBSD__)
199 DEFAULT_DEFAULT_wxUSE_GTK=1
201 *-*-openbsd*|*-*-mirbsd*)
204 AC_DEFINE(__OPENBSD__)
206 DEFAULT_DEFAULT_wxUSE_GTK=1
211 AC_DEFINE(__NETBSD__)
213 DEFAULT_DEFAULT_wxUSE_GTK=1
214 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
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"
225 DEFAULT_DEFAULT_wxUSE_MOTIF=1
226 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
233 DEFAULT_DEFAULT_wxUSE_MOTIF=1
240 DEFAULT_DEFAULT_wxUSE_MOTIF=1
246 dnl quoting from http://www-1.ibm.com/servers/esdd/articles/gnu.html:
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.
255 DEFAULT_DEFAULT_wxUSE_MOTIF=1
262 AC_DEFINE(__UNIXWARE__)
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
271 DEFAULT_DEFAULT_wxUSE_MSW=1
279 DEFAULT_DEFAULT_wxUSE_MGL=1
282 *-pc-os2_emx | *-pc-os2-emx )
287 DEFAULT_DEFAULT_wxUSE_PM=1
288 dnl "c++" wrapper is not always available, so always use plain gcc.
290 LDFLAGS="$LDFLAGS -Zcrtdll"
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.
303 for ac_dir in $PATH; do
305 if test -z "$ac_TEMP_PATH"; then
306 ac_TEMP_PATH="$ac_dir"
308 ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
311 export PATH="$ac_TEMP_PATH"
317 dnl Darwin based distributions (including Mac OS X)
322 AC_DEFINE(__DARWIN__)
323 AC_DEFINE(TARGET_CARBON)
324 DEFAULT_DEFAULT_wxUSE_MAC=1
327 powerpc-apple-macos* )
328 dnl Classic Mac OS (< X)
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
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
341 dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
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.])
350 DEFAULT_DEFAULT_wxUSE_X11=1
351 DEFAULT_wxUSE_SHARED=no
354 dnl ---------------------------------------------------------------------------
355 dnl command line options for configure
356 dnl ---------------------------------------------------------------------------
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)
362 dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
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
370 DEFAULT_wxUSE_ALL_FEATURES=yes
372 DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
373 DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
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
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
392 DEFAULT_wxUSE_UNICODE_UTF8=auto
393 DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
395 dnl Mac/Cocoa users need to enable building universal binaries explicitly
396 DEFAULT_wxUSE_UNIVERSAL_BINARY=no
398 DEFAULT_wxUSE_OFFICIAL_BUILD=no
400 dnl Applicable only when --with-gtk was used:
401 DEFAULT_wxUSE_GTK2=yes
403 dnl Always default to no. Only special cases require this.
404 DEFAULT_wxUSE_OBJC_UNIQUIFYING=no
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
412 eval "CACHE_$toolkit=1"
414 LINE=`grep "wx${toolkit}_VERSION=" ${wx_arg_cache_file}`
415 if test "x$LINE" != "x" ; then
421 dnl ===========================
422 dnl deal with configure options
423 dnl ===========================
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
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)
443 dnl ---------------------------------------------------------------------------
444 dnl global build options
445 dnl ---------------------------------------------------------------------------
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
458 WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
460 dnl ---------------------------------------------------------------------------
462 dnl ---------------------------------------------------------------------------
464 if test "$wxUSE_GUI" = "yes"; then
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"])
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
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)
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)
490 dnl ---------------------------------------------------------------------------
491 dnl external libraries
492 dnl ---------------------------------------------------------------------------
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)
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)
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
520 # NOTE: Empty string on purpose so that --without-macosx-sdk (thus no)
521 # will override --enable-universal_binary's automatic SDK usage.
523 LINE=`grep "^wxUSE_MACOSX_SDK=" ${wx_arg_cache_file}`
524 if test "x$LINE" != x ; then
526 echo "$LINE" >> ${wx_arg_cache_file}.tmp
529 AC_MSG_RESULT([$wxUSE_MACOSX_SDK])
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
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
544 echo "$LINE" >> ${wx_arg_cache_file}.tmp
547 AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
549 dnl ---------------------------------------------------------------------------
550 dnl global compile options
551 dnl ---------------------------------------------------------------------------
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
566 WX_ARG_ENABLE(omf, [ --enable-omf use OMF object format], wxUSE_OMF)
569 if test "$wxUSE_DEBUG" = "yes"; then
570 DEFAULT_wxUSE_DEBUG_FLAG=yes
571 DEFAULT_wxUSE_DEBUG_INFO=yes
573 elif test "$wxUSE_DEBUG" = "no"; then
574 DEFAULT_wxUSE_DEBUG_FLAG=no
575 DEFAULT_wxUSE_DEBUG_INFO=no
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)
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)
595 WX_ARG_DISABLE(rpath, [ --disable-rpath disable use of rpath for uninstalled builds], wxUSE_RPATH)
597 WX_ARG_ENABLE(objc_uniquifying,[ --enable-objc_uniquifying enable Objective-C class name uniquifying], wxUSE_OBJC_UNIQUIFYING)
599 WX_ARG_DISABLE(visibility, [ --disable-visibility disable use of ELF symbols visibility even if supported], wxUSE_VISIBILITY)
601 dnl ---------------------------------------------------------------------------
602 dnl optional non GUI features
603 dnl ---------------------------------------------------------------------------
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)
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)
617 WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
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)
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)
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)
670 WX_ARG_FEATURE(threads, [ --enable-threads use threads], wxUSE_THREADS)
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)
675 if test "$wxUSE_GUI" = "yes"; then
677 dnl ---------------------------------------------------------------------------
678 dnl optional "big" GUI features
679 dnl ---------------------------------------------------------------------------
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)
702 dnl ---------------------------------------------------------------------------
704 dnl ---------------------------------------------------------------------------
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)
710 dnl ---------------------------------------------------------------------------
711 dnl optional GUI controls (in alphabetical order except the first one)
712 dnl ---------------------------------------------------------------------------
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)
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
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)
890 dnl ---------------------------------------------------------------------------
892 dnl ---------------------------------------------------------------------------
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)
910 dnl ---------------------------------------------------------------------------
912 dnl ---------------------------------------------------------------------------
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)
926 dnl ---------------------------------------------------------------------------
927 dnl support for image formats that do not rely on external library
928 dnl ---------------------------------------------------------------------------
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)
940 dnl ---------------------------------------------------------------------------
941 dnl wxMSW-only options
942 dnl ---------------------------------------------------------------------------
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)
953 dnl cache the options values before (may be) aborting below
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
959 AC_MSG_CHECKING(for toolkit)
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
972 if test "$wxUSE_GUI" = "yes"; then
974 if test "$USE_BEOS" = 1; then
975 AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
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
982 eval "value=\$${var}"
983 if test "x$value" = "xno"; then
985 elif test "x$value" != "x"; then
989 if test "x$value" != "x" -a "x$value" != "xyes" -a "x$value" != "xno"; then
990 eval "wx${toolkit}_VERSION=$value"
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
999 var=DEFAULT_wxUSE_$toolkit
1001 eval "version=\$DEFAULT_wx${toolkit}_VERSION"
1002 if test "x$version" != "x"; then
1003 eval "wx${toolkit}_VERSION=$version"
1006 eval "wxUSE_$toolkit=\$${var}"
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}`
1016 dnl Allow wxUSE_PM only for OS/2 with EMX.
1018 *-pc-os2_emx | *-pc-os2-emx )
1019 NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}`
1022 case "$NUM_TOOLKITS" in
1026 AC_MSG_ERROR(Please specify a toolkit -- cannot determine the default for ${host})
1029 AC_MSG_ERROR(Please specify at most one toolkit (maybe some are cached in configarg.cache?))
1032 # to be removed when --disable-gtk2 isn't needed
1033 if test "x$wxUSE_GTK2" = "xyes"; then
1035 elif test "x$wxUSE_GTK2" = "xno"; then
1039 dnl cache the wxUSE_<TOOLKIT> values too
1040 for toolkit in $ALL_TOOLKITS; do
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}
1053 if test "$value" = 1; then
1054 toolkit_echo=`echo $toolkit | tr A-Z a-z`
1055 AC_MSG_RESULT($toolkit_echo)
1060 if test "x$host_alias" != "x"; then
1061 AC_MSG_RESULT(base ($host_alias hosted) only)
1063 AC_MSG_RESULT(base only)
1067 dnl ---------------------------------------------------------------------------
1068 dnl Checks for programs
1069 dnl ---------------------------------------------------------------------------
1071 dnl flush the cache because checking for programs might abort
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
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
1086 dnl is -traditional needed for correct compilations
1087 dnl adds -traditional for gcc if needed
1088 AC_PROG_GCC_TRADITIONAL
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
1096 dnl see CFLAGS line above
1097 CXXFLAGS=${CXXFLAGS:=}
1098 AC_BAKEFILE_PROG_CXX
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])
1108 dnl defines AR with the appropriate command
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])
1118 retest_macosx_linking=no
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
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])
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])
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.
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
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.])
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
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"
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])
1194 AC_MSG_RESULT([exists])
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.
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
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/'`
1219 # If that failed, try again with the new key
1220 if test "x$MACOSX_SDK_PLIST_VERSION_MIN" == "x"; then
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/'`
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])
1230 AC_MSG_WARN([Could not determine deployment target from SDKSettings.plist])
1231 wxUSE_MACOSX_VERSION_MIN=
1234 wxUSE_MACOSX_VERSION_MIN=
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
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
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])
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])
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...
1268 INSTALL_PROGRAM="cp -fp"
1269 INSTALL_DATA="cp -fp"
1275 dnl ------------------------------------------------------------------------
1276 dnl Platform specific tests
1277 dnl ------------------------------------------------------------------------
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"
1285 dnl This case is for PowerPC OS X vs. everything else
1288 AC_MSG_CHECKING([if __POWERPC__ is already defined])
1289 AC_TRY_COMPILE([],[#ifndef __POWERPC__
1290 choke me for lack of PowerPC
1293 [AC_MSG_RESULT([yes])],
1294 [AC_MSG_RESULT([no])
1295 AC_DEFINE(__POWERPC__)
1300 dnl This case is for OS X vs. everything else
1303 AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
1304 AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
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>
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.])]
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
1329 if test "$wxUSE_MSW" = 1 ; then
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,
1349 if test "$wx_cv_nocygwin" = "yes"; then
1355 if test "$wants_win32" = 1 ; then
1356 BAKEFILE_FORCE_PLATFORM=win32
1364 if test "$wxUSE_WINE" = "yes"; then
1366 LDFLAGS_GUI="-mwindows"
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
1374 AC_DEFINE(__WIN32__)
1375 AC_DEFINE(__WIN95__)
1376 AC_DEFINE(__WINDOWS__)
1377 AC_DEFINE(__GNUWIN32__)
1380 if test "$doesnt_want_win32" = 1 ; then
1384 dnl (end of Windows-only piece)
1386 if test "$USE_UNIX" = 1 ; then
1391 dnl This case is for OS/2 vs. everything else
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",
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")
1407 dnl Include resources for the "native" port (wxPM).
1408 RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res"
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,[
1417 dnl Check the gcc version macro.
1423 FILE *f=fopen("conftestval", "w");
1428 #elif (__GNUC__==3) && ((__GNUC_MINOR__ < 2) || ((__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__<2)))
1430 #elif (__GNUC__==3) && (__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__==2)
1439 wx_cv_gccversion=`cat conftestval`,
1440 wx_cv_gccversion="EMX2",
1441 dnl Compilation error: Assuming standard EMX environment
1442 wx_cv_gccversion="EMX2"
1445 if test "$wx_cv_gccversion" = "EMX2"; then
1446 LIBS="$LIBS -lstdcpp"
1447 LDFLAGS="$LDFLAGS -Zsysv-signals"
1449 if test "$wx_cv_gccversion" = "EMX3"; then
1450 LIBS="$LIBS -lstdcxx -lgcc"
1451 LDFLAGS="$LDFLAGS -Zsysv-signals"
1453 LIBS="$LIBS -lstdc++"
1456 if test "$wxUSE_SHARED" = "yes" -a "$wxUSE_OMF" = "no"; then
1457 AC_MSG_WARN([Building DLLs requires OMF mode, enabled])
1461 dnl (end of OS/2-only piece)
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
1468 dnl ---------------------------------------------------------------------
1469 dnl (non-OS/2-only piece)
1471 AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
1476 strcasecmp("foo", "bar");
1478 ac_cv_string_strcasecmp=yes,
1479 ac_cv_string_strcasecmp=no
1483 if test x"$ac_cv_string_strcasecmp" = "xyes"; then
1484 AC_DEFINE(HAVE_STRCASECMP_IN_STRING_H)
1486 AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [
1488 #include <strings.h>
1491 strcasecmp("foo", "bar");
1493 ac_cv_strings_strcasecmp=yes,
1494 ac_cv_strings_strcasecmp=no
1498 if test x"$ac_cv_strings_strcasecmp" = "xyes"; then
1499 AC_DEFINE(HAVE_STRCASECMP_IN_STRINGS_H)
1501 AC_MSG_ERROR([No case-insensitive string comparison function found.])
1505 dnl (end of non-OS/2-only piece)
1509 dnl ------------------------------------------------------------------------
1510 dnl Check for headers
1511 dnl ------------------------------------------------------------------------
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])
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()])
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
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()])
1540 dnl ---------------------------------------------------------------------------
1541 dnl Checks for compiler characteristics
1542 dnl ---------------------------------------------------------------------------
1544 dnl defines const to be empty if c-compiler does not support const fully
1546 dnl defines inline to a sensible value for the c-compiler
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)
1560 AC_CHECK_SIZEOF(long long, 8)
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"
1570 AC_CHECK_SIZEOF(long long, 0)
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,
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"
1583 # include <stddef.h>
1587 #ifdef HAVE_STDLIB_H
1588 # include <stdlib.h>
1593 if test "$ac_cv_sizeof_wchar_t" != 0; then
1599 dnl checks needed to define wxVaCopy
1600 AC_CACHE_CHECK([for va_copy],
1606 void foo(char *f, ...)
1619 wx_cv_func_va_copy=yes,
1620 wx_cv_func_va_copy=no
1626 if test $wx_cv_func_va_copy = "yes"; then
1627 AC_DEFINE(HAVE_VA_COPY)
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,
1635 int foo(char *f, ...)
1640 if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 )
1648 return foo("hi", 17);
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
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)
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
1670 dnl Check if variadic macros (C99 feature) are supported:
1672 [whether the compiler supports variadic macros],
1673 [wx_cv_have_variadic_macros],
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
1682 #define test(fmt, ...) printf(fmt, __VA_ARGS__)
1685 test("%s %d %p", "test", 1, 0);
1688 [wx_cv_have_variadic_macros=yes],
1689 [wx_cv_have_variadic_macros=no]
1695 if test $wx_cv_have_variadic_macros = "yes"; then
1696 AC_DEFINE(HAVE_VARIADIC_MACROS)
1699 fi dnl wxUSE_VARARG_MACROS == yes
1701 dnl check for large file support
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
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"
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
1719 if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then
1721 [if -D__STDC_EXT__ is required],
1722 wx_cv_STDC_EXT_required,
1728 #ifndef __STDC_EXT__
1732 wx_cv_STDC_EXT_required=no,
1733 wx_cv_STDC_EXT_required=yes
1738 if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
1739 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -D__STDC_EXT__"
1743 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGE_FILES"
1745 dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source
1747 if test "$ac_cv_sys_largefile_source" != no; then
1748 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
1752 dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
1755 dnl check for iostream (as opposed to iostream.h) standard header
1756 WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
1758 dnl check whether C++ compiler supports bool built-in type
1761 dnl check whether C++ compiler supports explicit keyword
1764 dnl check whether C++ compiler supports C++ casts
1766 AC_CXX_REINTERPRET_CAST
1768 dnl we don't use HAVE_DYNAMIC_CAST anywhere right now...
1769 dnl AC_CXX_DYNAMIC_CAST
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"
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
1781 if test "x$SUNCC" = xyes; then
1782 CFLAGS="-erroff=E_NO_EXPLICIT_TYPE_GIVEN $CFLAGS"
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
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"
1795 if test "x$SGICXX" = "xyes"; then
1796 CXXFLAGS="-woff 3970 $CXXFLAGS"
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"
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"
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
1822 CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
1825 dnl the next few tests are all for C++ features and so need to be done using
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"
1835 std_string="std::string"
1839 dnl check if <string> declares std::[w]string
1840 AC_CACHE_CHECK([for $std_string in <string>],
1841 wx_cv_class_stdstring,
1843 AC_TRY_COMPILE([#include <string>],
1845 wx_cv_class_stdstring=yes,
1846 wx_cv_class_stdstring=no
1851 if test "$wx_cv_class_stdstring" = yes; then
1852 if test "$wxUSE_UNICODE" = "yes"; then
1853 AC_DEFINE(HAVE_STD_WSTRING)
1855 dnl we don't need HAVE_STD_STRING, we just suppose it's available if
1856 dnl wxUSE_STD_STRING==yes
1858 AC_CACHE_CHECK([if std::basic_string<$char_type> works],
1859 wx_cv_class_stdbasicstring,
1864 # include <stddef.h>
1868 #ifdef HAVE_STDLIB_H
1869 # include <stdlib.h>
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
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>])
1888 AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string])
1895 if test "$wxUSE_STD_IOSTREAM" = "yes"; then
1896 AC_CHECK_TYPES([std::istream, std::ostream],,
1897 [wxUSE_STD_IOSTREAM=no],
1898 [#include <iostream>])
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])
1904 AC_MSG_WARN([No std::iostreams, switching to --disable-std_iostreams])
1909 if test "$wxUSE_STL" = "yes"; then
1910 dnl check for basic STL functionality
1911 AC_CACHE_CHECK([for basic STL functionality],
1913 [AC_TRY_COMPILE([#include <string>
1914 #include <functional>
1915 #include <algorithm>
1918 [std::vector<int> moo;
1920 std::vector<int>::iterator it =
1921 std::find_if(moo.begin(), moo.end(),
1922 std::bind2nd(std::less<int>(), 3));],
1928 if test "$wx_cv_lib_stl" != yes; then
1929 AC_MSG_ERROR([Can't use --enable-stl as basic STL functionality is missing])
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;
1938 foo.compare(1, 1, bar);
1939 foo.compare(1, 1, bar, 1, 1);
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
1948 if test "$wx_cv_func_stdstring_compare" = yes; then
1949 AC_DEFINE(HAVE_STD_STRING_COMPARE)
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)
1968 if test "$wx_cv_class_stdhashmapset" = yes; then
1969 AC_DEFINE(HAVE_HASH_MAP)
1970 AC_DEFINE(HAVE_STD_HASH_MAP)
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)
1988 if test "$wx_cv_class_gnuhashmapset" = yes; then
1989 AC_DEFINE(HAVE_EXT_HASH_MAP)
1990 AC_DEFINE(HAVE_GNU_CXX_HASH_MAP)
1994 dnl check for atomic operations builtins for wx/atomic.h:
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 ---------------------------------------------------------------------------
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.
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!
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)
2015 /usr/local/include \
2017 /usr/Motif-2.1/include \
2018 /usr/Motif-1.2/include \
2019 /usr/include/Motif1.2 \
2022 /usr/openwin/include \
2026 /usr/X11R6/include \
2027 /usr/X11R6.4/include \
2028 /usr/X11R5/include \
2029 /usr/X11R4/include \
2031 /usr/include/X11R6 \
2032 /usr/include/X11R5 \
2033 /usr/include/X11R4 \
2035 /usr/local/X11R6/include \
2036 /usr/local/X11R5/include \
2037 /usr/local/X11R4/include \
2039 /usr/local/include/X11R6 \
2040 /usr/local/include/X11R5 \
2041 /usr/local/include/X11R4 \
2045 /usr/local/X11/include \
2046 /usr/local/include/X11 \
2048 /usr/XFree86/include/X11 \
2051 /usr/openwin/share/include"
2053 dnl try to find out the standard lib locations for the systems with multiple
2055 AC_MSG_CHECKING([for libraries directory])
2062 for d in WX_STD_LIBPATH(); do
2063 for e in a so sl dylib dll.a; do
2065 if test -f $libc; then
2068 AC_LINK_IFELSE([int main() { return 0; }],
2069 wx_cv_std_libpath=`echo $d | sed s@/usr/@@`)
2071 if test "x$wx_cv_std_libpath" != "x"; then
2077 if test "x$wx_cv_std_libpath" = "x"; then
2078 wx_cv_std_libpath="lib"
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"
2089 wx_cv_std_libpath="lib"
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"
2099 wx_cv_std_libpath="lib"
2104 wx_cv_std_libpath="lib";
2108 AC_MSG_RESULT($wx_cv_std_libpath)
2110 SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` /usr/$wx_cv_std_libpath"
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`
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"
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
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
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
2148 dnl ------------------------------------------------------------------------
2149 dnl Check for libraries
2150 dnl ------------------------------------------------------------------------
2152 dnl flush the cache because checking for libraries below might abort
2155 dnl check for glibc version
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>],
2163 #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
2168 wx_cv_lib_glibc21=yes
2171 wx_cv_lib_glibc21=no
2175 if test "$wx_cv_lib_glibc21" = "yes"; then
2176 AC_DEFINE(wxHAVE_GLIBC2)
2180 dnl we may need _GNU_SOURCE for 2 things:
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)
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)
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
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.
2207 dnl On MacOS X, this test will find that -lm is unnecessary and leave it out.
2209 dnl Just check a few floating point functions. If they are all found without
2210 dnl -lm, then we must not need -lm.
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
2221 # use different functions to avoid configure caching
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
2231 # not sure we should warn the user, crash, etc.
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
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
2241 if test "wxUSE_UNICODE" = "yes"; then
2242 WX_CHECK_FUNCS(wcstoull)
2244 WX_CHECK_FUNCS(strtoull)
2248 dnl ---------------------------------------------------------------------------
2249 dnl Optional libraries
2251 dnl --with-<lib>=sys
2252 dnl looks for system library and fails if not found
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
2259 dnl --with-<lib>=builtin
2260 dnl uses builtin wx version without searching for system library
2264 dnl do not use library (neither system nor builtin wx version)
2266 dnl ---------------------------------------------------------------------------
2268 dnl ------------------------------------------------------------------------
2269 dnl Check for regex libraries
2270 dnl ------------------------------------------------------------------------
2272 if test "$wxUSE_REGEX" != "no"; then
2273 AC_DEFINE(wxUSE_REGEX)
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.])
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)],, [ ])
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])
2289 AC_MSG_WARN([system regex library not found, will use built-in instead])
2293 dnl we are using the system library
2295 dnl only the built-in supports advanced REs
2296 AC_DEFINE(WX_NO_REGEX_ADVANCED)
2301 dnl ------------------------------------------------------------------------
2302 dnl Check for zlib compression library
2303 dnl ------------------------------------------------------------------------
2306 if test "$wxUSE_ZLIB" != "no" ; then
2307 AC_DEFINE(wxUSE_ZLIB)
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"
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)
2324 AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h,
2326 dnl zlib.h defines ZLIB_VERSION="x.y.z"
2333 FILE *f=fopen("conftestval", "w");
2336 ZLIB_VERSION[0] == '1' &&
2337 (ZLIB_VERSION[2] > '1' ||
2338 (ZLIB_VERSION[2] == '1' &&
2339 ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
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
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,,, [ ])
2353 system_zlib_h_ok=$ac_cv_header_zlib_h
2356 if test "$system_zlib_h_ok" = "yes"; then
2357 AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz")
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])
2364 AC_MSG_WARN([zlib library not found or too old, will use built-in instead])
2368 dnl we are using the system library
2374 dnl ------------------------------------------------------------------------
2375 dnl Check for png library
2376 dnl ------------------------------------------------------------------------
2379 if test "$wxUSE_LIBPNG" != "no" ; then
2380 AC_DEFINE(wxUSE_LIBPNG)
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])
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
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,
2402 dnl png.h defines PNG_LIBPNG_VER=number
2409 FILE *f=fopen("conftestval", "w");
2412 PNG_LIBPNG_VER > 90 ? "yes" : "no");
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
2422 AC_CHECK_HEADER(png.h,,, [ ])
2424 if test "$ac_cv_header_png_h" = "yes"; then
2425 AC_CHECK_LIB(png, png_check_sig, PNG_LINK=" -lpng -lz", , [-lz -lm])
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])
2432 AC_MSG_WARN([system png library not found or too old, will use built-in instead])
2433 wxUSE_LIBPNG=builtin
2436 dnl we are using the system library
2443 dnl ------------------------------------------------------------------------
2444 dnl Check for jpeg library
2445 dnl ------------------------------------------------------------------------
2447 dnl this check must be done before the check for libtiff as libtiff uses
2450 if test "$wxUSE_LIBJPEG" != "no" ; then
2451 AC_DEFINE(wxUSE_LIBJPEG)
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])
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,
2468 #undef HAVE_STDLIB_H
2470 #include <jpeglib.h>
2474 ac_cv_header_jpeglib_h=yes,
2475 ac_cv_header_jpeglib_h=no
2478 AC_MSG_RESULT($ac_cv_header_jpeglib_h)
2480 if test "$ac_cv_header_jpeglib_h" = "yes"; then
2481 AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg")
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])
2488 AC_MSG_WARN([system jpeg library not found, will use built-in instead])
2489 wxUSE_LIBJPEG=builtin
2492 dnl we are using the system library
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.
2509 #include <jpeglib.h>
2513 [wxInt`expr 8 \* $ac_cv_sizeof_boolean`])
2516 [#include <windows.h>])
2523 dnl ------------------------------------------------------------------------
2524 dnl Check for tiff library
2525 dnl ------------------------------------------------------------------------
2528 TIFF_PREREQ_LINKS=-lm
2529 if test "$wxUSE_LIBTIFF" != "no" ; then
2530 AC_DEFINE(wxUSE_LIBTIFF)
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"
2538 if test "$wxUSE_ZLIB" = "sys"; then
2539 TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK"
2541 AC_CHECK_HEADER(tiffio.h,
2543 AC_CHECK_LIB(tiff, TIFFError,
2544 TIFF_LINK=" -ltiff",
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])
2556 AC_MSG_WARN([system tiff library not found, will use built-in instead])
2557 wxUSE_LIBTIFF=builtin
2560 dnl we are using the system library
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"
2574 AC_CONFIG_SUBDIRS([src/tiff])
2578 dnl ------------------------------------------------------------------------
2579 dnl Check for expat libraries
2580 dnl ------------------------------------------------------------------------
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])
2587 if test "$wxUSE_XML" != "no"; then
2588 AC_MSG_WARN([wxWidgets requires wchar_t to use xml, disabling])
2593 if test "$wxUSE_EXPAT" != "no"; then
2595 AC_DEFINE(wxUSE_EXPAT)
2596 AC_DEFINE(wxUSE_XML)
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,
2606 AC_TRY_COMPILE([#include <expat.h>],[],
2607 wx_cv_expat_is_not_broken=yes,
2608 wx_cv_expat_is_not_broken=no
2613 if test "$wx_cv_expat_is_not_broken" = "yes" ; then
2614 AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LINK=" -lexpat")
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])
2621 AC_MSG_WARN([system expat library not found, will use built-in instead])
2625 dnl we are using the system library
2629 if test "$wxUSE_EXPAT" = "builtin" ; then
2630 dnl Expat needs this:
2631 AC_CONFIG_SUBDIRS([src/expat])
2636 dnl ------------------------------------------------------------------------
2637 dnl Check for libmspack
2638 dnl ------------------------------------------------------------------------
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")
2646 if test "x$MSPACK_LINK" = "x" ; then
2651 if test "$wxUSE_LIBMSPACK" != "no"; then
2652 AC_DEFINE(wxUSE_LIBMSPACK)
2656 dnl ----------------------------------------------------------------
2657 dnl search for toolkit (widget sets)
2658 dnl ----------------------------------------------------------------
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,,
2673 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
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"
2681 if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
2682 LIBS="$LIBS -loleacc"
2687 dnl Cygwin doesn't include these by default
2688 LIBS="$LIBS -lkernel32 -luser32"
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"
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__"
2700 dnl install Win32-specific files in "make install"
2701 WIN32INSTALL=win32install
2703 dnl pbt.h is missing on Wine at least
2704 AC_CHECK_HEADER([pbt.h],, [AC_DEFINE(NEED_PBT_H)], [ ])
2707 if test "$wxUSE_GUI" = "yes"; then
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
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
2726 if test "$wxUSE_DRAGIMAGE" = "yes"; then
2727 AC_MSG_WARN([wxDragImage not supported under wxCocoa yet, disabled])
2732 if test "$wxUSE_MSW" = 1 ; then
2736 dnl -mwindows causes a heap of other default gui libs to be linked in.
2739 WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows"
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])
2747 gtk_version_cached=1
2748 AC_CACHE_VAL(wx_cv_lib_gtk,
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
2755 dnl we must link against lgthread unless the user
2756 dnl used --disable-threads
2758 if test "$wxUSE_THREADS" = "yes"; then
2764 if test "x$wxGTK_VERSION" != "x1"
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.
2771 if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
2776 AM_PATH_GTK_2_0(2.4.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
2778 dnl Solaris also requires -lX11 for static lib
2781 if test "$wxUSE_SHARED" != "yes"; then
2782 GTK_LIBS="$GTK_LIBS -lX11"
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)
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)
2798 if test -z "$wx_cv_lib_gtk"; then
2799 dnl looks better in AC_MSG_RESULT
2802 dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
2804 wx_cv_cflags_gtk=$GTK_CFLAGS
2805 wx_cv_libs_gtk=`echo $GTK_LIBS | sed -e 's/ -l[[^ ]]*cairo[[^ ]]*//g'`
2810 dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
2812 if test "$gtk_version_cached" = 1; then
2813 AC_MSG_RESULT($wx_cv_lib_gtk)
2816 case "$wx_cv_lib_gtk" in
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.
2836 if test "$WXGTK2" = 1; then
2837 save_CFLAGS="$CFLAGS"
2839 CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
2840 LIBS="$LIBS $wx_cv_libs_gtk"
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>])
2851 dnl test if we have at least GTK+ 2.10:
2852 AC_MSG_CHECKING([if GTK+ is version >= 2.10])
2854 #include <gtk/gtk.h>
2857 #if !GTK_CHECK_VERSION(2,10,0)
2862 AC_DEFINE(__WXGTK210__)
2863 AC_DEFINE(__WXGTK26__)
2864 AC_MSG_RESULT([yes])
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])
2876 #include <gtk/gtk.h>
2879 #if !GTK_CHECK_VERSION(2,6,0)
2884 AC_DEFINE(__WXGTK26__)
2885 AC_MSG_RESULT([yes])
2894 CFLAGS="$save_CFLAGS"
2897 if test "$wxUSE_UNICODE" = "yes"; then
2898 AC_MSG_WARN([Unicode configuration not supported with GTK+ 1.x])
2902 dnl test for XIM support in libgdk
2903 AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
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)
2912 TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
2913 GUI_TK_LIBRARY="$wx_cv_libs_gtk $GUI_TK_LIBRARY"
2915 AFMINSTALL=afminstall
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"
2929 AC_MSG_RESULT([found in $ac_find_libraries])
2931 AC_MSG_RESULT(not found)
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)
2941 dnl AC_MSG_RESULT(not found)
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.])
2952 AC_MSG_RESULT($MGL_ROOT)
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
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"
2966 mgl_os_candidates="linux/gcc/x86/a linux/gcc/x86/so linux/gcc/glibc linux/gcc/glibc.so"
2970 mgl_os_candidates="dos32/dj2"
2973 AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
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
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
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.])
3002 AC_MSG_RESULT("$MGL_ROOT/lib/$mgl_lib_type/$mgl_os")
3004 wxUSE_UNIVERSAL="yes"
3006 TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
3007 GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
3009 AFMINSTALL=afminstall
3014 if test "$wxUSE_DFB" = 1; then
3015 PKG_PROG_PKG_CONFIG()
3017 PKG_CHECK_MODULES(DIRECTFB,
3018 [directfb >= 0.9.23],
3020 wxUSE_UNIVERSAL="yes"
3021 TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS"
3022 GUI_TK_LIBRARY="$DIRECTFB_LIBS"
3027 AC_MSG_ERROR([DirectFB not found.])
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.])
3038 AC_MSG_RESULT($MICROWINDOWS)
3041 if test -f $MICROWINDOWS/lib/libmwin.a; then
3042 AC_MSG_RESULT(MicroWindows' libraries found.)
3044 AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
3047 TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
3048 GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
3050 wxUSE_UNIVERSAL="yes"
3052 AFMINSTALL=afminstall
3054 GUIDIST=MICROWIN_DIST
3056 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
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
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)])
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
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
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.])
3087 AC_MSG_RESULT($MICROWIN)
3088 AC_DEFINE(wxUSE_NANOX)
3092 if test "$wxUSE_UNICODE" = "yes"; then
3093 PKG_PROG_PKG_CONFIG()
3095 PKG_CHECK_MODULES(PANGOX, pangox,
3097 CFLAGS="$PANGOX_CFLAGS $CFLAGS"
3098 CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS"
3099 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS"
3102 AC_MSG_ERROR([pangox library not found, library cannot be compiled in Unicode mode])
3105 PKG_CHECK_MODULES(PANGOFT2, pangoft2,
3107 CFLAGS="$PANGOFT2_CFLAGS $CFLAGS"
3108 CXXFLAGS="$PANGOFT2_CFLAGS $CXXFLAGS"
3109 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOFT2_LIBS"
3112 AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support])
3113 wxUSE_PRINTING_ARCHITECTURE="no"
3116 PKG_CHECK_MODULES(PANGOXFT, pangoxft,
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"
3124 AC_MSG_WARN([pangoxft library not found, library will be compiled without anti-aliasing support])
3128 LIBS="$LIBS $PANGOX_LIBS"
3129 AC_CHECK_FUNCS([pango_font_family_is_monospace])
3133 wxUSE_UNIVERSAL="yes"
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"
3140 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11"
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"
3156 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
3164 version = xmUseVersion;
3167 AC_MSG_RESULT(found in default search path)
3168 COMPILED_X_PROGRAM=1
3172 AC_MSG_ERROR(please set CPPFLAGS to contain the location of Xm/Xm.h)
3180 AC_MSG_CHECKING(for Motif/Lesstif library)
3181 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
3183 if test "x$ac_find_libraries" != "x" ; then
3184 AC_MSG_RESULT(found in $ac_find_libraries)
3186 WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
3187 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
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
3193 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
3195 LIBS="$GUI_TK_LIBRARY -lXm -lXmu -lXext -lX11"
3203 version = xmUseVersion;
3206 AC_MSG_RESULT(found in default search path)
3207 COMPILED_X_PROGRAM=1
3211 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
3219 AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE])
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
3228 LIBS="$GUI_TK_LIBRARY -lXm ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11"
3230 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
3235 #include <Xm/List.h>
3238 XmString string = NULL;
3241 XmListAddItem(w, string, position);
3245 libsm_ice_link="$libsm_ice"
3247 [need${libp_link}${libsm_ice_link}])
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])
3264 dnl this seems to be needed under IRIX and shouldn't do any harm
3266 AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"])
3269 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
3271 AC_CACHE_CHECK([for Motif 2],
3277 #if XmVersion < 2000
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)
3286 AC_DEFINE(__WXMOTIF20__,0)
3289 AC_CACHE_CHECK([whether Motif is Lesstif],
3295 #if !defined(LesstifVersion) || LesstifVersion <= 0
3299 wx_cv_lib_lesstif="yes",
3300 wx_cv_lib_lesstif="no")
3302 if test "$wx_cv_lib_lesstif" = "yes"; then
3303 AC_DEFINE(__WXLESSTIF__,1)
3305 AC_DEFINE(__WXLESSTIF__,0)
3310 GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"
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)
3326 AC_CACHE_CHECK([for X11/xpm.h],
3330 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
3334 #include <X11/xpm.h>
3338 version = XpmLibraryVersion();
3340 wx_cv_x11_xpm_h=yes,
3348 if test $wx_cv_x11_xpm_h = "yes"; then
3349 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXpm"
3350 AC_DEFINE(wxHAVE_LIB_XPM)
3352 AC_MSG_WARN([built-in less efficient XPM decoder will be used])
3358 dnl XShapeQueryExtension checks: first the library, then prototype
3359 AC_CHECK_LIB([Xext], [XShapeQueryExtension],
3361 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXext"
3364 [], [$GUI_TK_LIBRARY -lX11])
3366 if test "$wxHAVE_XEXT_LIB" = 1; then
3367 save_CFLAGS="$CFLAGS"
3368 CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
3370 AC_MSG_CHECKING([for X11/extensions/shape.h])
3372 #include <X11/Xlib.h>
3373 #include <X11/extensions/shape.h>
3377 XShapeQueryExtension((Display*)NULL,
3378 (int*)NULL, (int*)NULL);
3381 AC_DEFINE(HAVE_XSHAPE)
3382 AC_MSG_RESULT([found])
3385 AC_MSG_RESULT([not found])
3387 CFLAGS="$save_CFLAGS"
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"
3401 AC_MSG_RESULT([none])
3404 if test "x$wxUSE_UNIX" = "xyes"; then
3405 CPPFLAGS="$CPPFLAGS_PASCAL -I\${top_srcdir}/src/mac/carbon/morefilex -I/Developer/Headers/FlatCarbon $CPPFLAGS"
3407 dnl platform.h needs TARGET_CARBON before setup.h
3408 CPPFLAGS="$CPPFLAGS_PASCAL -I\${top_srcdir}/src/mac/carbon/morefilex -DTARGET_CARBON $CPPFLAGS"
3412 dnl we can't call this MAC_DIST or autoconf thinks its a macro
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"
3419 if test "$wxUSE_COCOA" = 1; then
3424 if test "$wxUSE_PM" = 1; then
3427 AC_CACHE_CHECK([for type SPBCDATA],
3444 if test $wx_cv_spbcdata = "yes"; then
3445 AC_DEFINE(HAVE_SPBCDATA)
3449 dnl the name of the directory where the files for this toolkit live
3450 if test "$TOOLKIT" = "PM" ; then
3453 TOOLKIT_DIR=`echo ${TOOLKIT} | tr A-Z a-z`
3456 if test "$wxUSE_UNIVERSAL" = "yes"; then
3457 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__"
3461 dnl distribute samples/demos/utils with GUI versions
3462 GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST"
3463 DISTDIR="wx\$(TOOLKIT)"
3467 dnl this doesn't quite work right for wxBase, but the places
3468 dnl where it is wrong aren't fatal (yet) though.
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.
3478 dnl distribute only wxBase sources/headers
3484 dnl ---------------------------------------------------------------------------
3486 dnl ---------------------------------------------------------------------------
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
3499 wxUSE_UNICODE_UTF8=no
3503 dnl ---------------------------------------------------------------------------
3504 dnl Optional libraries included when system library is not used
3505 dnl ---------------------------------------------------------------------------
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],,,
3515 #include <X11/Xlib.h>
3522 dnl ---------------------------------------------------------------------------
3523 dnl wxDisplay Sanity checks
3524 dnl ---------------------------------------------------------------------------
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"
3538 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
3539 AC_MSG_RESULT([yes])
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],
3547 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
3552 #include <X11/Xlib.h>
3561 AC_MSG_WARN([Xinerama not found; disabling wxDisplay])
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>])
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"
3584 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM"
3585 AC_MSG_RESULT([yes])
3588 AC_MSG_WARN([libSM not found; disabling session management detection])
3589 wxUSE_DETECT_SM="no"
3592 wxUSE_DETECT_SM="no"
3597 dnl ---------------------------------------------------------------------------
3598 dnl OpenGL libraries
3599 dnl ---------------------------------------------------------------------------
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.])
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"
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"
3620 AC_MSG_RESULT([not found])
3623 AC_CHECK_HEADER(GL/gl.h, [
3624 AC_CHECK_HEADER(GL/glu.h, [
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])
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"
3637 dnl don't suppose that libGL and libGLU are always in the
3638 dnl same directory -- this is not true for some common
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"
3650 OPENGL_LIBS="-lGL -lGLU"
3651 AC_MSG_RESULT([yes])
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])
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)
3684 if test "$wxUSE_OPENGL" = "yes"; then
3686 AC_DEFINE(wxUSE_OPENGL)
3687 AC_DEFINE(wxUSE_GLCANVAS)
3688 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf"
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}__"
3699 dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
3701 if test "$wxUSE_SHARED" = "yes"; then
3704 dnl only static for now
3706 AC_MSG_WARN([Host system doesn't support shared libraries, disabling])
3711 if test "$wxUSE_SHARED" = "yes"; then
3713 dnl use versioned symbols if available on the platform
3714 WX_VERSIONED_SYMBOLS([\$(wx_top_builddir)/version-script])
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
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"
3728 *-*-linux* | *-*-gnu* )
3729 SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
3730 WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
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
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"
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])
3749 AC_MSG_RESULT([yes])
3750 SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
3751 WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
3754 AC_MSG_CHECKING([if the linker accepts -R])
3755 LDFLAGS="$saveLdflags -Wl,-R,/"
3759 AC_MSG_RESULT([yes])
3760 SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib"
3761 WXCONFIG_RPATH="-Wl,-R,\$libdir"
3766 LDFLAGS="$saveLdflags"
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
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}"
3782 chmod +x change-install-names
3786 *-*-cygwin* | *-*-mingw32* )
3790 SAMPLES_RPATH_FLAG="-Wl,+b,\$(wx_top_builddir)/lib"
3791 WXCONFIG_RPATH="-Wl,+b,\$libdir"
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"
3801 if test $wxUSE_RPATH = "no"; then
3802 SAMPLES_RPATH_FLAG=''
3803 SAMPLES_RPATH_POSTLINK=''
3811 config_linkage_component="-static"
3820 if test "$wxUSE_UNICODE" = "yes"; then
3821 lib_unicode_suffix=u
3822 WX_CHARTYPE="unicode"
3827 WX_DEBUGTYPE="release"
3829 if test "$wxUSE_DEBUG_FLAG" = "yes"; then
3831 WX_DEBUGTYPE="debug"
3835 WX_FLAVOUR=${WX_FLAVOUR:+-$WX_FLAVOUR}
3836 WX_LIB_FLAVOUR=`echo $WX_FLAVOUR | tr '-' '_'`
3839 if test "$wxUSE_DEBUG_INFO" = "yes"; then
3843 WX_VERSION_TAG=`echo WX${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}_${WX_RELEASE} | tr a-z A-Z`
3845 TOOLCHAIN_NAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}"
3847 TOOLCHAIN_FULLNAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}-${WX_CHARTYPE}-${WX_DEBUGTYPE}${config_linkage_component}-${WX_RELEASE}${WX_FLAVOUR}"
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"
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}"
3862 WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
3867 if test "$wxUSE_COCOA" = 1; then
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>
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>
3887 [AC_MSG_RESULT([yes])
3888 AC_DEFINE(__Point__)
3890 [AC_MSG_FAILURE([no])]
3896 dnl ---------------------------------------------------------------------------
3897 dnl Checks for typedefs
3898 dnl ---------------------------------------------------------------------------
3900 dnl defines mode_t if not already defined
3902 dnl defines off_t if not already defined
3904 dnl defines pid_t if not already defined
3906 dnl defines size_t if not already defined
3908 dnl defines uid_t and gid_t if not already defined
3911 dnl sets HAVE_SSIZE_T if ssize_t is defined
3912 AC_CHECK_TYPES(ssize_t)
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,
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!!
3925 dnl hence the hack below: we must have Foo at global scope!
3926 AC_TRY_COMPILE([#include <stddef.h>],
3930 struct Foo { void foo(size_t); void foo(unsigned int); };
3934 wx_cv_size_t_is_uint=no,
3935 wx_cv_size_t_is_uint=yes
3940 if test "$wx_cv_size_t_is_uint" = "yes"; then
3941 AC_DEFINE(wxSIZE_T_IS_UINT)
3943 AC_CACHE_CHECK([if size_t is unsigned long],
3944 wx_cv_size_t_is_ulong,
3945 AC_TRY_COMPILE([#include <stddef.h>],
3949 struct Foo { void foo(size_t); void foo(unsigned long); };
3953 wx_cv_size_t_is_ulong=no,
3954 wx_cv_size_t_is_ulong=yes
3958 if test "$wx_cv_size_t_is_ulong" = "yes"; then
3959 AC_DEFINE(wxSIZE_T_IS_ULONG)
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>],
3969 struct Foo { void foo(wchar_t);
3970 void foo(unsigned short);
3971 void foo(unsigned int);
3972 void foo(unsigned long); };
3976 wx_cv_wchar_t_is_separate_type=yes,
3977 wx_cv_wchar_t_is_separate_type=no
3981 if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
3982 AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 1)
3984 AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 0)
3987 AC_LANG_POP() dnl C++
3989 dnl ---------------------------------------------------------------------------
3990 dnl Checks for structures
3991 dnl ---------------------------------------------------------------------------
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,
3996 AC_TRY_COMPILE([#include <pwd.h>],
4003 wx_cv_struct_pw_gecos=yes
4006 wx_cv_struct_pw_gecos=no
4012 if test "$wx_cv_struct_pw_gecos" = "yes"; then
4013 AC_DEFINE(HAVE_PW_GECOS)
4016 dnl ---------------------------------------------------------------------------
4017 dnl Check for functions
4018 dnl ---------------------------------------------------------------------------
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)
4024 dnl check for wcslen in all possible places
4027 AC_CHECK_FUNCS(wcslen, WCSLEN_FOUND=1)
4029 if test "$WCSLEN_FOUND" = 0; then
4030 if test "$TOOLKIT" = "MSW"; then
4031 AC_CHECK_LIB(msvcrt, wcslen, WCHAR_OK=1)
4033 AC_CHECK_LIB(w, wcslen, [
4040 if test "$WCSLEN_FOUND" = 1; then
4041 AC_DEFINE(HAVE_WCSLEN)
4044 AC_CHECK_FUNCS([wcsdup])
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"
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)],
4060 [#include <wchar.h>])
4062 AC_MSG_WARN([Wide character support is unavailable])
4065 dnl check for vsnprintf() -- a safe version of vsprintf())
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
4072 dnl so we first check if the function is in the library
4074 dnl FIXME: replace this mess with WX_CHECK_FUNCS()
4075 AC_CHECK_FUNCS(snprintf vsnprintf)
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,
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
4090 #if __MSL__ >= 0x6000
4092 using namespace std;
4099 vsnprintf(buf, 10u, "%s", ap);
4101 wx_cv_func_vsnprintf_decl=yes,
4102 wx_cv_func_vsnprintf_decl=no
4107 if test "$wx_cv_func_vsnprintf_decl" = "yes"; then
4108 AC_DEFINE(HAVE_VSNPRINTF_DECL)
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,
4119 #if __MSL__ >= 0x6000
4121 using namespace std;
4128 const char *fmt = "%s";
4129 vsnprintf(buf, 10u, fmt, ap);
4131 wx_cv_func_broken_vsnprintf_decl=no,
4132 wx_cv_func_broken_vsnprintf_decl=yes
4137 if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then
4138 AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL)
4143 dnl the same as above but for snprintf() now: it's not present in at least AIX
4145 if test "$ac_cv_func_snprintf" = "yes"; then
4146 AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl,
4153 #if __MSL__ >= 0x6000
4155 using namespace std;
4161 snprintf(buf, 10u, "%s", "wx");
4163 wx_cv_func_snprintf_decl=yes,
4164 wx_cv_func_snprintf_decl=no
4169 if test "$wx_cv_func_snprintf_decl" = "yes"; then
4170 AC_DEFINE(HAVE_SNPRINTF_DECL)
4173 if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
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,
4188 snprintf (buffer, 128, "%2$d %3$d %1$d", 1, 2, 3);
4189 if (strcmp ("2 3 1", buffer) == 0)
4194 wx_cv_func_snprintf_pos_params=no,
4195 wx_cv_func_snprintf_pos_params=yes,
4196 dnl be pessimistic when cross-compiling
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
4206 if test "$wx_cv_func_snprintf_pos_params" = "yes"; then
4207 AC_DEFINE(HAVE_UNIX98_PRINTF)
4212 if test "$wxUSE_UNICODE" = yes; then
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>
4220 AC_CHECK_HEADERS(widec.h,,, [AC_INCLUDES_DEFAULT()])
4221 if test "$ac_cv_header_widec_h" = "yes"; then
4222 wchar_headers="$wchar_headers
4227 WX_CHECK_FUNCS(putws fputws wprintf vswprintf,,,
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>],
4236 [AC_MSG_RESULT([yes])
4237 AC_DEFINE(HAVE__VSNWPRINTF)],
4238 [AC_MSG_RESULT([no])]);
4241 if test "$wxUSE_FILE" = "yes"; then
4242 WX_CHECK_FUNCS(fsync)
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
4248 WX_CHECK_FUNCS(round,,,[#include <math.h>])
4251 dnl the following tests are for Unix(like) systems only
4252 if test "$TOOLKIT" != "MSW"; then
4254 dnl check for available version of iconv()
4257 LIBS="$LIBICONV $LIBS"
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)
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
4268 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
4269 AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
4271 dnl C compiler happily compiles the code even if there is type mismatch
4273 AC_TRY_COMPILE([#include <signal.h>],
4275 extern void testSigHandler(int);
4277 struct sigaction sa;
4278 sa.sa_handler = testSigHandler;
4280 wx_cv_type_sa_handler=int
4282 wx_cv_type_sa_handler=void
4287 AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
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,
4296 AC_TRY_COMPILE([#include <execinfo.h>],
4301 backtrace(trace, 1);
4302 messages = backtrace_symbols(trace, 1);
4304 wx_cv_func_backtrace=yes,
4305 wx_cv_func_backtrace=no
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
4316 AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
4319 AC_TRY_LINK([#include <cxxabi.h>],
4322 __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
4324 wx_cv_func_cxa_demangle=yes,
4325 wx_cv_func_cxa_demangle=no
4331 if test "$wx_cv_func_cxa_demangle" = "yes"; then
4332 AC_DEFINE(HAVE_CXA_DEMANGLE)
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
4343 dnl check for the function for temp files creation
4344 AC_CHECK_FUNCS(mkstemp mktemp, break)
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,
4351 #if defined(__BSD__)
4352 #include <sys/param.h>
4353 #include <sys/mount.h>
4355 #include <sys/vfs.h>
4366 wx_cv_func_statfs=yes,
4367 wx_cv_func_statfs=no
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,
4377 #if defined(__BSD__)
4378 #include <sys/param.h>
4379 #include <sys/mount.h>
4381 #include <sys/vfs.h>
4388 wx_cv_func_statfs_decl=yes,
4389 wx_cv_func_statfs_decl=no
4394 if test "$wx_cv_func_statfs_decl" = "yes"; then
4395 AC_DEFINE(HAVE_STATFS_DECL)
4398 wx_cv_type_statvfs_t="struct statfs"
4399 AC_DEFINE(HAVE_STATFS)
4401 AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs,
4405 #include <sys/statvfs.h>
4410 wx_cv_func_statvfs=yes,
4411 wx_cv_func_statvfs=no
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)
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,
4427 #include <sys/statvfs.h>
4437 wx_cv_type_statvfs_t=statvfs_t,
4441 #include <sys/statvfs.h>
4451 wx_cv_type_statvfs_t="struct statvfs",
4452 wx_cv_type_statvfs_t="unknown"
4459 if test "$wx_cv_type_statvfs_t" != "unknown"; then
4460 AC_DEFINE(HAVE_STATVFS)
4463 dnl set it for the test below
4464 wx_cv_type_statvfs_t="unknown"
4468 if test "$wx_cv_type_statvfs_t" != "unknown"; then
4469 AC_DEFINE_UNQUOTED(WX_STATFS_T, $wx_cv_type_statvfs_t)
4471 AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
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)
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
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)
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
4495 AC_DEFINE(HAVE_SLEEP)
4496 HAVE_SOME_SLEEP_FUNC=1
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
4506 if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
4507 dnl try nanosleep() in libc and libposix4, if this fails - usleep()
4509 AC_CHECK_FUNCS(nanosleep,
4510 AC_DEFINE(HAVE_NANOSLEEP),
4512 AC_CHECK_LIB(posix4, nanosleep,
4514 AC_DEFINE(HAVE_NANOSLEEP)
4515 POSIX4_LINK=" -lposix4"
4518 WX_CHECK_FUNCS(usleep,,
4519 AC_MSG_WARN([wxSleep() function will not work])
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)
4533 WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
4535 dnl check for inet_addr and inet_aton (these may live either in libc, or in
4536 dnl libnsl or libresolv or libsocket)
4538 AC_CHECK_FUNCS(inet_addr,
4539 AC_DEFINE(HAVE_INET_ADDR),
4541 AC_CHECK_LIB(nsl, inet_addr,
4544 AC_CHECK_LIB(resolv, inet_addr,
4547 AC_CHECK_LIB(socket, inet_addr,
4557 AC_CHECK_FUNCS(inet_aton,
4558 AC_DEFINE(HAVE_INET_ATON),
4560 dnl only check it in the same lib
4561 AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
4564 if test "x$INET_LINK" != "x"; then
4565 AC_DEFINE(HAVE_INET_ADDR)
4566 INET_LINK=" -l$INET_LINK"
4569 WX_CHECK_FUNCS(fdopen)
4571 if test "$wxUSE_TARSTREAM" = "yes"; then
4572 WX_CHECK_FUNCS(sysconf)
4574 WX_CHECK_FUNCS(getpwuid_r, [], [],
4580 struct passwd pw, *ppw;
4582 getpwuid_r(0, &pw, buf, sizeof(buf), &ppw)
4585 WX_CHECK_FUNCS(getgrgid_r, [], [],
4591 struct group grp, *pgrp;
4593 getgrgid_r(0, &grp, buf, sizeof(buf), &pgrp)
4600 dnl ===========================================================================
4601 dnl Now we have all the info we need - use it!
4602 dnl ===========================================================================
4607 dnl ---------------------------------------------------------------------------
4608 dnl thread support for Unix (for Win32 and OS/2 see past
4609 dnl the next matching "else")
4610 dnl ---------------------------------------------------------------------------
4612 dnl under MSW (except mingw32) we always have thread support
4613 if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
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
4621 dnl sets wxUSE_THREADS=1 if thread support is activated
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])
4633 if test "$wxUSE_THREADS" = "yes" ; then
4634 dnl find if POSIX threads are available
4636 dnl the tests here are based on ACX_PTHREAD macro from autoconf macro
4637 dnl archive from http://ac-archive.sourceforge.net/
4639 dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro
4640 dnl Forero Cuervo <bachue@bachue.com> for the original code
4642 dnl TODO: cache the result
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"
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"
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"
4664 *-*-darwin* | *-*-cygwin* )
4665 dnl Darwin / Mac OS X just uses -lpthread tested below
4666 dnl and so does Cygwin
4670 dnl AIX calls the library libpthreads - thanks IBM!
4671 THREAD_OPTS="pthreads"
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 ||
4679 dnl HP-UX aCC (tested with version B3910B A.06.05 [Jul 25
4680 dnl 2005]) supports -mt
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
4695 dnl flying by man pages here: Caldera online docs use this
4696 if test "x$GCC" != "xyes"; then
4697 THREAD_OPTS="-Ethread"
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"
4707 dnl now test for all possibilities
4709 for flag in $THREAD_OPTS; do
4712 AC_MSG_CHECKING([whether pthreads work without any flags])
4716 AC_MSG_CHECKING([whether pthreads work with $flag])
4717 THREADS_CFLAGS="$flag"
4721 AC_MSG_CHECKING([for the pthreads library -l$flag])
4722 THREADS_LINK="-l$flag"
4727 save_CFLAGS="$CFLAGS"
4728 LIBS="$THREADS_LINK $LIBS"
4729 CFLAGS="$THREADS_CFLAGS $CFLAGS"
4731 AC_TRY_LINK([#include <pthread.h>],
4732 [pthread_create(0,0,0,0);],
4736 CFLAGS="$save_CFLAGS"
4738 AC_MSG_RESULT($THREADS_OK)
4739 if test "x$THREADS_OK" = "xyes"; then
4747 if test "x$THREADS_OK" != "xyes"; then
4749 AC_MSG_WARN([No thread support on this system... disabled])
4751 dnl yes, these special compiler flags should be used with the
4753 LDFLAGS="$THREADS_CFLAGS $LDFLAGS"
4754 LIBS="$THREADS_LINK $LIBS"
4756 AC_MSG_CHECKING([if more special flags are required for pthreads])
4760 dnl again quoting from
4761 dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html:
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"
4770 flag="-D_THREAD_SAFE"
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"
4779 *solaris* | alpha*-osf*)
4783 AC_MSG_RESULT(${flag})
4784 if test "x$flag" != xno; then
4785 THREADS_CFLAGS="$THREADS_CFLAGS $flag"
4788 dnl don't add these options to CPPFLAGS as cpp might not know them
4789 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS $THREADS_CFLAGS"
4793 dnl do other tests only if we are using threads
4794 if test "$wxUSE_THREADS" = "yes" ; then
4795 AC_CHECK_FUNCS(thr_setconcurrency)
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,
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
4805 AC_TRY_COMPILE([#include <pthread.h>
4806 void ThreadCleanupFunc(void *p);
4810 pthread_cleanup_push(ThreadCleanupFunc, p);
4811 pthread_cleanup_pop(0);
4813 wx_cv_func_pthread_cleanup=yes
4815 wx_cv_func_pthread_cleanup=no
4820 if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
4821 AC_DEFINE(wxHAVE_PTHREAD_CLEANUP)
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),
4829 AC_CHECK_LIB(posix4,
4831 [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
4832 AC_MSG_WARN(wxThread::Yield will not work properly)
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
4845 AC_CHECK_FUNC(pthread_attr_getschedpolicy,
4846 [AC_CHECK_FUNC(pthread_attr_setschedparam,
4847 [AC_CHECK_FUNC(sched_get_priority_max,
4849 [AC_CHECK_LIB([posix4], sched_get_priority_max,
4852 POSIX4_LINK=" -lposix4"
4859 if test "$HAVE_PRIOR_FUNCS" = 1; then
4860 AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
4862 AC_MSG_WARN(Setting thread priority will not work)
4865 AC_CHECK_FUNC(pthread_cancel,
4866 AC_DEFINE(HAVE_PTHREAD_CANCEL),
4867 AC_MSG_WARN([wxThread::Kill() will not work properly]))
4869 AC_CHECK_FUNC(pthread_mutex_timedlock,
4870 AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK),
4871 AC_MSG_WARN([wxMutex::LockTimeout() will not work]))
4873 AC_CHECK_FUNC(pthread_attr_setstacksize,
4874 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE))
4876 dnl mutexattr_t initialization is done in quite different ways on different
4877 dnl platforms, so check for a few things:
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
4885 AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
4887 AC_TRY_COMPILE([#include <pthread.h>],
4889 pthread_mutexattr_t attr;
4890 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
4892 wx_cv_type_pthread_mutexattr_t=yes,
4893 wx_cv_type_pthread_mutexattr_t=no
4897 if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
4898 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
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>],
4906 pthread_mutexattr_t attr;
4907 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
4909 wx_cv_func_pthread_mutexattr_settype_decl=yes,
4910 wx_cv_func_pthread_mutexattr_settype_decl=no
4913 if test "$wx_cv_func_pthread_mutexattr_settype_decl" = "yes"; then
4914 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL)
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,
4921 AC_TRY_COMPILE([#include <pthread.h>],
4923 pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
4925 wx_cv_type_pthread_rec_mutex_init=yes
4927 wx_cv_type_pthread_rec_mutex_init=no
4931 if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
4932 AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
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])
4942 if test "$wxUSE_THREADS" = "yes" ; then
4945 dnl check if the compiler accepts -mthreads
4946 AC_CACHE_CHECK([if compiler supports -mthreads],
4947 wx_cv_cflags_mthread,
4949 CFLAGS_OLD="$CFLAGS"
4950 CFLAGS="-mthreads $CFLAGS"
4951 AC_TRY_COMPILE([], [],
4952 wx_cv_cflags_mthread=yes,
4953 wx_cv_cflags_mthread=no
4958 if test "$wx_cv_cflags_mthread" = "yes"; then
4960 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mthreads"
4961 LDFLAGS="$LDFLAGS -mthreads"
4964 CFLAGS="$CFLAGS_OLD"
4968 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -Zmt -D__ST_MT_ERRNO__"
4969 LDFLAGS="$LDFLAGS -Zmt"
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
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) ])
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) ])
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 )
5010 if test "$wxUSE_THREADS" = "yes"; then
5011 AC_DEFINE(wxUSE_THREADS)
5013 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
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"
5028 if test "$WXGTK2" = 1 ; then
5029 AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK2)
5033 if test "$WXGTK12" = 1 ; then
5034 AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
5037 if test "$WXGTK127" = 1 ; then
5038 AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
5041 if test "$WXGPE" = 1 ; then
5042 AC_DEFINE_UNQUOTED(__WXGPE__,$WXGPE)
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)
5048 if test "$wxUSE_DEBUG_INFO" = "yes" ; then
5053 if test "$wxUSE_DEBUG_GDB" = "yes" ; then
5054 wxUSE_DEBUG_INFO=yes
5055 if test "$GCC" = yes; then
5056 DEBUG_CFLAGS="-ggdb"
5060 if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
5062 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D__WXDEBUG__"
5064 if test "$wxUSE_GTK" = 1 ; then
5065 if test "x$wxGTK_VERSION" = "x1" ; then
5066 CPPFLAGS="-DGTK_NO_CHECK_CASTS $CPPFLAGS"
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"
5078 if test "$wxUSE_DMALLOC" = "yes" ; then
5079 DMALLOC_LIBS="-ldmallocthcxx"
5082 dnl cc/cxx/ld option for profiling
5084 if test "$wxUSE_PROFILE" = "yes" ; then
5085 PROFILE_FLAGS=" -pg"
5088 if test "$GCC" = "yes" ; then
5089 if test "$wxUSE_NO_RTTI" = "yes" ; then
5090 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti"
5092 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
5093 WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions"
5095 if test "$wxUSE_PERMISSIVE" = "yes" ; then
5096 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -fpermissive"
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
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.
5109 dnl TODO: test for the gcc version here (how?)
5112 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mminimal-toc"
5115 WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -ffunction-sections"
5120 dnl C/C++ compiler option for optimization (supposed to be the same for both)
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"
5129 if test "$GCC" = yes ; then
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"
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"
5144 OPTIMISE_CFLAGS="-O"
5148 dnl ---------------------------------------------------------------------------
5149 dnl compatibility level
5150 dnl ---------------------------------------------------------------------------
5152 if test "x$WXWIN_COMPATIBILITY_2_6" = "xyes"; then
5153 AC_DEFINE(WXWIN_COMPATIBILITY_2_6)
5155 WXWIN_COMPATIBILITY_2_8="yes"
5158 if test "x$WXWIN_COMPATIBILITY_2_8" != "xno"; then
5159 AC_DEFINE(WXWIN_COMPATIBILITY_2_8)
5162 dnl ---------------------------------------------------------------------------
5163 dnl the library may be built without GUI classes at all
5164 dnl ---------------------------------------------------------------------------
5166 if test "$wxUSE_GUI" = "yes"; then
5167 AC_DEFINE(wxUSE_GUI)
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
5182 dnl ---------------------------------------------------------------------------
5184 dnl ---------------------------------------------------------------------------
5186 if test "$wxUSE_UNIX" = "yes"; then
5187 AC_DEFINE(wxUSE_UNIX)
5190 dnl ------------------------------------------------------------------------
5192 dnl ------------------------------------------------------------------------
5194 dnl under MSW we always have LoadLibrary/GetProcAddress
5195 if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
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
5203 elif test "$USE_DOS" = 1; then
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,
5211 AC_DEFINE(HAVE_DLOPEN)
5215 AC_CHECK_LIB(dl, dlopen,
5217 AC_DEFINE(HAVE_DLOPEN)
5219 DL_LINK=" -ldl$DL_LINK"
5222 AC_CHECK_FUNCS(shl_load,
5224 AC_DEFINE(HAVE_SHL_LOAD)
5228 AC_CHECK_LIB(shl_load, dld,
5231 DL_LINK=" -ldld$DL_LINK"
5237 dnl check also for dlerror()
5238 if test "$HAVE_DL_FUNCS" = 1; then
5239 AC_CHECK_FUNCS(dlerror,
5240 AC_DEFINE(HAVE_DLERROR),
5242 AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))
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
5255 AC_MSG_WARN([Assuming wxLibrary class works on this platform])
5262 if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
5263 AC_DEFINE(wxUSE_DYNAMIC_LOADER)
5265 if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
5266 AC_DEFINE(wxUSE_DYNLIB_CLASS)
5270 dnl ---------------------------------------------------------------------------
5271 dnl Verify consistency of plugins/monolithic/shared settings:
5272 dnl ---------------------------------------------------------------------------
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])
5279 if test "$wxUSE_MONOLITHIC" = "yes" ; then
5280 AC_MSG_WARN([plugins not supported monolithic build, disabling])
5283 if test "$wxUSE_DYNLIB_CLASS" = "no" ; then
5284 AC_MSG_WARN([plugins require wxDynamicLibrary, disabling])
5287 if test "$wxUSE_PLUGINS" = "yes" ; then
5288 AC_DEFINE(wxUSE_PLUGINS)
5292 dnl ---------------------------------------------------------------------------
5293 dnl Register non-GUI class options for makefiles and setup.h
5294 dnl ---------------------------------------------------------------------------
5296 if test "$wxUSE_STL" = "yes"; then
5297 AC_DEFINE(wxUSE_STL)
5300 if test "$wxUSE_EXTENDED_RTTI" = "yes"; then
5301 AC_DEFINE(wxUSE_EXTENDED_RTTI)
5304 if test "$wxUSE_APPLE_IEEE" = "yes"; then
5305 AC_DEFINE(wxUSE_APPLE_IEEE)
5308 if test "$wxUSE_TIMER" = "yes"; then
5309 AC_DEFINE(wxUSE_TIMER)
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, [
5322 #include <sys/ioctl.h>
5323 #include <sys/soundcard.h>
5326 ioctl(0, SNDCTL_DSP_SPEED, 0);
5328 ac_cv_header_sys_soundcard=yes,
5331 LIBS="$saveLibs -lossaudio"
5333 #include <sys/ioctl.h>
5334 #include <sys/soundcard.h>
5337 ioctl(0, SNDCTL_DSP_SPEED, 0);
5339 ac_cv_header_sys_soundcard=yes,
5342 ac_cv_header_sys_soundcard=no
5350 if test "$ac_cv_header_sys_soundcard" = "yes"; then
5351 AC_DEFINE(HAVE_SYS_SOUNDCARD_H)
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],
5361 EXTRALIBS_SDL="$SDL_LIBS"
5362 CFLAGS="$SDL_CFLAGS $CFLAGS"
5363 CXXFLAGS="$SDL_CFLAGS $CXXFLAGS"
5364 AC_DEFINE(wxUSE_LIBSDL)
5366 [wxUSE_LIBSDL="no"])
5367 if test "$wxUSE_LIBSDL" = "yes" -a "$wxUSE_PLUGINS" = "yes" ; then
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])
5380 if test "$wxUSE_SOUND" = "yes"; then
5381 AC_DEFINE(wxUSE_SOUND)
5382 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sound"
5385 if test "$WXGTK2" = 1; then
5386 PKG_PROG_PKG_CONFIG()
5388 if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
5390 if test "$wxUSE_GTKPRINT" = "yes" ; then
5392 PKG_CHECK_MODULES(GTKPRINT,
5393 [gtk+-unix-print-2.0 >= 2.10],
5395 CFLAGS="$GTKPRINT_CFLAGS $CFLAGS"
5396 CXXFLAGS="$GTKPRINT_CFLAGS $CXXFLAGS"
5397 AC_DEFINE(wxUSE_GTKPRINT)
5400 AC_MSG_WARN([GTK printing support not found (GTK+ >= 2.10), library will use GNOME printing support or standard PostScript printing])
5406 if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then
5408 PKG_CHECK_MODULES(LIBGNOMEPRINTUI,
5409 [libgnomeprintui-2.2 >= 2.8],
5411 CFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CFLAGS"
5412 CXXFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CXXFLAGS"
5413 AC_DEFINE(wxUSE_LIBGNOMEPRINT)
5416 AC_MSG_WARN([libgnomeprintui not found, library will use standard PostScript printing])
5417 wxUSE_LIBGNOMEPRINT="no"
5423 if test "$wxUSE_MIMETYPE" = "yes" ; then
5424 if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
5426 PKG_CHECK_MODULES(GNOMEVFS,
5427 [gnome-vfs-2.0 >= 2.0],
5429 CFLAGS="$GNOMEVFS_CFLAGS $CFLAGS"
5430 CXXFLAGS="$GNOMEVFS_CFLAGS $CXXFLAGS"
5431 AC_DEFINE(wxUSE_LIBGNOMEVFS)
5434 AC_MSG_WARN([libgnomevfs not found, library won't be able to associate MIME type])
5435 wxUSE_LIBGNOMEVFS="no"
5441 if test "$wxUSE_LIBHILDON" = "yes" ; then
5442 PKG_CHECK_MODULES(HILDON,
5443 [hildon-lgpl >= 0.9],
5445 EXTRALIBS_HILDON="$HILDON_LIBS"
5446 CFLAGS="$CFLAGS $HILDON_CFLAGS"
5447 CXXFLAGS="$CXXFLAGS $HILDON_CFLAGS"
5448 AC_DEFINE(wxUSE_LIBHILDON)
5451 AC_MSG_WARN([libhildon_lgpl not found])
5452 wxUSE_LIBHILDON="no"
5458 if test "$wxUSE_CMDLINE_PARSER" = "yes"; then
5459 AC_DEFINE(wxUSE_CMDLINE_PARSER)
5462 if test "$wxUSE_STOPWATCH" = "yes"; then
5463 AC_DEFINE(wxUSE_STOPWATCH)
5466 if test "$wxUSE_DATETIME" = "yes"; then
5467 AC_DEFINE(wxUSE_DATETIME)
5470 if test "$wxUSE_FILE" = "yes"; then
5471 AC_DEFINE(wxUSE_FILE)
5474 if test "$wxUSE_FFILE" = "yes"; then
5475 AC_DEFINE(wxUSE_FFILE)
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
5483 AC_DEFINE(wxUSE_ARCHIVE_STREAMS)
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)
5493 AC_DEFINE(wxUSE_ZIPSTREAM)
5497 if test "$wxUSE_TARSTREAM" = "yes"; then
5498 if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
5499 AC_MSG_WARN(wxTar requires wxArchive... disabled)
5501 AC_DEFINE(wxUSE_TARSTREAM)
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)
5510 AC_DEFINE(wxUSE_FILESYSTEM)
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)
5518 AC_DEFINE(wxUSE_FS_ARCHIVE)
5522 if test "$wxUSE_FS_ZIP" = "yes"; then
5523 if test "$wxUSE_FS_ARCHIVE" != yes; then
5524 AC_MSG_WARN(wxZipFSHandler requires wxArchiveFSHandler... disabled)
5526 AC_DEFINE(wxUSE_FS_ZIP)
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
5535 AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION)
5539 if test "$wxUSE_STACKWALKER" = "yes"; then
5540 AC_DEFINE(wxUSE_STACKWALKER)
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
5548 AC_DEFINE(wxUSE_DEBUGREPORT)
5549 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
5550 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt"
5555 if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
5556 AC_DEFINE(wxUSE_SNGLINST_CHECKER)
5559 if test "$wxUSE_BUSYINFO" = "yes"; then
5560 AC_DEFINE(wxUSE_BUSYINFO)
5563 if test "$wxUSE_STD_IOSTREAM" = "yes"; then
5564 AC_DEFINE(wxUSE_STD_IOSTREAM)
5567 if test "$wxUSE_STD_STRING" = "yes"; then
5568 AC_DEFINE(wxUSE_STD_STRING)
5571 if test "$wxUSE_STDPATHS" = "yes"; then
5572 AC_DEFINE(wxUSE_STDPATHS)
5575 if test "$wxUSE_TEXTBUFFER" = "yes"; then
5576 AC_DEFINE(wxUSE_TEXTBUFFER)
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)
5583 AC_DEFINE(wxUSE_TEXTFILE)
5587 if test "$wxUSE_CONFIG" = "yes" ; then
5588 if test "$wxUSE_TEXTFILE" != "yes"; then
5589 AC_MSG_WARN(wxConfig requires wxTextFile... disabled)
5591 AC_DEFINE(wxUSE_CONFIG)
5592 AC_DEFINE(wxUSE_CONFIG_NATIVE)
5593 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
5597 if test "$wxUSE_INTL" = "yes" ; then
5598 if test "$wxUSE_FILE" != "yes"; then
5599 AC_MSG_WARN(I18n code requires wxFile... disabled)
5601 AC_DEFINE(wxUSE_INTL)
5602 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
5603 GUIDIST="$GUIDIST INTL_DIST"
5607 if test "$wxUSE_LOG" = "yes"; then
5608 AC_DEFINE(wxUSE_LOG)
5610 if test "$wxUSE_LOGGUI" = "yes"; then
5611 AC_DEFINE(wxUSE_LOGGUI)
5614 if test "$wxUSE_LOGWINDOW" = "yes"; then
5615 AC_DEFINE(wxUSE_LOGWINDOW)
5618 if test "$wxUSE_LOGDIALOG" = "yes"; then
5619 AC_DEFINE(wxUSE_LOG_DIALOG)
5622 dnl the keyboard sample requires wxUSE_LOG
5623 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
5626 if test "$wxUSE_LONGLONG" = "yes"; then
5627 AC_DEFINE(wxUSE_LONGLONG)
5630 if test "$wxUSE_GEOMETRY" = "yes"; then
5631 AC_DEFINE(wxUSE_GEOMETRY)
5634 if test "$wxUSE_BASE64" = "yes"; then
5635 AC_DEFINE(wxUSE_BASE64)
5638 if test "$wxUSE_STREAMS" = "yes" ; then
5639 AC_DEFINE(wxUSE_STREAMS)
5642 if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
5643 AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
5646 if test "$wxUSE_OBJC_UNIQUIFYING" = "yes"; then
5647 AC_DEFINE(wxUSE_OBJC_UNIQUIFYING)
5650 dnl ---------------------------------------------------------------------------
5651 dnl console event loop stuff
5652 dnl ---------------------------------------------------------------------------
5654 if test "$wxUSE_CONSOLE_EVENTLOOP" = "yes"; then
5655 AC_DEFINE(wxUSE_CONSOLE_EVENTLOOP)
5657 if test "$wxUSE_UNIX" = "yes"; then
5658 if test "$wxUSE_SELECT_DISPATCHER" = "yes"; then
5659 AC_DEFINE(wxUSE_SELECT_DISPATCHER)
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)
5667 AC_MSG_WARN([sys/epoll.h not available, wxEpollDispatcher disabled])
5673 dnl ---------------------------------------------------------------------------
5674 dnl time/date functions
5675 dnl ---------------------------------------------------------------------------
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)
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,
5685 dnl on some _really_ old systems it takes only 1 argument
5688 #include <sys/time.h>
5693 gettimeofday(&tv, NULL);
5695 wx_cv_func_gettimeofday_has_2_args=yes,
5698 #include <sys/time.h>
5705 wx_cv_func_gettimeofday_has_2_args=no,
5707 AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
5708 wx_cv_func_gettimeofday_has_2_args=unknown
5714 if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
5715 AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
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,
5732 strptime("foo", "bar", &t);
5734 wx_cv_func_strptime_decl=yes,
5735 wx_cv_func_strptime_decl=no
5741 if test "$wx_cv_func_strptime_decl" = "yes"; then
5742 AC_DEFINE(HAVE_STRPTIME_DECL)
5744 wx_strptime_decl="extern char *strptime(const char *, const char *, struct tm *);"
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,
5757 #include "confdefs.h"
5764 return !!strptime("", "%x", &t);
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
5774 if test "$wx_cv_func_strptime_ok" = "yes"; then
5775 AC_DEFINE(HAVE_STRPTIME)
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>,
5794 wx_cv_var_timezone=timezone
5806 wx_cv_var_timezone=_timezone
5818 wx_cv_var_timezone=__timezone
5821 if test "$USE_DOS" = 0 ; then
5822 AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
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)
5839 dnl check for localtime (it's POSIX, but the check can do no harm...)
5840 AC_CHECK_FUNCS(localtime)
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,
5855 wx_cv_struct_tm_has_gmtoff=yes
5857 wx_cv_struct_tm_has_gmtoff=no
5862 if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
5863 AC_DEFINE(WX_GMTOFF_IN_TM)
5866 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
5869 dnl ------------------------------------------------------------------------
5871 dnl ------------------------------------------------------------------------
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])
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,,
5887 AC_CHECK_LIB(socket, socket,
5888 if test "$INET_LINK" != " -lsocket"; then
5889 INET_LINK="$INET_LINK -lsocket"
5892 AC_MSG_WARN([socket library not found - sockets will be disabled])
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,
5916 #include <sys/types.h>
5917 #include <sys/socket.h>
5921 getsockname(0, 0, &len);
5923 wx_cv_type_getsockname3=socklen_t,
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"
5938 #include <sys/types.h>
5939 #include <sys/socket.h>
5943 getsockname(0, 0, &len);
5945 wx_cv_type_getsockname3=size_t,
5948 #include <sys/types.h>
5949 #include <sys/socket.h>
5953 getsockname(0, 0, &len);
5955 wx_cv_type_getsockname3=int,
5956 wx_cv_type_getsockname3=unknown
5960 CFLAGS="$CFLAGS_OLD"
5966 if test "$wx_cv_type_getsockname3" = "unknown"; then
5968 AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
5970 AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3)
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,
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.
5984 #include <sys/types.h>
5985 #include <sys/socket.h>
5989 getsockopt(0, 0, 0, 0, &len);
5991 wx_cv_type_getsockopt5=socklen_t,
5995 #include <sys/types.h>
5996 #include <sys/socket.h>
6000 getsockopt(0, 0, 0, 0, &len);
6002 wx_cv_type_getsockopt5=size_t,
6005 #include <sys/types.h>
6006 #include <sys/socket.h>
6010 getsockopt(0, 0, 0, 0, &len);
6012 wx_cv_type_getsockopt5=int,
6013 wx_cv_type_getsockopt5=unknown
6021 if test "$wx_cv_type_getsockopt5" = "unknown"; then
6023 AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
6025 AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5)
6030 if test "$wxUSE_SOCKETS" = "yes" ; then
6031 if test "$wxUSE_IPV6" = "yes"; then
6033 [whether we have sockaddr_in6],
6034 [wx_cv_type_sockaddr_in6],
6038 #include <sys/types.h>
6039 #include <sys/socket.h>
6040 #include <netinet/in.h>
6043 struct sockaddr_in6 sa6;
6045 wx_cv_type_sockaddr_in6=yes,
6046 wx_cv_type_sockaddr_in6=no
6051 if test "$wx_cv_type_sockaddr_in6"="yes"; then
6052 AC_DEFINE(wxUSE_IPV6)
6054 AC_MSG_WARN([IPv6 support not available... disabled])
6058 AC_DEFINE(wxUSE_SOCKETS)
6059 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
6062 if test "$wxUSE_PROTOCOL" = "yes"; then
6063 if test "$wxUSE_SOCKETS" != "yes"; then
6064 AC_MSG_WARN(Protocol classes require sockets... disabled)
6069 if test "$wxUSE_PROTOCOL" = "yes"; then
6070 AC_DEFINE(wxUSE_PROTOCOL)
6072 if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then
6073 AC_DEFINE(wxUSE_PROTOCOL_HTTP)
6075 if test "$wxUSE_PROTOCOL_FTP" = "yes"; then
6076 AC_DEFINE(wxUSE_PROTOCOL_FTP)
6078 if test "$wxUSE_PROTOCOL_FILE" = "yes"; then
6079 AC_DEFINE(wxUSE_PROTOCOL_FILE)
6082 if test "$wxUSE_FS_INET" = "yes"; then
6083 AC_MSG_WARN([HTTP filesystem require protocol classes... disabled])
6088 if test "$wxUSE_URL" = "yes"; then
6089 if test "$wxUSE_PROTOCOL" != "yes"; then
6090 AC_MSG_WARN(wxURL class requires wxProtocol... disabled)
6093 if test "$wxUSE_URL" = "yes"; then
6094 AC_DEFINE(wxUSE_URL)
6098 if test "$wxUSE_VARIANT" = "yes"; then
6099 AC_DEFINE(wxUSE_VARIANT)
6102 if test "$wxUSE_FS_INET" = "yes"; then
6103 AC_DEFINE(wxUSE_FS_INET)
6106 dnl ---------------------------------------------------------------------------
6107 dnl Joystick support
6108 dnl ---------------------------------------------------------------------------
6110 if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
6113 dnl under MSW we always have joystick support
6114 if test "$TOOLKIT" = "MSW"; then
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])
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 ]
6130 AC_MSG_RESULT($wxUSE_JOYSTICK)
6133 dnl joystick support is only for Linux 2.1.x or greater
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()])
6147 if test "$wxUSE_JOYSTICK" = "yes"; then
6148 AC_DEFINE(wxUSE_JOYSTICK)
6149 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
6151 AC_MSG_WARN(Joystick not supported by this system... disabled)
6156 dnl ---------------------------------------------------------------------------
6158 dnl ---------------------------------------------------------------------------
6160 if test "$wxUSE_FONTENUM" = "yes" ; then
6161 AC_DEFINE(wxUSE_FONTENUM)
6164 if test "$wxUSE_FONTMAP" = "yes" ; then
6165 AC_DEFINE(wxUSE_FONTMAP)
6168 if test "$wxUSE_UNICODE" = "yes" ; then
6169 AC_DEFINE(wxUSE_UNICODE)
6171 if test "$USE_WIN32" != 1; then
6172 wxUSE_UNICODE_MSLU=no
6175 if test "$USE_WIN32" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
6176 AC_CHECK_LIB(unicows,main,
6178 AC_DEFINE(wxUSE_UNICODE_MSLU)
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
6188 if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_UTF8" = "yes"; then
6189 AC_DEFINE(wxUSE_UNICODE_UTF8)
6191 if test "$wxUSE_UNICODE_UTF8_LOCALE" = "yes"; then
6192 AC_DEFINE(wxUSE_UTF8_LOCALE_ONLY)
6196 dnl ---------------------------------------------------------------------------
6197 dnl big GUI components: MDI, doc/view, printing, help, ...
6198 dnl ---------------------------------------------------------------------------
6200 if test "$wxUSE_CONSTRAINTS" = "yes"; then
6201 AC_DEFINE(wxUSE_CONSTRAINTS)
6202 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
6205 if test "$wxUSE_MDI" = "yes"; then
6206 AC_DEFINE(wxUSE_MDI)
6208 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
6209 AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
6210 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
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"
6222 if test "$wxUSE_HELP" = "yes"; then
6223 AC_DEFINE(wxUSE_HELP)
6224 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
6226 if test "$wxUSE_MSW" = 1; then
6227 if test "$wxUSE_MS_HTML_HELP" = "yes"; then
6228 AC_DEFINE(wxUSE_MS_HTML_HELP)
6232 if test "$wxUSE_WXHTML_HELP" = "yes"; then
6233 if test "$wxUSE_HTML" = "yes"; then
6234 AC_DEFINE(wxUSE_WXHTML_HELP)
6236 AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled)
6237 wxUSE_WXHTML_HELP=no
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)
6246 AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
6248 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
6251 if test "$wxUSE_POSTSCRIPT" = "yes" ; then
6252 AC_DEFINE(wxUSE_POSTSCRIPT)
6255 AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
6257 if test "$wxUSE_SVG" = "yes"; then
6258 AC_DEFINE(wxUSE_SVG)
6261 dnl ---------------------------------------------------------------------------
6262 dnl wxMetafile availability
6263 dnl ---------------------------------------------------------------------------
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])
6272 dnl ---------------------------------------------------------------------------
6273 dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
6274 dnl ---------------------------------------------------------------------------
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,,, [ ])
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>
6290 [AC_MSG_RESULT(no)],
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"
6302 dnl for OLE clipboard and dnd
6303 if test "$wxUSE_DATAOBJ" = "yes" ; then
6304 AC_DEFINE(wxUSE_DATAOBJ)
6307 AC_MSG_WARN([Some features disabled because OLE headers not found])
6310 wxUSE_DRAG_AND_DROP=no
6315 if test "$wxUSE_METAFILE" = "yes"; then
6316 AC_DEFINE(wxUSE_METAFILE)
6318 dnl this one should probably be made separately configurable
6319 AC_DEFINE(wxUSE_ENH_METAFILE)
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)
6329 if test "$wxUSE_IPC" = "yes"; then
6330 AC_DEFINE(wxUSE_IPC)
6331 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc"
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])
6340 AC_DEFINE(wxUSE_DATAOBJ)
6343 AC_MSG_WARN([Clipboard and drag-and-drop require wxDataObject -- disabled])
6345 wxUSE_DRAG_AND_DROP=no
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])
6354 if test "$wxUSE_CLIPBOARD" = "yes"; then
6355 AC_DEFINE(wxUSE_CLIPBOARD)
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
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
6373 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
6374 AC_DEFINE(wxUSE_DRAG_AND_DROP)
6379 if test "$wxUSE_DRAG_AND_DROP" = "yes" -o "$wxUSE_CLIPBOARD" = "yes"; then
6380 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
6383 if test "$wxUSE_SPLINES" = "yes" ; then
6384 AC_DEFINE(wxUSE_SPLINES)
6387 if test "$wxUSE_MOUSEWHEEL" = "yes" ; then
6388 AC_DEFINE(wxUSE_MOUSEWHEEL)
6391 dnl ---------------------------------------------------------------------------
6393 dnl ---------------------------------------------------------------------------
6396 if test "$wxUSE_CONTROLS" = "yes"; then
6400 if test "$wxUSE_ACCEL" = "yes"; then
6401 AC_DEFINE(wxUSE_ACCEL)
6405 if test "$wxUSE_ANIMATIONCTRL" = "yes"; then
6406 AC_DEFINE(wxUSE_ANIMATIONCTRL)
6408 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate"
6411 if test "$wxUSE_BUTTON" = "yes"; then
6412 AC_DEFINE(wxUSE_BUTTON)
6416 if test "$wxUSE_BMPBUTTON" = "yes"; then
6417 AC_DEFINE(wxUSE_BMPBUTTON)
6421 if test "$wxUSE_CALCTRL" = "yes"; then
6422 AC_DEFINE(wxUSE_CALENDARCTRL)
6424 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar"
6427 if test "$wxUSE_CARET" = "yes"; then
6428 AC_DEFINE(wxUSE_CARET)
6430 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
6433 if test "$wxUSE_COLLPANE" = "yes"; then
6434 AC_DEFINE(wxUSE_COLLPANE)
6436 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS collpane"
6439 if test "$wxUSE_COMBOBOX" = "yes"; then
6440 AC_DEFINE(wxUSE_COMBOBOX)
6444 if test "$wxUSE_COMBOCTRL" = "yes"; then
6445 AC_DEFINE(wxUSE_COMBOCTRL)
6449 if test "$wxUSE_CHOICE" = "yes"; then
6450 AC_DEFINE(wxUSE_CHOICE)
6454 if test "$wxUSE_CHOICEBOOK" = "yes"; then
6455 AC_DEFINE(wxUSE_CHOICEBOOK)
6459 if test "$wxUSE_CHECKBOX" = "yes"; then
6460 AC_DEFINE(wxUSE_CHECKBOX)
6464 if test "$wxUSE_CHECKLST" = "yes"; then
6465 AC_DEFINE(wxUSE_CHECKLISTBOX)
6469 if test "$wxUSE_COLOURPICKERCTRL" = "yes"; then
6470 AC_DEFINE(wxUSE_COLOURPICKERCTRL)
6474 if test "$wxUSE_DATEPICKCTRL" = "yes"; then
6475 AC_DEFINE(wxUSE_DATEPICKCTRL)
6479 if test "$wxUSE_DIRPICKERCTRL" = "yes"; then
6480 AC_DEFINE(wxUSE_DIRPICKERCTRL)
6484 if test "$wxUSE_FILECTRL" = "yes"; then
6485 AC_DEFINE(wxUSE_FILECTRL)
6489 if test "$wxUSE_FILEPICKERCTRL" = "yes"; then
6490 AC_DEFINE(wxUSE_FILEPICKERCTRL)
6494 if test "$wxUSE_FONTPICKERCTRL" = "yes"; then
6495 AC_DEFINE(wxUSE_FONTPICKERCTRL)
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])
6504 AC_DEFINE(wxUSE_DISPLAY)
6505 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS display"
6509 if test "$wxUSE_DETECT_SM" = "yes"; then
6510 AC_DEFINE(wxUSE_DETECT_SM)
6513 if test "$wxUSE_GAUGE" = "yes"; then
6514 AC_DEFINE(wxUSE_GAUGE)
6518 if test "$wxUSE_GRID" = "yes"; then
6519 AC_DEFINE(wxUSE_GRID)
6521 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
6524 if test "$wxUSE_HYPERLINKCTRL" = "yes"; then
6525 AC_DEFINE(wxUSE_HYPERLINKCTRL)
6529 if test "$wxUSE_BITMAPCOMBOBOX" = "yes"; then
6530 AC_DEFINE(wxUSE_BITMAPCOMBOBOX)
6534 if test "$wxUSE_DATAVIEWCTRL" = "yes"; then
6535 AC_DEFINE(wxUSE_DATAVIEWCTRL)
6537 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview"
6540 if test "$wxUSE_IMAGLIST" = "yes"; then
6541 AC_DEFINE(wxUSE_IMAGLIST)
6544 if test "$wxUSE_LISTBOOK" = "yes"; then
6545 AC_DEFINE(wxUSE_LISTBOOK)
6549 if test "$wxUSE_LISTBOX" = "yes"; then
6550 AC_DEFINE(wxUSE_LISTBOX)
6554 if test "$wxUSE_LISTCTRL" = "yes"; then
6555 if test "$wxUSE_IMAGLIST" = "yes"; then
6556 AC_DEFINE(wxUSE_LISTCTRL)
6558 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
6560 AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
6564 if test "$wxUSE_EDITABLELISTBOX" = "yes"; then
6565 AC_DEFINE(wxUSE_EDITABLELISTBOX)
6567 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS editlbox"
6570 if test "$wxUSE_NOTEBOOK" = "yes"; then
6571 AC_DEFINE(wxUSE_NOTEBOOK)
6573 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
6576 if test "$wxUSE_ODCOMBOBOX" = "yes"; then
6577 AC_DEFINE(wxUSE_ODCOMBOBOX)
6579 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS combo"
6582 if test "$wxUSE_RADIOBOX" = "yes"; then
6583 AC_DEFINE(wxUSE_RADIOBOX)
6587 if test "$wxUSE_RADIOBTN" = "yes"; then
6588 AC_DEFINE(wxUSE_RADIOBTN)
6592 if test "$wxUSE_SASH" = "yes"; then
6593 AC_DEFINE(wxUSE_SASH)
6594 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
6597 if test "$wxUSE_SCROLLBAR" = "yes"; then
6598 AC_DEFINE(wxUSE_SCROLLBAR)
6600 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll scrollsub"
6603 if test "$wxUSE_SEARCHCTRL" = "yes"; then
6604 AC_DEFINE(wxUSE_SEARCHCTRL)
6608 if test "$wxUSE_SLIDER" = "yes"; then
6609 AC_DEFINE(wxUSE_SLIDER)
6613 if test "$wxUSE_SPINBTN" = "yes"; then
6614 AC_DEFINE(wxUSE_SPINBTN)
6618 if test "$wxUSE_SPINCTRL" = "yes"; then
6619 AC_DEFINE(wxUSE_SPINCTRL)
6623 if test "$wxUSE_SPLITTER" = "yes"; then
6624 AC_DEFINE(wxUSE_SPLITTER)
6625 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
6628 if test "$wxUSE_STATBMP" = "yes"; then
6629 AC_DEFINE(wxUSE_STATBMP)
6633 if test "$wxUSE_STATBOX" = "yes"; then
6634 AC_DEFINE(wxUSE_STATBOX)
6638 if test "$wxUSE_STATTEXT" = "yes"; then
6639 AC_DEFINE(wxUSE_STATTEXT)
6643 if test "$wxUSE_STATLINE" = "yes"; then
6644 AC_DEFINE(wxUSE_STATLINE)
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)
6654 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar"
6657 if test "$wxUSE_TAB_DIALOG" = "yes"; then
6658 AC_DEFINE(wxUSE_TAB_DIALOG)
6661 if test "$wxUSE_TEXTCTRL" = "yes"; then
6662 AC_DEFINE(wxUSE_TEXTCTRL)
6664 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text"
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])
6673 if test "$wxUSE_TOGGLEBTN" = "yes"; then
6674 AC_DEFINE(wxUSE_TOGGLEBTN)
6679 if test "$wxUSE_TOOLBAR" = "yes"; then
6680 AC_DEFINE(wxUSE_TOOLBAR)
6683 if test "$wxUSE_UNIVERSAL" = "yes"; then
6684 wxUSE_TOOLBAR_NATIVE="no"
6686 wxUSE_TOOLBAR_NATIVE="yes"
6687 AC_DEFINE(wxUSE_TOOLBAR_NATIVE)
6690 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
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])
6697 if test "$wxUSE_UNIVERSAL" = "yes"; then
6698 AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled])
6700 AC_DEFINE(wxUSE_TOOLTIPS)
6705 if test "$wxUSE_TREEBOOK" = "yes"; then
6706 AC_DEFINE(wxUSE_TREEBOOK)
6710 if test "$wxUSE_TOOLBOOK" = "yes"; then
6711 AC_DEFINE(wxUSE_TOOLBOOK)
6715 if test "$wxUSE_TREECTRL" = "yes"; then
6716 if test "$wxUSE_IMAGLIST" = "yes"; then
6717 AC_DEFINE(wxUSE_TREECTRL)
6719 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
6721 AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
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])
6729 if test "$wxUSE_PM" = 1; then
6730 AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
6732 AC_DEFINE(wxUSE_POPUPWIN)
6733 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup"
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])
6744 AC_DEFINE(wxUSE_DIALUP_MANAGER)
6745 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup"
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])
6753 AC_DEFINE(wxUSE_TIPWINDOW)
6757 if test "$USES_CONTROLS" = 1; then
6758 AC_DEFINE(wxUSE_CONTROLS)
6761 dnl ---------------------------------------------------------------------------
6763 dnl ---------------------------------------------------------------------------
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"
6771 if test "$wxUSE_DRAGIMAGE" = "yes"; then
6772 AC_DEFINE(wxUSE_DRAGIMAGE)
6773 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag"
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])
6780 AC_DEFINE(wxUSE_EXCEPTIONS)
6781 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS except"
6786 if test "$wxUSE_HTML" = "yes"; then
6787 AC_DEFINE(wxUSE_HTML)
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"
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],
6800 AC_DEFINE(wxUSE_WEBKIT)
6801 WEBKIT_LINK="-framework WebKit"
6804 AC_MSG_WARN([WebKit headers not found; disabling wxWebKit])
6808 #include <Carbon/Carbon.h>
6809 #include <WebKit/WebKit.h>
6811 CPPFLAGS="$old_CPPFLAGS"
6812 elif test "$wxUSE_COCOA" = 1; then
6813 AC_DEFINE(wxUSE_WEBKIT)
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])
6825 AC_DEFINE(wxUSE_XRC)
6827 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS xrc"
6832 if test "$wxUSE_AUI" = "yes"; then
6833 AC_DEFINE(wxUSE_AUI)
6835 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS aui"
6839 if test "$wxUSE_STC" = "yes"; then
6840 AC_DEFINE(wxUSE_STC)
6842 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS stc"
6845 if test "$wxUSE_MENUS" = "yes"; then
6846 AC_DEFINE(wxUSE_MENUS)
6847 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu"
6850 if test "$wxUSE_METAFILE" = "yes"; then
6851 AC_DEFINE(wxUSE_METAFILE)
6854 if test "$wxUSE_MIMETYPE" = "yes"; then
6855 AC_DEFINE(wxUSE_MIMETYPE)
6858 if test "$wxUSE_MINIFRAME" = "yes"; then
6859 AC_DEFINE(wxUSE_MINIFRAME)
6862 if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
6863 AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
6866 if test "$wxUSE_TASKBARICON" = "yes"; then
6867 AC_DEFINE(wxUSE_TASKBARICON)
6868 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar"
6872 if test "$wxUSE_VALIDATORS" = "yes"; then
6873 AC_DEFINE(wxUSE_VALIDATORS)
6874 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
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])
6882 AC_DEFINE(wxUSE_PALETTE)
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"
6892 if test "$wxUSE_RICHTEXT" = "yes"; then
6893 AC_DEFINE(wxUSE_RICHTEXT)
6895 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS richtext"
6898 dnl ---------------------------------------------------------------------------
6900 dnl ---------------------------------------------------------------------------
6902 if test "$wxUSE_IMAGE" = "yes" ; then
6903 AC_DEFINE(wxUSE_IMAGE)
6905 if test "$wxUSE_GIF" = "yes" ; then
6906 AC_DEFINE(wxUSE_GIF)
6909 if test "$wxUSE_PCX" = "yes" ; then
6910 AC_DEFINE(wxUSE_PCX)
6913 if test "$wxUSE_TGA" = "yes" ; then
6914 AC_DEFINE(wxUSE_TGA)
6917 if test "$wxUSE_IFF" = "yes" ; then
6918 AC_DEFINE(wxUSE_IFF)
6921 if test "$wxUSE_PNM" = "yes" ; then
6922 AC_DEFINE(wxUSE_PNM)
6925 if test "$wxUSE_XPM" = "yes" ; then
6926 AC_DEFINE(wxUSE_XPM)
6929 if test "$wxUSE_ICO_CUR" = "yes" ; then
6930 AC_DEFINE(wxUSE_ICO_CUR)
6934 dnl ---------------------------------------------------------------------------
6936 dnl ---------------------------------------------------------------------------
6938 if test "$wxUSE_ABOUTDLG" = "yes"; then
6939 AC_DEFINE(wxUSE_ABOUTDLG)
6942 if test "$wxUSE_CHOICEDLG" = "yes"; then
6943 AC_DEFINE(wxUSE_CHOICEDLG)
6946 if test "$wxUSE_COLOURDLG" = "yes"; then
6947 AC_DEFINE(wxUSE_COLOURDLG)
6950 if test "$wxUSE_FILEDLG" = "yes"; then
6951 AC_DEFINE(wxUSE_FILEDLG)
6954 if test "$wxUSE_FINDREPLDLG" = "yes"; then
6955 AC_DEFINE(wxUSE_FINDREPLDLG)
6958 if test "$wxUSE_FONTDLG" = "yes"; then
6959 AC_DEFINE(wxUSE_FONTDLG)
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)
6966 AC_DEFINE(wxUSE_DIRDLG)
6970 if test "$wxUSE_MSGDLG" = "yes"; then
6971 AC_DEFINE(wxUSE_MSGDLG)
6974 if test "$wxUSE_NUMBERDLG" = "yes"; then
6975 AC_DEFINE(wxUSE_NUMBERDLG)
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)
6982 AC_DEFINE(wxUSE_PROGRESSDLG)
6986 if test "$wxUSE_SPLASH" = "yes"; then
6987 AC_DEFINE(wxUSE_SPLASH)
6988 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splash"
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)
6995 AC_DEFINE(wxUSE_STARTUP_TIPS)
6999 if test "$wxUSE_TEXTDLG" = "yes"; then
7000 AC_DEFINE(wxUSE_TEXTDLG)
7003 if test "$wxUSE_WIZARDDLG" = "yes"; then
7004 AC_DEFINE(wxUSE_WIZARDDLG)
7005 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard"
7008 dnl ---------------------------------------------------------------------------
7009 dnl options used under wxMSW and wxPM
7010 dnl ---------------------------------------------------------------------------
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)
7018 dnl ---------------------------------------------------------------------------
7019 dnl wxMSW-only options
7020 dnl ---------------------------------------------------------------------------
7022 if test "$wxUSE_MSW" = 1 ; then
7024 if test "$wxUSE_DC_CACHEING" = "yes"; then
7025 AC_DEFINE(wxUSE_DC_CACHEING)
7028 if test "$wxUSE_DIB" = "yes"; then
7029 AC_DEFINE(wxUSE_WXDIB)
7032 if test "$wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW" = "yes"; then
7033 AC_DEFINE(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
7036 if test "$wxUSE_UXTHEME" = "yes"; then
7037 AC_DEFINE(wxUSE_UXTHEME)
7044 if test "$USE_WIN32" = 1 ; then
7045 if test "$wxUSE_INICONF" = "yes"; then
7046 AC_DEFINE(wxUSE_INICONF)
7049 if test "$wxUSE_REGKEY" = "yes"; then
7050 AC_DEFINE(wxUSE_REGKEY)
7055 dnl ---------------------------------------------------------------------------
7056 dnl wxGraphicsContext
7057 dnl ---------------------------------------------------------------------------
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)
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])]
7074 dnl ---------------------------------------------------------------------------
7076 dnl ---------------------------------------------------------------------------
7080 if test "$wxUSE_MEDIACTRL" = "yes"; then
7083 dnl -----------------------------------------------------------------------
7085 dnl -----------------------------------------------------------------------
7086 if test "$wxUSE_GTK" = 1; then
7087 wxUSE_GSTREAMER="no"
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.
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 -------------------------------------------------------------------
7097 GST_VERSION_MINOR=10
7098 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
7100 if test "$wxUSE_GSTREAMER8" = "no"; then
7101 PKG_CHECK_MODULES(GST,
7102 [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION gconf-2.0],
7104 wxUSE_GSTREAMER="yes"
7105 GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
7108 AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
7113 dnl check only for 0.8
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",
7123 AC_MSG_WARN([GStreamer 0.8/0.10 not available.])
7128 if test "$wxUSE_GSTREAMER" = "yes"; then
7129 CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
7130 LIBS="$GST_LIBS $LIBS"
7132 AC_DEFINE(wxUSE_GSTREAMER)
7138 if test $USE_MEDIA = 1; then
7139 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
7140 AC_DEFINE(wxUSE_MEDIACTRL)
7144 dnl ---------------------------------------------------------------------------
7145 dnl get the string with OS info - used by wxGetOsDescription() on MacOS X
7146 dnl ---------------------------------------------------------------------------
7148 if test "$cross_compiling" = "yes"; then
7149 dnl Use best guess from host as we can't use uname when cross compiling
7152 dnl attualy work out OS version
7153 OSINFO=`uname -s -r -m`
7154 OSINFO="\"$OSINFO\""
7157 AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
7159 dnl ---------------------------------------------------------------------------
7160 dnl define the variable containing the installation prefix (used in dcpsg.cpp)
7161 dnl ---------------------------------------------------------------------------
7163 if test "x$prefix" != "xNONE"; then
7166 wxPREFIX=$ac_default_prefix
7169 AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
7172 dnl ---------------------------------------------------------------------------
7173 dnl define variables with all built libraries for wx-config
7174 dnl ---------------------------------------------------------------------------
7176 STD_BASE_LIBS="base"
7178 BUILT_WX_LIBS="base"
7179 ALL_WX_LIBS="xrc stc gl media qa html adv core xml net base"
7181 if test "$wxUSE_SOCKETS" = "yes" ; then
7182 STD_BASE_LIBS="net $STD_BASE_LIBS"
7183 BUILT_WX_LIBS="net $BUILT_WX_LIBS"
7185 if test "$wxUSE_XML" = "yes" ; then
7186 STD_BASE_LIBS="xml $STD_BASE_LIBS"
7187 BUILT_WX_LIBS="xml $BUILT_WX_LIBS"
7190 if test "$wxUSE_GUI" = "yes"; then
7191 STD_GUI_LIBS="adv core"
7192 BUILT_WX_LIBS="$STD_GUI_LIBS $BUILT_WX_LIBS"
7194 if test "$wxUSE_DEBUGREPORT" = "yes" ; then
7195 STD_GUI_LIBS="qa $STD_GUI_LIBS"
7196 BUILT_WX_LIBS="qa $BUILT_WX_LIBS"
7198 if test "$wxUSE_HTML" = "yes" ; then
7199 STD_GUI_LIBS="html $STD_GUI_LIBS"
7200 BUILT_WX_LIBS="html $BUILT_WX_LIBS"
7202 if test "$wxUSE_MEDIACTRL" = "yes" ; then
7203 BUILT_WX_LIBS="media $BUILT_WX_LIBS"
7205 if test "$wxUSE_OPENGL" = "yes" ; then
7206 BUILT_WX_LIBS="gl $BUILT_WX_LIBS"
7208 if test "$wxUSE_AUI" = "yes" ; then
7209 BUILT_WX_LIBS="aui $BUILT_WX_LIBS"
7211 if test "$wxUSE_STC" = "yes" ; then
7212 BUILT_WX_LIBS="stc $BUILT_WX_LIBS"
7214 if test "$wxUSE_XRC" = "yes" ; then
7215 STD_GUI_LIBS="xrc $STD_GUI_LIBS"
7216 BUILT_WX_LIBS="xrc $BUILT_WX_LIBS"
7220 AC_SUBST(ALL_WX_LIBS)
7221 AC_SUBST(BUILT_WX_LIBS)
7222 AC_SUBST(STD_BASE_LIBS)
7223 AC_SUBST(STD_GUI_LIBS)
7225 dnl ---------------------------------------------------------------------------
7226 dnl Output the makefiles and such from the results found above
7227 dnl ---------------------------------------------------------------------------
7229 dnl all additional libraries (except wxWidgets itself) we link with
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"
7236 LDFLAGS="$LDFLAGS -lQuickTimeLib"
7239 if test "$USE_DARWIN" = 1; then
7240 LDFLAGS="$LDFLAGS -framework IOKit -framework Carbon -framework Cocoa -framework System"
7242 LDFLAGS="$LDFLAGS -lCarbonLib"
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"
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"
7255 LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS"
7257 if test "$wxUSE_GUI" = "yes"; then
7259 dnl TODO add checks that these samples will really compile (i.e. all the
7260 dnl library features they need are present)
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"
7268 if test "$wxUSE_MONOLITHIC" != "yes"; then
7269 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console"
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"
7277 if test "$TOOLKIT" = "PM" -a "$wxUSE_UNIVERSAL" != "yes"; then
7278 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw"
7281 SAMPLES_SUBDIRS="console"
7285 dnl C/C++ compiler options used to compile wxWidgets
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:
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
7295 dnl remark #1684: conversion from pointer to same-sized integral type
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"
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
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"
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`
7330 dnl add -I options we use during library compilation
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.
7336 CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \
7337 -I\\${wx_top_builddir}/lib/wx/include/${TOOLCHAIN_FULLNAME} \
7338 -I\\${top_srcdir}/include $TOOLKIT_INCLUDE \
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 `
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`
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.
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-"
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`
7374 if test "$wxUSE_OPENGL" = "yes"; then
7375 EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS"
7378 LDFLAGS="$LDFLAGS $PROFILE_FLAGS"
7380 WXCONFIG_LIBS="$LIBS"
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"
7386 if test "$wxUSE_EXPAT" = "builtin" ; then
7387 wxconfig_3rdparty="expat $wxconfig_3rdparty"
7389 if test "$wxUSE_LIBTIFF" = "builtin" ; then
7390 wxconfig_3rdparty="tiff $wxconfig_3rdparty"
7392 if test "$wxUSE_LIBJPEG" = "builtin" ; then
7393 wxconfig_3rdparty="jpeg $wxconfig_3rdparty"
7395 if test "$wxUSE_LIBPNG" = "builtin" ; then
7396 wxconfig_3rdparty="png $wxconfig_3rdparty"
7398 if test "$wxUSE_ZLIB" = "builtin" ; then
7399 wxconfig_3rdparty="zlib $wxconfig_3rdparty"
7402 for i in $wxconfig_3rdparty ; do
7403 WXCONFIG_LIBS="-lwx${i}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS"
7407 if test "x$wxUSE_UNIVERSAL" = "xyes" ; then
7410 case "$wxUNIV_THEMES" in
7412 AC_DEFINE(wxUSE_ALL_THEMES)
7416 for t in `echo $wxUNIV_THEMES | tr , ' ' | tr a-z A-Z`; do
7417 AC_DEFINE_UNQUOTED(wxUSE_THEME_$t)
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)
7431 if test $wxUSE_MONOLITHIC = "yes" ; then
7437 if test $wxUSE_PLUGINS = "yes" ; then
7443 if test "$wxUSE_DEBUGREPORT" = "yes" ; then
7449 if test $wxUSE_OFFICIAL_BUILD = "yes" ; then
7456 AC_SUBST(OFFICIAL_BUILD)
7457 AC_SUBST(WX_FLAVOUR)
7458 AC_SUBST(WX_LIB_FLAVOUR)
7461 AC_SUBST(MONOLITHIC)
7462 AC_SUBST(USE_PLUGINS)
7464 AC_SUBST(CXXWARNINGS)
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)
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)
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";
7497 if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then
7498 TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomeprint";
7500 if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
7501 TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomevfs"
7503 if test "$wxUSE_LIBHILDON" = "yes"; then
7504 TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon"
7507 if test "$TOOLKIT_EXTRA" != ""; then
7508 TOOLKIT_DESC="$TOOLKIT_DESC with support for `echo $TOOLKIT_EXTRA | tr -s ' '`"
7514 TOOLKIT_DESC=$TOOLKIT_LOWERCASE
7518 TOOLKIT_DESC="base only"
7522 if test "$wxUSE_WINE" = "yes"; then
7523 BAKEFILE_FORCE_PLATFORM=win32
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
7532 [for gcc precompiled header bug],
7533 [wx_cv_gcc_pch_bug],
7535 echo '#include <stdio.h>
7536 const wchar_t test_var[] = L"awidetest";' > conftest.h
7538 echo '#include "conftest.h"
7541 printf("%ls", test_var);
7545 wx_cv_gcc_pch_bug="pch not supported"
7547 if $CXX conftest.h >/dev/null 2>&1
7551 if $CXX -o conftest$PROGRAM_EXT conftest.cpp >/dev/null 2>&1
7553 if tr -dc a-z < conftest$PROGRAM_EXT |
7554 grep awidetest >/dev/null
7556 wx_cv_gcc_pch_bug=no
7558 wx_cv_gcc_pch_bug=yes
7563 rm -f conftest.h conftest.gch conftest.cpp conftest$PROGRAM_EXT
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
7573 AC_BAKEFILE([m4_include(autoconf_inc.m4)])
7575 dnl make install path absolute (if not already);
7576 dnl will fail with (some) MSDOS paths
7580 ?:* ) # Drive letter, considered as absolute.
7583 INSTALL=`pwd`/${INSTALL} ;;
7586 if test "$wxUSE_GUI" = "yes"; then
7588 if test "$wxUSE_MSW" = 1 ; then
7589 if test "x$WINDRES" = "x"; then
7590 AC_MSG_ERROR([Required windres program not found])
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"
7602 dnl add the resources target for wxMac
7603 LIBWXMACRES="\$(wx_top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}"
7605 AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
7607 MACSETFILE="\$(SETFILE)"
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"
7614 WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL Carbon.r -o"
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"
7622 dnl default value is to (silently) do nothing in the makefile
7625 if test "$wxUSE_PM" = 1; then
7627 WXCONFIG_RESFLAGS="-ep"
7629 dnl Is this one really used anywhere for pm?
7630 POSTLINK_COMMAND="$RESCOMP $WXCONFIG_RESFLAGS"
7632 POSTLINK_COMMAND="@true"
7640 dnl find out if the compiler supports PCH
7642 dnl TODO: this should be in bakefile
7643 if test $GCC_PCH = 1
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])
7651 CPPFLAGS="-DWX_PRECOMP $CPPFLAGS"
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.
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
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. )
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 .
7681 if test "$wxUSE_OMF" = "yes"; then
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"
7691 dnl TOOLCHAIN_DEFS should be used for both wx and client code
7692 WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS"
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
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)
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//'`
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//'`
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"
7731 dnl for convenience, sort the samples in alphabetical order
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!
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'`"
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
7748 AC_SUBST(WX_LIBRARY_BASENAME_NOGUI)
7749 AC_SUBST(WX_LIBRARY_BASENAME_GUI)
7753 AC_SUBST(AFMINSTALL)
7754 AC_SUBST(WIN32INSTALL)
7756 AC_SUBST(TOOLKIT_DIR)
7757 AC_SUBST(TOOLCHAIN_NAME)
7758 AC_SUBST(TOOLCHAIN_FULLNAME)
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)
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
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
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)
7784 AC_SUBST(WXCONFIG_LIBS)
7785 AC_SUBST(WXCONFIG_RPATH)
7786 AC_SUBST(WXCONFIG_LDFLAGS_GUI)
7787 AC_SUBST(WXCONFIG_RESFLAGS)
7789 dnl distribution vars
7793 dnl additional subdirectories where we will build
7794 AC_SUBST(SAMPLES_SUBDIRS)
7796 dnl additional libraries and linker settings
7798 AC_SUBST(LDFLAGS_GL)
7799 AC_SUBST(OPENGL_LIBS)
7800 AC_SUBST(DMALLOC_LIBS)
7801 AC_SUBST(WX_VERSION_TAG)
7803 dnl additional resurces settings
7808 AC_SUBST(RESPROGRAMOBJ)
7809 AC_SUBST(WX_RESOURCES_MACOSX_ASCII)
7810 AC_SUBST(WX_RESOURCES_MACOSX_DATA)
7812 dnl additional for Mac OS X
7814 AC_SUBST(LIBWXMACRES)
7815 AC_SUBST(POSTLINK_COMMAND)
7816 AC_SUBST(MACSETFILE)
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)
7829 AC_CONFIG_HEADERS([lib/wx/include/${TOOLCHAIN_FULLNAME}/wx/setup.h:setup.h.in])
7831 if test "$USE_WIN32" = 1; then
7838 $CPP $infile | sed 's/^# *[1-9].*//;s/^ *//;/./,/^$/!d' > $outdir/rcdefs.h
7842 infile="$srcdir/include/wx/msw/genrcdefs.h"
7843 outdir="lib/wx/include/$TOOLCHAIN_FULLNAME/wx/msw"
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}" ])
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}" ])
7856 if test "$wx_cv_version_script" = "yes"; then
7857 AC_CONFIG_FILES(version-script)
7859 AC_CONFIG_FILES(Makefile)
7861 AC_CONFIG_COMMANDS([wx-config],
7863 ${LN_S} lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} wx-config
7865 [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}"
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 ])
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"
7880 dnl we build wxBase only
7881 dnl there are no wxBase programs in demos
7882 SUBDIRS="samples utils"
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"])
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"
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"`
7909 dnl we build wxBase only
7910 dnl don't take all samples/utils, just those which build with
7912 if test ${subdir} = "samples"; then
7913 makefiles="samples/Makefile.in samples/console/Makefile.in"
7914 elif test ${subdir} = "utils"; then
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 \
7924 dnl assume that everything compiles for tests
7925 makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
7929 for mkin in $makefiles ; do
7930 mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'`
7931 AC_CONFIG_FILES([$mk])
7935 fi dnl wxWITH_SUBDIRS
7939 dnl report how we have been configured
7941 echo "Configured wxWidgets ${WX_VERSION} for \`${host}'"
7943 echo " Which GUI toolkit should wxWidgets use? ${TOOLKIT_DESC}"
7944 echo " Should wxWidgets be compiled into single library? ${wxUSE_MONOLITHIC:-yes}"
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)"
7953 echo " (using wchar_t)"
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}"
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}"
7972 echo " zlib ${wxUSE_ZLIB}"
7973 echo " expat ${wxUSE_EXPAT}"
7974 echo " libmspack ${wxUSE_LIBMSPACK}"
7975 echo " sdl ${wxUSE_LIBSDL}"
7979 dnl vi: set et sts=4 sw=4 com=\:dnl: