Last modified 15 months ago Last modified on 02/27/11 19:29:09

Windows Cross Compile Guide

Preface

This guide describes how to cross-compile Warzone for Windows on Linux (starting with r8841 for trunk, r8851 for 2.3, older instructions below). Instructions are for a Debian unstable system, but should be easy to adapt for other distros.

Requirements

You need the following packages: subversion, nsis (to build an installer), mingw32-runtime, mingw32-binutils, and either the old mingw32 or gcc-mingw32 (at least version 4.4.2-2), plus of course the Warzone source and the usual build tools (autoconf, automake, make... using ccache is not required, but very recommended). All library dependencies are downloaded during the build process.

Configuration

For preparation, run "./autogen.sh", and to build an installer with correct translations "./configure && make && make -Cpo update-po && make distclean" (this is necessary until #1473 is fixed).

You can configure the build with a win32/__BUILD_CONFIG.USER file, where you can set two options. DOWNLOADS specifies where downloaded source packages are saved, default is win32/downloads. You can set this to some other directory to not redownload the files after e.g. cleaning the complete source tree. HOST_TRIPLET depends on the configuration of the used cross-compiler, on Debian unstable, this would be HOST_TRIPLET=i586-mingw32msvc which is already the default, you only need to set this if you need a different prefix. These options can also be set when calling the build script: "win32/__BUILD_SCRIPT HOST_TRIPLET=i586-mingw32msvc".

Building etc.

The whole process is handled by win32/__BUILD_SCRIPT (run it like that from the top of the source tree, or as ./__BUILD_SCRIPT from the win32 dir). For a simple build of the game you don't need any options (except the host triplet mentioned above). To build an installer, you also need the nsis package, and the --enable-installer option. If you want to use other options for the configure script, just pass them to the build script.

Note: If you make a version for other people to use, please add --with-distributor=<your name/website>, so that we know where builds are from when people send us crashdumps.

After a successful compile run, the binary is located in win32/build/src/warzone2100.exe, the installer in win32/build/pkg/nsis/.

To remove the compiled files use the clean option to the script, very-clean also removes the downloaded sources. Those are saved in win32/downloads.

Attachments