This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.
Cross compiling with MXE
M Cross Evironment (MXE) provides an easy to set up cross compiling environment which produces static windows binaries. You can use MXE to build SuperTux.
- Install MXE according to the documentation:
git clone -b stable https://github.com/mxe/mxe.git
The location you installed it into will be called mxe_path later on.
- Install the required libraries in MXE:
make boost curl gcc gettext glew openal physfs sdl sdl_image sdl_mixer ogg vorbis w32api
- checkout a supertux copy into a directory outside the mxe tree.
Hack your build
- windres.exe is hardcoded in supertux. Go to /mxe_path/usr/bin and symlink i686-pc-mingw32-windres to windres.exe:
ln -s windres.exe ./i686-pc-mingw32-windres
see also Bug 846
- cd into the supertux directory and create a build directory
mkdir build cd build
- Now launch cmake:
ccmake .. -DCMAKE_TOOLCHAIN_FILE=/mxe_path/usr/i686-pc-mingw32/share/cmake/mxe-conf.cmake
- Configure by pressing [c]
- You'll get an error about SDLIMAGE_INCLUDE_DIR. Exit with [e].
- Now set the following variables in "advanced mode" [t]. Use the arrow keys to move, [Return] to enter and leave editing mode.
- Press [c] to configure again: There should be no more errors
- Press [g] to generate the makefiles and exit ccmake. Ccmake might complain about
CMAKE_TOOLCHAIN)FILEnot being used in the project: just ignore ([e]).
- Now type
PATH=$PATH:/mxe_path/usr/bin makeand watch it compile. If you forgot the
PATHstatement then cmake will complain about not finding
- The resulting
supertux2.exedoes not depend on any dlls.