Skip to contentSkip to conversation

gtk: cleanup backend dependencies

PATCH In review Gerd Hoffmann 3 participants 3 messages Jun 2, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gtk: cleanup backend dependencies

Make configure detect gtk x11 backend and link libX11 then. Make gtk backend specific code properly #ifdef'ed on the GTK_WINDOWING_* backends at runtime). Our gtk ui code should build and run fine on any platform now.

This also fixes the linker failute due to the new XkbGetKeyboard call added by commit 3158a3482b0093e41f2b2596fba50774ea31ae08.

Cc Richard Henderson <[email protected]>
---
 configure |  4 +++
 ui/gtk.c  | 97 ++++++++++++++++++++++++++++++++++++---------------------------
 2 files changed, 60 insertions(+), 41 deletions(-)
configure +4 -0
index 0e516f9..871452e 100755
@@ -1986,6 +1986,7 @@ fi
 
 if test "$gtk" != "no"; then
     gtkpackage="gtk+-$gtkabi"
+    gtkx11package="gtk+-x11-$gtkabi"
     if test "$gtkabi" = "3.0" ; then
       gtkversion="3.0.0"
     else
@@ -1996,6 +1997,9 @@ if test "$gtk" != "no"; then
         gtk_libs=`$pkg_config --libs $gtkpackage`
         libs_softmmu="$gtk_libs $libs_softmmu"
         gtk="yes"
+        if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
+            gtk_libs="$gtk_libs -lX11"
+        fi
     elif test "$gtk" = "yes"; then
         feature_not_found "gtk" "Install gtk2 or gtk3 devel"
     else
ui/gtk.c +56 -41

129 lines not on this page · raw message

Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Gerd Hoffmann

Make configure detect gtk x11 backend and link libX11 then. Make gtk backend specific code properly #ifdef'ed on the GTK_WINDOWING_* backends at runtime). Our gtk ui code should build and run fine on any platform now.

This also fixes the linker failute due to the new XkbGetKeyboard call added by commit 3158a3482b0093e41f2b2596fba50774ea31ae08.

Quoted 6 lines
Cc Richard Henderson <[email protected]>
---
 configure |  4 +++
 ui/gtk.c  | 97 ++++++++++++++++++++++++++++++++++++---------------------------
 2 files changed, 60 insertions(+), 41 deletions(-)

Looks good.

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#2 lore raw
In reply to Gerd Hoffmann

configure if test "$gtk" != "no"; then · line 2002

Quoted 7 lines · Gerd Hoffmann
configure +3 -0
@@ -1996,6 +1997,9 @@ if test "$gtk" != "no"; then
         gtk_libs=`$pkg_config --libs $gtkpackage`
         libs_softmmu="$gtk_libs $libs_softmmu"
         gtk="yes"
+        if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
+            gtk_libs="$gtk_libs -lX11"
+        fi

You need to move this hunk above the libs_softmmu line, otherwise the assignment is unused.

r~