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
Put them into a sub-directory "external" inside the wesnoth root dir, so it looks like:
wesnoth/external/include/SDL.h wesnoth/external/include/freetype/... ... wesnoth/external/lib/libSDL.a wesnoth/external/lib/libfreetype.a ...
Put all DLLs into the external/lib dir.
Create a file called SConstruct, and put the following text into it:
# vi: syntax=python import glob sources = glob.glob("src/*.cpp") + glob.glob("src/widgets/*.cpp") +\ glob.glob("src/serialization/*.cpp") + glob.glob("src/sdl_ttf/*.c") sources.remove("src/loadscreen_empty.cpp") env = Environment() # The cross compiler to use env["CC"] = "i586-mingw32msvc-gcc" env["CXX"] = "i586-mingw32msvc-g++" # Dependencies: SDL, SDL_net, SDL_mixer, SDL_image, freetype, libintl, libpng, # jpeg, zlib (included in SDL_image), libiconv # This is where I put the dependency headers env.Append(CPPPATH = ["external/include"]) # This is where I put the dependency libs env.Append(LIBPATH = ["external/lib"]) # Compilation settings env.Append(CCFLAGS = ["-W", "-Wall", "-O2", "-mwindow"]) env.Append(CPPPATH = ["src", "src/widgets"]) env.Append(LIBS = ["mingw32", "SDLmain", "SDL", "SDL_net", "SDL_mixer", "SDL_image", "intl", "wsock32", "freetype"]) # Scons stuff env.BuildDir("build", "src") env.SConsignFile("sconsign") # Windows stuff env["PROGSUFFIX"] = ".exe" # Compile it! env.Program("wesnoth", ["build/" + x[4:] for x in sources])
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 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: