I’m having trouble with compiling openocd-0.5.0 on Mac OS X.
I’ve switched to gcc-4.2
libusb and libftdi are already built.
Here’s my build-commands (shortened for better overview):
./configure --enable-ft2232_libftdi --enable-usbprog
make install DESTDIR="$INSTALLDIR/openocd"
First problem:
src/jtag/drivers/usbprog.c wouldn’t compile (unless you add --disable-werror), I’ve submitted a bug report marked ‘trivial’.
Solution: Remove line #320, below line 303, add:
ScanProc f;
Above line 303, add:
typedef void (*ScanProc)(struct usbprog_jtag *usbprog_jtag, char * buffer, int size);
After that, it starts compiling, but stops here…
libtool: link: ranlib .libs/libopenocd.a
libtool: link: rm -fr .libs/libopenocd.lax .libs/libopenocd.lax
libtool: link: ( cd ".libs" && rm -f "libopenocd.la" && ln -s "../libopenocd.la" "libopenocd.la" )
gcc -m32 -std=gnu99 -DHAVE_CONFIG_H -I. -I../../src -I.. -I../../src -I../src -DPKGDATADIR=\"/usr/local/share/openocd\" -DPKGLIBDIR=\"/usr/local/lib/openocd\" -I../../jimtcl -I../jimtcl -g -O2 -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o ../../src/main.c
mv -f .deps/main.Tpo .deps/main.Po
make[3]: *** No rule to make target `../jimtcl/libjim.a', needed by `openocd'. Stop.
make[2]: *** [install-recursive] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1
I’ve tried everything I could think of.
–with-jim-tcl= … (found it on the net, but it does not work; looking at configure, I found out that it’s actually not present. Please someone implement this.)
LD_LIBRARY_PATH= … (Never got this to work with anything else anyway)
ln -s …
(also tried changing directory, etc…)
As I am creating a distribution, I’d really like having a build directory, which I can remove using a rm -R (I do this for all my other builds, such as binutils, gcc, libusb, libftdi, etc, etc.
Eg. I usually do it this way…
cd openocd-0.5.0
mkdir build
cd build
../configure ...
make ...
But as the above wouldn’t work for me, I tried building in the openocd-0.5.0 ‘parent directory’; it didn’t work for me.
I’m really stuck. I could successfully build openocd-0.4.0, and I had it working once, but after a system re-installation, I had trouble building it again, so I decided to move to openocd-0.5.0, however jimtcl is giving me so much trouble; I don’t know how to get it compiling.