qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
@ 2014-05-17 14:29 Stefan Weil
  2014-05-19  6:19 ` Gerd Hoffmann
  2014-05-19  7:49 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Weil @ 2014-05-17 14:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil

The configure option --with-gtkabi=3.0 is still supported, but no longer
needed when GTK+-2.0 is missing. When no GTK+ ABI is selected by the
user, configure first tries 2.0, then 3.0.

For some platforms (e.g. Windows) newer binaries of GTK+ are only
available for GTK+ 3.0. Now building on these platforms is a little bit
easier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 configure |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 605a0ec..678a106 100755
--- a/configure
+++ b/configure
@@ -317,7 +317,7 @@ glusterfs_discard="no"
 glusterfs_zerofill="no"
 virtio_blk_data_plane=""
 gtk=""
-gtkabi="2.0"
+gtkabi=""
 vte=""
 tpm="no"
 libssh2=""
@@ -1970,6 +1970,18 @@ fi
 ##########################################
 # GTK probe
 
+if test "$gtkabi" = ""; then
+    # The GTK ABI was not specified explicitly, so try whether 2.0 is available.
+    # Use 3.0 as a fallback if that is available.
+    if $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
+        gtkabi=2.0
+    elif $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
+        gtkabi=3.0
+    else
+        gtkabi=2.0
+    fi
+fi
+
 if test "$gtk" != "no"; then
     gtkpackage="gtk+-$gtkabi"
     if test "$gtkabi" = "3.0" ; then
@@ -1983,7 +1995,7 @@ if test "$gtk" != "no"; then
         libs_softmmu="$gtk_libs $libs_softmmu"
         gtk="yes"
     elif test "$gtk" = "yes"; then
-        feature_not_found "gtk" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel"
+        feature_not_found "gtk" "Install gtk2 or gtk3 devel"
     else
         gtk="no"
     fi
@@ -2006,7 +2018,11 @@ if test "$vte" != "no"; then
         libs_softmmu="$vte_libs $libs_softmmu"
         vte="yes"
     elif test "$vte" = "yes"; then
-        feature_not_found "vte" "Install libvte or libvte-2.90 (requires --with-gtkabi=3.0 option to configure) devel"
+        if test "$gtkabi" = "3.0"; then
+            feature_not_found "vte" "Install libvte-2.90 devel"
+        else
+            feature_not_found "vte" "Install libvte devel"
+        fi
     else
         vte="no"
     fi
-- 
1.7.10.4

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

* Re: [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  2014-05-17 14:29 [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable Stefan Weil
@ 2014-05-19  6:19 ` Gerd Hoffmann
  2014-05-19  7:38   ` Stefan Weil
  2014-05-19  7:49 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  1 sibling, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2014-05-19  6:19 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel

  Hi,

> +if test "$gtkabi" = ""; then
> +    # The GTK ABI was not specified explicitly, so try whether 2.0 is available.
> +    # Use 3.0 as a fallback if that is available.
> +    if $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
> +        gtkabi=2.0
> +    elif $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
> +        gtkabi=3.0
> +    else
> +        gtkabi=2.0
> +    fi
> +fi

Shouldn't we probe for gtk3 first?

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  2014-05-19  6:19 ` Gerd Hoffmann
@ 2014-05-19  7:38   ` Stefan Weil
  2014-05-19  7:57     ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Weil @ 2014-05-19  7:38 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-trivial, qemu-devel

Am 19.05.2014 08:19, schrieb Gerd Hoffmann:
>   Hi,
>
>> +if test "$gtkabi" = ""; then
>> +    # The GTK ABI was not specified explicitly, so try whether 2.0 is available.
>> +    # Use 3.0 as a fallback if that is available.
>> +    if $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
>> +        gtkabi=2.0
>> +    elif $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
>> +        gtkabi=3.0
>> +    else
>> +        gtkabi=2.0
>> +    fi
>> +fi
> Shouldn't we probe for gtk3 first?
>
> cheers,
>   Gerd

That sounds reasonable, but would result in a non trivial change for all
developers who build on a system with both GTK versions. I tried to
preserve the current default (2.0) as far as possible.

Stefan

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  2014-05-17 14:29 [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable Stefan Weil
  2014-05-19  6:19 ` Gerd Hoffmann
@ 2014-05-19  7:49 ` Michael Tokarev
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2014-05-19  7:49 UTC (permalink / raw)
  To: Stefan Weil, qemu-devel; +Cc: qemu-trivial

17.05.2014 18:29, Stefan Weil wrote:
> The configure option --with-gtkabi=3.0 is still supported, but no longer
> needed when GTK+-2.0 is missing. When no GTK+ ABI is selected by the
> user, configure first tries 2.0, then 3.0.
> 
> For some platforms (e.g. Windows) newer binaries of GTK+ are only
> available for GTK+ 3.0. Now building on these platforms is a little bit
> easier.

This is something I wanted to do for a long time (but before I disabled
gtk entirely :).

Applied to -trivial, thank you!

/mjt

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

* Re: [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  2014-05-19  7:38   ` Stefan Weil
@ 2014-05-19  7:57     ` Gerd Hoffmann
  0 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2014-05-19  7:57 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, qemu-devel

  Hi,

> > Shouldn't we probe for gtk3 first?

> That sounds reasonable, but would result in a non trivial change for all
> developers who build on a system with both GTK versions. I tried to
> preserve the current default (2.0) as far as possible.

The differences between gtk2 + gtk3 are not that big, I don't expect
much trouble from it.  Not sure why we have gtk2 as default, I guess
it's because gtk3 wasn't widely used yet when gtk3 support was initially
added.  That has changed meanwhile, and with auto-fallback-to-2.0 it's a
moot point anyway.

cheers,
  Gerd

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

end of thread, other threads:[~2014-05-19  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-17 14:29 [Qemu-devel] [PATCH] configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable Stefan Weil
2014-05-19  6:19 ` Gerd Hoffmann
2014-05-19  7:38   ` Stefan Weil
2014-05-19  7:57     ` Gerd Hoffmann
2014-05-19  7:49 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

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).