On Mon, Jul 11, 2011 at 8:14 PM, Steve Bennett <[email protected]> wrote:
> On 11/07/2011, at 10:03 PM, Xiaofan Chen wrote:
>
>> On Tue, Jun 28, 2011 at 1:48 PM, Xiaofan Chen <[email protected]> wrote:
>>> On Sun, Jun 26, 2011 at 10:14 PM, Øyvind Harboe <[email protected]> 
>>> wrote:
>>>> Can someone review this?
>>>>
>>>
>>> Maybe it is good to fix for 64bit as well, similar to the case of
>>> --with-ftd2xx-win32-zipdir where $host_cpu is checked to decide
>>> which library to use (build/i386/libftd2xx.a or build/amd64/libftd2xx.a)
>>>
>>
>> The patch works with the x86 build at least. And it does not
>> make things worse for the old version of ftd2xx. So I think
>> this should be committed.
>
> Hear, hear!
>
> And if someone has the appropriate environment to test and submit a fix for 
> 64bit,
> that would be a useful later addition.
>

Following your x86 patch, at least the following patch is okay for x64 build
(only tested the compiling under Ubuntu 10.10 64bit).

Maybe you want to  to detect the 32bit build and 64bit build under
Linux and combine the patches into one.

diff --git a/configure.in b/configure.in
index de74ffa..fd8eb11 100644
--- a/configure.in
+++ b/configure.in
@@ -873,14 +873,15 @@ if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx
     AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find
     fi
     CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir"
-    FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir"
-    FTD2XX_LIB="-lftd2xx"
-    if test $with_ftd2xx_lib != shared; then
-      # Test #1 - Future proof - if/when ftdichip fixes their distro.
-      # Try it with the simple ".a" suffix.
-      FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a"
-      if test -f "${FTD2XX_LIB}"; then
-        FTD2XX_LDFLAGS="${FTD2XX_LDFLAGS}/static_lib"
+    if test $with_ftd2xx_lib = shared; then
+       FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir"
+       FTD2XX_LIB="-lftd2xx"
+    else
+      # Test #1 - v1.0.x
+      if test -f "$with_ftd2xx_linux_tardir/build/x86_64/libftd2xx.a"; then
+        FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir/build/x86_64"
+        # Also needs -lrt
+        FTD2XX_LIB="-lftd2xx -lrt"
       else
         # Test Number2.
         # Grr.. perhaps it exists as a version number?

There are warnings like the following though.

libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I.
-I../../../../git/openocd/src/jtag/drivers -I../../..
-I../../../../git/openocd/src -I../../../src
-DPKGDATADIR=\"/usr/local/share/openocd\"
-DPKGLIBDIR=\"/usr/local/lib/openocd\"
-I../../../../git/openocd/jimtcl -I../../../jimtcl -g -O2
-I/home/mcuee/Desktop/build/openocd/d2xx/libftd2xx1.0.4 -Wall
-Wstrict-prototypes -Wformat-security -Wshadow -Wextra
-Wno-unused-parameter -Wbad-function-cast -Wcast-align
-Wredundant-decls -MT ft2232.lo -MD -MP -MF .deps/ft2232.Tpo -c
../../../../git/openocd/src/jtag/drivers/ft2232.c -o ft2232.o
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function 'ft2232_write':
../../../../git/openocd/src/jtag/drivers/ft2232.c:518: warning: format
'%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function 'ft2232_read':
../../../../git/openocd/src/jtag/drivers/ft2232.c:561: warning: format
'%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function
'ft2232_init_ftd2xx':
../../../../git/openocd/src/jtag/drivers/ft2232.c:2218: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2222: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2238: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'DWORD'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2257: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2263: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2273: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2279: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2285: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2295: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_DEVICE'
../../../../git/openocd/src/jtag/drivers/ft2232.c:2296: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'DWORD'
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function
'ft2232_purge_ftd2xx':
../../../../git/openocd/src/jtag/drivers/ft2232.c:2310: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function
'signalyzer_h_led_set':
../../../../git/openocd/src/jtag/drivers/ft2232.c:3631: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3639: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3647: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3654: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function
'signalyzer_h_init':
../../../../git/openocd/src/jtag/drivers/ft2232.c:3743: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3753: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3767: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3774: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3781: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3789: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3796: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3803: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3810: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3819: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3833: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3898: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3906: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3916: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3925: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3933: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3943: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3952: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:3961: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4033: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4042: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4054: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4063: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4072: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4084: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4093: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/ft2232.c:4102: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
mv -f .deps/ft2232.Tpo .deps/ft2232.Plo
/bin/sh ../../../libtool --tag=CC   --mode=compile gcc -std=gnu99
-DHAVE_CONFIG_H -I. -I../../../../git/openocd/src/jtag/drivers
-I../../..  -I../../../../git/openocd/src -I../../../src
-DPKGDATADIR=\"/usr/local/share/openocd\"
-DPKGLIBDIR=\"/usr/local/lib/openocd\"
-I../../../../git/openocd/jimtcl -I../../../jimtcl   -g -O2
-I/home/mcuee/Desktop/build/openocd/d2xx/libftd2xx1.0.4 -Wall
-Wstrict-prototypes -Wformat-security -Wshadow -Wextra
-Wno-unused-parameter -Wbad-function-cast -Wcast-align
-Wredundant-decls -MT usb_blaster.lo -MD -MP -MF .deps/usb_blaster.Tpo
-c -o usb_blaster.lo
../../../../git/openocd/src/jtag/drivers/usb_blaster.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I.
-I../../../../git/openocd/src/jtag/drivers -I../../..
-I../../../../git/openocd/src -I../../../src
-DPKGDATADIR=\"/usr/local/share/openocd\"
-DPKGLIBDIR=\"/usr/local/lib/openocd\"
-I../../../../git/openocd/jimtcl -I../../../jimtcl -g -O2
-I/home/mcuee/Desktop/build/openocd/d2xx/libftd2xx1.0.4 -Wall
-Wstrict-prototypes -Wformat-security -Wshadow -Wextra
-Wno-unused-parameter -Wbad-function-cast -Wcast-align
-Wredundant-decls -MT usb_blaster.lo -MD -MP -MF .deps/usb_blaster.Tpo
-c ../../../../git/openocd/src/jtag/drivers/usb_blaster.c -o
usb_blaster.o
../../../../git/openocd/src/jtag/drivers/usb_blaster.c: In function
'usb_blaster_buf_write':
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:138: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/usb_blaster.c: In function
'usb_blaster_buf_read':
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:171: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/usb_blaster.c: In function
'usb_blaster_init':
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:387: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:405: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'DWORD'
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:424: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:431: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
../../../../git/openocd/src/jtag/drivers/usb_blaster.c:439: warning:
format '%lu' expects type 'long unsigned int', but argument 6 has type
'FT_STATUS'
mv -f .deps/usb_blaster.Tpo .deps/usb_blaster.Plo


-- 
Xiaofan
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to