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

Submitted by Uri Lublin on June 28, 2012, 1:46 a.m.

Details

Message ID 1340848001-7791-7-git-send-email-uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin June 28, 2012, 1:46 a.m.
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(-)

Patch hide | download patch | download mbox

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

Comments

ack, seems ok to me but can u pls remind me why needed to add 
$(GUDEV_CFLAGS/LIBS) ?

Uri Lublin wrote:
> 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
>
On 06/28/2012 09:53 AM, Arnon Gilboa wrote:
> ack, seems ok to me but can u pls remind me why needed to add 
> $(GUDEV_CFLAGS/LIBS) ?

Before the CFLAGS and LIBS of GUDEV where included in the CFLAGS and 
LIBS of USBREDIR
Now they are not, so I added them separately in Makefile.am

>
> Uri Lublin wrote:
>> 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
>