(I guess this is not related to the topic "Building openocd on Cygwin -
Still trying - Progress !")

Hello,

I used to build OpenOCD for Win32 with mingw/msys since svn<100 but I
could not get it to work any more, there seems to be an issue with the
libtool that comes with mingw/msys which is too old. libtool may be
updated from source but I tried with Cygwin and could finally build the
binary from svn 2461 using configuration:

./configure --enable-parport --enable-parport_giveio
--enable-ft2232_ftd2xx
--with-ftd2xx-win32-zipdir=/home/mthomas/src_ftd2xx/
--enable-maintainer-mode CC="gcc -mno-cygwin"

Build went smoothly for most of the sources but then the following error
occurred:

make[3]: Entering directory `C:/cygwin/home/mthomas/openocd/trunk/src'
C:/cygwin/bin/sh.exe ../libtool  --tag=CC   --mode=compile gcc
-mno-cygwin -std=
gnu99 -DHAVE_CONFIG_H -I. -I..  -DPKGBLDDATE=\"`date +%F-%R`\" 
-DRELSTR=\"svn:\
" -DPKGBLDREV=\"`../guess-rev.sh ..`\" -I../src -I../src/helper
-I../src/jtag -I
../src/target -I../src/xsvf -I../src/svf -I../src/server -I../src/flash
-I../src
/pld    -g -O2 -I/home/mthomas/src_ftd2xx -Wall -Wstrict-prototypes
-Wformat-sec
urity -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align
-Wredundant
-decls -Werror -MT libopenocd_la-openocd.lo -MD -MP -MF
.deps/libopenocd_la-open
ocd.Tpo -c -o libopenocd_la-openocd.lo `test -f 'openocd.c' || echo
'./'`openocd
.c
/usr/bin/sh: \: command not found
libtool: compile:  gcc -mno-cygwin -std=gnu99 -DHAVE_CONFIG_H -I. -I..
-DPKGBLDD
ATE=\\\`date "+%F-%R\\ -I../src" -I../src/helper -I../src/jtag
-I../src/target -
I../src/xsvf -I../src/svf -I../src/server -I../src/flash -I../src/pld -g
-O2 -I/
home/mthomas/src_ftd2xx -Wall -Wstrict-prototypes -Wformat-security
-Wextra -Wno
-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls
-Werror -MT
 libopenocd_la-openocd.lo -MD -MP -MF .deps/libopenocd_la-openocd.Tpo -c
openocd
.c -o libopenocd_la-openocd.o
gcc: +%F-%R\ -I../src: No such file or directory
make[3]: *** [libopenocd_la-openocd.lo] Error 1
make[3]: Leaving directory `C:/cygwin/home/mthomas/openocd/trunk/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `C:/cygwin/home/mthomas/openocd/trunk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `C:/cygwin/home/mthomas/openocd/trunk'
make: *** [all] Error 2



It seems that there are problems with the "inline"-execution of commands
like date and guess-rev, don't know the real reason. Some
version-informations:

mtho...@fischkiste ~/openocd/trunk/src
$ c:/cygwin/bin/sh.exe --version
GNU bash, version 3.2.48(21)-release (i686-pc-cygwin)
Copyright (C) 2007 Free Software Foundation, Inc.

mtho...@fischkiste ~/openocd/trunk/src
$ libtool --version
libtool (GNU libtool 1.3081 2009-02-17) 2.2.7a
Written by Gordon Matzigkeit <g...@gnu.ai.mit.edu>, 1996

Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



After editing the generated src/Makefile like:

...
###am__append_2 = -DRELSTR=\"svn:\"
-DPKGBLDREV=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\"
am__append_2 = -DRELSTR=\"svn:\" -DPKGBLDREV=\"2461\"
...
# add default CPPFLAGS
###libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\" \
###    $(am__append_1) $(am__append_2) $(AM_CPPFLAGS) $(CPPFLAGS)
libopenocd_la_CPPFLAGS = -DPKGBLDDATE=set \
    $(am__append_1) $(am__append_2) $(AM_CPPFLAGS) $(CPPFLAGS)



the build process continued a little bit further but stopped with an
error in replacements (don't remember the exact message). This error has
been caused by usage of stdint.h typdefs but stdint.h has not been
included. After adding #include <stdint.h> at the top of replacements.h
the build went trough and generated openocd.exe (not yet tested with
hardware).

Maybe src/Makefile.am and replacments.h can be modified a little bit to
increase compatibility with (maybe just my) cygwin-environment.

Regards,
Martin Thomas

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

Reply via email to