Skip to main content
Topic: Compiling urjtag on windows (Read 12606 times) previous topic - next topic

Compiling urjtag on windows

I was trying to compile urjtag from http://sourceforge.net/projects/urjtag/files/urjtag/0.10/urjtag-0.10.tar.gz/download using codeblocks but still having problems with it. And thinking that I can compile it using a makefile but the source still need to generate that makefile.
I have tried compiling source in a debian environment, and just following the sequence as per documentation for compiling urjtag:
Code: [Select]
tar xzvf urjtag-0.10.tar.gz
cd urjtag-0.10
./configure
make
make install

and I was able to compile and run it successfully

Since the objective is to run it in a windows environment I decided to download cygwin and install it using the default setting and a full install of mingw (I guess this was not used)
Then  I copied urjtag-0.10.tar.gz in the c: cygwinhomeusername   directory and then run the Cygwin.bat located in that cygwin directory. And followed the same sequence as above and make a successful compile and run.

Then I download the cdm20808.zip from ftdi website and unzip in the the cygwin home folder and run above command sequence again, but this time the ./configure command have additional parameter as instructed in http://urjtag.sourceforge.net/book/_com ... html  section #2.4.6:

./configure --with-ftd2xx="/cdm20808"
And the result was:
Code: [Select]
jtag is now configured for

  Detected libusb      : yes
  Detected libftdi     : no
  Detected libftd2xx   : yes    <---- ftd2XX drivers
  Detected inpout32    : no
  Build SVF player     : yes
  Build BSDL subsystem : yes
  Bus drivers          : au1500 avr32 bcm1250 bf526_ezkit bf527_ezkit bf533_stamp bf533_ezkit bf537_stamp bf537_ezkit bf538f_ezkit bf548_ezkit bf561_ezkit bscoach ejtag ejtag_dma fjmem ixp425 jopcyc h7202 lh7a400 mpc5200 mpc824x ppc405ep ppc440gx_ebc8 prototype pxa2x0 pxa27x s3c4510 sa1110 sh7727 sh7750r sh7751r sharc_21065L slsup3 tx4925 zefant_xs3
  Cable drivers        : arcom byteblaster dlc5 ea253 ei012 ft2232 igloo jlink keithkoep lattice mpcbdm triton usbblaster wiggler xpc
  Lowlevel drivers     : direct ftd2xx

I should be happy using  notepad++ as my editor,  But it still nice if I can use a good IDE such as codeblocks or VS2010.

The ./configure command has created a makefile and a new  config.h for use in codeblocks. But codeblocks complain about mssing rule when I use the customize makefile.


I'll investigate next how this makefile is made of and will try to add those missing variables in the project settings.

I am currently on win7-64bit machine and so far so good, I was able to compile and  run urjtag.
 
Quote
To run autogen.sh, you need autoconf and automake, bison, and a recent flex.

Haven't use autogen.sh yet so I don't need those files yet.

Re: Compiling urjtag on windows

Reply #1
Great update jamz! Thanks! We'll post this up on the blog as part of the BBv2 testing series tomorrow. I'm moving this to a public forum now, please keep the updates coming :)
Got a question? Please ask in the forum for the fastest answers.

Re: Compiling urjtag on windows

Reply #2
Here's some notes and progress in compiling urjtag under windows, using code::blocks 10.05.. Been looking for cmake but and other tools but it will take so much time to understand.

After a successful  compile on debian and cygwin, I was able to go through the makefile and config.h, and config.log and other relevant information.
I have also a fresh install of the code::blocks  which is around 70mb (codeblocks-10.05mingw-setup.exe_
It has mingw built in already but there are some notes regarding compiling urjtag in mingw
I also have code:blocks installed in my debian, and its using gcc  and I have a mix though whether to do it in debian or in windows.
But since I am more of a windows user, I opted to compile it in windows machine, with code::blocks 10.05

I unpack a fresh copy of urjtag on a new directory and fireup code::base and created a new project file, in console mode and copy over the jtag.c into main.c
I've test compile it and it complains about having not found some files.
So I added the directories in project->build options->search directories tab:

Code: [Select]
c:urjtag-0.10
c:urjtag-0.10src
c:urjtag-0.10srclib
c:urjtag-0.10srcinclude


I also did an "add files recursively" by right clicking my project name under the projects tab.  This load all files found in the urjtag-0.10 directory.

then I recompile again it again, which gave me a missing config.h error, since this config files is created when I run the ./configure under cygwin and debian, I choose to copy it into the directory where main.c is located, and add it to my project and recompile again

And it complains about the undeclared 'JTAG_DATA_DIR'.  Adding #define JTAG_DATA_DIR "./"   temporarily solve this but created a new error about the missing "PACKAGE". I have put it in config.h but it still complain so I have to edit quit.c":

#include "config.h"  in srccmdquit.c

then again readline.h was not found so I have to goggle and download it from: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
add added the new directory in the search path.
Then 'LOCALEDIR' was then another undeclared or missing so adding it again to config.h as #define LOCALEDIR  "./"   the "./" was just temporary so that the compilation can pass this line.

Then another one came out after running the compile:

Code: [Select]
Compiling: srctapcablejlink.c
In file included from C:urjtag-0.10srctapcablejlink.c:36:0:
C:urjtag-0.10include/usbconn/libusb.h:30:17: fatal error: usb.h: No such file or directory

Then this again need to get the libusb from : http://www.libusb.org/ because usb.h is in the include directory
and again same procedure done with that readline thing.
compile again :)
and another error came out:

Code: [Select]
Compiling: srctapcablets7800.c
C:urjtag-0.10srctapcablets7800.c:35:22: fatal error: sys/mman.h: No such file or directory
compilation terminated.

So I remove if from the project, (right click in tapcablets7800.c then remove)
same thing was done with file  vision_ep9307.c
These are cables that can be enable and disable.
the config.h has some #undefs too that need to check. 
Then I got another error regarding the ftdi.h not found so I grab it from http://www.intra2net.com/en/developer/libftdi/&nbsp; , and added the search path, and end up with the following in the search directories:

Code: [Select]
C:urjtag-0.10
C:urjtag-0.10include
C:urjtag-0.10srclib
C:urjtag-0.10libusbinclude
C:urjtag-0.10readline
C:urjtag-0.10CDM20808
C:urjtag-0.10libftdisrc

then I got  this message after the compile:

Code: [Select]
== Build finished: 0 errors, 34 warnings ===

But no exe file.  looking at the build log I see this:

Code: [Select]
Linking console executable: binDebugdpurjtag.exe
mingw32-g++.exe: objDebugobjDebugsrcbsdlbsdl.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbsdlbsdl_bison.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbsdlbsdl_flex.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbsdlbsdl_sem.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbsdlvhdl_bison.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbsdlvhdl_flex.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusau1500.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusavr32.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbcm1250.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbf533_ezkit.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbf533_stamp.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbf537_stamp.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbf548_ezkit.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbf561_ezkit.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbscoach.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusbuses.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusejtag.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusejtag_dma.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusfjmem.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusgeneric_bus.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbush7202.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusixp425.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusjopcyc.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbuslh7a400.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusmpc5200.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusmpc824x.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusppc405ep.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusppc440gx_ebc8.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusprototype.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbuspxa2x0.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusreadmem.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbuss3c4510x.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbussa1110.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbussh7727.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbussh7750r.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbussh7751r.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbussharc21065l.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbusslsup3.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbustx4925.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbuswritemem.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrcbuszefant-xs3.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdaddpart.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdbit.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdbsdl.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdbus.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdcable.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdcmd.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmddebug.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmddetect.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmddetectflash.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmddiscovery.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmddr.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdendian.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmderaseflash.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdflashmem.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdfrequency.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdget.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdhelp.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdidcode.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdinclude.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdinitbus.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdinstruction.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdjtag_data_dir.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdparse.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdpart.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdpeekpoke.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdpod.o: No such file or directory
mingw32-g++.exe: objDebugobjDebugsrccmdprint.o: No such file or directory
Process terminated with status 1 (0 minutes, 46 seconds)

Almost there but,  objDebugobjDebug is a wrong dir .. I am stuck here but these files *.o exist 

To be continue.....

Re: Compiling urjtag on windows

Reply #3
dont forget these prereqs too:
http://dangerousprototypes.com/forum/in ... 3#msg15203

Are you able to make a windows compile under cygwin? If so, that is a fine option too. As long as we can make a compile that is usable under windows, that's what 80%+ of our users are using.
Got a question? Please ask in the forum for the fastest answers.

Re: Compiling urjtag on windows

Reply #4
yes, I was able to compile urjtag in cygwin.
when you install cygwin and take on the urjtag tar and unzip it,

you can run the:

./configure
make
make install

and you will be able to execute jtag.

compiling with ftd2xx library works too.

./configure --with-ftd2xx="/cdm20808"  works when I uncompress the drivers from ftdichips.
and it will show

Detected libftd2xx   : yes   

then run
make
make install

to make executable.
but I am more comfortable working on an IDE so I'll keep trying to make it work.
I already got 0 errors and 34 warnings that can be ignore for the mean time, but I was not able to produce an EXE file because the object files created where not seen by code::blocks, I haven't read the code:blocks manual yet to find the answer.

Re: Compiling urjtag on windows

Reply #5
Ian,
Check your e-mail, I have sent you a new build with patches to test.

Regards

Re: Compiling urjtag on windows

Reply #6
Woohoo! I'll get the test bench setup.
Got a question? Please ask in the forum for the fastest answers.

Re: Compiling urjtag on windows

Reply #7
Quote
update your urjtag build info with this, share with jams, forget editing the makfiles, and just add this after his cflags
LDFLAGS="-L/data/src/CDM208/i386"  LIBS="-lftd2xx"

Here's a note with a fix for the compile.
Got a question? Please ask in the forum for the fastest answers.

Re: Compiling urjtag on windows

Reply #8
Where LDFLAGS is the full path to your ftd2xx drivers

Re: Compiling urjtag on windows

Reply #9
Thanks!
I have started to build the documentation for cross compiling the urjtag and I have to start from scratch because I wanted to simplify things.

here's the link to simplify cross compiler builds on win64 and win32: http://mingw-w64.sourceforge.net/

Re: Compiling urjtag on windows

Reply #10
Great Jamz,

Also, I have built my own multilib toolchain with mingw64, it helps alot on multiple target builds on the linux side for windows x32/x64 builds

Thanks

Re: Compiling urjtag on windows

Reply #11
Hello All,

UrJtag-0.10 compiles successfully under native windows (win7) and CodeBlocks 10.05.

This took me so long before I was able to compile urjtag under codeblocks. But Ian was so kind not to give me some task so that I can focus on this. After reading a lot of materials  on the web, I was so surprise that its relatively easy to compile Urjtag under native windows, using only codeblocks with its default Mingw compiler, plus the ftd2xx source.

I decided to concentrate on the latest stable version (0.10, build 1502) since the svn version still gives me troubles (different directories, 2 exe files need to do plus the patches. but I hope to get around that too.)

Despite 34 warnings (see log) , An exe file was created and was running under windows console.
The zip file along with the codeblocks project file is in the svn repository http://code.google.com/p/dangerous-prot ... tail?r=656
 
The .cbp file should compile if you installed urjtag source in c:urjtag-0.10
There were only 3 files that were modified:  config.h, quit.c and safe-ctype.h.

Here are the steps to replicate compilation of urjtag-0.10 build 1502

1. Download urjtag 0.10 from http://sourceforge.net/projects/urjtag/files/ and uncompress to a directory (say c:urjtag-0.10)
2. you need to find a way to run ./configure because we need to create a config.h file. I used cygwin to do this. And I have a copy from my cygwin directory. Its best to just copy the full urjtag-0.10 after running the configure command under cygwin. But once you have the generated config.h, you do not need cygwin anymore.
 
3 Create a C console codeblocks project, (my codeblocks is a fresh install around 73mb)
save the .cbp  and .layout files  and exit.
4. Move the .cbp and .layout files under the src directory where the jtag.c resides. You can copy over jtag.c into main.c
5. open up the .cbp under codeblocks. Right click the project file (urjtag-0.10) and click on "add files recursively" It will check some files that need to be added to the project (default) (.c and .h)

6. Add to codeblocks search directories: 
(project->project build options->search directories->compiler tab)
c:urjag-0.10
c:urjag-0.10include
C:urjtag-0.10srclib
c:CDM20909


7. Modify/add to config.h
#define JTAG_DATA_DIR "DATA"

Disable readline from config.h (REMarked) depends how you run ./configure parameters
this might be disabled already in the file.
// #define HAVE_LIBREADLINE 1
// #define ENABLE_NLS 1
// #define HAVE_LIBUSB 1
// #define HAVE_READLINE_COMPLETION 1
// #undef HAVE_READLINE_H */
// #define HAVE_READLINE_HISTORY 1
// #define HAVE_READLINE_HISTORY_H 1
// #define HAVE_READLINE_READLINE_H 1

8. Remove from project file (  right click file in project dir, remove file).
This cause some errors, but I believe we do not need this things unless you use them.
srcjtag.c if still in the project file.
tapusbconnlibftdi
tapcablets7800.c 
tapcablevision_ep9307.c
tapcablejlink.c
tapcablexpc.c


9. Add #define "config.h" to the following files
cmd/quit.c
lib/safe-ctype.c

10. Add the ftd2xxlib to project build option->linker tab add under link libraries: (use the '...' to locate your ftd2xx library):
C:CDM20808i386ftd2xx.lib

Code: [Select]
Build started on: 04-02-2011 at 02:19.20
Build ended on: 04-02-2011 at 02:20.02
-------------- Build: Release in urjtag10 ---------------
Compiling: bsdlbsdl.c
Compiling: bsdlbsdl_bison.c
Compiling: bsdlbsdl_flex.c
bsdl_flex.c:2533: warning: 'yyunput' defined but not used
bsdl_flex.c:2575: warning: 'input' defined but not used
Compiling: bsdlbsdl_sem.c
C:urjtag-0.10srcbsdlbsdl_sem.c: In function 'create_register':
C:urjtag-0.10srcbsdlbsdl_sem.c:209: warning: unknown conversion type character 'z' in format
C:urjtag-0.10srcbsdlbsdl_sem.c:209: warning: too many arguments for format
Compiling: bsdlvhdl_bison.c
Compiling: bsdlvhdl_flex.c
vhdl_flex.c:2024: warning: 'yyunput' defined but not used
vhdl_flex.c:2066: warning: 'input' defined but not used
Compiling: busau1500.c
Compiling: busavr32.c
C:urjtag-0.10srcbusavr32.c: In function 'avr32_bus_read_end':
C:urjtag-0.10srcbusavr32.c:680: warning: 'data' may be used uninitialized in this function
Compiling: busbcm1250.c
Compiling: busbf533_ezkit.c
Compiling: busbf533_stamp.c
Compiling: busbf537_stamp.c
C:urjtag-0.10srcbusbf537_stamp.c:69: warning: 'bf537_stamp_bus_new' defined but not used
C:urjtag-0.10srcbusbf537_stamp.c:136: warning: 'bf537_stamp_bus_area' defined but not used
C:urjtag-0.10srcbusbf537_stamp.c:220: warning: 'bf537_stamp_bus_read_start' defined but not used
C:urjtag-0.10srcbusbf537_stamp.c:240: warning: 'bf537_stamp_bus_read_next' defined but not used
C:urjtag-0.10srcbusbf537_stamp.c:261: warning: 'bf537_stamp_bus_read_end' defined but not used
C:urjtag-0.10srcbusbf537_stamp.c:285: warning: 'bf537_stamp_bus_write' defined but not used
C:urjtag-0.10srcbusbf537_stamp.c:310: warning: 'bf537_stamp_bus_printinfo' defined but not used
Compiling: busbf548_ezkit.c
Compiling: busbf561_ezkit.c
Compiling: busbscoach.c
Compiling: busbuses.c
Compiling: busejtag.c
Compiling: busejtag_dma.c
Compiling: busfjmem.c
Compiling: busgeneric_bus.c
Compiling: bush7202.c
Compiling: busixp425.c
Compiling: busjopcyc.c
Compiling: buslh7a400.c
Compiling: busmpc5200.c
Compiling: busmpc824x.c
Compiling: busppc405ep.c
Compiling: busppc440gx_ebc8.c
Compiling: busprototype.c
Compiling: buspxa2x0.c
Compiling: busreadmem.c
Compiling: buss3c4510x.c
Compiling: bussa1110.c
Compiling: bussh7727.c
Compiling: bussh7750r.c
Compiling: bussh7751r.c
Compiling: bussharc21065l.c
Compiling: busslsup3.c
Compiling: bustx4925.c
Compiling: buswritemem.c
Compiling: buszefant-xs3.c
Compiling: cmdaddpart.c
Compiling: cmdbit.c
Compiling: cmdbsdl.c
Compiling: cmdbus.c
Compiling: cmdcable.c
Compiling: cmdcmd.c
Compiling: cmddebug.c
Compiling: cmddetect.c
Compiling: cmddetectflash.c
Compiling: cmddiscovery.c
Compiling: cmddr.c
Compiling: cmdendian.c
Compiling: cmderaseflash.c
Compiling: cmdflashmem.c
Compiling: cmdfrequency.c
Compiling: cmdget.c
Compiling: cmdhelp.c
Compiling: cmdidcode.c
Compiling: cmdinclude.c
Compiling: cmdinitbus.c
Compiling: cmdinstruction.c
Compiling: cmdjtag_data_dir.c
Compiling: cmdparse.c
Compiling: cmdpart.c
Compiling: cmdpeekpoke.c
Compiling: cmdpod.c
Compiling: cmdprint.c
Compiling: cmdquit.c
Compiling: cmdreadmem.c
Compiling: cmdregister.c
Compiling: cmdreset.c
Compiling: cmdsalias.c
Compiling: cmdscan.c
Compiling: cmdset.c
Compiling: cmdshell.c
Compiling: cmdshift.c
Compiling: cmdsignal.c
Compiling: cmdsvf.c
Compiling: cmdtest.c
Compiling: cmdusleep.c
Compiling: cmdwritemem.c
Compiling: flashamd.c
Compiling: flashamd_flash.c
Compiling: flashcfi.c
Compiling: flashdetectflash.c
Compiling: flashflash.c
Compiling: flashintel.c
Compiling: flashjedec.c
Compiling: flashjedec_exp.c
Compiling: jimintel_28f800b3.c
Compiling: jimsome_cpu.c
Compiling: jimtap.c
C:urjtag-0.10srcjimtap.c: In function 'jim_init':
C:urjtag-0.10srcjimtap.c:267: warning: unknown conversion type character 'z' in format
C:urjtag-0.10srcjimtap.c:267: warning: too many arguments for format
Compiling: libfclock.c
Compiling: libgetdelim.c
Compiling: libgetline.c
Compiling: liblbasename.c
Compiling: liblrealpath.c
Compiling: libmake-relative-prefix.c
C:urjtag-0.10srclibmake-relative-prefix.c: In function 'save_string':
C:urjtag-0.10srclibmake-relative-prefix.c:105: warning: implicit declaration of function 'malloc'
C:urjtag-0.10srclibmake-relative-prefix.c:105: warning: incompatible implicit declaration of built-in function 'malloc'
C:urjtag-0.10srclibmake-relative-prefix.c: In function 'split_directories':
C:urjtag-0.10srclibmake-relative-prefix.c:143: warning: incompatible implicit declaration of built-in function 'malloc'
C:urjtag-0.10srclibmake-relative-prefix.c:156: warning: implicit declaration of function 'free'
C:urjtag-0.10srclibmake-relative-prefix.c:156: warning: incompatible implicit declaration of built-in function 'free'
C:urjtag-0.10srclibmake-relative-prefix.c: In function 'free_split_directories':
C:urjtag-0.10srclibmake-relative-prefix.c:207: warning: incompatible implicit declaration of built-in function 'free'
C:urjtag-0.10srclibmake-relative-prefix.c: In function 'make_relative_prefix_1':
C:urjtag-0.10srclibmake-relative-prefix.c:242: warning: implicit declaration of function 'getenv'
C:urjtag-0.10srclibmake-relative-prefix.c:242: warning: assignment makes pointer from integer without a cast
C:urjtag-0.10srclibmake-relative-prefix.c:275: warning: implicit declaration of function 'access'
C:urjtag-0.10srclibmake-relative-prefix.c:305: warning: incompatible implicit declaration of built-in function 'free'
C:urjtag-0.10srclibmake-relative-prefix.c:358: warning: incompatible implicit declaration of built-in function 'malloc'
Compiling: libsafe-ctype.c
Compiling: main.c
Compiling: partbsbit.c
Compiling: partdata_register.c
Compiling: partinstruction.c
Compiling: partpart.c
Compiling: partsignal.c
Compiling: svfsvf.c
C:urjtag-0.10srcsvfsvf.c:609: warning: 'sigalrm_handler' defined but not used
Compiling: svfsvf_bison.c
Compiling: svfsvf_flex.c
svf_flex.c:1343: warning: 'yyunput' defined but not used
svf_flex.c:1385: warning: 'input' defined but not used
Compiling: tapcable.c
Compiling: tapcablearcom.c
Compiling: tapcablebyteblaster.c
Compiling: tapcablecmd_xfer.c
Compiling: tapcabledlc5.c
Compiling: tapcableea253.c
Compiling: tapcableei012.c
Compiling: tapcableft2232.c
Compiling: tapcablegeneric.c
C:urjtag-0.10srctapcablegeneric.c: In function 'generic_set_frequency':
C:urjtag-0.10srctapcablegeneric.c:400: warning: unknown conversion type character 'L' in format
C:urjtag-0.10srctapcablegeneric.c:400: warning: format '%u' expects type 'unsigned int', but argument 2 has type 'long double'
C:urjtag-0.10srctapcablegeneric.c:400: warning: too many arguments for format
Compiling: tapcablegeneric_parport.c
Compiling: tapcablegeneric_usbconn.c
Compiling: tapcablejim.c
C:urjtag-0.10srctapcablejim.c:169: warning: initialization from incompatible pointer type
C:urjtag-0.10srctapcablejim.c:170: warning: initialization from incompatible pointer type
Compiling: tapcablekeithkoep.c
Compiling: tapcablelattice.c
Compiling: tapcablempcbdm.c
Compiling: tapcabletriton.c
Compiling: tapcableusbblaster.c
Compiling: tapcablewiggler.c
Compiling: tapcablewiggler2.c
Compiling: tapchain.c
Compiling: tapdetect.c
Compiling: tapdiscovery.c
Compiling: tapidcode.c
Compiling: tapparport.c
Compiling: tapparportdirect.c
Compiling: tapparportppdev.c
Compiling: tapparportppi.c
Compiling: tapregister.c
Compiling: tapstate.c
Compiling: taptap.c
Compiling: tapusbconn.c
Compiling: tapusbconnlibftd2xx.c
Compiling: tapusbconnlibusb.c
Linking console executable: binReleaseurjtag10.exe
Output size is 356.50 KB
Process terminated with status 0 (0 minutes, 42 seconds)
0 errors, 35 warnings

Next task will be  to compile under codeblocks the latest svn version including the  patches into native windows environment.

Jamz

Re: Re: Compiling urjtag on windows

Reply #12
Jamz,

Great info, please keep us informed !!

Re: Compiling urjtag on windows

Reply #13
Thanks Tjtag

I am not yet successful in compiling the latest svn source. The some files in the svn is missing while it exist in the distribution, like the bsdl_config.h and the svf_bison.h and there are lots of compiler warnings and errors. although the latest svn was already updated and compile well in linux and cygwin, using the cross compiler in cygwin gives me problem, while the linux hosted cross compiler works well.

Here's just some additional notes that should keep in mind when compiling urjtag under windows and codeblocks:

For some reason, I still need to put on the search path for the usb.h which can be found under mingw ddk directory. Maybe its because mingw hate directory names with spaces. (like c:program files)
and sometimes  you need to edit long lines that span more than a line in codeblocks if you copy files from cygwin or linux into a windows directory. It always gives me an error regarding a missing ')' when that line looks valid to me.

I have remarked the #define HAVE_LIBUSB but it keeps on compiling libusb.c and libusb.h even though I remove it from the projects.

Also codeblocks can only create one exe file at a time ( I don't dig enough to find some configuration) but I will just create two project files (jtag.cbp and bsdl2jag.cbp).

Re: Compiling urjtag on windows

Reply #14
Hello all

I have successfully compiled urjtag build 1872 under codeblocks last week but didn't document it well and I got lost reproducing the same procedure, but now it compiled again. Its almost the same in compiling the released version of urjtag-10, with modified directories.

jtag has 0 errors and 202 warnings while  bsdl2jtag has 0 errors and 200 warnings and I do not yet know it those warnings can be safely ignored. 
I haven't touch the source to fix the warnings, except for the config.h and sysdep.h

You need to place the urjtag files in c:urjtag to succesfully compile. I've attached the project  jtag.cbp  file in codeblocks which should be place  in the C:urjtagsrcappsjtag, and the bsdl2jtag.cbp in C:urjtagsrcappsbsdl2jtag directory. Using this project file along with the config.h and sysdep.h will bypass the procedure of calling the ./configure command under cygwin or linux. The ./configure produces these files.

what I did:
I grab the urjtag files from the latest svn repository at urjtag.  Note that is build 1872.
And since the source  doesn't have the config.h, i need run configure under cygwin  to produce this file.

I created a jtag.cbp project file under codeblocks and rename jtag.c into main.c. I should use the original jtag.c file but codeblocks keep on complaing  with the "_MAIN16" not define thing.
then I have gone through the cycle of:
compile
add search path
compile again
remove some unneeded files from tap and cable directory
compile again
modify config.h or sysdep.h accordingly. ( remarks or #undef some lines that gets in the way)
and repeat same procedure from the start again until it has successfully produced an exe file.

Here's the codeblocks project file configuration for jtag.cbp

project->project build options->search directories: (both debug and release)

c:urjtag
c:urjtaginclude
c:urjtagincludeurjtag
c:urjtagsrcbsdl
c:urjtagsrclib
c:urjtagsrctag
c:CDM20808
c:Program files(x86)CodeblocksMingGWincludeDDK    -> this is for usb.h. remove (x86) if using  winxp. be sure to check for the existence of this file.

at project->project build options->linker settings:

C:CDM20808i386ftd2xx.lib

and removed the following files from project: (right click workspace and remove file or directory).

ice100
jlink
vslink
xpc
ts7800
vision_ep9307
parport
libftdi
parport directory

The bsdl2jtag.cbp is just a copy of jtag.cbp including the .layout file.  I move it in the bsdl2jtag directory and under codeblocks, right click bsdl2jtag project file, under properties, rename the title and in the build targets tabs, changes the output filename to bsdl2jag.exe.

You can bypass the procedure of running the ./configure command under cygwin or linux by using the attached files, by placing each file in the appropriate directories under c:urjtag  and when in codeblocks, just load jtag.cbp from the src/apps/jtag  and compile, switch and then load bsdl2jtag from src/apps/bsdl2jat and compile.  that's all.