CompilingWesnoth/CrossCompiling

From Wesnoth

[edit]Compiling Wesnoth

Platforms
Tools

Cross-compiling wesnoth v1.13.0-dev from Linux Mint 17 (Qiana) to win32, using mingw32 and scons

Here's my detailed notes from recent successful build. It should work just the same for ubuntu also.

Cross-compiling with mingw and scons


Here's another attempt at cross-compiling linux->windows using scons, by Allefant.

To use this, you need scons and mingw and of course a checkout from the wesnoth svn repository. You also need the source for SDL, as well as header files (SDL_net.h, SDL_image.h and SDL_mixer.h from the source packages) and DLLs (the -win32 packages) for the following packages: SDL_image, SDL_net, SDL_mixer.

And you need the developer files (-lib packages) for freetype, libintl, libpng, jpeg, libiconv.

You need to adjust the path from include/freetype2/freetype/.. to include/freetype after unpacking

Last, you will need the Python headers and Python .DLL (both are included e.g. in the windows installer on python.org). If you don't have wine to extract files from the installer, the headers can also be obtained from the Python sources package, and the .dll I found with google:

Put them into a sub-directory "win-deps" inside the wesnoth root dir, so it looks like:

wesnoth/win-deps/include/SDL.h
wesnoth/win-deps/include/freetype/...
...
wesnoth/win-deps/lib/libSDL.a
wesnoth/win-deps/lib/libfreetype.a
...

Put the files in the Include folder inside the python .tar.bz2 into a subfolder called python24, and also drop PC/pyconfig.h from the .tar.bz2 into that folder.

Put all DLLs into the win-deps/lib dir.

Then inside your wesnoth folder, do this:

cd utils
scons

You may want to adjust some of the settings, like the exact name of the mingw tools. Next, type scons.

It should compile, and create wesnoth.exe.

For running wesnoth you need also the binaries (-bin packages) of freetype, libintl, libpng, jpeg, libiconv. Copy the DLL files (also the SDL and Python ones from above) into the wesnoth root directory. Now, send the whole folder to the windows machine, and there the windows users can double-click wesnoth.exe and play the latest SVN version.

At the time of writing this is the list of files I needed to download (Python is not listed, you need that as well though):

This page was last modified on 22 April 2015, at 07:15.