Author

Topic: Gitian windows compile on ubuntu (Read 1787 times)

legendary
Activity: 1232
Merit: 1094
August 18, 2013, 11:36:46 AM
#2
Looks like installing wine on the host fixes it.
legendary
Activity: 1232
Merit: 1094
August 18, 2013, 11:12:09 AM
#1
I am trying to compile using gitian using Ubuntu (so cross-compile for windows).

I have it mostly working.  However, I can get miniupnpc to work.

There is an executable "wingenminiupnpcstrings" that is generated during the building process.

The issue can be replicated with

Code:
wget -O miniupnpc-1.6.tar.gz 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz'

tar xzf miniupnpc-1.6.tar.gz

cd miniupnpc-1.6/

make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar

The error it gives is

Code:
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpc.o upnpc.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -c -o dll/upnpc.o upnpc.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o wingenminiupnpcstrings.o wingenminiupnpcstrings.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/wingenminiupnpcstrings.o wingenminiupnpcstrings.c
i586-mingw32msvc-gcc   wingenminiupnpcstrings.o  -lws2_32 -liphlpapi -o wingenminiupnpcstrings
wingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
make: wingenminiupnpcstrings: Command not found
make: *** [miniupnpcstrings.h] Error 127

What is happening is that it is generating "wingenminiupnpcstrings" as a windows executable, but it can't run the .exe, since it is cross compiled.

A simple workaround is to generate the file using linux, but then it gives the wrong string.

If i added the 2 sed commands to update the make file, I get this

Code:
i586-mingw32msvc-ar
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpc.o upnpc.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -c -o dll/upnpc.o upnpc.c
i586-mingw32msvc-gcc   wingenminiupnpcstrings.o  -lws2_32 -liphlpapi -o wingenminiupnpcstrings
./wingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
./wingenminiupnpcstrings: 1: ./wingenminiupnpcstrings: MZ����@���: not found
./wingenminiupnpcstrings: 1: ./wingenminiupnpcstrings: .data: not found
./wingenminiupnpcstrings: 2: ./wingenminiupnpcstrings: 6�R2��
                                                                 0: not found
./wingenminiupnpcstrings: 10: ./wingenminiupnpcstrings: Syntax error: Unterminated quoted string
[/quote]
Jump to: