I have currently update mingw to compile the last OpenOCD version under 
my Microsoft Windows 7 64-bit machine.

Autoconf 2.67
Automake 1.11.1
GCC 4.6.2
Make 3.81


But an error occured during configuration
./configure --enable-maintainer-mode --with-jim-ext=nvp 
--disable-werror --disable-shared --enable-ft2232_ftd2xx 
--with-ftd2xx-win32-zipdir=/c/drivers/d2xx CC="gcc -mno-cygwin"

gcc version 4.6.2 (GCC)
configure:3292: $? = 0
configure:3281: gcc -mno-cygwin -V >&5
gcc.exe: error: unrecognized option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3292: $? = 1
configure:3281: gcc -mno-cygwin -qversion >&5
gcc.exe: error: unrecognized option '-qversion'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3292: $? = 1
configure:3312: checking whether the C compiler works
configure:3334: gcc -mno-cygwin    conftest.c  >&5
cc1.exe: error: unrecognized command line option '-mno-cygwin'
configure:3338: $? = 1
configure:3376: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "openocd"
| #define PACKAGE_TARNAME "openocd"
| #define PACKAGE_VERSION "0.5.0-dev"
| #define PACKAGE_STRING "openocd 0.5.0-dev"
| #define PACKAGE_BUGREPORT "OpenOCD Mailing List 
<openocd-developm...@lists.berlios.de>"
| #define PACKAGE_URL ""
| #define PACKAGE "openocd"
| #define VERSION "0.5.0-dev"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3381: error: in 
`/c/Temp/amontec/sdk-v0.1/sources/openocd/local':
configure:3383: error: C compiler cannot create executables
See `config.log' for more details

--------------------------------------------------------------------------------


So I have removed the -mno-cygwin option because this option seems not 
be longer supported and cause errors.
./configure --enable-maintainer-mode --with-jim-ext=nvp 
--disable-werror --disable-shared --enable-ft2232_ftd2xx 
--with-ftd2xx-win32-zipdir=/c/drivers/d2xx CC="gcc"

In this case, configuration terminates without error but an error 
occured during make

Making all in drivers
make[6]: Entering directory 
`/c/Temp/amontec/sdk-v0.1/sources/openocd/git/src/jtag/drivers'
/bin/sh ../../../libtool --tag=CC   --mode=compile gcc -std=gnu99 
-DHAVE_CONFIG_H -I. -I../../..  -I../../../src -I../../../src 
-I../../../src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" 
-DPKGLIBDIR=\"/usr/local/lib/openocd\" -I../../../jimtcl 
-I../../../jimtcl   -g -O2 -D__USE_MINGW_ANSI_STDIO -I/c/drivers/d2xx 
-Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra 
-Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls 
-MT driver.lo -MD -MP -MF .deps/driver.Tpo -c -o driver.lo driver.c

libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../.. 
-I../../../src-I../../../src -I../../../src/helper 
-DPKGDATADIR=\"/usr/local/share/openocd\" 
-DPKGLIBDIR=\"/usr/local/lib/openocd\" -I../../../jimtcl 
-I../../../jimtcl -g -O2 -D__USE_MINGW_ANSI_STDIO -I/c/drivers/d2xx 
-Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra 
-Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls 
-MT driver.lo -MD -MP -MF .deps/driver.Tpo -c driver.c -o driver.o
In file included from ../../../config.h:307:0,
                  from driver.c:32:
../../../src/helper/replacements.h:125:24: error: conflicting types for 
'usleep'

c:\temp\amontec\sdk-v0.1\programs\msys\1.0\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/unistd.h:36:29:
 
note: previous declaration of 'usleep' was here
make[6]: *** [driver.lo] Error 1



Because during the configure
checking for usleep... no


On config.log, we can see:
configure:12944: checking for usleep
configure:12944: gcc -mno-cygwin -std=gnu99 -o conftest.exe -g -O2   
conftest.c  >&5
configure:12944: $? = 0
.
.
.
configure:12944: result: no

And in config.h:

/* Define to 1 if you have the `usleep' function. */
/* #undef HAVE_USLEEP */


--------------------------------------------------------------------------------


The problem was during the configure, all time the usleep is checked, 
the free antivirus: Avast 6.0.1367 locks the file: conftest.exe
    Infection : Win32 : Malware-gen
    Action    : Quarantined
    Process   : mingw\...\ld.exe


If the antivirus is inactive, during configure:
checking for usleep... yes

And in config.h

/* Define to 1 if you have the `usleep' function. */
#define HAVE_USLEEP 1

So OpenOCD is correctly build

Amontec Team can give to important news :

1. With the gcc 4.6.1+ under mingw32 (Microsoft windows 7 64-bit), we 
don't need the gcc option "-mno-cygwin" anymore.
2. Make sure to inactive the antivirus during the build of OpenOCD

---
Regards,
Sébastien Farquet
   http://www.amontec.com/
   Amontec JTAGkey-2 : High speed USB JTAG interface

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to