Allow to obtain fd from USB Security Daemon
[platform/upstream/libusb.git] / configure.ac
index c00af33..7eb4628 100644 (file)
@@ -107,6 +107,16 @@ case $backend in
 linux)
        AC_DEFINE(OS_LINUX, 1, [Linux backend])
        AC_SUBST(OS_LINUX)
+       AC_ARG_ENABLE([usd],
+               [AC_HELP_STRING([--enable-usd], [Use USB security daemon to obtain dev node fds [default=no]])],
+               [], [enable_usd="no"])
+       if test "x$enable_usd" = "xyes"; then
+          PKG_CHECK_MODULES([USD], [capi-system-usbhost-usd])
+          AC_DEFINE(USE_USD, 1, [Use USB security daemon to obtain dev node fds])
+       fi
+
+       AC_SUBST(USE_USD)
+
        AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)
        AC_ARG_ENABLE([udev],
                [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])],
@@ -213,6 +223,7 @@ AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix)
 AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes")
 AM_CONDITIONAL(USE_UDEV, test "x$enable_udev" = xyes)
 AM_CONDITIONAL(USE_USBDK, test "x$enable_usbdk" = xyes)
+AM_CONDITIONAL(USE_USD, test "x$enable_usd" = xyes)
 if test "$threads" = posix; then
        AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])
 fi