Xiaofan Chen wrote:
> > The libusb-1.0 dir in CFLAGS is a workaround for a bug in how libftdi
> > uses libusb-1.0. libftdi should do #include <libusb-1.0/libusb.h> but
> > does #include <libusb.h> which is wrong. This forces all libftdi
> > users to mess with include paths, to add the directory that libftdi
> > happened to be built with, and this is clearly *not* how things are
> > supposed to work. libftdi should be fixed.
> 
> This may not be quite true. libftdi-1.0 will try to get libusb-1.0 CFLAGS
> from pkg-config data (libusb-1.0.pc). libftdi (0.1) will try to get
> libusb CFLAGS from pkg-config data (libusb.pc) or libusb-config.
> I think it should work fine.

Thanks! You're absolutely right about pkg-config. It's a little
annoying for very simple apps, and it might be troublesome on
Windows.. Hmm, I'll bring it up on libusb-devel.

libftdi.pc doesn't have Requires: libusb-1.0 so that should be fixed.
I guess it's work in progress still, but these build things should be
fixed sooner rather than later.


> > The two seds are neccessary since OpenOCD assumes that libftdi is
> > built against libusb-0.1. I'm not sure about the best fix for the
> > configure.in test,

pkg-config is obviously the answer for the configure test.


> > but for build time libtool will always do the
> > right thing if -lusb is simply removed from src/Makefile.am.
> 
> What if I need both libusb-1.0 (for libftdi-1.0) and
> libusb-0.1 (say for J-Link)?

Yeah, I thought about this. It would be ideal for OpenOCD (and all
it's dependencies) to only use libusb-0.1 or libusb-1.0 for
everything, but it's possible to mix both APIs by using
libusb-compat-0.1 which provides the libusb-0.1 API on top of
libusb-1.0.

That's the only way to not have to rewrite all the drivers at once.

Building with both libusb-1.0 and libusb-0.1 at the same time is not
a good idea, they will conflict with each other.


> Probably it is the time for OpenOCD to start to offer the options
> for libusb-1.0 and libftdi-1.0 and may migrate the libusb-0.1 based
> files to libusb-1.0.

Yes, I agree it's the best way, but someone has to do it. :)


//Peter
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to