From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:6f8:1178:2:5054:ff:fec0:8e10] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WW0so-0007Fe-SM for ptxdist@pengutronix.de; Fri, 04 Apr 2014 11:57:58 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1WW0so-0005cb-Qr for ptxdist@pengutronix.de; Fri, 04 Apr 2014 11:57:58 +0200 Date: Fri, 4 Apr 2014 11:57:58 +0200 From: Michael Olbrich Message-ID: <20140404095758.GE21499@pengutronix.de> References: <1396079083-22287-1-git-send-email-alex.aring@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1396079083-22287-1-git-send-email-alex.aring@gmail.com> Subject: Re: [ptxdist] [PATCH v3] libusb: drop libusb and use libusbx Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Sat, Mar 29, 2014 at 08:44:43AM +0100, Alexander Aring wrote: > This patch drops the libusb support and add the libusbx instead. > = > We can do that because libusb and libusbx offers the same API, original > text from libusbx project website: > = > "If you are an existing user of libusb, you don't have to change > anything. Just download the libusbx library and use it in your code. The > library is designed as a drop in replacement for libusb, so please give > it a try. If you don't like it, which we very much doubt, you can always > revert..." > = > Another point is that libusbx website says that the libusb project is > somehow died and will not longer release new releases: > = > "The reason for the fork is that, despite having dedicated members, > libusb has still not been able to produce a new release for the past 2 > years. When a project fails to produce regular releases, we consider > that you, its user, are paying the ultimate price. This is because it > means that patches and new feature are being witheld and you end up > wasting your time." > = > This patch fix also a few bugs which I detected: > = > i) switch to "--disable-static", otherwise it was "--enable-shared > --enable-static" > = > ii) correct use of --disable-log and --enable-debug-log, there was an > option for these two configure flags but also was a static > "--disable-log --disable-debug-log" in the configure call, which > makes no sense. > = > iii) Fix J=FCrgen Beisert's mail address. > = > iv) cleanup and remove _ENV and _PATH setting. > = > new features: > = > i) Add LIBUSB_SYSTEM_LOG which could enable --enable-system-log flag. > = > ii) also adding some new disable flag --disable-tests-build > = > iii) I add "--disable-udev" there but we should have a --enable-udev... > The old one has no kind of udev support and I got a recursive > dependency detection because udev-legacy needs usbutils which needs > libusb. We should look at this in the near future. > = > iv) change "libusb" entry to "libusbx" > = > v) rename LIBUSB_DISBALE_LOG to LIBUSB_LOG and change logic. > = > I also keep the patch from libusb and port it to libusbx because I saw > that libusbx uses also pthreads. > = > Signed-off-by: Alexander Aring Thanks, applied. Michael > --- > changes since v2: > - add fix for juergen beiserts mail address. This is the second time whi= ch > I fix his mail address. :-) > - change to --disable-tests-build. > - remove LIBUSB_ENV and LIBUSB_PATH. I learned from the libgmp. Sorry. > - Add LIBUSB_SYSTEM_LOG. > - Change logic of LIBUSB_DISABLE_LOG to LIBUSB_LOG. > - remove the second -lusb-1.0 in the patch file. > - remove the timerfd configure flag and let it to auto behaviour. > = > changes since v3: > - fix a J=FCrgen Beisert's mail address. Thanks to Uwe Kleine-K=F6nig f= or > this hint. > = > patches/libusb-1.0.8/libusb-1.0.1-pkg-config.diff | 27 ----------------- > patches/libusb-1.0.8/series | 1 - > ...libusbx-libusb-needs-librt-and-libpthread.patch | 35 ++++++++++++++++= ++++++ > patches/libusbx-1.0.18/series | 1 + > rules/libusb.in | 26 ++++++++-------- > rules/libusb.make | 33 ++++++++--------= ---- > 6 files changed, 62 insertions(+), 61 deletions(-) > delete mode 100644 patches/libusb-1.0.8/libusb-1.0.1-pkg-config.diff > delete mode 100644 patches/libusb-1.0.8/series > create mode 100644 patches/libusbx-1.0.18/0001-libusbx-libusb-needs-libr= t-and-libpthread.patch > create mode 100644 patches/libusbx-1.0.18/series > = > diff --git a/patches/libusb-1.0.8/libusb-1.0.1-pkg-config.diff b/patches/= libusb-1.0.8/libusb-1.0.1-pkg-config.diff > deleted file mode 100644 > index f3c05af..0000000 > --- a/patches/libusb-1.0.8/libusb-1.0.1-pkg-config.diff > +++ /dev/null > @@ -1,27 +0,0 @@ > -Subject: libusb needs librt and libpthread > - > -Add missing dependencies. > - > -Signed-off-by: Robert Schwebel > - > ---- > -# 20100603 rsc: The patch was closed upstream, and I don't > -# remember a use case any more :-( Let's keep it > -# here for the moment, until we have a user. > -# 20100101 rsc: added as http://libusb.org/ticket/24 > - > - libusb-1.0.pc.in | 2 +- > - 1 file changed, 1 insertion(+), 1 deletion(-) > - > -Index: libusb-1.0.1/libusb-1.0.pc.in > -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---- libusb-1.0.1.orig/libusb-1.0.pc.in > -+++ libusb-1.0.1/libusb-1.0.pc.in > -@@ -6,6 +6,6 @@ includedir=3D@includedir@ > - Name: libusb-1.0 > - Description: C API for USB device access from Linux userspace > - Version: @VERSION@ > --Libs: -L${libdir} -lusb-1.0 > -+Libs: -L${libdir} -lusb-1.0 -lrt -lpthread > - Cflags: -I${includedir}/libusb-1.0 > - > diff --git a/patches/libusb-1.0.8/series b/patches/libusb-1.0.8/series > deleted file mode 100644 > index 25e430f..0000000 > --- a/patches/libusb-1.0.8/series > +++ /dev/null > @@ -1 +0,0 @@ > -libusb-1.0.1-pkg-config.diff > diff --git a/patches/libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-l= ibpthread.patch b/patches/libusbx-1.0.18/0001-libusbx-libusb-needs-librt-an= d-libpthread.patch > new file mode 100644 > index 0000000..2ee3f72 > --- /dev/null > +++ b/patches/libusbx-1.0.18/0001-libusbx-libusb-needs-librt-and-libpthre= ad.patch > @@ -0,0 +1,35 @@ > +From e5c3ffc155a33a9d8f97dc1524be9a776d4ed656 Mon Sep 17 00:00:00 2001 > +From: Alexander Aring > +Date: Fri, 28 Mar 2014 12:04:23 +0100 > +Subject: [PATCH] libusbx: libusb needs librt and libpthread > + > +This patch is taken from the old libusb package and changes to apply the > +libusbx package. Original commit msg from patch is: > + > +Add missing dependencies. > + > +20100603 rsc: The patch was closed upstream, and I don't > + remember a use case any more :-( Let's keep it > + here for the moment, until we have a user. > +20100101 rsc: added as http://libusb.org/ticket/24 > + > +Signed-off-by: Alexander Aring > +--- > + libusb-1.0.pc.in | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/libusb-1.0.pc.in b/libusb-1.0.pc.in > +index 7bc33c1..0c6fea7 100644 > +--- a/libusb-1.0.pc.in > ++++ b/libusb-1.0.pc.in > +@@ -6,6 +6,6 @@ includedir=3D@includedir@ > + Name: libusbx-1.0 > + Description: C API for USB device access from Linux, Mac OS X, Windows = and OpenBSD/NetBSD userspace > + Version: @VERSION@ > +-Libs: -L${libdir} -lusb-1.0 > ++Libs: -L${libdir} -lusb-1.0 -lrt -lpthread > + Libs.private: @LIBS@ > + Cflags: -I${includedir}/libusb-1.0 > +-- = > +1.9.1 > + > diff --git a/patches/libusbx-1.0.18/series b/patches/libusbx-1.0.18/series > new file mode 100644 > index 0000000..4284244 > --- /dev/null > +++ b/patches/libusbx-1.0.18/series > @@ -0,0 +1 @@ > +0001-libusbx-libusb-needs-librt-and-libpthread.patch > diff --git a/rules/libusb.in b/rules/libusb.in > index 42ad262..ff1a797 100644 > --- a/rules/libusb.in > +++ b/rules/libusb.in > @@ -4,34 +4,36 @@ menuconfig LIBUSB > tristate > select LIBC_RT > select LIBC_PTHREAD > - prompt "libusb-1.x " > + prompt "libusbx-1.x " > help > - userspace USB programming library > - > Library for programming USB applications without the > knowledge of Linux kernel internals. > = > - Note: libusb-1.x is not binary compatible with its precedessor > - libusb-0.x! > - > if LIBUSB > = > -config LIBUSB_DISABLE_LOG > +config LIBUSB_LOG > bool > - prompt "Disable all log" > - default y > + prompt "Enable all log" > help > - Disable all logging. Even if an application setup the debug level > + Enable all logging. Even if an application setup the debug level > to a value other than 0, this library will not output any messages. > - If this menu entry is not enabled, an application or the environment > + If this menu entry is enabled, an application or the environment > variable LIBUSB_DEBUG can setup the debug message level at runtime. > Refer http://libusb.sourceforge.net/api-1.0/group__lib.htm function > libusb_set_debug() > = > +config LIBUSB_SYSTEM_LOG > + bool > + prompt "Enable system log" > + depends on LIBUSB_LOG > + help > + Enable output logging messages to system wide log, if supported by > + the OS. > + > config LIBUSB_DEBUG_LOG > bool > prompt "Enable debug log" > - depends on !LIBUSB_DISABLE_LOG > + depends on LIBUSB_LOG > help > Enable full debug logging. This will always output debug messages, > there is no way to disable them at runtime. > diff --git a/rules/libusb.make b/rules/libusb.make > index 4dfa0e5..addc4d8 100644 > --- a/rules/libusb.make > +++ b/rules/libusb.make > @@ -16,37 +16,28 @@ PACKAGES-$(PTXCONF_LIBUSB) +=3D libusb > # > # Paths and names > # > -LIBUSB_VERSION :=3D 1.0.8 > -LIBUSB_MD5 :=3D 37d34e6eaa69a4b645a19ff4ca63ceef > -LIBUSB :=3D libusb-$(LIBUSB_VERSION) > +LIBUSB_VERSION :=3D 1.0.18 > +LIBUSB_MD5 :=3D f2ccd0589dde901dfd5607459f77bf44 > +LIBUSB :=3D libusbx-$(LIBUSB_VERSION) > LIBUSB_SUFFIX :=3D tar.bz2 > -LIBUSB_URL :=3D $(call ptx/mirror, SF, libusb/$(LIBUSB).$(LIBUSB_SUFFIX)) > +LIBUSB_URL :=3D $(call ptx/mirror, SF, libusbx/$(LIBUSB).$(LIBUSB_SUFFIX= )) > LIBUSB_SOURCE :=3D $(SRCDIR)/$(LIBUSB).$(LIBUSB_SUFFIX) > LIBUSB_DIR :=3D $(BUILDDIR)/$(LIBUSB) > LIBUSB_LICENSE :=3D LGPLv2.1 > = > -# ----------------------------------------------------------------------= ------ > -# Prepare > -# ----------------------------------------------------------------------= ------ > - > -LIBUSB_PATH :=3D PATH=3D$(CROSS_PATH) > -LIBUSB_ENV :=3D $(CROSS_ENV) > - > # > # autoconf > # > LIBUSB_AUTOCONF :=3D \ > $(CROSS_AUTOCONF_USR) \ > - --disable-log \ > - --disable-debug-log \ > - --disable-examples-build \ > - --enable-static \ > + --disable-static \ > --enable-shared \ > - --$(call ptx/endis, PTXCONF_LIBUSB_DISABLE_LOG)-log > - > -ifdef PTXCONF_LIBUSB_DEBUG_LOG > -LIBUSB_AUTOCONF +=3D --enable-debug-log > -endif > + --disable-udev \ > + --$(call ptx/endis, PTXCONF_LIBUSB_LOG)-log \ > + --$(call ptx/endis, PTXCONF_LIBUSB_DEBUG_LOG)-debug-log \ > + --$(call ptx/endis, PTXCONF_LIBUSB_SYSTEM_LOG)-system-log \ > + --disable-examples-build \ > + --disable-tests-build > = > # ----------------------------------------------------------------------= ------ > # Target-Install > @@ -58,7 +49,7 @@ $(STATEDIR)/libusb.targetinstall: > @$(call install_init, libusb) > @$(call install_fixup, libusb,PRIORITY,optional) > @$(call install_fixup, libusb,SECTION,base) > - @$(call install_fixup, libusb,AUTHOR,"Juergen Beisert ") > + @$(call install_fixup, libusb,AUTHOR,"Juergen Beisert ") > @$(call install_fixup, libusb,DESCRIPTION,missing) > = > @$(call install_lib, libusb, 0, 0, 0644, libusb-1.0) > -- = > 1.9.1 > = > = > -- = > ptxdist mailing list > ptxdist@pengutronix.de -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de