summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-07-04 17:10:27 +0200
committerHans de Goede <hdegoede@redhat.com>2013-07-05 12:39:30 +0200
commit53874127d2815250acff8b43916d36a3b903102e (patch)
treef8f461b631be2637562733c88d9a8fb1d604e859 /configure.ac
parent45cfbe8f86ce9808e951bc1117c7ad6d91ed20d9 (diff)
usb-device-manager: Add support for libusb hotplug API
For now this makes the usb-code even more of a #ifdef party (albeit only slightly so). But it does give us (theoretical, untested) usb support on Mac OS X, and once the libusb Windows backend also gets hotplug support, we can bump the required libusb version to a new enough one, and drop both the windows gudev emulation as well as the gudev code-paths. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac41
1 files changed, 27 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index bd59ccf..11f11fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -367,21 +367,34 @@ else
if test "x$have_usbredir" = "xno" && test "x$enable_usbredir" = "xyes"; then
AC_MSG_ERROR([usbredir support explicitly requested, but some required packages are not available])
fi
- 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])
+ # On non windows we need either libusb hotplug support or gudev
+ if test "x$have_usbredir" = "xyes" && test "x$os_win32" = "xno"; then
+ PKG_CHECK_MODULES([LIBUSB_HOTPLUG], [libusb-1.0 >= 1.0.16],
+ [have_libusb_hotplug=yes], [have_libusb_hotplug=no])
+ if test "x$have_libusb_hotplug" = "xyes"; then
+ AC_DEFINE(USE_LIBUSB_HOTPLUG, [1], [Define if libusb has hotplug support])
+ with_usbredir_hotplug="with libusb hotplug"
+ else
+ PKG_CHECK_MODULES([GUDEV],
+ [gudev-1.0],
+ [have_gudev=yes],
+ [have_gudev=no])
+
+ if test "x$have_gudev" = "xno" && test "x$enable_usbredir" = "xyes"; then
+ AC_MSG_ERROR([usbredir requested but required gudev is not available])
+ fi
+ if test "x$have_gudev" = "xyes"; then
+ AC_DEFINE(USE_GUDEV, [1], [Define if supporting gudev])
+ with_usbredir_hotplug="with gudev hotplug"
+ else
+ have_usbredir=no
+ fi
fi
- AC_DEFINE(USE_GUDEV, [1], [Define if supporting gudev])
+ fi
+
+ if test "x$have_usbredir" = "xyes"; then
+ AC_DEFINE(USE_USBREDIR, [1], [Define if supporting usbredir proxying])
fi
fi
AM_CONDITIONAL([WITH_USBREDIR], [test "x$have_usbredir" = "xyes"])
@@ -686,7 +699,7 @@ AC_MSG_NOTICE([
Target: ${red_target}
SASL support: ${enable_sasl}
Smartcard support: ${have_smartcard}
- USB redirection support: ${have_usbredir}
+ USB redirection support: ${have_usbredir} ${with_usbredir_hotplug}
Gtk: $GTK_API_VERSION
Now type 'make' to build $PACKAGE