svn rev 2039 cross compiling i686-w64-mingw32 fails

2014-01-14
2014-01-15
  • Hello,
    compiling native on a debian wheezy (7.1) works fine, but cross compiling for i686-w64-mingw-32 fails. I configured with

    ./configure --enable-maintainer-mode --host=i686-w64-mingw32 --with-ftd2xx=/home/tkrawuts/mnt/urjtag/ftdi-driver-win81 --disable-werror --disable-nls --without-libusb --disable-silent-rules --enable-relocatable

    Somehow only chain.c is compiled with gcc instead of i686-w64-mingw-32. Maybe it is related to the python script (setup.py) called before? I appreciate any advice how to fix this.

    Thank you
    Tobias

    PS: end of compile output:

    ...
    libtool: link: i686-w64-mingw32-ranlib .libs/liburjtag.a
    libtool: link: rm -fr .libs/liburjtag.lax
    libtool: link: ( cd ".libs" && rm -f "liburjtag.la" && ln -s "../liburjtag.la" "liburjtag.la" )
    make[3]: Leaving directory /home/tkrawuts/mnt/urjtag/urjtag_sf_svn/src' make[2]: Leaving directory/home/tkrawuts/mnt/urjtag/urjtag_sf_svn/src'
    Making all in po
    make[2]: Entering directory /home/tkrawuts/mnt/urjtag/urjtag_sf_svn/po' make[2]: Leaving directory/home/tkrawuts/mnt/urjtag/urjtag_sf_svn/po'
    Making all in bindings
    make[2]: Entering directory /home/tkrawuts/mnt/urjtag/urjtag_sf_svn/bindings' Making all in python make[3]: Entering directory/home/tkrawuts/mnt/urjtag/urjtag_sf_svn/bindings/python'
    { /usr/bin/python setup.py build && touch build; } || { exit 1; }
    running build
    running build_ext
    building 'urjtag' extension
    creating build
    creating build/temp.linux-i686-2.7
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_CONFIG_H -I../.. -I../../include -I/usr/include/python2.7 -c chain.c -o build/temp.linux-i686-2.7/chain.o
    In file included from chain.c:29:
    ../../sysdep.h:47:21: error: windows.h: No such file or directory
    error: command 'gcc' failed with exit status 1

     
    • akre
      akre
      2014-01-14

      Hi,

      You must tell python to cross compile. According to a quick google search I
      found https://pypi.python.org/pypi/distutilscross

      Change Makefile.am in urjtag/bindings accordingly. I’ve not made this myself
      so I don’t know if it works though.

      However if you don’t need the python bindings just supply --disable-python
      to configure

      /Regards Ake

      From: Tobias Krawutschke [mailto:tkrawuts951@users.sf.net]
      Sent: den 14 januari 2014 15:51
      To: [urjtag:discussion]
      Subject: [urjtag:discussion] svn rev 2039 cross compiling i686-w64-mingw32
      fails

      Hello,
      compiling native on a debian wheezy (7.1) works fine, but cross compiling
      for i686-w64-mingw-32 fails. I configured with

      ./configure --enable-maintainer-mode --host=i686-w64-mingw32
      --with-ftd2xx=/home/tkrawuts/mnt/urjtag/ftdi-driver-win81 --disable-werror
      --disable-nls --without-libusb --disable-silent-rules --enable-relocatable

      Somehow only chain.c is compiled with gcc instead of i686-w64-mingw-32.
      Maybe it is related to the python script (setup.py) called before? I
      appreciate any advice how to fix this.

      Thank you
      Tobias

      PS: end of compile output:

      ...
      libtool: link: i686-w64-mingw32-ranlib .libs/liburjtag.a
      libtool: link: rm -fr .libs/liburjtag.lax
      libtool: link: ( cd ".libs" && rm -f "liburjtag.la" && ln -s
      "../liburjtag.la" "liburjtag.la" )
      make[3]: Leaving directory /home/tkrawuts/mnt/urjtag/urjtag_sf_svn/src'
      make[2]: Leaving directory/home/tkrawuts/mnt/urjtag/urjtag_sf_svn/src'
      Making all in po
      make[2]: Entering directory /home/tkrawuts/mnt/urjtag/urjtag_sf_svn/po'
      make[2]: Leaving directory/home/tkrawuts/mnt/urjtag/urjtag_sf_svn/po'
      Making all in bindings
      make[2]: Entering directory
      /home/tkrawuts/mnt/urjtag/urjtag_sf_svn/bindings' Making all in python
      make[3]: Entering
      directory/home/tkrawuts/mnt/urjtag/urjtag_sf_svn/bindings/python'
      { /usr/bin/python setup.py build && touch build; } || { exit 1; }
      running build
      running build_ext
      building 'urjtag' extension
      creating build
      creating build/temp.linux-i686-2.7
      gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
      -Wstrict-prototypes -fPIC -DHAVE_CONFIG_H -I../.. -I../../include
      -I/usr/include/python2.7 -c chain.c -o build/temp.linux-i686-2.7/chain.o
      In file included from chain.c:29:
      ../../sysdep.h:47:21: error: windows.h: No such file or directory
      error: command 'gcc' failed with exit status 1


      svn rev 2039 cross compiling i686-w64-mingw32 fails
      https://sourceforge.net/p/urjtag/discussion/682993/thread/e9eaba7d/?limit=2 5#d16e


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/urjtag/discussion/682993/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • ...
        However if you don’t need the python bindings just supply --disable-python
        to configure
        ...

        Hi Ake, thank you very much,- that fixed it for the cross build. I cross compiled a static linked exe (but needs ftd2xx.dll) with my custom bus drivers for Win 8.1 with following configure call on the debian machine:

        CFLAGS="-DJTAG_BIN_DIR=\\"/\\" -DJTAG_DATA_DIR=\\"/data\\"" LDFLAGS="-L/home/tkrawuts/mnt/urjtag/ftdi-driver-win81/i386 -static" LIBS="-lftd2xx" ./configure --enable-maintainer-mode --host=i686-w64-mingw32 --with-ftd2xx="/home/tkrawuts/mnt/urjtag/ftdi-driver-win81" --disable-python --disable-werror --disable-nls --without-libusb --disable-silent-rules --enable-static

        Most of the switches and environment vars are blindly copied from the DP cross compile instructions.

        Best regards
        Tobias