Xiaofan Chen wrote: > > Please use pkg-config. > > Please also consider where pkg_config is usually not available, > like in the case of MinGW under Windows.
There's pkg-config also for MinGW, although maybe that is perhaps more within a full MSYS environment. The question is whether OpenOCD already has a standalone MinGW Makefile or not. If not (only autoconf) then I think requiring pkg-config is fine as a build dependency. > >> #if IS_WIN32 == 0 > >> > >> - usb_reset(dev); > >> + libusb_reset_device(devh); > > > > Unsure. libusb_reset_device() shouldn't really need to be used in the > > common case.. > > I remember this was necessary last time some of us were > testing OpenOCD with J-Link. Ok. > On the other hand, this may well be not necessary now > but the best is to look at Segger J-Link utility and see > if it issues a reset in the beginning or not. This is a good idea. Also, usb_reset() may not be exactly the same as libusb_reset_device(). > The following codes are obviously hacky but you can see that > any changes in these codes deserve great scrutiny. > > /* BE ***VERY CAREFUL*** ABOUT MAKING CHANGES IN THIS > * AREA!!!!!!!!!!! The behavior of libusb is not completely > * consistent across Windows, Linux, and Mac OS X platforms. > * The actions taken in the following compiler conditionals may > * not agree with published documentation for libusb, but were > * found to be necessary through trials and tribulations. I think this may be largely due to the fact that libusb-0.1 was implemented in different projects for different platforms. It is really important to me that we make sure to have libusb-1.0 behave the same across platforms, because it is the only way we can claim to actually have a cross-platform library. With the exception of the still young Windows code I think we are so far doing a fairly good job. I believe the difference between Linux and Mac OS X were larger in libusb-0.1, so I think this code in OpenOCD can be simplified. Let's see. > > Or does the driver support so many jlink devices with so many different > > USB interface variants that there's no way to get around it? > > That is right, there are different version of J-Link with different > endpoints configuration. With the same vidpid? Meh. :( //Peter _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development