libftdi Archives

Subject: Re: [RFC][PATCH] explicitly include libusb-1.0

From: Matthias Janke <matthias.janke@xxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sun, 13 Jan 2013 15:27:51 +0100
On Sun, 13 Jan 2013 20:35:03 +0800
Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:

> On Sun, Jan 13, 2013 at 12:04 PM, Matthias Janke
> <matthias.janke@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > Hi All,
> >
> > I've appended a patch that changes the include from libusb.h to
> > libusb-1.0/libusb.h so that one hasn't to manually append
> > -I/usr/include/libusb-1.0 to cmdline or makefile for projects that
> > only use libftdi. Any thoughts?
> 
> I myself am not against this patch. But the official stand of the
> libusb.org maintainer (Peter Stuge) is against using this method,
> rather he suggests using pkg-config to avoid manually specifying
> libusb-1.0 header file directory.

Hm the pkg-config call is even longer as the -I option. Plus it
forks. :(

pkg-config libusb-1.0 --cflags
-I/usr/include/libusb-1.0  

Beeing lazy is one motivaton for the patch. The other one is that
compiling an application is differnt from linking. When you link
libusb is proxied by libftdi, since libftdi is linked against libusb,
so on the linker cmd line there is only -lftdi1. So you don't care about
libusb/x at all. But when you compile you have to include libusb
explicitly even if you don't use it in your application. This
breaks abstraction layers.

Cheers
Matthias


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread