Thursday, March 20, 2008

Cross-compiling GMP

I build Windows binaries from Ubuntu, using the MinGW port (search for packages starting with mingw).

For the PBC library I need a Windows version of the GMP library, which I build using:
$ ./configure --prefix=~/cross/gmp --host=i586-mingw32msvc --build=local
$ make install
I don't fully understand how it works, but when it's over, I have libraries I can link against to produce Windows executables that can do multi-precision arithmetic.

I sometimes test the binaries with wine. Thus Windows can be completely avoided in the development cycle, from coding to building to testing. However, for an important project, I'd test on at least one real Windows box.