This gives us the bare amount of features we need. We can add work arounds for older versions and lower the requirement but this should be a good starting point.
Signed-off-by: Anthony Liguori <[email protected]> --- configure | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 0dadd31..259fa7d 100755 --- a/configure +++ b/configure @@ -1640,18 +1640,51 @@ if test "$sparse" != "no" ; then fi fi +gtk_check_version() +{ + version="$1" + major="$2" + minor="$3" + release="$4" + + a=`echo $version | cut -f1 -d.` + b=`echo $version | cut -f2 -d.` + c=`echo $version | cut -f3 -d.` + + if test $a != $major; then + return 1 + elif test $b -lt $minor; then + return 1 + elif test $b = $minor -a $c -lt $release; then + return 1 + fi + + return 0 +} + ########################################## # GTK probe if test "$gtk" != "no"; then if $pkg_config gtk+-2.0 --modversion >/dev/null 2>/dev/null && \ $pkg_config vte --modversion >/dev/null 2>/dev/null; then - gtk_cflags=`$pkg_config --cflags gtk+-2.0 2>/dev/null` - gtk_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null` - vte_cflags=`$pkg_config --cflags vte 2>/dev/null` - vte_libs=`$pkg_config --libs vte 2>/dev/null` - libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" - gtk="yes" + gtk_version=`$pkg_config --modversion gtk+-2.0` + vte_version=`$pkg_config --modversion vte` + + if gtk_check_version $gtk_version 2 18 0 && + gtk_check_version $vte_version 0 26 0; then + gtk_cflags=`$pkg_config --cflags gtk+-2.0 2>/dev/null` + gtk_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null` + vte_cflags=`$pkg_config --cflags vte 2>/dev/null` + vte_libs=`$pkg_config --libs vte 2>/dev/null` + libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" + gtk="yes" + else + if test "$gtk" = "yes" ; then + feature_not_found "gtk" + fi + gtk="no" + fi else if test "$gtk" = "yes" ; then feature_not_found "gtk" -- 1.8.0
