From patchwork Fri Feb 22 14:41:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 222536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6CA72C0090 for ; Sat, 23 Feb 2013 01:42:34 +1100 (EST) Received: from localhost ([::1]:56406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8tpY-00082O-To for incoming@patchwork.ozlabs.org; Fri, 22 Feb 2013 09:42:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8tpM-0007j2-Kq for qemu-devel@nongnu.org; Fri, 22 Feb 2013 09:42:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8tpB-0002ao-PH for qemu-devel@nongnu.org; Fri, 22 Feb 2013 09:42:20 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:57956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8tpB-0002ZJ-8M for qemu-devel@nongnu.org; Fri, 22 Feb 2013 09:42:09 -0500 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 23 Feb 2013 00:38:00 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 23 Feb 2013 00:37:58 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 61CF9357804E for ; Sat, 23 Feb 2013 01:41:54 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1METVjV51904678 for ; Sat, 23 Feb 2013 01:29:32 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1MEfr0w019366 for ; Sat, 23 Feb 2013 01:41:53 +1100 Received: from titi.austin.rr.com (sig-9-49-153-3.mts.ibm.com [9.49.153.3]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1MEfpfr019323; Sat, 23 Feb 2013 01:41:52 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2013 08:41:42 -0600 Message-Id: <1361544102-9359-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13022214-1396-0000-0000-0000029460F5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.147 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH] ui/gtk: require at least GTK 2.18 and VTE 0.26 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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"