X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f597b41c5aebd1783a0b316243068281e1b06069..7ea07c5342eaa56f14f33462bed4d68ac5ba5faf:/configure.in diff --git a/configure.in b/configure.in index 1e23f19194..1f4a71bb13 100644 --- a/configure.in +++ b/configure.in @@ -17,7 +17,7 @@ dnl --------------------------------------------------------------------------- dnl initialization dnl --------------------------------------------------------------------------- -AC_INIT([wxWidgets], [2.6.0], [wx-dev@lists.wxwidgets.org]) +AC_INIT([wxWidgets], [2.6.2], [wx-dev@lists.wxwidgets.org]) dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package AC_CONFIG_SRCDIR([wx-config.in]) @@ -31,33 +31,11 @@ AC_CANONICAL_TARGET dnl When making releases do: dnl dnl wx_release_number += 1 -dnl -dnl ..and update WX_CURRENT, WX_REVISION and WX_AGE according to the -dnl following rules: -dnl -dnl If any changes have been made to the public interface, that is if any -dnl exported class, method, global or global type has been added, removed -dnl or changed in any way, then do: WX_CURRENT += 1 -dnl -dnl If source changes have been made that *do not* alter the public -dnl interface then do: WX_REVISION += 1 -dnl If WX_CURRENT was incremented (as above) instead do: WX_REVISION = 0 -dnl -dnl If any public interface was added, do: WX_AGE += 1 -dnl If any public interface was removed (or altered in a way effectively -dnl removing the previous definition), instead do: WX_AGE = 0 -dnl -dnl When the major or minor version numbers are incremented, all the above -dnl variables should be reset to 0. wx_subrelease_number should be set to zero -dnl when major, minor or release numbers change. -dnl -dnl The resulting library name will be of the form: -dnl libwx_$(TOOLKIT)-$(WX_RELEASE).so.$(WX_CURRENT).$(WX_REVISION).$(WX_AGE) wx_major_version_number=2 wx_minor_version_number=6 -wx_release_number=0 -wx_subrelease_number=0 +wx_release_number=2 +wx_subrelease_number=1 WX_RELEASE=$wx_major_version_number.$wx_minor_version_number WX_VERSION=$WX_RELEASE.$wx_release_number @@ -65,9 +43,6 @@ WX_SUBVERSION=$WX_VERSION.$wx_subrelease_number WX_MSW_VERSION=$wx_major_version_number$wx_minor_version_number$wx_release_number -WX_CURRENT=0 -WX_REVISION=0 -WX_AGE=0 dnl ------------------------------------------------------------------------ @@ -146,6 +121,8 @@ SO_SUFFIX=so SAMPLES_RPATH_FLAG= SAMPLES_RPATH_POSTLINK= +DEFAULT_STD_FLAG=yes + dnl to support a new system, you need to add its canonical name (as determined dnl by config.sub or specified by the configure command line) to this "case" dnl and also define the shared library flags below - search for @@ -275,8 +252,8 @@ case "${host}" in dnl USE_UNIX must be set and not USE_WIN32 SO_SUFFIX=dll PROGRAM_EXT=".exe" - RESCOMP=windres DEFAULT_DEFAULT_wxUSE_MSW=1 + DEFAULT_STD_FLAG=no ;; *-pc-msdosdjgpp ) @@ -285,8 +262,6 @@ case "${host}" in AC_DEFINE(__DOS__) PROGRAM_EXT=".exe" DEFAULT_DEFAULT_wxUSE_MGL=1 - dnl DJGPP needs explicit -lstdc++ for some reason (VS: mayb some versions only?) - LIBS="$LIBS -lstdc++" ;; *-pc-os2_emx | *-pc-os2-emx ) @@ -320,10 +295,11 @@ case "${host}" in done export PATH="$ac_TEMP_PATH" unset ac_TEMP_PATH + DEFAULT_STD_FLAG=no ;; - powerpc-*-darwin* ) - dnl PowerPC Darwin based distributions (including Mac OS X) + *-*-darwin* ) + dnl Darwin based distributions (including Mac OS X) USE_BSD=1 USE_DARWIN=1 SO_SUFFIX=dylib @@ -331,6 +307,7 @@ case "${host}" in AC_DEFINE(__DARWIN__) AC_DEFINE(TARGET_CARBON) DEFAULT_DEFAULT_wxUSE_MAC=1 + DEFAULT_STD_FLAG=no ;; powerpc-apple-macos* ) dnl Classic Mac OS (< X) @@ -342,6 +319,7 @@ case "${host}" in dnl AC_DEFINE(TARGET_CARBON) dnl platform.h needs TARGET_CARBON before setup.h, we'll add it to CPPFLAGS DEFAULT_DEFAULT_wxUSE_MAC=1 + DEFAULT_STD_FLAG=no ;; *-*-beos* ) @@ -433,7 +411,6 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_TEXTFILE=no DEFAULT_wxUSE_SOUND=no DEFAULT_wxUSE_MEDIACTRL=no - DEFAULT_wxUSE_DIRECTSHOW=no DEFAULT_wxUSE_INTL=no DEFAULT_wxUSE_CONFIG=no DEFAULT_wxUSE_FONTMAP=no @@ -567,9 +544,6 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_MONOLITHIC=no DEFAULT_wxUSE_PLUGINS=no DEFAULT_wxUSE_OFFICIAL_BUILD=no - - DEFAULT_wxUSE_GTK1=no - DEFAULT_wxUSE_GTK2=no else DEFAULT_wxUSE_UNIVERSAL=no DEFAULT_wxUSE_STL=no @@ -612,16 +586,16 @@ else DEFAULT_wxUSE_LIBXPM=yes DEFAULT_wxUSE_LIBMSPACK=yes DEFAULT_wxUSE_LIBSDL=no - DEFAULT_wxUSE_LIBGNOMEPRINT=yes + DEFAULT_wxUSE_LIBGNOMEPRINT=no DEFAULT_wxUSE_ODBC=no - DEFAULT_wxUSE_OPENGL=yes + DEFAULT_wxUSE_OPENGL=no DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes DEFAULT_wxUSE_STACKWALKER=yes DEFAULT_wxUSE_DEBUGREPORT=yes DEFAULT_wxUSE_SNGLINST_CHECKER=yes - DEFAULT_wxUSE_STD_IOSTREAM=yes - DEFAULT_wxUSE_STD_STRING=yes + DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG + DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG DEFAULT_wxUSE_CMDLINE_PARSER=yes DEFAULT_wxUSE_DATETIME=yes DEFAULT_wxUSE_TIMER=yes @@ -633,7 +607,6 @@ else DEFAULT_wxUSE_TEXTFILE=yes DEFAULT_wxUSE_SOUND=yes DEFAULT_wxUSE_MEDIACTRL=no - DEFAULT_wxUSE_DIRECTSHOW=no DEFAULT_wxUSE_INTL=yes DEFAULT_wxUSE_CONFIG=yes DEFAULT_wxUSE_FONTMAP=yes @@ -768,11 +741,11 @@ else DEFAULT_wxUSE_PLUGINS=no DEFAULT_wxUSE_OFFICIAL_BUILD=no - dnl Implies --with-gtk. Should be no here, the default is set to yes below - DEFAULT_wxUSE_GTK1=no - DEFAULT_wxUSE_GTK2=no + dnl Appliable only when --with-gtk was used: + DEFAULT_wxUSE_GTK2=yes fi + dnl WX_ARG_WITH should be used to select whether an external package will be dnl used or not, to configure compile-time features of this package itself, dnl use WX_ARG_ENABLE instead @@ -789,6 +762,11 @@ for toolkit in `echo $ALL_TOOLKITS`; do has_toolkit_in_cache=1 eval "DEFAULT_$LINE" eval "CACHE_$toolkit=1" + + LINE=`grep "wx${toolkit}_VERSION=" ${wx_arg_cache_file}` + if test "x$LINE" != "x" ; then + eval "DEFAULT_$LINE" + fi fi done @@ -807,9 +785,7 @@ WX_ARG_ENABLE(plugins, [ --enable-plugins build parts of wxWidgets a if test "$wxUSE_GUI" = "yes"; then WX_ARG_ENABLE(universal, [ --enable-universal use wxWidgets GUI controls instead of native ones], wxUSE_UNIVERSAL) -AC_ARG_WITH(gtk, [ --with-gtk use GTK+ (currently uses 2.0)], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) -WX_ARG_WITH(gtk1, [ --with-gtk1 use GTK+ 1.2], wxUSE_GTK1) -WX_ARG_WITH(gtk2, [ --with-gtk2 use GTK+ 2.0], wxUSE_GTK2) +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]) AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(mac, [ --with-mac use Mac OS X], [wxUSE_MAC="$withval" CACHE_MAC=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(cocoa, [ --with-cocoa use Cocoa], [wxUSE_COCOA="$withval" CACHE_COCOA=1 TOOLKIT_GIVEN=1]) @@ -821,6 +797,7 @@ AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_ AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) +AC_ARG_ENABLE(gtk2, [ --disable-gtk2 use GTK+ 1.2 instead of 2.0], [wxUSE_GTK2="$enableval"]) WX_ARG_ENABLE(gpe, [ --enable-gpe use GNOME PDA Environment features if possible], wxUSE_GPE) WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG) @@ -1161,10 +1138,14 @@ WX_ARG_ENABLE(mousewheel, [ --enable-mousewheel use mousewheel], wxUSE_MOU WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS) WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO) WX_ARG_ENABLE(joystick, [ --enable-joystick use wxJoystick], wxUSE_JOYSTICK) -WX_ARG_ENABLE(metafile, [ --enable-metafiles use wxMetaFile (Windows only)], wxUSE_METAFILE) +WX_ARG_ENABLE(metafile, [ --enable-metafiles use wxMetaFile (Win32 only)], wxUSE_METAFILE) WX_ARG_ENABLE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE) WX_ARG_ENABLE(accessibility,[ --enable-accessibility enable accessibility support], wxUSE_ACCESSIBILITY) +if test "$wxUSE_MSW" = "1"; then + WX_ARG_ENABLE(dccache, [ --enable-dccache cache temporary wxDC objects (Win32 only)], wxUSE_DC_CACHEING) +fi + dnl --------------------------------------------------------------------------- dnl support for image formats that do not rely on external library dnl --------------------------------------------------------------------------- @@ -1218,11 +1199,6 @@ if test "$wxUSE_WINE" = "yes"; then wxUSE_SHARED=no fi -dnl --with-gtk1 or --with-gtk2 imply --with-gtk -if test "$wxUSE_GTK1" = "yes" -o "$wxUSE_GTK2" = "yes"; then - wxUSE_GTK=yes - TOOLKIT_GIVEN=1 -fi if test "$wxUSE_GUI" = "yes"; then @@ -1231,11 +1207,19 @@ if test "$wxUSE_GUI" = "yes"; then fi if test "$TOOLKIT_GIVEN" = 1; then - dnl convert "yes" to 1 and "no" to 0 + dnl convert "yes", "any" or a number to 1 and "no" to 0 for toolkit in `echo $ALL_TOOLKITS`; do var=wxUSE_$toolkit eval "value=\$${var}" - eval "$var=`echo \$value | sed -e "s/yes/1/" -e "s/no/0/"`" + if test "x$value" = "xno"; then + eval "$var=0" + elif test "x$value" != "x"; then + eval "$var=1" + fi + + if test "x$value" != "x" -a "x$value" != "xyes" -a "x$value" != "xno"; then + eval "wx${toolkit}_VERSION=$value" + fi done else dnl try to guess the most apropriate toolkit for this platform @@ -1244,6 +1228,11 @@ if test "$wxUSE_GUI" = "yes"; then var=DEFAULT_DEFAULT_wxUSE_$toolkit else var=DEFAULT_wxUSE_$toolkit + + eval "version=\$DEFAULT_wx${toolkit}_VERSION" + if test "x$version" != "x"; then + eval "wx${toolkit}_VERSION=$version" + fi fi eval "wxUSE_$toolkit=\$${var}" done @@ -1271,6 +1260,13 @@ if test "$wxUSE_GUI" = "yes"; then AC_MSG_ERROR(Please specify at most one toolkit (maybe some are cached in configarg.cache?)) esac + # to be removed when --disable-gtk2 isn't needed + if test "x$wxUSE_GTK2" = "xyes"; then + wxGTK_VERSION=2 + elif test "x$wxUSE_GTK2" = "xno"; then + wxGTK_VERSION=1 + fi + dnl cache the wxUSE_ values too for toolkit in `echo $ALL_TOOLKITS`; do var=wxUSE_$toolkit @@ -1280,6 +1276,10 @@ if test "$wxUSE_GUI" = "yes"; then eval "cache=\$${cache_var}" if test "$cache" = 1; then echo "$var=$value" >> ${wx_arg_cache_file} + eval "version=\$wx${toolkit}_VERSION" + if test "x$version" != "x"; then + echo "wx${toolkit}_VERSION=$version" >> ${wx_arg_cache_file} + fi fi if test "$value" = 1; then toolkit_echo=`echo $toolkit | tr "[[A-Z]]" "[[a-z]]"` @@ -1306,6 +1306,7 @@ case "${host}" in *-*-cygwin*) if test "$wxUSE_MSW" = 1 ; then wants_win32=1 + BAKEFILE_FORCE_PLATFORM=win32 else doesnt_want_win32=1 fi @@ -1323,7 +1324,6 @@ if test "$wxUSE_WINE" = "yes"; then dnl FIXME: we should do a better job of testing for these CC=winegcc CXX=wineg++ - RESCOMP=wrc LDFLAGS_GUI="-mwindows" fi @@ -1357,24 +1357,6 @@ dnl --------------------------------------------------------------------------- dnl flush the cache because checking for programs might abort AC_CACHE_SAVE -dnl cross-compiling support: we're cross compiling if the build system is -dnl different from the target one (assume host and target be always the same) -if test "$build" != "$host" ; then - if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 -o "$USE_UNIX" = 1; then - CC=$host_alias-gcc - CXX=$host_alias-c++ - AR=$host_alias-ar - RANLIB=$host_alias-ranlib - DLLTOOL=$host_alias-dlltool - RESCOMP=$host_alias-windres - STRIP=$host_alias-strip - elif test "x$CC" '!=' "x"; then - echo "You set CC, I assume you know what you are doing." - else - AC_MSG_ERROR($build_alias -> $host_alias cross compilation not supported yet.) - fi -fi - dnl C-compiler checks dnl defines CC with the compiler to use dnl defines GCC with yes if using gcc @@ -1412,7 +1394,7 @@ AC_PROG_RANLIB dnl ar command dnl defines AR with the appropriate command -AC_CHECK_PROG(AR, ar, ar) +AC_CHECK_TOOL(AR, ar) if test "x$AR" = "x" ; then AC_MSG_ERROR([ar is needed to build wxWidgets]) fi @@ -1438,7 +1420,7 @@ case "${host}" in dnl The other BSD's should probably go in here too, since this is dnl to workaround a strange static lib BSDism. dnl Mac OS X install seems to ignore -p option... - powerpc-*-darwin* ) + *-*-darwin* ) INSTALL_PROGRAM="cp -fp" INSTALL_DATA="cp -fp" ;; @@ -1447,8 +1429,20 @@ case "${host}" in esac dnl strip command -dnl defines STRIP as strip or nothing if not found -AC_CHECK_PROG(STRIP, strip, strip, true) +dnl defines STRIP as strip or nothing (true) if not found +AC_CHECK_TOOL(STRIP, strip, true) + +dnl Win32 tools +if test "$wxUSE_WINE" = "yes"; then + AC_CHECK_TOOL(RESCOMP, wrc) +else + case "${host}" in + *-*-cygwin* | *-*-mingw32* ) + AC_CHECK_TOOL(RESCOMP, windres) + AC_CHECK_TOOL(DLLTOOL, dlltool) + ;; + esac +fi dnl does make support "-include" (only GNU make does AFAIK)? AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu, @@ -1517,14 +1511,14 @@ dnl ------------------------------------------------------------------------ dnl Platform specific tests dnl ------------------------------------------------------------------------ -dnl xlC needs -qunique (at least on AIX) so that one source file can be +dnl xlC needs -qunique under AIX so that one source file can be dnl compiled to multiple object files and safely linked together. -if test "x$XLCXX" = "xyes"; then +if test "x$XLCXX" = "xyes" -a "x$USE_AIX" = "x1"; then CXXFLAGS="$CXXFLAGS -qunique" fi -dnl This case is for OS X vs. everything else +dnl This case is for PowerPC OS X vs. everything else case "${host}" in powerpc-*-darwin* ) AC_MSG_CHECKING([if __POWERPC__ is already defined]) @@ -1536,6 +1530,12 @@ case "${host}" in [AC_MSG_RESULT([no]) AC_DEFINE(__POWERPC__) ]) + ;; +esac + +dnl This case is for OS X vs. everything else +case "${host}" in + *-*-darwin* ) AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable]) AC_TRY_COMPILE([#include ],[], @@ -1615,7 +1615,7 @@ case "${host}" in LDFLAGS="$LDFLAGS -Zsysv-signals" else if test "$wx_cv_gccversion" = "EMX3"; then - LIBS="$LIBS -lstdcxx" + LIBS="$LIBS -lstdcxx -lgcc" LDFLAGS="$LDFLAGS -Zsysv-signals" else LIBS="$LIBS -lstdc++" @@ -1700,10 +1700,6 @@ fi dnl defines HAVE_FNMATCH_H AC_CHECK_HEADERS(fnmatch.h) -if test "x$ac_cv_header_fnmatch_h" = "xyes"; then - AC_CHECK_FUNCS(fnmatch) -fi - dnl defines HAVE_LANGINFO_H (GNU libc locale parameters) AC_CHECK_HEADERS(langinfo.h) @@ -1720,19 +1716,6 @@ case "${host}" in ;; esac -if test "$wxUSE_GUI" = "yes"; then - if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then - dnl defines HAVE_X11_XKBLIB_H - AC_CHECK_HEADERS(X11/Xlib.h) - AC_CHECK_HEADERS([X11/XKBlib.h], [], [], - [ - #if HAVE_X11_XLIB_H - #include - #endif - ]) - fi -fi - dnl --------------------------------------------------------------------------- dnl Checks for compiler characteristics dnl --------------------------------------------------------------------------- @@ -1771,8 +1754,8 @@ dnl SGI/Irix's stdio.h does not include wchar_t. Mac OS X does not provide dnl wchar.h and wchar_t is defined by stdlib.h (GD) AC_CHECK_SIZEOF(wchar_t, 0, [ - /* DJGPP only has fake wchar_t: */ - #ifdef __DJGPP__ + /* DJGPP's wchar_t is now a keyword in C++ (still not C though) */ + #if defined(__DJGPP__) && !( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 ) # error "fake wchar_t" #endif #ifdef HAVE_WCHAR_H @@ -1787,6 +1770,11 @@ AC_CHECK_SIZEOF(wchar_t, 0, #include ] ) +if test "$ac_cv_sizeof_wchar_t" != "0"; then + wxUSE_WCHAR_T=yes +else + wxUSE_WCHAR_T=no +fi dnl checks needed to define wxVaCopy AC_CACHE_CHECK([for va_copy], @@ -1863,6 +1851,37 @@ dnl problems if test "x$wx_largefile" = "xyes"; then if test "x$ac_cv_sys_file_offset_bits" = "x64"; then WX_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" + + dnl We get "Large Files (ILP32) not supported in strict ANSI mode." + dnl #error from HP standard headers unless __STDC_EXT__ is defined. + dnl The compiler should define it automatically, but some old g++ + dnl versions don't define it, so test and add it if necessary. AFAIK + dnl the problem only affects the C++ compiler so it is added to + dnl CXXFLAGS only. + if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then + AC_CACHE_CHECK( + [if -D__STDC_EXT__ is required], + wx_cv_STDC_EXT_required, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE( + [], + [ + #ifndef __STDC_EXT__ + choke me + #endif + ], + wx_cv_STDC_EXT_required=no, + wx_cv_STDC_EXT_required=yes + ) + AC_LANG_RESTORE + ] + ) + if test "x$wx_cv_STDC_EXT_required" = "xyes"; then + CXXFLAGS="$CXXFLAGS -D__STDC_EXT__" + fi + fi else WX_LARGEFILE_FLAGS="-D_LARGE_FILES" fi @@ -1893,19 +1912,54 @@ AC_CXX_STATIC_CAST dnl we don't use HAVE_DYNAMIC_CAST anywhere right now... dnl AC_CXX_DYNAMIC_CAST -dnl check various STL features -if test "$wxUSE_UNICODE" = "yes" -a \ - \( "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes" \); then +dnl With Sun CC, temporaries have block scope by default. This flag is needed +dnl to get the expression scope behaviour that conforms to the standard. +if test "x$SUNCXX" = xyes; then + CXXFLAGS="$CXXFLAGS -features=tmplife" +fi + +dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do +dnl was to hack their C++ compiler to accept them silently -- but C compiler +dnl still spits out dozens of warnings for each X include file, so suppress +dnl them +if test "x$SUNCC" = xyes; then + CFLAGS="$CFLAGS -erroff=E_NO_EXPLICIT_TYPE_GIVEN" +fi + +dnl SGI mipsPro compiler gives this warning for "conversion from pointer to +dnl same-sized integral type" even when there is an explicit cast and as there +dnl is no way to turn it off and there are hundreds of these warnings in wx +dnl sources, just turn it off for now +dnl +dnl a better long term solution would be to use #pragma set/reset woff in +dnl wxPtrToUInt() and use it instead of casts elsewhere +if test "x$SGICC" = "xyes"; then + CFLAGS="$CFLAGS -woff 3970" +fi +if test "x$SGICXX" = "xyes"; then + CXXFLAGS="$CXXFLAGS -woff 3970" +fi + +dnl check for std::string or std::wstring +if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then AC_LANG_PUSH(C++) + if test "$wxUSE_UNICODE" = "yes"; then + std_string="std::wstring" + char_type="wchar_t" + else + std_string="std::string" + char_type="char" + fi + dnl check if declares std::wstring - AC_MSG_CHECKING([for std::wstring in ]) + AC_MSG_CHECKING([for $std_string in ]) AC_TRY_COMPILE([#include ], - [std::wstring foo;], + [$std_string foo;], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_STD_WSTRING)], [AC_MSG_RESULT(no) - AC_MSG_CHECKING([if std::basic_string works]) + AC_MSG_CHECKING([if std::basic_string<$char_type> works]) AC_TRY_COMPILE([ #ifdef HAVE_WCHAR_H # ifdef __CYGWIN__ @@ -1919,17 +1973,43 @@ if test "$wxUSE_UNICODE" = "yes" -a \ #include #include ], - [std::basic_string foo; - const wchar_t* dummy = foo.c_str();], + [std::basic_string<$char_type> foo; + const $char_type* dummy = foo.c_str();], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT([no]) - AC_MSG_ERROR([Can't compile without unicode string class])] + if test "$wxUSE_STL" = "yes"; then + AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>]) + elif grep wxUSE_STD_STRING $wx_arg_cache_file >/dev/null; then + AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>]) + else + AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string]) + wxUSE_STD_STRING=no + fi + ] ) ]) AC_LANG_POP fi +if test "$wxUSE_STD_IOSTREAM" = "yes"; then + AC_LANG_PUSH(C++) + + AC_CHECK_TYPES([std::istream, std::ostream],, + [wxUSE_STD_IOSTREAM=no], + [#include ]) + + if test "$wxUSE_STD_IOSTREAM" != "yes"; then + if grep wxUSE_STD_IOSTREAM $wx_arg_cache_file >/dev/null; then + AC_MSG_ERROR([Can't use --enable-std_iostreams without std::istream and std::ostream]) + else + AC_MSG_WARN([No std::iostreams, switching to --disable-std_iostreams]) + fi + fi + + AC_LANG_POP +fi + if test "$wxUSE_STL" = "yes"; then AC_LANG_PUSH(C++) @@ -2011,9 +2091,6 @@ SEARCH_INCLUDE="\ /usr/Motif-2.1/include \ /usr/Motif-1.2/include \ /usr/include/Motif1.2 \ - /opt/xpm/include/X11 \ - /opt/GBxpm/include/ \ - /opt/GBxpm/X11/include/ \ \ /usr/dt/include \ /usr/openwin/include \ @@ -2042,42 +2119,72 @@ SEARCH_INCLUDE="\ /usr/local/X11/include \ /usr/local/include/X11 \ \ - /usr/X386/include \ - /usr/x386/include \ /usr/XFree86/include/X11 \ - \ - X:/XFree86/include \ - X:/XFree86/include/X11 \ - \ - /usr/include/gtk \ - /usr/local/include/gtk \ - /usr/include/glib \ - /usr/local/include/glib \ - \ - /usr/include/qt \ - /usr/local/include/qt \ - \ - /usr/local/arm/3.3.2/include \ - \ - /usr/include/windows \ - /usr/include/wine \ - /usr/local/include/wine \ - \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ + /usr/pkg/include \ \ /usr/openwin/share/include" -dnl prepend lib and lib32 for IRIX where the files in these directories should -dnl be found before the ones in lib64 for 32bit compilation -- of course, this -dnl probably/surely breaks 64bit compilation... IMO the only real solution is to -dnl stop using WX_PATH_FIND_LIBRARIES() at all and use AC_CHECK_LIB() instead -dnl -dnl also put 64 bit versions for Linux on AMD, they must come before the usual -dnl locations or 64 bit compilation failed -SEARCH_LIB="/usr/lib /usr/lib32 /usr/lib64 /usr/X11R6/lib64 `echo "$SEARCH_INCLUDE" | sed s/include/lib/g`" +dnl try to find out the standard lib locations +AC_CACHE_CHECK([for libraries directory], + wx_cv_std_libpath, + [ + for d in WX_STD_LIBPATH(); do + for e in a so sl dylib dll.a; do + libc="$d/libc.$e" + if test -f $libc; then + save_LIBS="$LIBS" + LIBS="$libc" + AC_LINK_IFELSE([int main() { return 0; }], + wx_cv_std_libpath=`echo $d | sed s@/usr/@@`) + LIBS="$save_LIBS" + if test "x$wx_cv_std_libpath" != "x"; then + break 2 + fi + fi + done + done + if test "x$wx_cv_std_libpath" = "x"; then + wx_cv_std_libpath="lib" + fi + ] +) + +SEARCH_LIB=`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` + +dnl Cross compiling with gcc? +if test "$build" != "$host" -a "$GCC" = yes; then + dnl for gcc cross-compilers "$CC -print-prog-name=ld" prints the path to + dnl the linker. Stripping off the trailing '/bin/ld' gives us a candiate + dnl for a 'root' below which libraries and headers for the target system + dnl might be installed. + if cross_root=`$CC -print-prog-name=ld 2>/dev/null`; then + cross_root=`dirname $cross_root` + cross_root=`dirname $cross_root` + + dnl substitute this candiate root for '^/usr' in the search lists, + dnl strip out any that don't start '^/usr'. + SEARCH_LIB=`for x in $SEARCH_LIB; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"` + SEARCH_INCLUDE=`for x in $SEARCH_INCLUDE; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"` + + dnl also have pkg-config search for *.pc files under this 'root' + if test -z "$PKG_CONFIG_PATH"; then + PKG_CONFIG_PATH="$cross_root/local/lib/pkgconfig:$cross_root/lib/pkgconfig" + export PKG_CONFIG_PATH + fi + + dnl AC_PATH_XTRA doesn't work currently unless -x-includes and + dnl -x-libraries are given on the command line. So if they are not + dnl set then set them here to plausible defaults. + if test -z "$x_includes" -o "$x_includes" = NONE; then + WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h) + x_includes=$ac_find_includes + fi + if test -z "$x_libraries" -o "$x_libraries" = NONE; then + WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xt) + x_libraries=$ac_find_libraries + fi + fi +fi dnl ------------------------------------------------------------------------ dnl Check for libraries @@ -2095,7 +2202,7 @@ if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then AC_TRY_COMPILE([#include ], [ #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1) - #error not glibc2.1 + not glibc 2.1 #endif ], [ @@ -2421,6 +2528,17 @@ dnl ------------------------------------------------------------------------ dnl Check for expat libraries dnl ------------------------------------------------------------------------ +if test "$wxUSE_WCHAR_T" != "yes"; then + if test "$wxUSE_EXPAT" != "no"; then + AC_MSG_WARN([wxWidgets requires wchar_t to use expat, disabling]) + wxUSE_EXPAT=no + fi + if test "$wxUSE_XML" != "no"; then + AC_MSG_WARN([wxWidgets requires wchar_t to use xml, disabling]) + wxUSE_XML=no + fi +fi + if test "$wxUSE_EXPAT" != "no"; then wxUSE_XML=yes AC_DEFINE(wxUSE_EXPAT) @@ -2591,23 +2709,20 @@ if test "$wxUSE_GUI" = "yes"; then GTK_MODULES=gthread fi - dnl GTK+2 is currently the default - if test "x$wxUSE_GTK1" != "xyes" -a "x$wxUSE_GTK2" != "xyes"; then - wxUSE_GTK2=yes - fi - - dnl test for GTK2 + dnl detect GTK2 wx_cv_lib_gtk= - if test "x$wxUSE_GTK2" = "xyes"; then + if test "x$wxGTK_VERSION" != "x1"; then AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES) fi - dnl test for GTK1.x - if test -z "$wx_cv_lib_gtk" -a "x$wxUSE_GTK1" = "xyes"; then - AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES) + dnl detect GTK1.x + if test -z "$wx_cv_lib_gtk"; then + if test "x$wxGTK_VERSION" = "x1" -o "x$wxGTK_VERSION" = "xany" ; then + AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES) - if test -z "$wx_cv_lib_gtk"; then - AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES) + if test -z "$wx_cv_lib_gtk"; then + AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES) + fi fi fi @@ -2618,7 +2733,7 @@ if test "$wxUSE_GUI" = "yes"; then dnl we need to cache GTK_CFLAGS and GTK_LIBS for the dnl subsequent runs wx_cv_cflags_gtk=$GTK_CFLAGS - wx_cv_libs_gtk=$GTK_LIBS + wx_cv_libs_gtk=`echo $GTK_LIBS | sed -e 's/ -l[[^ ]]*cairo[[^ ]]*//g'` fi ] ) @@ -2653,10 +2768,27 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config save_CFLAGS="$CFLAGS" save_LIBS="$LIBS" CFLAGS="$CFLAGS $wx_cv_cflags_gtk" - LIBS="$LIBS $wx_cv_lib_gtk" - - AC_CHECK_FUNCS([pango_font_family_is_monospace]) - + LIBS="$LIBS $wx_cv_libs_gtk" + + dnl gtk_icon_size_lookup is not available in the GTK+ headers + dnl that have shipped with some versions of Sun's JDS. Not using + dnl AC_CHECK_FUNCS here since it only checks the function exists + dnl in the lib (not the header). + AC_MSG_CHECKING([if gtk_icon_size_lookup is missing]) + AC_TRY_COMPILE([ + #include + ], + [ + void *f = gtk_icon_size_lookup; + ], + [ + AC_MSG_RESULT([no]) + ], + [ + AC_DEFINE(NEED_GTK_ICON_SIZE_LOOKUP) + AC_MSG_RESULT([yes]) + ]) + dnl test if we have at least GTK+ 2.4: AC_MSG_CHECKING([if GTK+ is version >= 2.4]) AC_TRY_COMPILE([ @@ -2664,7 +2796,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config ], [ #if !GTK_CHECK_VERSION(2,4,0) - #error "Not GTK+ 2.4" + Not GTK+ 2.4 #endif ], [ @@ -2674,7 +2806,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config [ AC_MSG_RESULT([no]) ]) - + CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" else @@ -2711,7 +2843,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config dnl we guess its path from the prefix GUI_TK_LIBRARY="-L${prefix}/lib -lgpewidget $GUI_TK_LIBRARY" WXGPE=1 - AC_MSG_RESULT(found at $ac_find_libraries) + AC_MSG_RESULT([found in $ac_find_libraries]) else AC_MSG_RESULT(not found) fi @@ -2721,7 +2853,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config dnl if test "$ac_find_libraries" != "" ; then dnl WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) dnl GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe" - dnl AC_MSG_RESULT(found at $ac_find_libraries) + dnl AC_MSG_RESULT(found in $ac_find_libraries) dnl else dnl AC_MSG_RESULT(not found) dnl fi @@ -2921,6 +3053,9 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE) TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include" else + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" + AC_TRY_COMPILE( [ #include @@ -2935,46 +3070,48 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config ], [ AC_MSG_RESULT(no) - AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h) + AC_MSG_ERROR(please set CPPFLAGS to contain the location of Xm/Xm.h) ] ) + + CFLAGS=$save_CFLAGS fi - if test "$COMPILED_X_PROGRAM" = 0; then - AC_MSG_CHECKING(for Motif/Lesstif library) - WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) - if test "$ac_find_libraries" != "" ; then - AC_MSG_RESULT(found at $ac_find_libraries) - WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) - GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" - else - dnl it might happen that we found headers in one of the - dnl standard paths but the libs are elsewhere - we do need to - dnl try to compile a sample program then here - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" + AC_MSG_CHECKING(for Motif/Lesstif library) + WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) - AC_TRY_COMPILE( - [ - #include - ], - [ - int version; - version = xmUseVersion; - ], - [ - AC_MSG_RESULT(found in default search path) - COMPILED_X_PROGRAM=1 - ], - [ + if test "x$ac_find_libraries" != "x" ; then + AC_MSG_RESULT(found in $ac_find_libraries) + + WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) + GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" + else + dnl it might happen that we found headers in one of the standard + dnl paths but the libs are elsewhere but still in default (linker) + dnl path -- try to compile a test program to check for this + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" + + AC_TRY_LINK( + [ + #include + ], + [ + int version; + version = xmUseVersion; + ], + [ + AC_MSG_RESULT(found in default search path) + COMPILED_X_PROGRAM=1 + ], + [ AC_MSG_RESULT(no) AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm) ] ) - CFLAGS=$save_CFLAGS - fi + CFLAGS=$save_CFLAGS fi AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE]) @@ -3022,28 +3159,53 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config AC_MSG_ERROR([can't link a simple motif program]) fi + dnl this seems to be needed under IRIX and shouldn't do any harm + dnl elsewhere + AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"]) + save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" - AC_MSG_CHECKING([for Motif 2]) - AC_TRY_COMPILE([ - #include - ], - [ - #if XmVersion < 2000 - #error "Not Motif 2" - #endif - ], - [ - AC_DEFINE(__WXMOTIF20__,1) - AC_MSG_RESULT([found]) - ], - [ - AC_DEFINE(__WXMOTIF20__,0) - AC_MSG_RESULT([not found]) - ]) + + AC_CACHE_CHECK([for Motif 2], + wx_cv_lib_motif2, + AC_TRY_COMPILE([ + #include + ], + [ + #if XmVersion < 2000 + Not Motif 2 + #endif + ], + wx_cv_lib_motif2="yes", + wx_cv_lib_motif2="no")) + if test "$wx_cv_lib_motif2" = "yes"; then + AC_DEFINE(__WXMOTIF20__,1) + else + AC_DEFINE(__WXMOTIF20__,0) + fi + + AC_CACHE_CHECK([whether Motif is Lesstif], + wx_cv_lib_lesstif, + AC_TRY_COMPILE([ + #include + ], + [ + #if !defined(LesstifVersion) || LesstifVersion <= 0 + Not Lesstif + #endif + ], + wx_cv_lib_lesstif="yes", + wx_cv_lib_lesstif="no") + ) + if test "$wx_cv_lib_lesstif" = "yes"; then + AC_DEFINE(__WXLESSTIF__,1) + else + AC_DEFINE(__WXLESSTIF__,0) + fi + CFLAGS=$save_CFLAGS - GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11" TOOLKIT=MOTIF GUIDIST=MOTIF_DIST fi @@ -3057,7 +3219,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config if test "$ac_find_libraries" != "" ; then WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" - AC_MSG_RESULT(found at $ac_find_libraries) + AC_MSG_RESULT(found in $ac_find_libraries) AC_CACHE_CHECK([for X11/xpm.h], wx_cv_x11_xpm_h, @@ -3220,6 +3382,20 @@ dnl --------------------------------------------------------------------------- dnl Optional libraries included when system library is not used dnl --------------------------------------------------------------------------- +dnl do this after test for X11 above so that we have a chance of finding Xlib.h +if test "$wxUSE_GUI" = "yes"; then + if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then + dnl defines HAVE_X11_XKBLIB_H + AC_CHECK_HEADERS(X11/Xlib.h) + AC_CHECK_HEADERS([X11/XKBlib.h], [], [], + [ + #if HAVE_X11_XLIB_H + #include + #endif + ]) + fi +fi + dnl ---------------------------------------------------------------- dnl iODBC support @@ -3228,7 +3404,7 @@ dnl ---------------------------------------------------------------- IODBC_C_SRC="" -dnl ODBC is handled seperately for MSW +dnl ODBC is handled separately for MSW if test "$TOOLKIT" != "MSW" ; then if test "$wxUSE_ODBC" = "sys" -o "$wxUSE_ODBC" = "yes" ; then @@ -3400,7 +3576,7 @@ if test "$wxUSE_OPENGL" = "yes"; then if test "x$OPENGL_LIBS" = "x"; then dnl it should be an error and not a warning because OpenGL is not on - dnl by default and so if it had been explicitely requested, we + dnl by default and so if it had been explicitly requested, we dnl shouldn't just fall back to compiling the library without it AC_MSG_ERROR(OpenGL libraries not available) fi @@ -3442,7 +3618,7 @@ if test "$wxUSE_SHARED" = "yes"; then *-*-linux* | *-*-gnu* ) SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib" WXCONFIG_RPATH="-Wl,-rpath,\$libdir" - ;; + ;; *-*-solaris2* ) if test "$GCC" = yes ; then @@ -3482,9 +3658,11 @@ if test "$wxUSE_SHARED" = "yes"; then fi ;; - powerpc-*-darwin* ) - SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@" - cat <change-install-names + *-*-darwin* ) + install_name_tool=`which install_name_tool` + if test "$install_name_tool" -a -x "$install_name_tool"; then + SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@" + cat <change-install-names #!/bin/sh libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\` inst_cmd="install_name_tool " @@ -3493,7 +3671,8 @@ for i in \${libnames} ; do done \${inst_cmd} \${3} EOF - chmod +x change-install-names + chmod +x change-install-names + fi ;; *-*-cygwin* | *-*-mingw32* ) @@ -3565,7 +3744,11 @@ dnl library link name dnl These just save us from exporting lib_{unicode,debug,flavour}_suffix. dnl If we ever need to do that, we won't need to keep these. WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" -WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" +if test "${TOOLKIT_DIR}" = "os2"; then + WX_LIBRARY_BASENAME_GUI="wx_pm${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" +else + WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" +fi @@ -3616,11 +3799,11 @@ if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then dnl resources are bundled both with shared library and applications dnl since the carb resource *must* be included in the application if test "$wxUSE_MAC" = 1; then - MACRESCOMP="\$(RESCOMP) -d __DARWIN__ -t APPL Carbon.r ${LIBWXMACRES} -o" + MACRESCOMP="\$(RESCOMP) -d __DARWIN__ -t APPL Carbon.r -o" dnl this command is used to implement `wx-config --rezflags` and it is dnl eval'd there so escape any metacharacters inside - MACRESWXCONFIG="${RESCOMP} -d __DARWIN__ -t APPL Carbon.r \\\${exec_prefix}/lib/${WX_RESOURCES_MACOSX_ASCII} -o" + MACRESWXCONFIG="${RESCOMP} -d __DARWIN__ -t APPL Carbon.r -o" else MACRESCOMP="echo -n | \$(RESCOMP) -d __DARWIN__ -t APPL ${LIBWXMACRES} -o" MACRESWXCONFIG="echo -n \\\| ${RESCOMP} -d __DARWIN__ -t APPL \\\${exec_prefix}/lib/${WX_RESOURCES_MACOSX_ASCII} -o" @@ -3741,7 +3924,7 @@ dnl Check for functions dnl --------------------------------------------------------------------------- dnl don't check for wchar_t functions if we haven't got wchar_t itself -if test "$ac_cv_sizeof_wchar_t" != "0"; then +if test "$wxUSE_WCHAR_T" = "yes"; then AC_DEFINE(wxUSE_WCHAR_T) dnl check for wcslen in all possible places @@ -3764,14 +3947,21 @@ if test "$ac_cv_sizeof_wchar_t" != "0"; then AC_DEFINE(HAVE_WCSLEN) fi - dnl on HP-UX aCC and g++ need this define to find mbstrtowcs() &c - if test "$USE_HPUX" = 1; then + dnl On HP-UX aCC need this define to find mbstrtowcs() &c + dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict + dnl with g++'s in (unless -D_INCLUDE__STDC_A1_SOURCE is in the + dnl flags when g++ is configured, it will declare it's own). + if test "$USE_HPUX" = 1 -a "$GCC" != "yes"; then CPPFLAGS="$CPPFLAGS -D_INCLUDE__STDC_A1_SOURCE " fi - dnl try to use wcsrtombs instead of wcstombs which is buggy in old GNU - dnl libc versions if possible - AC_CHECK_FUNCS(wcsrtombs) + dnl Try to use wcsrtombs instead of wcstombs which is buggy in old GNU + dnl libc versions if possible. AC_CHECK_FUNCS only checks it's in the + dnl library, not the header, so do a header check for mbstate_t first. + AC_CHECK_TYPES([mbstate_t], + [AC_CHECK_FUNCS(wcsrtombs)], + [], + [#include ]) else AC_MSG_WARN([Wide character support is unavailable]) fi @@ -3784,22 +3974,32 @@ AC_LANG_CPLUSPLUS dnl check for vsnprintf() -- a safe version of vsprintf()) dnl -dnl the trouble here is that on some systems (notable HP-UX) this function is +dnl the trouble here is that on some systems (e.g HP-UX 10) this function is dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which, dnl stupidly, provides a dummy function declaration inside its extension) dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails dnl dnl so we first check if the function is in the library -AC_CHECK_FUNCS(vsnprintf) +AC_CHECK_FUNCS(snprintf vsnprintf) if test "$ac_cv_func_vsnprintf" = "yes"; then dnl yes it is -- now check if it is in the headers AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl, [ + dnl our troubles are not over: HP-UX 11 prototypes vsnprintf() as + dnl taking "char *" and not "const char *" while Metrowerks does + dnl provide a correct vsnprintf declaration but in C++ mode it's + dnl always in std namespace and so we have to bring it in scope AC_TRY_COMPILE( [ #include #include + #ifdef __MSL__ + #if __MSL__ >= 0x6000 + namespace std {} + using namespace std; + #endif + #endif ], [ char *buf; @@ -3807,33 +4007,105 @@ if test "$ac_cv_func_vsnprintf" = "yes"; then vsnprintf(buf, 10u, "%s", ap); ], wx_cv_func_vsnprintf_decl=yes, - [ - dnl Metrowerks does provide a vsnprintf declaration - dnl but in C++ mode it's always in std namespace. - dnl FIXME: Do we have any UNIX C++ compilers that would - dnl fail this test if using namespace std; was - dnl simply always included? - AC_TRY_COMPILE( - [ - #include - #include - using namespace std; - ], - [ - char *buf; - va_list ap; - vsnprintf(buf, 10u, "%s", ap); - ], - wx_cv_func_vsnprintf_decl=yes, - wx_cv_func_vsnprintf_decl=no - ) - ] + wx_cv_func_vsnprintf_decl=no ) ] ) if test "$wx_cv_func_vsnprintf_decl" = "yes"; then AC_DEFINE(HAVE_VSNPRINTF_DECL) + + dnl we know there is a vsnprintf declaration, but some old headers + dnl may have one taking a "char *" format instead of "const char *" + AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl, + [ + AC_TRY_COMPILE( + [ + #include + #include + #ifdef __MSL__ + #if __MSL__ >= 0x6000 + namespace std {} + using namespace std; + #endif + #endif + ], + [ + char *buf; + va_list ap; + const char *fmt = "%s"; + vsnprintf(buf, 10u, fmt, ap); + ], + wx_cv_func_broken_vsnprintf_decl=no, + wx_cv_func_broken_vsnprintf_decl=yes + ) + ] + ) + + if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then + AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL) + fi + fi +fi + +dnl the same as above but for snprintf() now: it's not present in at least AIX +dnl 4.2 headers +if test "$ac_cv_func_snprintf" = "yes"; then + AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl, + [ + AC_TRY_COMPILE( + [ + #include + #include + #ifdef __MSL__ + #if __MSL__ >= 0x6000 + namespace std {} + using namespace std; + #endif + #endif + ], + [ + char *buf; + snprintf(buf, 10u, "%s", "wx"); + ], + wx_cv_func_snprintf_decl=yes, + wx_cv_func_snprintf_decl=no + ) + ] + ) + + if test "$wx_cv_func_snprintf_decl" = "yes"; then + AC_DEFINE(HAVE_SNPRINTF_DECL) + + dnl we know there is an snprintf declaration, but some old headers + dnl may have one taking a "char *" format instead of "const char *" + AC_CACHE_CHECK([if snprintf declaration is broken], wx_cv_func_broken_snprintf_decl, + [ + AC_TRY_COMPILE( + [ + #include + #include + #ifdef __MSL__ + #if __MSL__ >= 0x6000 + namespace std {} + using namespace std; + #endif + #endif + ], + [ + char *buf; + const char *fmt = "%s"; + snprintf(buf, 10u, fmt, "wx"); + ], + wx_cv_func_broken_snprintf_decl=no, + wx_cv_func_broken_snprintf_decl=yes + ) + ] + ) + + if test "$wx_cv_func_broken_snprintf_decl" = "yes"; then + AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL) + fi fi fi @@ -3854,6 +4126,13 @@ fi AC_LANG_RESTORE +if test "x$ac_cv_header_fnmatch_h" = "xyes"; then + AC_CHECK_FUNCS(fnmatch) +fi + +if test "$wxUSE_FILE" = "yes"; then + AC_CHECK_FUNCS(fsync) +fi dnl the following tests are for Unix(like) systems only @@ -3963,10 +4242,10 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs, AC_TRY_COMPILE( [ #if defined(__BSD__) - #include - #include + #include + #include #else - #include + #include #endif ], [ @@ -3977,16 +4256,39 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs, l += fs.f_blocks; l += fs.f_bavail; ], - [ - wx_cv_func_statfs=yes - ], - [ - wx_cv_func_statfs=no - ] + wx_cv_func_statfs=yes, + wx_cv_func_statfs=no ) ) if test "$wx_cv_func_statfs" = "yes"; then + dnl check whether we have its dcelaration too: some systems (AIX 4) lack it + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl, + AC_TRY_COMPILE( + [ + #if defined(__BSD__) + #include + #include + #else + #include + #endif + ], + [ + struct statfs fs; + statfs("", &fs); + ], + wx_cv_func_statfs_decl=yes, + wx_cv_func_statfs_decl=no + ) + ) + AC_LANG_RESTORE + + if test "$wx_cv_func_statfs_decl" = "yes"; then + AC_DEFINE(HAVE_STATFS_DECL) + fi + wx_cv_type_statvfs_t="struct statfs" AC_DEFINE(HAVE_STATFS) else @@ -4270,10 +4572,14 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then THREAD_OPTS="pthreads" ;; *-hp-hpux* ) - dnl HP-UX aCC only gives a warning, not an error about - dnl -pthread but it doesn't work and we have to use -lpthread - dnl there - if test "x$GCC" != "xyes"; then + if test "x$GCC" = "xyes"; then + dnl g++ versions before 3.3.2 don't support -pthread. + $CXX -dumpspecs | grep 'pthread:' >/dev/null || + THREAD_OPTS="" + else + dnl HP-UX aCC only gives a warning, not an error about + dnl -pthread but it doesn't work and we have to use + dnl -lpthread there THREAD_OPTS="" fi ;; @@ -4393,6 +4699,28 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then if test "$wxUSE_THREADS" = "yes" ; then AC_CHECK_FUNCS(thr_setconcurrency) + dnl can't use AC_CHECK_FUNCS for this one as it's usually a macro and so + dnl wouldn't be found by it + AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup, + [ + AC_TRY_COMPILE([#include + void ThreadCleanupFunc(void *p); + ], + [ + void *p; + pthread_cleanup_push(ThreadCleanupFunc, p); + pthread_cleanup_pop(0); + ], [ + wx_cv_func_pthread_cleanup=yes + ], [ + wx_cv_func_pthread_cleanup=no + ] + ) + ]) + if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then + AC_DEFINE(wxHAVE_PTHREAD_CLEANUP) + fi + AC_CHECK_HEADERS(sched.h) if test "$ac_cv_header_sched_h" = "yes"; then AC_CHECK_FUNC(sched_yield, @@ -4438,26 +4766,8 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then AC_DEFINE(HAVE_PTHREAD_CANCEL), AC_MSG_WARN([wxThread::Kill() will not work properly])) - dnl we don't use pthread_cleanup_push/pop() any more in the code, but I - dnl the code here for now in case we need it again soon; otherwise it - dnl should be removed in a couple of months (VZ in Sep 2003) - dnl - dnl AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push, - dnl [ - dnl AC_TRY_COMPILE([#include ], - dnl [ - dnl pthread_cleanup_push(NULL, NULL); - dnl pthread_cleanup_pop(0); - dnl ], [ - dnl wx_cv_func_pthread_cleanup_push=yes - dnl ], [ - dnl wx_cv_func_pthread_cleanup_push=no - dnl ]) - dnl ]) - dnl - dnl if test "$wx_cv_func_pthread_cleanup_push" = "yes"; then - dnl AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS) - dnl fi + AC_CHECK_FUNC(pthread_attr_setstacksize, + AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE)) dnl mutexattr_t initialization is done in quite different ways on different dnl platforms, so check for a few things: @@ -4589,7 +4899,9 @@ fi if test "$wxUSE_DEBUG_GDB" = "yes" ; then wxUSE_DEBUG_INFO=yes - WXDEBUG="-ggdb" + if test "$GCC" = yes; then + WXDEBUG="-ggdb" + fi fi if test "$wxUSE_DEBUG_FLAG" = "yes" ; then @@ -4609,7 +4921,7 @@ if test "$wxUSE_MEM_TRACING" = "yes" ; then fi if test "$wxUSE_DMALLOC" = "yes" ; then - DMALLOC_LIBS="-ldmalloc" + DMALLOC_LIBS="-ldmallocthcxx" fi PROFILE= @@ -4728,6 +5040,8 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then if test "$USE_DARWIN" = 1; then dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X HAVE_DL_FUNCS=1 + elif test "$USE_DOS" = 1; then + HAVE_DL_FUNCS=0 else dnl the test is a bit complicated because we check for dlopen() both with dnl and without -ldl and we also try to find shl_load() if there is no @@ -4773,7 +5087,7 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then if test "$HAVE_DL_FUNCS" = 0; then if test "$HAVE_SHL_FUNCS" = 0; then - if test "$USE_UNIX" = 1; then + if test "$USE_UNIX" = 1 -o "$USE_DOS" = 1; then AC_MSG_WARN([Missing dynamic loading support, several features will be disabled]) wxUSE_DYNAMIC_LOADER=no wxUSE_DYNLIB_CLASS=no @@ -4831,13 +5145,48 @@ if test "$wxUSE_TIMER" = "yes"; then AC_DEFINE(wxUSE_TIMER) fi +dnl Unix implementation needs additional checks because audio support +dnl comes in many favours: +if test "$USE_UNIX" = "1" ; then + dnl it's not enough to check for just the header because OSS under NetBSD + dnl redefines ioctl as oss_ioctrl inside it and so we also need to test + dnl whether we need -lossaudio at link-time + AC_CACHE_CHECK([for ioctl() in sys/soundcard.h], ac_cv_header_sys_soundcard, [ + AC_TRY_LINK([ + #include + ], + [ + ioctl(0, SNDCTL_DSP_SYNC, 0); + ], + ac_cv_header_sys_soundcard=yes, + [ + saveLibs="$LIBS" + LIBS="$saveLibs -lossaudio" + AC_TRY_LINK([ + #include + ], + [ + ioctl(0, SNDCTL_DSP_SYNC, 0); + ], + ac_cv_header_sys_soundcard=yes, + [ + LIBS="$saveLibs" + ac_cv_header_sys_soundcard=no + ] + ) + ] + ) + ]) + + if test "$ac_cv_header_sys_soundcard" = "yes"; then + AC_DEFINE(HAVE_SYS_SOUNDCARD_H) + else + DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia" + fi +fi WITH_PLUGIN_SDL=0 if test "$wxUSE_SOUND" = "yes"; then - dnl Unix implementation needs additional checks because audio support - dnl comes in many favours: if test "$USE_UNIX" = "1" ; then - AC_CHECK_HEADERS([sys/soundcard.h]) - if test "$wxUSE_LIBSDL" != "no"; then AM_PATH_SDL([1.2.0], [ @@ -4920,7 +5269,12 @@ if test "$wxUSE_ZIPSTREAM" = "yes"; then fi if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then - AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION) + if test "$USE_UNIX" != 1; then + AC_MSG_WARN([Catching fatal exceptions not currently supported on this system, wxApp::OnFatalException will not be called]) + wxUSE_ON_FATAL_EXCEPTION=no + else + AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION) + fi fi if test "$wxUSE_STACKWALKER" = "yes"; then @@ -4928,12 +5282,14 @@ if test "$wxUSE_STACKWALKER" = "yes"; then fi if test "$wxUSE_DEBUGREPORT" = "yes"; then - if test "$USE_OS2" = "1"; then - AC_MSG_WARN([Creating debug reports not supported under OS/2 yet, disabled]) + if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then + AC_MSG_WARN([Creating debug reports not currently supported on this system, disabled]) wxUSE_DEBUGREPORT=no else AC_DEFINE(wxUSE_DEBUGREPORT) - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt" + if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt" + fi fi fi @@ -5262,7 +5618,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then wxUSE_SOCKETS=no AC_MSG_WARN([Couldn't find socklen_t synonym for this system]) else - AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3) + AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3) fi dnl Do this again for getsockopt as it may be different AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt], @@ -5378,30 +5734,39 @@ dnl --------------------------------------------------------------------------- dnl Joystick support dnl --------------------------------------------------------------------------- -if test "$wxUSE_GUI" = "yes"; then - dnl under MSW we always have joystick support - if test "$wxUSE_JOYSTICK" = "yes"; then - - dnl joystick support is only for Linux 2.1.x or greater - if test "$TOOLKIT" != "MAC" -a "$TOOLKIT" != "COCOA" -a "$TOOLKIT" != "MSW"; then - AC_CHECK_HEADERS(linux/joystick.h) - if test "$ac_cv_header_linux_joystick_h" != "yes"; then - wxUSE_JOYSTICK=no - AC_MSG_WARN(Joystick not supported by this system... disabled) - fi - else - dnl mac only available on darwin - if test "$USE_DARWIN" != 1 -a "$TOOLKIT" != "MSW"; then - wxUSE_JOYSTICK=no - AC_MSG_WARN(Joystick not supported by this system... disabled) - fi - fi +if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then + wxUSE_JOYSTICK=no + dnl under MSW we always have joystick support + if test "$TOOLKIT" = "MSW"; then + wxUSE_JOYSTICK=yes - if test "$wxUSE_JOYSTICK" = "yes"; then - AC_DEFINE(wxUSE_JOYSTICK) - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest" + dnl mac only available on darwin + elif test "$TOOLKIT" = "MAC" -o "$TOOLKIT" = "COCOA"; then + if test "$USE_DARWIN" = 1; then + dnl check for a bug in the headers, some have bad setEventCallout + AC_MSG_CHECKING([headers have declarations needed for joystick support]) + AC_LANG_PUSH(C++) + AC_TRY_COMPILE( [ #include ], + [ IOHIDQueueInterface *qi = NULL; + IOHIDCallbackFunction cb = NULL; + qi->setEventCallout(NULL, cb, NULL, NULL); ], + [ wxUSE_JOYSTICK=yes ] + ) + AC_LANG_POP + AC_MSG_RESULT($wxUSE_JOYSTICK) fi + + dnl joystick support is only for Linux 2.1.x or greater + else + AC_CHECK_HEADERS(linux/joystick.h, wxUSE_JOYSTICK=yes) + fi + + if test "$wxUSE_JOYSTICK" = "yes"; then + AC_DEFINE(wxUSE_JOYSTICK) + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest" + else + AC_MSG_WARN(Joystick not supported by this system... disabled) fi fi @@ -5509,6 +5874,17 @@ if test "$wxUSE_PROLOGIO" = "yes" -o "$wxUSE_RESOURCES" = "yes"; then AC_MSG_ERROR([wxExpr and old-style resources are now available in contrib only]) fi +dnl --------------------------------------------------------------------------- +dnl wxMetafile availability +dnl --------------------------------------------------------------------------- + +if test "$wxUSE_METAFILE" = "yes"; then + if test "$wxUSE_MSW" != 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_PM" != 1; then + AC_MSG_WARN([wxMetafile is not available on this system... disabled]) + wxUSE_METAFILE=no + fi +fi + dnl --------------------------------------------------------------------------- dnl IPC: IPC, Drag'n'Drop, Clipboard, ... dnl --------------------------------------------------------------------------- @@ -5574,6 +5950,19 @@ if test "$wxUSE_IPC" = "yes"; then fi fi +if test "$wxUSE_DATAOBJ" = "yes"; then + if test "$wxUSE_MGL" = 1; then + AC_MSG_WARN([wxDataObject not yet supported under MGL... disabled]) + wxUSE_DATAOBJ=no + else + AC_DEFINE(wxUSE_DATAOBJ) + fi +else + AC_MSG_WARN([Clipboard and drag-and-drop require wxDataObject -- disabled]) + wxUSE_CLIPBOARD=no + wxUSE_DRAG_AND_DROP=no +fi + if test "$wxUSE_CLIPBOARD" = "yes"; then if test "$wxUSE_MGL" = 1; then AC_MSG_WARN([Clipboard not yet supported under MGL... disabled]) @@ -5582,9 +5971,6 @@ if test "$wxUSE_CLIPBOARD" = "yes"; then if test "$wxUSE_CLIPBOARD" = "yes"; then AC_DEFINE(wxUSE_CLIPBOARD) - - dnl required by clipboard code in configuration check - AC_DEFINE(wxUSE_DATAOBJ) fi fi @@ -5936,6 +6322,10 @@ if test "$wxUSE_ACCESSIBILITY" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access" fi +if test "$wxUSE_DC_CACHEING" = "yes"; then + AC_DEFINE(wxUSE_DC_CACHEING) +fi + if test "$wxUSE_DRAGIMAGE" = "yes"; then AC_DEFINE(wxUSE_DRAGIMAGE) SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag" @@ -6141,24 +6531,6 @@ dnl wxMediaCtrl dnl --------------------------------------------------------------------------- if test "$wxUSE_MEDIACTRL" = "yes"; then - if test "$wxUSE_MSW" = 1; then - dnl ----------------------------------------------------------------------- - dnl DirectShow MSW - dnl ----------------------------------------------------------------------- - wxUSE_DIRECTSHOW="yes" - AC_CHECK_HEADERS([dshow.h], [], - [ - wxUSE_DIRECTSHOW="no" - AC_MSG_WARN([DirectShow not installed; consider installing the DirectX7 SDK or higher]) - ], - [#include ]) - - if test "$wxUSE_DIRECTSHOW" = "yes"; then - AC_DEFINE(wxUSE_DIRECTSHOW) - LIBS="$LIBS -lstrmiids" - fi - fi - dnl ----------------------------------------------------------------------- dnl GStreamer dnl ----------------------------------------------------------------------- @@ -6323,8 +6695,6 @@ if test "$wxUSE_MAC" = 1 ; then else LDFLAGS="$LDFLAGS -lCarbonLib" fi -elif test "$USE_DARWIN" = 1; then - LDFLAGS="$LDFLAGS -framework IOKit -framework CoreServices -framework System" fi if test "$wxUSE_COCOA" = 1 ; then LDFLAGS="$LDFLAGS -framework IOKit -framework Cocoa" @@ -6332,6 +6702,9 @@ if test "$wxUSE_COCOA" = 1 ; then LDFLAGS="$LDFLAGS -framework QuickTime" fi fi +if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1 ; then + LDFLAGS="$LDFLAGS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices" +fi dnl FIXME: should this be covered by the conditional above dnl given the -lm comment there? Or should that comment (and @@ -6420,10 +6793,8 @@ INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_FULLNAME} \ dnl C/C++ compiler options used to compile wxWidgets if test "$GXX" = yes ; then dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" - CWARNINGS="-Wall" + CWARNINGS="-Wall -Wundef" CXXWARNINGS="$CWARNINGS -Wno-ctor-dtor-privacy" - dnl should enable this one day... - dnl CXXWARNINGS="-Wall -Werror" fi EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE" @@ -6432,7 +6803,7 @@ dnl remove the extra white space from the cc/c++/ld options CPPFLAGS=`echo $WXDEBUG_DEFINE $INCLUDES $CPPFLAGS` CFLAGS=`echo $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CWARNINGS` CXXFLAGS=`echo $CODE_GEN_FLAGS $CODE_GEN_FLAGS_CXX $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS` - + if test "x$MWCC" = "xyes"; then dnl Correct MW 8.3 to be more similar to GCC. In particular we dnl must use from system not our local copy on OS X, @@ -6588,6 +6959,10 @@ case "$TOOLKIT" in ;; esac +if test "$wxUSE_WINE" = "yes"; then + BAKEFILE_FORCE_PLATFORM=win32 +fi + AC_BAKEFILE([m4_include(autoconf_inc.m4)]) if test "$wxUSE_SHARED" = "yes"; then @@ -6632,55 +7007,70 @@ dnl According to Vaclav, if NO_GCC_PRAGMA is used for any reason it needs to dnl be in wx-config output. Not doing so could result in link problems. GCC_PRAGMA_FLAGS="" PCH_FLAGS="" -dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP: + +dnl Find out if we have to define WX_PRECOMP (and thus NO_GCC_PRAGMA) if test $GCC_PCH = 1 ; then - GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" PCH_FLAGS="-DWX_PRECOMP" + GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" else - case "${host}" in - powerpc-*-darwin* ) - dnl Some Apple's GCC version are broken and can't handle the - dnl pragmas: - GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" - ;; - *-*-mingw32* ) - dnl MinGW GCC versions >= 3.2 have problems with - dnl static member of classes derived from templates - dnl in combination with #pragma interface/implementation - dnl (the test case uses 4 files) - dnl ... and with exceptions handling (undefined symbols needed - dnl to correctly calls dtors when unwinding) as well - if test "$wxUSE_STL" = "yes" -o \ + dnl Find out if we have to define NO_GCC_PRAGMA + if test "$GCC" = yes; then + AC_MSG_CHECKING([if this GCC version is >= 4.0 and needs -DNO_GCC_PRAGMA]) + AC_TRY_COMPILE([], + [#if (__GNUC__ < 4) + Not GCC 4.0 or greater + #endif + ], + [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + case "${host}" in + *-*-darwin* ) + dnl Some Apple's GCC version are broken and can't handle the + dnl pragmas: + GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + ;; + *-*-mingw32* ) + dnl MinGW GCC versions > 3.2 have problems with + dnl static member of classes derived from templates + dnl in combination with #pragma interface/implementation + dnl (the test case uses 4 files) + dnl ... and with exceptions handling (undefined symbols needed + dnl to correctly calls dtors when unwinding) as well + if test "$wxUSE_STL" = "yes" -o \ "$wxUSE_NO_EXCEPTIONS" != "yes" -o \ "$wxUSE_NO_RTTI" != "yes"; then - AC_MSG_CHECKING([if this MinGW version needs -DNO_GCC_PRAGMA]) - AC_TRY_COMPILE([], - [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) - #error "Not GCC 3.2 or greater" - #endif - ], - [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - fi - ;; - *-pc-os2_emx | *-pc-os2-emx ) - dnl GCC versions ported to OS/2 have similar problems with - dnl static member of classes in combination with STL and - dnl pragma interface/implementation - if test "$wxUSE_STL" = "yes"; then - AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA]) - AC_TRY_COMPILE([], - [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) - #error "Not GCC 3.2 or greater" - #endif - ], - [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - fi - ;; - esac + AC_MSG_CHECKING([if this MinGW version needs -DNO_GCC_PRAGMA]) + AC_TRY_COMPILE([], + [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) + Not GCC 3.2 or greater + #endif + ], + [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + fi + ;; + *-pc-os2_emx | *-pc-os2-emx ) + dnl GCC versions ported to OS/2 have similar problems with + dnl static member of classes in combination with STL and + dnl pragma interface/implementation + if test "$wxUSE_STL" = "yes"; then + AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA]) + AC_TRY_COMPILE([], + [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) + Not GCC 3.2 or greater + #endif + ], + [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + fi + ;; + esac +dnl closing bracket of if GCC < 4.0 + ] ) + fi fi CPPFLAGS="$PCH_FLAGS $GCC_PRAGMA_FLAGS $CPPFLAGS" @@ -6828,8 +7218,14 @@ for subdir in `echo $SUBDIRS`; do makefiles="samples/$sample/Makefile.in $makefiles" fi done - else dnl assume that everything compiles for utils &c - makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)` + else + dnl assume that everything compiles for utils &c + dnl any that shouldn't be built can be added to + dnl DISABLED_UTILS, DISABLED_CONTRIB or DISABLED_DEMOS + disabled_var=DISABLED_`echo $subdir | tr [[a-z]] [[A-Z]]`; + eval "disabled=\$$disabled_var" + disabled=/`echo X $disabled | sed 's@ @/|/@g'`/ + makefiles=`(cd $srcdir ; find $subdir -name Makefile.in) | egrep -v "$disabled"` fi else dnl we build wxBase only dnl don't take all samples/utils, just those which build with