OpenOCD 0.7.0 on Mac OS X failed to build

Installed libusbx-1.0.16

./configure --prefix=$HOME/bin --enable-stlink --enable-ulink --enable-jlink --enable-oocd_trace --enable-ioutil --enable-verbose --enable-verbose-jtag-io

checking libusb-1.0/libusb.h usability… yes
checking libusb-1.0/libusb.h presence… yes
checking for libusb-1.0/libusb.h… yes
checking usb.h usability… no
checking usb.h presence… no
checking for usb.h… no
configure: error: libusb or libusb-1.0 are required to build some OpenOCD driver(s)

What to do?

Try removing libusb1, then rebuild it.

(fortunately, it works fine with ./configure && make && sudo make install)

I’ve encountered the above error once; I forgot how I fixed it, though (I’ve been swimming in compile-problems).

Build works for me with libusb 1.0.9.

Hints:

1: On Mac OS X, you MUST use gcc-4.2 for building; gcc-4.0 won’t work.

2: These are my versions:

binutils-2.23.1

gcc-4.8.1

gmp-5.0.5

mpfr-3.0.1

mpc-1.0.1

newlib-1.19.0

gdb-7.6

libusb-0.1.12 (legacy)

libusb-1.0.9

libftdi-0.20

libftdi1-1.0

boost_1_53_0

confuse-2.7

openocd-0.7.0

This is my openocd configure line:

./configure" --enable-ft2232_libftdi --enable-usbprog --enable-presto_libftdi --enable-stlink --enable-arm-jtag-ew --enable-jlink --enable-rlink --enable-vsllink --enable-usb_blaster_libftdi --enable-remote-bitbang --enable-vsllink --enable-ulink --enable-osbdm --enable-opendous --disable-shared --enable-ftdi

if the following fails, you’re probably using gcc-4.0 for compiling instead of gcc-4.2:

./bootstrap

make && sudo make install

My only comment is that what adapter are you building for. I ask because some require libusb-0.1, some libusb-1.0 or some can use either.

Also most of the other options are used by devs and not really intended for general use.

Cheers

Spen

A. Fig Lee, were you able to build OpenOCD successfully ?

Are you on an intel-Mac or a PPC-Mac (that’s significant) ?

I begin to recall that I once tried building it from git, however I think I had the same problems (and I’m using PPC).

What I did, was that I downloaded the snapshot-archive, and ran ./configure from there.

-I’ve been using the archive method ever since.

So to get you up and running, try using the 0.7.0 snapshot instead of cloning the git repository.

The same thing happens to me. The configure script generates test programs that use "include <usb.h> which

means the default path /usr/include/usb.h. But what you probably have is /usr/include/libusb-1.0/libusb.h.

I know it is a bit of a hack but you can copy libusb.h to /usr/include/usb.h. That make the configure script work.

Or you can use “configure --includedir=/usr/include/libusb-1.0 …” and copy libusb.h to usb.h in that same directory.

Or you can dig into the configure script.

The same issue applies to libftdi. The configure script looks for /usr/include/ftdi.h. When I built libftdi it was installed as:

/usr//include/libftdi1/ftdi.h.

This is a bug in the release.

hi

I was going through various websites to find a solution to openOCD configuration problem, and also tried the suggestions on this posting, but to no avail.

I used MacPorts for installing various tools, including OpenOCD, and inspecting my installation through ‘port’, I noticed that it read:

openocd @0.7.0_0+ft2232

Remembering having installed qemu using “sudo port install qemu +target_arm”, I finally tried this:

sudo port install openocd +stlink

Now inquiring ‘port’ shows:

openocd @0.7.0_0+ft2232+stlink

And I was able to establish connection with my STM32F3DISCOVERY board.

Hope this save a lot of trouble.

:sunglasses: