qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: don't warn GTK if disabled
@ 2018-04-09  8:23 Peter Xu
  2018-04-09  8:31 ` Daniel P. Berrangé
  2018-04-10  8:48 ` Daniel P. Berrangé
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Xu @ 2018-04-09  8:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: peterx, Paolo Bonzini, Gerd Hoffmann, Peter Maydell, Fam Zheng,
	Philippe Mathieu-Daudé

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 <pbonzini@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Fam Zheng <famz@redhat.com>
CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 configure | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 4d0e92c96c..ce67ad050e 100755
--- a/configure
+++ b/configure
@@ -2537,19 +2537,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.14.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: don't warn GTK if disabled
  2018-04-09  8:23 [Qemu-devel] [PATCH] configure: don't warn GTK if disabled Peter Xu
@ 2018-04-09  8:31 ` Daniel P. Berrangé
  2018-04-09  9:24   ` Peter Maydell
  2018-04-10  8:48 ` Daniel P. Berrangé
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel P. Berrangé @ 2018-04-09  8:31 UTC (permalink / raw)
  To: Peter Xu
  Cc: qemu-devel, Peter Maydell, Fam Zheng, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Paolo Bonzini

On Mon, Apr 09, 2018 at 04:23:23PM +0800, Peter Xu wrote:
> 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 <pbonzini@redhat.com>
> CC: Gerd Hoffmann <kraxel@redhat.com>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Fam Zheng <famz@redhat.com>
> CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  configure | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/configure b/configure
> index 4d0e92c96c..ce67ad050e 100755
> --- a/configure
> +++ b/configure
> @@ -2537,19 +2537,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

Feels to me that since we've deprecated 2.0, we could just *never* auto
detect - just do     test -z "$gtkabi" && gtkabi=3.0

Anyone who wants gtk2 should have to use an explicit --with-gtkabi=2.0

>      gtkpackage="gtk+-$gtkabi"
>      gtkx11package="gtk+-x11-$gtkabi"
>      if test "$gtkabi" = "3.0" ; then


BTW, this same problem you're fixing exists for SDL too I expect

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: don't warn GTK if disabled
  2018-04-09  8:31 ` Daniel P. Berrangé
@ 2018-04-09  9:24   ` Peter Maydell
  2018-04-09 17:37     ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2018-04-09  9:24 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Peter Xu, QEMU Developers, Fam Zheng, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Paolo Bonzini

On 9 April 2018 at 09:31, Daniel P. Berrangé <berrange@redhat.com> wrote:
> Feels to me that since we've deprecated 2.0, we could just *never* auto
> detect - just do     test -z "$gtkabi" && gtkabi=3.0
>
> Anyone who wants gtk2 should have to use an explicit --with-gtkabi=2.0

I think if we still work with gtk2 then we should go ahead and
warn-but-use it.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: don't warn GTK if disabled
  2018-04-09  9:24   ` Peter Maydell
@ 2018-04-09 17:37     ` Paolo Bonzini
  2018-04-10  5:13       ` Peter Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2018-04-09 17:37 UTC (permalink / raw)
  To: Peter Maydell, Daniel P. Berrangé
  Cc: Peter Xu, QEMU Developers, Fam Zheng, Philippe Mathieu-Daudé,
	Gerd Hoffmann

On 09/04/2018 11:24, Peter Maydell wrote:
> On 9 April 2018 at 09:31, Daniel P. Berrangé <berrange@redhat.com> wrote:
>> Feels to me that since we've deprecated 2.0, we could just *never* auto
>> detect - just do     test -z "$gtkabi" && gtkabi=3.0
>>
>> Anyone who wants gtk2 should have to use an explicit --with-gtkabi=2.0
>
> I think if we still work with gtk2 then we should go ahead and
> warn-but-use it.

Both are valid choices of course.  Since we have Peter (Xu)'s patch, I
think we should go for that and revisit in 2.13 whether to remove GTK+
2.0 support altogether, require an explicit configure argument, or leave
things as they are.

Paolo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: don't warn GTK if disabled
  2018-04-09 17:37     ` Paolo Bonzini
@ 2018-04-10  5:13       ` Peter Xu
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Xu @ 2018-04-10  5:13 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Peter Maydell, Daniel P. Berrangé, QEMU Developers,
	Fam Zheng, Philippe Mathieu-Daudé, Gerd Hoffmann

On Mon, Apr 09, 2018 at 07:37:11PM +0200, Paolo Bonzini wrote:
> On 09/04/2018 11:24, Peter Maydell wrote:
> > On 9 April 2018 at 09:31, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >> Feels to me that since we've deprecated 2.0, we could just *never* auto
> >> detect - just do     test -z "$gtkabi" && gtkabi=3.0
> >>
> >> Anyone who wants gtk2 should have to use an explicit --with-gtkabi=2.0
> >
> > I think if we still work with gtk2 then we should go ahead and
> > warn-but-use it.
> 
> Both are valid choices of course.  Since we have Peter (Xu)'s patch, I
> think we should go for that and revisit in 2.13 whether to remove GTK+
> 2.0 support altogether, require an explicit configure argument, or leave
> things as they are.

Thanks all. Please anyone let me know if a repost is needed. Otherwise
I'll keep it as is and I can try to post a similar one for SDL.

-- 
Peter Xu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: don't warn GTK if disabled
  2018-04-09  8:23 [Qemu-devel] [PATCH] configure: don't warn GTK if disabled Peter Xu
  2018-04-09  8:31 ` Daniel P. Berrangé
@ 2018-04-10  8:48 ` Daniel P. Berrangé
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2018-04-10  8:48 UTC (permalink / raw)
  To: Peter Xu
  Cc: qemu-devel, Peter Maydell, Fam Zheng, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Paolo Bonzini

On Mon, Apr 09, 2018 at 04:23:23PM +0800, Peter Xu wrote:
> 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 <pbonzini@redhat.com>
> CC: Gerd Hoffmann <kraxel@redhat.com>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Fam Zheng <famz@redhat.com>
> CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-10  8:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-09  8:23 [Qemu-devel] [PATCH] configure: don't warn GTK if disabled Peter Xu
2018-04-09  8:31 ` Daniel P. Berrangé
2018-04-09  9:24   ` Peter Maydell
2018-04-09 17:37     ` Paolo Bonzini
2018-04-10  5:13       ` Peter Xu
2018-04-10  8:48 ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).