Cross building with mingw

From Gnash Project Wiki

Jump to: navigation, search

I found a good post on a Makefile that builds a full cross compiler tool chain with many dependent libraries, for building win32 executables with mingw32. It builds a recent G++ version 4.3.3, and runs forever, but seems the easiest way to build a mingw32 tool chain for building Gnash for win32.


Fedora 10 includes a mingw32 package with many hard to build libraries like boost included. Using their default packages, I configure Gnash like this to cross compile:

../trunk/configure --enable-gui=sdl --enable-media=ffmpeg --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --disable-plugins --with-sysroot=/usr/i686-pc-mingw32/sys-root/mingw

It turns out that to cross compile the latest ffmpeg, you need a more recent mingw32 runtime and w32api than is in the updates for Fedora 10. I assume it'll be fixed in Fedora 11, but till then just grab the newer versions from the mingw32 web site and untar them in /usr/i686-pc-mingw32/.

I used the standard mingw32 toolchains available with Fedora or Ubuntu, I then cross compiled a bunch more libraries that Gnash needed, including upgrading the mingw32 and w32api libraries to newer releases so ffmpeg would compile.

The sys-root I used is at [Mingw32 Sys-Root - Apr 20, 2009].

A newer sysroot that works with GCC 4.4 is here: The sys-root I used is at [Mingw32 Sys-Root - June 14, 2009].