Linux Compile Guide
Table of Contents
Preface
This guide assumes some familiarity with Linux/Unix systems and their command line, for example how to run commands that install packages as root. The author uses a Debian system, so users of other distributions might have to adapt some commands, like for the package manager. It was completely rewritten in 2010/08, the old version can be seen at http://developer.wz2100.net/wiki/LinuxCompileGuide?version=38.
Introduction
Warzone 2100 uses the common autotools build system, so the basic procedure is just "./configure && make" from the source tree, then you can run the game with "src/warzone2100". Note that we strongly discourage running "make install" unless you gave a custom prefix to ./configure (not /usr/ or /usr/local/, e.g. "./configure --prefix=/home/user/warzone"), since the game can be confused by old data when you install a newer version and haven't removed all old files first.
Generic Build Instructions
Preparation
You need to get the source for Warzone, either from a release tarball or SVN. You also need some build tools, and libraries with their header files (Linux distributions usually put those in separate packages with the suffix -dev or -devel, so for a library foo you need both libfoo and libfoo-dev(el) installed).
Getting The Dependencies
As mentioned, Warzone needs the various autotools to compile, as well as Flex, Bison, and various libraries. On a current Debian/Ubuntu system, you can install the needed packages with "apt-get build-dep warzone2100". That should install all needed packages, to do that manually, run "apt-get install build-essential automake flex bison libpng12-dev libsdl1.2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglc-dev zip unzip", plus the OpenGL development packages for your graphics driver (libgl1-mesa-dev for the open source drivers, nvidia-glx-dev for the binary Nvidia driver). For 2.3, you also need the libpopt-dev package, and bisonc++ on Ubuntu.
Getting The Source From A Tarball
Go to http://wz2100.net/download or http://sourceforge.net/projects/warzone2100/files/ to download it, then running "tar xfz warzone2100-<version>.tar.gz" will create a subfolder "warzone2100-<version>" in the current folder. Run "cd warzone2100-<version>" to change to that folder, unless stated otherwise, all following commands have to be run from there.
Getting The Source From SVN
Our base repository is at https://warzone2100.svn.sourceforge.net/svnroot/warzone2100, with the usual SVN subfolders trunk, branches and tags. The most important two trees at the moment are trunk (main development branch) and branches/2.3 (more or less stable release branch). For example, "svn co https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk warzone-trunk" will check out the current trunk into a subdirectory "warzone-trunk" (adapt for other branches). If you want to use git to access the SVN repository, see the git-svn part of Compile Guide. As for the tarball, change into the source folder, since all following commands have to be run from there.
Configuring
Now comes the time for the configure script. If you got the source from SVN, run "./autogen.sh" to create the script, tarballs already include it (but if it is too old, you might have to run autogen.sh to recreate a working version). As mentioned above, it is recommended to use a custom prefix (or run the game directly from the source tree, if you don't need translations), e.g. "./configure --prefix=/opt/warzone2100-trunk". You can install different versions into different prefixes, if you want to run e.g. both trunk and 2.3. If you want to make packages to distribute, please use the "--with-distributor=<your name/distro name/website here>" option, so if it crashes, we know who made the build.
Compiling
Compiling is done with a simple "make", maybe using the -jX option to run X processes in parallel (if possible).
Installing
If you want to install the game and gave configure a custom prefix, run "make install" now.
Updating
If you want to install a new version into the same prefix as an older one, make sure to remove all old files first. With a custom prefix, this is easy, just run "rm -rf <prefix>" (e.g. for the prefix used in the configure section above "rm -rf /opt/warzone2100-trunk"). Then either get a new tarball or do "svn up" to update your SVN tree, and restart at "Configuring" above.
Building Debian/Ubuntu Packages
Current trunk and 2.3 have dpkg scripts to build .debs of Warzone. Get the source and dependencies as above, then run "ln -s pkg/dpkg debian" so dpkg can find the files (having them in debian directly makes life for the packagers harder). To build the packages themselves, run "dpkg-buildpackage -uc -b" (you need to have the abovementioned dependencies installed, but if something is missing, it'll tell you the package names). This will create warzone2100, warzone2100-data and warzone2100-music packages in the parent folder which you can then install with dpkg -i (-music isn't necessary). If you want to have videos as well, you can use http://sourceforge.net/projects/warzone2100/files/warzone2100/Videos/warzone2100-video_2.3-1_all.deb/download for the good English videos. Or download the sequences.wz you want to use (low-quality English and German are the two other options at the moment), put it into "pkg/dpkg/videos" and run "dpkg-buildpackage -uc -b" from there. The videos probably won't change in the foreseeable future, so you won't have to update that package for newer versions of the game.
