Define __WXGTK220__ in configure and improve checks for GTK+ version.
Use AC_CACHE_CHECK() to avoid recompiling the test program(s) every time configure runs and also simplify the checks. This required renaming ac_wxgtkXXX to wx_cv_gtkXXX (cached variables must have "cv" in them). Also make the checks more logical, by simply setting wx_cv_gtkXXX if wx_cv_gtkYYY is set with XXX < YYY. Finally, and the real reason for these changes, add test for __WXGTK220__ which will be used by the upcoming commits to check whether GtkSpinner is available.
This commit is contained in:
99
configure
vendored
99
configure
vendored
@@ -24315,6 +24315,8 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if test "$WXGTK3" = 1; then
|
if test "$WXGTK3" = 1; then
|
||||||
|
$as_echo "#define __WXGTK220__ 1" >>confdefs.h
|
||||||
|
|
||||||
$as_echo "#define __WXGTK218__ 1" >>confdefs.h
|
$as_echo "#define __WXGTK218__ 1" >>confdefs.h
|
||||||
|
|
||||||
$as_echo "#define __WXGTK210__ 1" >>confdefs.h
|
$as_echo "#define __WXGTK210__ 1" >>confdefs.h
|
||||||
@@ -24325,8 +24327,53 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
|
CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
|
||||||
LIBS="$LIBS $wx_cv_libs_gtk"
|
LIBS="$LIBS $wx_cv_libs_gtk"
|
||||||
|
|
||||||
|
|
||||||
|
{ $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
|
||||||
|
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
#if !GTK_CHECK_VERSION(2,20,0)
|
||||||
|
Not GTK+ 2.20
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"; then :
|
||||||
|
wx_cv_gtk220=yes
|
||||||
|
else
|
||||||
|
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 "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.18" >&5
|
||||||
$as_echo_n "checking if GTK+ is version >= 2.18... " >&6; }
|
$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
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
@@ -24345,27 +24392,29 @@ main ()
|
|||||||
}
|
}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
if ac_fn_c_try_compile "$LINENO"; then :
|
if ac_fn_c_try_compile "$LINENO"; then :
|
||||||
|
wx_cv_gtk218=yes
|
||||||
$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
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
wx_cv_gtk218=no
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
|
||||||
$as_echo "no" >&6; }
|
|
||||||
ac_wxgtk218=0
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
if test "$ac_wxgtk218" = 0; then
|
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 "$as_me:${as_lineno-$LINENO}: checking if GTK+ is version >= 2.10" >&5
|
||||||
$as_echo_n "checking if GTK+ is version >= 2.10... " >&6; }
|
$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
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
@@ -24384,21 +24433,21 @@ main ()
|
|||||||
}
|
}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
if ac_fn_c_try_compile "$LINENO"; then :
|
if ac_fn_c_try_compile "$LINENO"; then :
|
||||||
|
wx_cv_gtk210=yes
|
||||||
$as_echo "#define __WXGTK210__ 1" >>confdefs.h
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
|
||||||
$as_echo "yes" >&6; }
|
|
||||||
ac_wxgtk210=1
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
wx_cv_gtk210=no
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
|
||||||
$as_echo "no" >&6; }
|
|
||||||
ac_wxgtk210=0
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
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
|
fi
|
||||||
|
|
||||||
CFLAGS="$save_CFLAGS"
|
CFLAGS="$save_CFLAGS"
|
||||||
|
64
configure.in
64
configure.in
@@ -2785,6 +2785,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if test "$WXGTK3" = 1; then
|
if test "$WXGTK3" = 1; then
|
||||||
|
AC_DEFINE(__WXGTK220__)
|
||||||
AC_DEFINE(__WXGTK218__)
|
AC_DEFINE(__WXGTK218__)
|
||||||
AC_DEFINE(__WXGTK210__)
|
AC_DEFINE(__WXGTK210__)
|
||||||
elif test "$WXGTK2" = 1; then
|
elif test "$WXGTK2" = 1; then
|
||||||
@@ -2793,8 +2794,31 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
|
CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
|
||||||
LIBS="$LIBS $wx_cv_libs_gtk"
|
LIBS="$LIBS $wx_cv_libs_gtk"
|
||||||
|
|
||||||
dnl test if we have at least GTK+ 2.18:
|
dnl We need to define __WXGTK2xx__ symbols for a few specific
|
||||||
AC_MSG_CHECKING([if GTK+ is version >= 2.18])
|
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.
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([if GTK+ is version >= 2.20], wx_cv_gtk220, [
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
],
|
||||||
|
[
|
||||||
|
#if !GTK_CHECK_VERSION(2,20,0)
|
||||||
|
Not GTK+ 2.20
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
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([
|
AC_TRY_COMPILE([
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
],
|
],
|
||||||
@@ -2803,20 +2827,17 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
Not GTK+ 2.18
|
Not GTK+ 2.18
|
||||||
#endif
|
#endif
|
||||||
],
|
],
|
||||||
[
|
wx_cv_gtk218=yes,
|
||||||
AC_DEFINE(__WXGTK218__)
|
wx_cv_gtk218=no
|
||||||
AC_DEFINE(__WXGTK210__)
|
)
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
ac_wxgtk218=1
|
|
||||||
],
|
|
||||||
[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
ac_wxgtk218=0
|
|
||||||
])
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$ac_wxgtk218" = 0; then
|
if test "$wx_cv_gtk218" = "yes"; then
|
||||||
dnl test if we have at least GTK+ 2.10:
|
AC_DEFINE(__WXGTK218__)
|
||||||
AC_MSG_CHECKING([if GTK+ is version >= 2.10])
|
wx_cv_gtk210=yes
|
||||||
|
else
|
||||||
|
AC_CACHE_CHECK([if GTK+ is version >= 2.10], wx_cv_gtk210, [
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
],
|
],
|
||||||
@@ -2825,17 +2846,16 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
Not GTK+ 2.10
|
Not GTK+ 2.10
|
||||||
#endif
|
#endif
|
||||||
],
|
],
|
||||||
[
|
wx_cv_gtk210=yes,
|
||||||
AC_DEFINE(__WXGTK210__)
|
wx_cv_gtk210=no
|
||||||
AC_MSG_RESULT([yes])
|
)
|
||||||
ac_wxgtk210=1
|
|
||||||
],
|
|
||||||
[
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
ac_wxgtk210=0
|
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$wx_cv_gtk210" = "yes"; then
|
||||||
|
AC_DEFINE(__WXGTK210__)
|
||||||
|
fi
|
||||||
|
|
||||||
CFLAGS="$save_CFLAGS"
|
CFLAGS="$save_CFLAGS"
|
||||||
LIBS="$save_LIBS"
|
LIBS="$save_LIBS"
|
||||||
else
|
else
|
||||||
|
@@ -65,6 +65,9 @@
|
|||||||
/* Define this if your version of GTK+ is greater than 2.18 */
|
/* Define this if your version of GTK+ is greater than 2.18 */
|
||||||
#undef __WXGTK218__
|
#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 */
|
/* Define this if your version of GTK+ is >= 3.0 */
|
||||||
#undef __WXGTK3__
|
#undef __WXGTK3__
|
||||||
|
|
||||||
|
@@ -101,6 +101,9 @@
|
|||||||
/* Define this if your version of GTK+ is greater than 2.18 */
|
/* Define this if your version of GTK+ is greater than 2.18 */
|
||||||
#undef __WXGTK218__
|
#undef __WXGTK218__
|
||||||
|
|
||||||
|
/* Define this if your version of GTK+ is greater than 2.20 */
|
||||||
|
#undef __WXGTK220__
|
||||||
|
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
typedef pid_t GPid;
|
typedef pid_t GPid;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user