[Spice-devel] [spice-gtk Win32 v3 06/12] Windows mingw: usb: configure.ac: do not require GUDEV for USBREDIR

Uri Lublin uril at redhat.com
Wed Jun 27 18:46:35 PDT 2012


For windows GUDEV is not required
For Linux GUDEV is checked as a part of USBREDIR block, but
as a separate check.
---
 configure.ac    |   15 ++++++++++++++-
 gtk/Makefile.am |    2 ++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 09129b7..d928f1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -343,7 +343,7 @@ if test "x$enable_usbredir" = "xno"; then
   have_usbredir="no"
 else
   PKG_CHECK_MODULES([USBREDIR],
-                    [gudev-1.0 libusb-1.0 >= 1.0.9 libusbredirhost >= 0.4.2 libusbredirparser >= 0.4],
+                    [libusb-1.0 >= 1.0.9 libusbredirhost >= 0.4.2 libusbredirparser >= 0.4],
                     [have_usbredir=yes],
                     [have_usbredir=no])
   if test "x$have_usbredir" = "xno" && test "x$enable_usbredir" = "xyes"; then
@@ -352,6 +352,19 @@ else
   if test "x$have_usbredir" = "xyes"; then
     AC_DEFINE(USE_USBREDIR, [1], [Define if supporting usbredir proxying])
   fi
+
+  # Require gudev for non-windows
+  if test "x$os_win32" = "xno"; then
+    PKG_CHECK_MODULES([GUDEV],
+                      [gudev-1.0],
+                      [have_gudev=yes],
+                      [have_gudev=no])
+
+    if test "x$have_usbredir" = "xyes" && test "x$have_gudev" = "xno"; then
+      AC_MSG_ERROR([usbredir requested but required gudev is not available])
+    fi
+    AC_DEFINE(USE_GUDEV, [1], [Define if supporting gudev])
+  fi
 fi
 AM_CONDITIONAL([WITH_USBREDIR], [test "x$have_usbredir" = "xyes"])

diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index e79abae..0cf5952 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -82,6 +82,7 @@ SPICE_COMMON_CPPFLAGS =						\
 	$(GST_CFLAGS)						\
 	$(SMARTCARD_CFLAGS)					\
 	$(USBREDIR_CFLAGS)					\
+	$(GUDEV_CFLAGS)						\
 	$(NULL)

 AM_CPPFLAGS =					\
@@ -179,6 +180,7 @@ libspice_client_glib_2_0_la_LIBADD =					\
 	$(SASL_LIBS)							\
 	$(SMARTCARD_LIBS)						\
 	$(USBREDIR_LIBS)						\
+	$(GUDEV_LIBS)							\
 	$(NULL)

 if WITH_POLKIT
-- 
1.7.7.6



More information about the Spice-devel mailing list