X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78de529bad368550fa7b6c0c2c5e29136193ebb4..e47ce385a75d78babaaac68d47d6f4dd5230a31c:/configure.in diff --git a/configure.in b/configure.in index 8858b84cfa..029b1d0d13 100644 --- a/configure.in +++ b/configure.in @@ -57,7 +57,7 @@ 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_subrelease_number=1 WX_RELEASE=$wx_major_version_number.$wx_minor_version_number WX_VERSION=$WX_RELEASE.$wx_release_number @@ -146,6 +146,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 @@ -277,6 +279,7 @@ case "${host}" in PROGRAM_EXT=".exe" RESCOMP=windres DEFAULT_DEFAULT_wxUSE_MSW=1 + DEFAULT_STD_FLAG=no ;; *-pc-msdosdjgpp ) @@ -285,8 +288,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,6 +321,7 @@ case "${host}" in done export PATH="$ac_TEMP_PATH" unset ac_TEMP_PATH + DEFAULT_STD_FLAG=no ;; powerpc-*-darwin* ) @@ -331,6 +333,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 +345,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* ) @@ -609,16 +613,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 @@ -769,6 +773,7 @@ else 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 @@ -785,6 +790,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 @@ -803,7 +813,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+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) +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]) @@ -815,7 +825,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) -WX_ARG_ENABLE(gtk2, [ --disable-gtk2 use GTK+ 1.2 instead of 2.0], wxUSE_GTK2) +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) @@ -1213,6 +1223,7 @@ if test "$wxUSE_WINE" = "yes"; then wxUSE_SHARED=no fi + if test "$wxUSE_GUI" = "yes"; then if test "$USE_BEOS" = 1; then @@ -1220,11 +1231,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 @@ -1233,6 +1252,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 @@ -1260,6 +1284,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 @@ -1269,6 +1300,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]]"` @@ -1760,8 +1795,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 @@ -1776,6 +1811,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], @@ -2410,6 +2450,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) @@ -2580,16 +2631,20 @@ if test "$wxUSE_GUI" = "yes"; then GTK_MODULES=gthread fi - dnl note that if we fail to find GTK2 we abort and don't fall - dnl back to GTK1.x + 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) - else - AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES) + fi + + 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 @@ -2621,10 +2676,12 @@ if test "$wxUSE_GUI" = "yes"; then 1.2.3) WXGTK12=1 ;; *) AC_MSG_ERROR([ -Please check that gtk-config is in path, the directory -where GTK+ libraries are installed (returned by -'gtk-config --libs' command) is in LD_LIBRARY_PATH or -equivalent variable and GTK+ is version 1.2.3 or above. +The development files for GTK+ were not found. For GTK+ 2, please +ensure that pkg-config is in the path and that gtk+-2.0.pc is +installed. For GTK+ 1.2 please check that gtk-config is in the path, +and that the version is 1.2.3 or above. Also check that the +libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config +--libs' are in the LD_LIBRARY_PATH or equivalent. ]) ;; esac @@ -3596,11 +3653,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" @@ -3721,7 +3778,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 @@ -4708,6 +4765,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 @@ -4753,7 +4812,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 @@ -4811,13 +4870,15 @@ 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 + AC_CHECK_HEADERS([sys/soundcard.h],, + [DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia"]) +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], [ @@ -4913,7 +4974,9 @@ if test "$wxUSE_DEBUGREPORT" = "yes"; then 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 @@ -6808,8 +6871,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