linux)
AC_DEFINE(OS_LINUX, 1, [Linux backend])
AC_SUBST(OS_LINUX)
- AC_SEARCH_LIBS([clock_gettime2], [rt], [], [], [-pthread])
+
+ AC_ARG_ENABLE([usbhost_api],
+ [AC_HELP_STRING([--enable-usbhost-api], [Request to deviced to obtain dev node fds [default=no]])],
+ [], [enable_usbhost_api="no"])
+ if test "x$enable_usbhost_api" = "xyes"; then
+ PKG_CHECK_MODULES([USBHOST_API], [dbus-1])
+ AC_DEFINE(USE_USBHOST_API, 1, [Request to deviced to obtain dev node fds])
+ fi
+
+ AC_SUBST(USE_USBHOST_API)
+
+ 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]])],
[], [enable_udev=yes])
while (size >= INTERFACE_DESC_LENGTH) {
struct libusb_interface_descriptor *altsetting =
(struct libusb_interface_descriptor *) usb_interface->altsetting;
- altsetting = usbi_reallocf(altsetting,
+ /* can't use usbi_realloc() as we need to free libusb_interface_descriptor members - see clear_interface() */
+ altsetting = realloc(altsetting,
sizeof(struct libusb_interface_descriptor) *
- (usb_interface->num_altsetting + 1));
+ ((size_t)usb_interface->num_altsetting + 1));
if (!altsetting) {
r = LIBUSB_ERROR_NO_MEM;
goto err;
--- /dev/null
- Version: 1.0.22
+%define TIZEN_FEATURE_USBHOST_API on
+
+Name: libusb
++Version: 1.0.23
+Release: 0
+License: LGPL-2.1+, MIT
+Summary: USB Library
+Url: http://www.libusb.org/
+Group: Base/Device Management
+Source: %{name}-%{version}.tar.bz2
+Source1: baselibs.conf
+Source1001: libusb.manifest
+BuildRequires: pkg-config
+BuildRequires: systemd-devel
+%if %{?TIZEN_FEATURE_USBHOST_API} == on
+BuildRequires: pkgconfig(dbus-1)
+%endif
+
+%description
+Libusb is a library that allows userspace access to USB devices.
+
+%package devel
+Summary: USB Library
+Group: Development/Libraries
+Requires: glibc-devel
+Requires: libusb = %{version}
+
+%description devel
+Libusb is a library that allows userspace access to USB devices.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+%reconfigure\
+ --with-pic\
+%if %{?TIZEN_FEATURE_USBHOST_API} == on
+ --enable-usbhost-api \
+%endif
+ --disable-static
+make %{?_smp_mflags}
+
+%install
+%make_install
+# usbhost_module
+mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d
+install -m 644 udev/99-usbhost.rules %{buildroot}%{_prefix}/lib/udev/rules.d/99-usbhost.rules
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root)
+%license LICENSE.LGPL-2.1+ LICENSE.MIT
+%{_libdir}/*.so.*
+# usbhost_module
+%{_prefix}/lib/udev/rules.d/99-usbhost.rules
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-,root,root)
+%license LICENSE.LGPL-2.1+ LICENSE.MIT
+%{_includedir}/libusb-1.0
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+
+%changelog