diff --git a/configure b/configure index ed4e4a4ce5..ec73c2b1d0 100755 --- a/configure +++ b/configure @@ -24315,6 +24315,8 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config esac if test "$WXGTK3" = 1; then + $as_echo "#define __WXGTK220__ 1" >>confdefs.h + $as_echo "#define __WXGTK218__ 1" >>confdefs.h $as_echo "#define __WXGTK210__ 1" >>confdefs.h @@ -24325,47 +24327,13 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config CFLAGS="$wx_cv_cflags_gtk $CFLAGS" LIBS="$LIBS $wx_cv_libs_gtk" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.18" >&5 -$as_echo_n "checking if GTK+ is version >= 2.18... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - #if !GTK_CHECK_VERSION(2,18,0) - Not GTK+ 2.18 - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define __WXGTK218__ 1" >>confdefs.h - - $as_echo "#define __WXGTK210__ 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_wxgtk218=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.20" >&5 +$as_echo_n "checking if GTK+ is version >= 2.20... " >&6; } +if ${wx_cv_gtk220+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_wxgtk218=0 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test "$ac_wxgtk218" = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.10" >&5 -$as_echo_n "checking if GTK+ is version >= 2.10... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24375,8 +24343,8 @@ int main () { - #if !GTK_CHECK_VERSION(2,10,0) - Not GTK+ 2.10 + #if !GTK_CHECK_VERSION(2,20,0) + Not GTK+ 2.20 #endif ; @@ -24384,21 +24352,102 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define __WXGTK210__ 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_wxgtk210=1 - + wx_cv_gtk220=yes else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_wxgtk210=0 + wx_cv_gtk220=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_gtk220" >&5 +$as_echo "$wx_cv_gtk220" >&6; } + + if test "$wx_cv_gtk220" = "yes"; then + $as_echo "#define __WXGTK220__ 1" >>confdefs.h + + wx_cv_gtk218=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.18" >&5 +$as_echo_n "checking if GTK+ is version >= 2.18... " >&6; } +if ${wx_cv_gtk218+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + #if !GTK_CHECK_VERSION(2,18,0) + Not GTK+ 2.18 + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + wx_cv_gtk218=yes +else + wx_cv_gtk218=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_gtk218" >&5 +$as_echo "$wx_cv_gtk218" >&6; } + fi + + if test "$wx_cv_gtk218" = "yes"; then + $as_echo "#define __WXGTK218__ 1" >>confdefs.h + + wx_cv_gtk210=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.10" >&5 +$as_echo_n "checking if GTK+ is version >= 2.10... " >&6; } +if ${wx_cv_gtk210+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + #if !GTK_CHECK_VERSION(2,10,0) + Not GTK+ 2.10 + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + wx_cv_gtk210=yes +else + wx_cv_gtk210=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_gtk210" >&5 +$as_echo "$wx_cv_gtk210" >&6; } + fi + + if test "$wx_cv_gtk210" = "yes"; then + $as_echo "#define __WXGTK210__ 1" >>confdefs.h + fi CFLAGS="$save_CFLAGS" diff --git a/configure.in b/configure.in index 5be016ab7a..208f03896c 100644 --- a/configure.in +++ b/configure.in @@ -2785,6 +2785,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config esac if test "$WXGTK3" = 1; then + AC_DEFINE(__WXGTK220__) AC_DEFINE(__WXGTK218__) AC_DEFINE(__WXGTK210__) elif test "$WXGTK2" = 1; then @@ -2793,47 +2794,66 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config CFLAGS="$wx_cv_cflags_gtk $CFLAGS" LIBS="$LIBS $wx_cv_libs_gtk" - dnl test if we have at least GTK+ 2.18: - AC_MSG_CHECKING([if GTK+ is version >= 2.18]) - AC_TRY_COMPILE([ - #include - ], - [ - #if !GTK_CHECK_VERSION(2,18,0) - Not GTK+ 2.18 - #endif - ], - [ - AC_DEFINE(__WXGTK218__) - AC_DEFINE(__WXGTK210__) - AC_MSG_RESULT([yes]) - ac_wxgtk218=1 - ], - [ - AC_MSG_RESULT([no]) - ac_wxgtk218=0 - ]) + dnl We need to define __WXGTK2xx__ symbols for a few specific + dnl versions in order to be able to test for them (and hence for + dnl the availability of the controls which appeared only in these + dnl versions) from our public headers, without having to include + dnl gtk/gtk.h from them. - if test "$ac_wxgtk218" = 0; then - dnl test if we have at least GTK+ 2.10: - AC_MSG_CHECKING([if GTK+ is version >= 2.10]) + AC_CACHE_CHECK([if GTK+ is version >= 2.20], wx_cv_gtk220, [ AC_TRY_COMPILE([ #include ], [ - #if !GTK_CHECK_VERSION(2,10,0) - Not GTK+ 2.10 + #if !GTK_CHECK_VERSION(2,20,0) + Not GTK+ 2.20 #endif ], - [ - AC_DEFINE(__WXGTK210__) - AC_MSG_RESULT([yes]) - ac_wxgtk210=1 - ], - [ - AC_MSG_RESULT([no]) - ac_wxgtk210=0 - ]) + wx_cv_gtk220=yes, + wx_cv_gtk220=no + ) + ]) + + if test "$wx_cv_gtk220" = "yes"; then + AC_DEFINE(__WXGTK220__) + wx_cv_gtk218=yes + else + AC_CACHE_CHECK([if GTK+ is version >= 2.18], wx_cv_gtk218, [ + AC_TRY_COMPILE([ + #include + ], + [ + #if !GTK_CHECK_VERSION(2,18,0) + Not GTK+ 2.18 + #endif + ], + wx_cv_gtk218=yes, + wx_cv_gtk218=no + ) + ]) + fi + + if test "$wx_cv_gtk218" = "yes"; then + AC_DEFINE(__WXGTK218__) + wx_cv_gtk210=yes + else + AC_CACHE_CHECK([if GTK+ is version >= 2.10], wx_cv_gtk210, [ + AC_TRY_COMPILE([ + #include + ], + [ + #if !GTK_CHECK_VERSION(2,10,0) + Not GTK+ 2.10 + #endif + ], + wx_cv_gtk210=yes, + wx_cv_gtk210=no + ) + ]) + fi + + if test "$wx_cv_gtk210" = "yes"; then + AC_DEFINE(__WXGTK210__) fi CFLAGS="$save_CFLAGS" diff --git a/setup.h.in b/setup.h.in index 9b49054473..1aec146871 100644 --- a/setup.h.in +++ b/setup.h.in @@ -65,6 +65,9 @@ /* Define this if your version of GTK+ is greater than 2.18 */ #undef __WXGTK218__ +/* Define this if your version of GTK+ is greater than 2.20 */ +#undef __WXGTK220__ + /* Define this if your version of GTK+ is >= 3.0 */ #undef __WXGTK3__ diff --git a/setup.h_vms b/setup.h_vms index 62e5640eef..37cdd8b9cc 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -101,6 +101,9 @@ /* Define this if your version of GTK+ is greater than 2.18 */ #undef __WXGTK218__ +/* Define this if your version of GTK+ is greater than 2.20 */ +#undef __WXGTK220__ + #include typedef pid_t GPid;