Hello all,

so I've tried again to build with both cygwin and mingw.

Short version: cygwin works, mingw does not.

Longer version:

As I mentioned earlier both cygwin and mingw will not build unless 
configure is modified. Libtool (or ld) does not want to link with 
something that does not begin with 'lib'. So I removed those lines and 
renamed ftd2xx.lib to libftd2xx.a and put the library file on the 
location of "with-ftd2xx=<path>" ei the "root" of where the ftdi archive 
was unpacked.

To even make mingw build I had to disable a bunch of packages, if it 
depends on libraries or header conflicts that needs more investigation. 
However even though it is actually possible to build with mingw, the 
compiler complains at a lot of places for formatting string problems. 
And trying to run the resulting jtag.exe yields an error message:

ARE@ARE-PC /cygdrive/c/akre/urjtag_proj/install/bin
$ ./jtag.exe --version
       1 [main] jtag 12052 child_copy: cygheap read copy failed, 
0x612EB408..0x612F9088, done 0, windows pid 12052, Win32 error 6
     297 [main] jtag 12052 C:\akre\urjtag_proj\install\bin\jtag.exe: *** 
fatal error - ccalloc would have returned NULL

Building for cygwin was easier but not without problems. First of all, 
***it's too much windows in this program***.  After removing the 
#include <windows.h> in sysdep.h I was able to build everything except 
for some snag with libIntl or if it was gettext.

If we want to build dynamic libraries we also have to add 
"-no-undefined" to the LDFLAGS in makefile.am line "liburjtag_la_LDFLAGS 
= -version-info 0:0:0 -no-undefined".

If you need parport I/O add #include <windows.h> after #if 
defined(HAVE_INPOUTXX)

Add to libftd2xx.c #include <windows.h>, unfortunately there is a 
collision with the definition of "interface" so interface has to be 
undefined. The ftd2xx.h header also require _WIN32 to be defined so that 
is done here as well.

#include <windows.h>
#define _WIN32
#include <ftd2xx.h>
#undef interface

So here is the recipe:

edit configure.am
autoconf
edit Makefile.am
automake
edit sysdep.h
edit tap/parport/direct.c
edit tap/usbconn/libftdi2xx.c
./configure --with-ftd2xx=/cygdrive/c/akre/urjtag_proj/ftdi_cdm_drivers 
--with-inpout32 --disable-nls --prefix=/cygdrive/c/akre/urjtag_proj/install
make V=1
make install

FTD2XXLIB=
AS_IF([test "x$with_ftd2xx" = xyes -o "x$with_ftd2xx" = xcheck], [
   AC_CHECK_LIB([ftd2xx], [FT_OpenEx], [
     HAVELIBFTD2XX=yes
     LIBS="-lftd2xx $LIBS"
   ],[
     AC_MSG_WARN([*** libftd2xx not found. No support for FTDI-based USB 
JTAG cables via libftd2xx.])
   ])
],[
   AS_IF([test "x$with_ftd2xx" != xno], [
     HAVELIBFTD2XX=yes
     case $host in
#    *cygwin*|*mingw*)
#      CFLAGS="$CFLAGS -I$with_ftd2xx"
#      AS_IF([test -d "$with_ftd2xx/i386"], [
#        FTD2XXLIB="$with_ftd2xx/i386/ftd2xx.lib"
#      ],[
#        FTD2XXLIB="$with_ftd2xx/ftd2xx.lib"
#      ])
#      ;;
     *)
       CFLAGS="$CFLAGS -I$with_ftd2xx -L$with_ftd2xx"
       LIBS="-lftd2xx $LIBS"
       ;;
     esac
   ],)
])


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to