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])
+ AC_ARG_ENABLE([deviced],
+ [AC_HELP_STRING([--enable-deviced], [Use deviced to obtain dev node fds [default=no]])],
+ [], [enable_deviced="no"])
+ if test "x$enable_deviced" = "xyes"; then
+ PKG_CHECK_MODULES([DEVICED], [deviced])
+ AC_DEFINE(USE_DEVICED, 1, [Use deviced to obtain dev node fds])
fi
- AC_SUBST(USE_USD)
+ AC_SUBST(USE_DEVICED)
AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)
AC_ARG_ENABLE([udev],
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_USD, test "x$enable_usd" = xyes)
+AM_CONDITIONAL(USE_DEVICED, test "x$enable_deviced" = xyes)
if test "$threads" = posix; then
AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])
fi
hdr_HEADERS = libusb.h
if OS_LINUX
-if USE_USD
-libusb_1_0_la_CFLAGS += $(USD_CFLAGS)
-libusb_1_0_la_LIBADD = $(USD_LIBS)
+if USE_DEVICED
+libusb_1_0_la_CFLAGS += $(DEVICED_CFLAGS)
+libusb_1_0_la_LIBADD = $(DEVICED_LIBS)
+endif
endif
-endif
\ No newline at end of file
#include <unistd.h>
/* Tizen specific */
-#ifdef USE_USD
-#include <usb-security-daemon.h>
+#ifdef USE_DEVICED
+#include <dd-usbhost.h>
#endif
#include "libusb.h"
return fd;
}
-#ifdef USE_USD
+#ifdef USE_DEVICED
static int _ask_for_open(const char *path, mode_t mode, int silent)
{
int ret;
int fd;
- ret = usd_open_usb_device(path, &fd);
- if (ret != USD_API_SUCCESS) {
+ ret = open_usb_device(path, &fd);
+ if (ret < 0) {
/*
* We have an error so let's set errno correctly
* just like open does
*/
- switch (ret) {
- case USD_API_ERROR_ACCESS_DENIED:
- case USD_API_ERROR_SOCKET:
- case USD_API_ERROR_AUTHENTICATION_FAILED:
- errno = EACCES;
- break;
-
- case USD_API_ERROR_INPUT_PARAM:
- case USD_API_ERROR_FILE_NOT_EXIST:
- errno = ENOENT;
- break;
- default:
- errno = EINVAL;
- break;
- }
-
+ errno= -ret;
ret = -1;
} else {
ret = fd;
return ret;
}
-#endif /* USE_USD */
+#endif /* USE_DEVICED */
static int _get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent)
{
if (fd != -1)
return fd; /* Success */
-#ifdef USE_USD
+#ifdef USE_DEVICED
/*
* If we are here, we were unable to go simple
* path and open the device directly. In Tizen
if (mode & O_RDWR) {
if (!silent)
usbi_info(ctx, "No direct access to device node: %s. "
- "Trying to use USD", path);
+ "Trying to use deviced", path);
fd = _ask_for_open(path, mode, silent);
if (fd != -1)
return fd;
}
-#endif /* USE_USD */
+#endif /* USE_DEVICED */
if (!silent) {
usbi_err(ctx, "libusb couldn't open USB device %s: %s",
Source1001: libusb.manifest
BuildRequires: pkg-config
BuildRequires: systemd-devel
-BuildRequires: pkgconfig(capi-system-usbhost-usd)
+BuildRequires: pkgconfig(deviced)
%description
Libusb is a library that allows userspace access to USB devices.
%reconfigure\
--with-pic\
--disable-static\
- --enable-usd
+ --enable-deviced
make %{?_smp_mflags}
%install