From: Peter Xu <pet...@redhat.com>

We don't need to detect GTK ABI if GTK is disabled in general.
Otherwise we could get this warning (when host is installed with GTK ABI
version 2) even when configure with "--disable-gtk":

    WARNING: Use of GTK 2.0 is deprecated and will be removed in
    WARNING: future releases. Please switch to using GTK 3.0

CC: Paolo Bonzini <pbonz...@redhat.com>
CC: Gerd Hoffmann <kra...@redhat.com>
CC: Peter Maydell <peter.mayd...@linaro.org>
CC: Fam Zheng <f...@redhat.com>
CC: "Philippe Mathieu-Daudé" <f4...@amsat.org>
Signed-off-by: Peter Xu <pet...@redhat.com>
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com>
Message-id: 20180409082323.29575-1-pet...@redhat.com
Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
 configure | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 752dd9ef32..931d2a07cc 100755
--- a/configure
+++ b/configure
@@ -2540,19 +2540,18 @@ fi
 ##########################################
 # GTK probe
 
-if test "$gtkabi" = ""; then
-    # The GTK ABI was not specified explicitly, so try whether 3.0 is 
available.
-    # Use 2.0 as a fallback if that is available.
-    if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
-        gtkabi=3.0
-    elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
-        gtkabi=2.0
-    else
-        gtkabi=3.0
-    fi
-fi
-
 if test "$gtk" != "no"; then
+    if test "$gtkabi" = ""; then
+        # The GTK ABI was not specified explicitly, so try whether 3.0 is 
available.
+        # Use 2.0 as a fallback if that is available.
+        if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
+            gtkabi=3.0
+        elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
+            gtkabi=2.0
+        else
+            gtkabi=3.0
+        fi
+    fi
     gtkpackage="gtk+-$gtkabi"
     gtkx11package="gtk+-x11-$gtkabi"
     if test "$gtkabi" = "3.0" ; then
-- 
2.9.3


Reply via email to