build urjtag for windows

  • Gaston Rodriguez

    I need to build the current SVN version of urjtag for windows from cygwin, so I follow the instructions in .

    Firstly I installed the packages listed in "required software", plus some others also needed, some obvious like subversion and gcc, but other not so obvious, like CVS (I don't know why!) and maybe another that I don't remember now.

    After that, the instructions are:

        svn co urjtag

        cd urjtag/jtag
    With "svn co" I get in my disk a new directory "urjtag" and into it there is two similar directories: "jtag" and "urjtag". Based on the Changelog files in the both copies, the latest seems to be "urjtag", so I think the right command should be:

        cd urjtag/urjtag
    I'm right? Maybe the documentation should explain the differences between the both trunks.

    Next, have tried with "./" but the process fail:

        $ ./
        autoreconf-2.64: Entering directory `.'
        autoreconf-2.64: running: autopoint -force
        Copying file ABOUT-NLS
        Copying file tools/config.rpath
        Creating directory m4
        Copying file m4/codeset.m4
        Copying file m4/gettext.m4
        Copying file m4/glibc21.m4
        Copying file m4/iconv.m4
        Copying file m4/intdiv0.m4
        Copying file m4/intmax.m4
        Copying file m4/inttypes-pri.m4
        Copying file m4/inttypes.m4
        Copying file m4/inttypes_h.m4
        Copying file m4/isc-posix.m4
        Copying file m4/lcmessage.m4
        Copying file m4/lib-ld.m4
        Copying file m4/lib-link.m4
        Copying file m4/lib-prefix.m4
        Copying file m4/longdouble.m4
        Copying file m4/longlong.m4
        Copying file m4/nls.m4
        Copying file m4/po.m4
        Copying file m4/printf-posix.m4
        Copying file m4/progtest.m4
        Copying file m4/signed.m4
        Copying file m4/size_max.m4
        Copying file m4/stdint_h.m4
        Copying file m4/uintmax_t.m4
        Copying file m4/ulonglong.m4
        Copying file m4/wchar_t.m4
        Copying file m4/wint_t.m4
        Copying file m4/xsize.m4
        Copying file tools/mkinstalldirs
        Copying file po/
        Copying file po/Makevars.template
        Copying file po/Rules-quot
        Copying file po/boldquot.sed
        Copying file po/en@boldquot.header
        Copying file po/en@quot.header
        Copying file po/insert-header.sin
        Copying file po/quot.sed
        Copying file po/remove-potcdate.sin
        autoreconf-2.64: running: aclocal -force -I m4
        autoreconf-2.64: tracing
        autoreconf-2.64: running: libtoolize -force
        libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `tools'.
        libtoolize: linking file `tools/'
        libtoolize: putting macros in `m4'.
        libtoolize: linking file `m4/libtool.m4'
        libtoolize: linking file `m4/ltoptions.m4'
        libtoolize: linking file `m4/ltsugar.m4'
        libtoolize: linking file `m4/ltversion.m4'
        libtoolize: linking file `m4/lt~obsolete.m4'
        libtoolize: Consider adding `AC_CONFIG_MACRO_DIR()' to and
        libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
        autoreconf-2.64: running: /usr/bin/autoconf-2.64 -force error: possibly undefined macro: dnl
              If this token and others are legitimate, please use m4_pattern_allow.
              See the Autoconf documentation. error: possibly undefined macro: AS_IF error: possibly undefined macro: AC_PATH_TOOL
        autoreconf failed.

    What can be the cause of this problem? Maybe a software package missing? I'm forgetting something? Thanks in advance for any help.


    PD: I also noted a little inconsistency y the docs about the instructions to build with ftdi devices support. In section 2.4.5 (build urjtag for cygwin) the drivers are in the path C:\temp\ftdi-cdm-drivers, while in section 2.4.7 (build urjtag for windows in cygwin) the path is C:\tmp\cdm-drivers. This is a non issue, but can make more easy to copy and paste these commands without need to edit after.


  • brag

    brag - 2009-11-26

    hi all!
    i've the same problem, but on freebsd-7.2 compilation works fine…

  • brag

    brag - 2009-11-26

    cd urjtag/jtag work on cygwin

  • brag

    brag - 2009-11-27

    solved :)
    just install pkg-config :)
    and also delete files like *_bison.c,*_bison.h,*_flex.c

  • Gaston Rodriguez

    Hi burjak!

    I installed pkg-config and now the works well. Thank for the tip! But I do not want to remove files. I think bison* and flex* files are needed for the BSDL and SVF parsers, and I need both features.

    I tried configuring urjtag with these commands to make a windows executable:

        $ CFLAGS="-mno-cygwin -O2" ./configure -with-ftd2xx=/tmp/cdm-drivers -with-inpout32
        $ make

    But now I get an error during compile:

        /bin/sh ../../libtool -tag=CC   -mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -
        I. -I../.. -I../../include/urjtag   -I../.. -I../../include   -Wall -Wmissing-pr
        ototypes -Wstrict-prototypes -Wpointer-arith -Werror -mno-cygwin -O2 -I/tmp/cdm-
        drivers -MT detect.lo -MD -MP -MF .deps/detect.Tpo -c -o detect.lo detect.c
        libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../include/ur
        jtag -I../.. -I../../include -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpo
        inter-arith -Werror -mno-cygwin -O2 -I/tmp/cdm-drivers -MT detect.lo -MD -MP -MF
         .deps/detect.Tpo -c detect.c  -DDLL_EXPORT -DPIC -o .libs/detect.o
        detect.c: In function `urj_tap_detect_parts':
        detect.c:265: warning: unknown conversion type character `I' in format
        detect.c:265: warning: too many arguments for format
        make: ***  Error 1
        make: Leaving directory `/home/gaston/sw/urjtag/urjtag/src/tap'
        make: ***  Error 1
        make: Leaving directory `/home/gaston/sw/urjtag/urjtag/src'
        make: ***  Error 1
        make: Leaving directory `/home/gaston/sw/urjtag/urjtag'
        make: ***  Error

    I have no time now to debug this new issue, but I'm closer to a solution thanks to your contribution.

  • Gaston Rodriguez


    After some attempts I think I'm close to a solution.

    The right configure commands seems to be:

        $ CFLAGS="-mno-cygwin -O2" ./configure -with-ftd2xx=/cygdrive/c/tmp/cdm-drivers -with-inpout32 -disable-werror
        $ make

    I believe that enabling werror converts warnings into errors, making the build fail for non important things (at least for me, that I only want a 'jtag.exe' now!). Also I see that "/temp" are pointing to C:\cygwin\temp and not C:\temp as I was assuming before. Also I've added the option -without-libusb to avoid the need to install libusb, since I will use ftd2xx drivers.

    After configuring, make… still failing. But is at the very end of the process, and I think the problem is related to the readline support.

    When configure, readline are detected but a strange warnings appears:

        checking for a readline compatible library… -lreadline
        checking readline.h usability… no
        checking readline.h presence… no
        checking for readline.h… no
        checking readline/readline.h usability… no
        checking readline/readline.h presence… yes
        configure: WARNING: readline/readline.h: present but cannot be compiled
        configure: WARNING: readline/readline.h:     check for missing prerequisite head
        configure: WARNING: readline/readline.h: see the Autoconf documentation
        configure: WARNING: readline/readline.h:     section "Present But Cannot Be Comp
        configure: WARNING: readline/readline.h: proceeding with the compiler's result
        configure: WARNING:     ## --------------------- ##
        configure: WARNING:     ## Report this to ##
        configure: WARNING:     ## --------------------- ##
        checking for readline/readline.h… no
        checking whether readline supports history… yes
        checking history.h usability… no
        checking history.h presence… no
        checking for history.h… no
        checking readline/history.h usability… no
        checking readline/history.h presence… yes
        configure: WARNING: readline/history.h: present but cannot be compiled
        configure: WARNING: readline/history.h:     check for missing prerequisite heade
        configure: WARNING: readline/history.h: see the Autoconf documentation
        configure: WARNING: readline/history.h:     section "Present But Cannot Be Compi
        configure: WARNING: readline/history.h: proceeding with the compiler's result
        configure: WARNING:     ## --------------------- ##
        configure: WARNING:     ## Report this to ##
        configure: WARNING:     ## --------------------- ##
        checking for readline/history.h… no

    The error raised when abort compiling is:

        make: Entering directory `/home/gaston/sw/urjtag/urjtag/src/apps/jtag'
        gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../.. -I../../../include/urjtag -DLOCALE
        DIR=\"/usr/local/share/locale\"  -I../../.. -I../../../include  -Wall -Wmissing-
        prototypes -Wstrict-prototypes -Wpointer-arith -mno-cygwin -O2 -I/cygdrive/c/tmp
        /cdm-drivers -MT jtag.o -MD -MP -MF .deps/jtag.Tpo -c -o jtag.o jtag.c
        jtag.c:39:31: readline/readline.h: No such file or directory
        jtag.c: In function `urj_cmd_completion':
        jtag.c:121: warning: implicit declaration of function `rl_completion_matches'
        jtag.c:121: warning: assignment makes pointer from integer without a cast
        jtag.c: In function `jtag_load_history':
        jtag.c:135: warning: implicit declaration of function `using_history'
        jtag.c:157: warning: implicit declaration of function `read_history'
        jtag.c: In function `jtag_save_history':
        jtag.c:190: warning: implicit declaration of function `write_history'
        jtag.c: In function `jtag_readline_loop':
        jtag.c:247: error: `HIST_ENTRY' undeclared (first use in this function)
        jtag.c:247: error: (Each undeclared identifier is reported only once
        jtag.c:247: error: for each function it appears in.)
        jtag.c:247: error: `hptr' undeclared (first use in this function)
        jtag.c:257: warning: implicit declaration of function `readline'
        jtag.c:257: warning: assignment makes pointer from integer without a cast
        jtag.c:273: error: `history_length' undeclared (first use in this function)
        jtag.c:274: warning: implicit declaration of function `add_history'
        jtag.c:277: warning: implicit declaration of function `history_get'
        jtag.c: In function `main':
        jtag.c:566: error: `rl_attempted_completion_function' undeclared (first use in t
        his function)
        make: ***  Error 1
        make: Leaving directory `/home/gaston/sw/urjtag/urjtag/src/apps/jtag'
        make: ***  Error 1
        make: Leaving directory `/home/gaston/sw/urjtag/urjtag'
        make: ***  Error 2

    The problem seems to be clearly related to the readline and history support. I will try disabling this to try to complete the compilation, and then see what can be the cause of the "Present But Cannot Be Compiled" message.

    Any help is appreciated!

  • Gaston Rodriguez

    Hi all!

    Finally I arrive to a solution for my problem. I know this is not the best, but at least work for me.

    The steps to build urjtag for windows in cygwin are the following:

    - svn co urjtag
    - cd urjtag/urjtag
    - ./
    - Here I edit urjtag/urjtag/configure to remove the readline support.

    Simply erase from:

            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible


        $as_echo "#define HAVE_READLINE_COMPLETION 1" >>confdefs.h

    - CFLAGS="-mno-cygwin -O2" ./configure -with-ftd2xx=/cygdrive/c/tmp/cdm-drivers -with-inpout32 -without-libusb -disable-werror
    - make

    Here compilation fail. The output is:

            libtool: link: gcc -std=gnu99 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -mno-cygwin -O2 -I/cygdrive/c/tmp/cdm-drivers -o .libs/jtag.exe jtag.o  ../../../src/.libs/liburjtag.a
            ../../../src/.libs/liburjtag.a(libftd2xx.o):libftd2xx.c:(.text+0x131): undefined  reference to `__imp__FT_Write@16'
            ../../../src/.libs/liburjtag.a(libftd2xx.o):libftd2xx.c:(.text+0x2ea): undefined reference to `__imp__FT_Read@16'
            ../../../src/.libs/liburjtag.a(libftd2xx.o):libftd2xx.c:(.text+0x55a): undefined reference to `__imp__FT_Read@16'

    - cd src/apps/jtag/
    - gcc -mno-cygwin -O2 -I/cygdrive/c/tmp/cdm-drivers   -o jtag.exe jtag.o ../../../src/.libs/liburjtag.a -lm /cygdrive/c/tmp/cdm-drivers/i386/ftd2xx.lib


    After that I get the wanted "urjtag/urjtag/src/apps/jtag/jtag.exe" file!

    However this executable doesn't work because it look for the environment variable "HOME" to create config directories. In my PC the HOME variable doesn't exists. Instead I have two variables:

        HOMEPATH=\Documents and Settings\gaston

    I think this feature is new, and was not present in previous versions of urjtag. BTW, I edit a little the file "urjtag/urjtag/src/apps/jtag/jtag.c" to workaround this issue and the resulting executable is usable.

    I hope this report could be a help to any urjtag user that want to build it for windows, and for maintainers to debug the configure scripts to make the users life easier.


  • hj00bh

    hj00bh - 2010-03-14

    This solution doesn’t seem to work, showing: error: possibly undefined macro: AC_PROG_LIBTOOL

  • Dave Vandenbout

    Dave Vandenbout - 2010-05-27

    The preceding messages in this thread were very helpful in getting UrJTAG to compile for me.  I thought I would add the steps I followed to get a working installation.

    1) On a 32-bit Windows XP SP3 machine, I created a fresh installation of cygwin 1.7.5 containing these packages (most of these are installed by default; I placed *'s by the ones I had to explicitly install):

    Cygwin Package Information
    Package                 Version
    _update-info-dir        00896-1
    alternatives            1.3.30c-10
    * autoconf                8-1
    * autoconf2.1             2.13-10
    * autoconf2.5             2.65-1
    * automake                4-10
    * automake1.10            1.10.3-1
    * automake1.11            1.11.1-1
    * automake1.4             1.4p6-10
    * automake1.5             1.5-10
    * automake1.6             1.6.3-11
    * automake1.7             1.7.9-10
    * automake1.8             1.8.5-10
    * automake1.9             1.9.6-10
    base-cygwin             2.1-1
    base-files              3.9-3
    base-passwd             3.1-1
    bash                    3.2.49-23
    * binutils                2.20.51-2
    * bison                   2.4.2-1
    bzip2                   1.0.5-10
    coreutils               8.5-1
    cpio                    2.11-1
    crypt                   1.1-1
    cvs                     1.12.13-10
    cvsps                   2.2b1-1
    cygutils                1.4.2-1
    cygwin                  1.7.5-1
    cygwin-doc              1.7-1
    diffutils               2.9-1
    editrights              1.01-2
    expat                   2.0.1-1
    file                    5.04-1
    findutils               4.5.8-1
    * flex                    2.5.35-1
    gawk                    3.1.8-1
    * gcc-core                3.4.4-999
    * gcc-g++                 3.4.4-999
    * gcc-mingw-core          20050522-1
    * gcc-mingw-g++           20050522-1
    * gdb                     6.8-2
    * gettext                 0.17-11
    * gettext-devel           0.17-11
    * git           
    * git-svn       
    grep                    2.5.4-2
    groff                   1.20.1-2
    gzip                    1.3.12-2
    * ioperm                  0.4-1
    ipc-utils               1.0-1
    less                    436-1
    libapr1                 1.4.2-1
    libaprutil1             1.3.9-2
    libattr1                2.4.43-1
    libbz2_1                1.0.5-10
    libcurl4                7.19.6-1
    libexpat1               2.0.1-1
    libexpat1-devel         2.0.1-1
    libgcc1                 4.3.4-3
    libgdbm4                1.8.3-20
    libgettextpo0           0.17-11
    libgmp3                 4.3.1-3
    libiconv2               1.13.1-1
    libidn11                1.18-1
    libintl3                0.14.5-1
    libintl8                0.17-11
    libltdl7                2.2.7a-15
    liblzma1                4.999.9beta-11
    libncurses-devel        5.7-18
    libncurses10            5.7-18
    libncurses8             5.5-10
    libncurses9             5.7-16
    libneon27               0.29.3-1
    libopenldap2_3_0        2.3.43-1
    libpcre0                8.00-1
    libpopt0                1.6.4-4
    libpq5                  8.2.11-1
    libproxy0               0.2.3-2
    libreadline7            6.0.3-2
    libsasl2                2.1.19-3
    libserf0_0              0.3.1-1
    libsigsegv2             2.8-1
    libsqlite3_0            3.6.21-3
    libssh2_1               1.2.2-1
    libssp0                 4.3.4-3
    libstdc++6              4.3.4-3
    * libtool                 2.2.7a-15
    * libusb-win32  
    login                   1.10-10
    m4                      1.4.14-1
    * make                    3.81-2
    man                     1.6f-1
    mingw-runtime           3.18-1
    minires                 1.02-1
    openssl                 0.9.8n-1
    perl                    5.10.1-3
    perl-Error              0.17016-1
    * perl-ExtUtils-PkgConfig 1.12-1
    * pkg-config              0.23b-10
    * readline                6.0.3-2
    rebase                  3.0.1-1
    run                     1.1.12-11
    sed                     4.2.1-1
    * subversion              1.6.11-1
    * subversion-perl         1.6.11-1
    tar                     1.22.90-1
    tcltk                   20080420-1
    terminfo                5.7_20091114-14
    terminfo0               5.5_20061104-12
    texinfo                 4.13-3
    tzcode                  2010j-1
    w32api                  3.14-1
    which                   2.20-2
    xz                      4.999.9beta-11
    zlib                    1.2.3-10
    zlib-devel              1.2.3-10
    zlib0                   1.2.3-10

    2) I opened a cygwin shell window and issued the following commands:
    $ cd /cygdrive/c/temp
    $ git clone git://
    $ cd urjtag/urjtag
    $ ./

    That's it - UrJTAG built without a hitch! 

    I had a lot of problems before achieving this, mostly because I didn't have all the necessary packages installed.  Hopefully this will help others avoid my difficulties.

  • Dave Vandenbout

    Dave Vandenbout - 2010-05-28

    Well, I declared victory too soon.  After I ran autogen, issuing the make command generated a few errors.  I needed to add two more packages (popt, libiconv), but I still had an error where IN and OUT were defined in both svf_bison.h and in the w32api files windef.h and rpcdce.h.  I got around that by adding a define to AM_CFLAGS in urjtag/src/svf/


    After that, everything compiled and ran correctly.

    I'm not sure if the AM_CFLAGS fix is the correct way to handle this problem, but it works for me.

  • Gaston Rodriguez

    Hi Dave.

    Thanks for the info. I removed my old cygwin installation and started again, installing all the packages that you enumerate. However the "git clone" command doesn't work. The output from the console is:

    $ git clone git://
    Initialized empty Git repository in /cygdrive/c/tmp/urjtag/.git/

    And nothing more happens… After that I tried with the svn tree. The first steps works ok. I don't need to edit the "configure" file anymore (see my last post). I don't have to make the AM_CFLAGS trick neither.
    But the problem with the undefined references to the library libft2xx remains. The complete list of commands used now are:

    svn co  urjtag
    cd urjtag/urjtag
    CFLAGS="-mno-cygwin -O2" ./configure -with-ftd2xx=/cygdrive/c/tmp/cdm-drivers -with-inpout32 -without-libusb -disable-werror
    cd src/apps/jtag
    gcc -mno-cygwin -O2 -I/cygdrive/c/tmp/cdm-drivers -o jtag.exe jtag.o ../../../src/.libs/liburjtag.a -lm /cygdrive/c/tmp/cdm-drivers/i386/ftd2xx.lib

    Maybe the git tree is different to the svn?

  • Dave Vandenbout

    Dave Vandenbout - 2010-06-01


    I'll try a new git checkout clone and see if I have the same problem.  I didn't use CFLAGS and the FTDI library previously, so I'll try that as well.

    I'm not sure how the git and svn trees are synchronized. 

  • Dave Vandenbout

    Dave Vandenbout - 2010-06-03


    I was unable to fix the problem with readline.  I had to remove the readline stuff from configure like you did.

    The undefined references to functions in the ftd2xx.lib are caused by libtool: it is placing ftd2xx.lib before jtag.o in the call to the linker so the function references cannot be resolved.  Your direct invocation of gcc fixes that because it gets things in the right order.  I tried using gcc4 and it has the same problem, plus it doesn't support the -mno-cygwin option.

    I could probably fix these problems if I knew more about autoconf/automake/libtool…

  • Mike Frysinger

    Mike Frysinger - 2010-06-14

    git and svn are exactly the same

    the printf modifiers are limitations in the mingw/cygwin compiler.  build with -disable-werror to ignore them.

    you need to read the config.log itself to find out why your compiler is sucking and producing mixed results with the readline headers.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks