[Spice-devel] [PATCH spice-gtk 2/5] build-sys: detect GDBus

Marc-André Lureau marcandre.lureau at gmail.com
Thu Feb 6 04:55:52 PST 2014


From: Marc-André Lureau <marcandre.lureau at redhat.com>

---
 configure.ac | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index d838bb6..6ab4c15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,8 +249,8 @@ PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.10.0 $gio_os)
 AC_SUBST(GIO_CFLAGS)
 AC_SUBST(GIO_LIBS)
 
-PKG_CHECK_EXISTS([gio-2.0 >= 2.26], [have_gproxy=yes])
-AM_CONDITIONAL([WITH_GPROXY], [test "x$have_gproxy" = "xyes"])
+PKG_CHECK_EXISTS([gio-2.0 >= 2.26], [have_gio26=yes])
+AM_CONDITIONAL([WITH_GPROXY], [test "x$have_gio26" = "xyes"])
 
 PKG_CHECK_MODULES(CAIRO, cairo >= 1.2.0)
 AC_SUBST(CAIRO_CFLAGS)
@@ -652,16 +652,20 @@ AC_ARG_ENABLE([dbus],
   [],
   [enable_dbus="auto"])
 
+have_dbus=no
 if test "x$enable_dbus" != "xno"; then
-  PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1],
-                                 [have_dbus=yes],
-                                 [have_dbus=no])
-  if test "x$enable_dbus" = "xyes" && test "x$have_dbus" = "xno"; then
-    AC_MSG_ERROR([D-Bus support explicitly requested, but some required packages are not available])
+  if test "x$have_gio26" = "xyes"; then
+    AC_DEFINE(USE_GDBUS, [1], [Define if supporting gdbus])
+    have_dbus=gdbus
+  else
+    PKG_CHECK_EXISTS([DBUS_GLIB], [dbus-glib-1], [
+      AC_DEFINE(USE_DBUS_GLIB, [1], [Define if supporting dbus-glib])
+      have_dbus=dbus-glib
+    ])
   fi
 
-  if test "x$have_dbus" = "xyes"; then
-    AC_DEFINE(USE_DBUS_GLIB, [1], [Define if supporting dbus])
+  if test "x$enable_dbus" = "xyes" && test "x$have_dbus" = "xno"; then
+    AC_MSG_ERROR([D-Bus support explicitly requested, but some required packages are not available])
   fi
 fi
 
@@ -730,6 +734,7 @@ AC_MSG_NOTICE([
         Smartcard support:        ${have_smartcard}
         USB redirection support:  ${have_usbredir} ${with_usbredir_hotplug}
         Gtk:                      $GTK_API_VERSION
+        DBus:                     ${have_dbus}
 
         Now type 'make' to build $PACKAGE
 
-- 
1.8.4.2



More information about the Spice-devel mailing list