First Start | Network Play | Configuration | FAQ | Bugs | Todo List | Changelog | Compilation

# Compilation

If you want to compile Armagetron (or run it in Linux), these are the libraries you need:

- Mesa from www.mesa3d.org (comes with the three libs GL,GLU and glut) or an official OpenGL
- SDL (Simple DirectMedia Layer) from www.libsdl.org version 1.0.1
  or higher; (the binary version is linked against version 1.2.0, but should work with some 1.1.x-versions, too)
and the additional
- SDL_image from www.libsdl.org/projects/SDL_image/index.html for the textures from the same site
which itself needs the libs
- pnglib and zlib from www.libpng.org/pub/png/pngcode.html that should be included in your distribution; if not, try www.debian.or.jp/debian.org/Packages/stable/graphics/libpng2-dev.html or www.slothmud.org/~hayward/Xmingw32/

### Basic Compilation

If you are using Linux/GCC, simply read on in the next paragraph. If you are using Windows/MSVC++, the easiest way to get Armagetron compiled is to grab my complete development system from WEBBASE/download_windows.html#src. I'm too lazy to describe the hard way.

You probably guessed it already: To compile Armagetron in a Linux environment, simply change to the main Armagetron directory and type

    CXXFLAGS="<your favorite C++ flags>" ./configure
    make

and you are done. If `configure` produced error messages, you probably do not have all the libraries you need; look hard at the error message, then check the file LIBS to see where you can get the missing libs. If `make` gave you errors, well... Mail me it's output or try to fix them yourself and send me a patch.

To run ArmageTron, you just type

    ./armagetron

I fear I have to apologize for the crude configuration script: it is my first project using this technique and it is probably full of bugs. If you have problems with it, simply send me the config.log (or fix the configure.in yorself if you can and mail me the changes; that would really be nice.)

To compile a dedicated server, use

    ./configure --disable-glout

insead of `./configure`

### Compiler Issues

I use gcc version 2.95.2 from gcc.gnu.org/ for linux compilation resp. an gcc 2.95.2 cross-compiler for the Windows version. Any higher version should do, too.

I sometimes test it with egcs-2.91.60; so far, no problems have occured (the linker complains a bit, that is all).

Everything before or equal to gcc 2.7.2.3 does NOT work; the corresponding c++ library is not compatible with SDL or the threads library, and exchanging the library alone does not help.

Maybe it was my fault, but pgcc from goof.com/pcg/ produced code that crashed every time an exception was thrown... Exceptions are only used in server mode to avoid a nasty way malevolent clients can block the server. Therefore, you still can use pgcc (tested: 2.95.2 and 2.95.3) to compile Armagetron, but exception handling will be disabled and you will be vulnerable to this attack. In a LAN game with friends, that should not be a problem.

### Installation

In the main directory, tpye

    make bindist

That creates a directory bindist with all the files you find in the binary distribution. Move it anywhere you want, i.e.

    /usr/local/games/armagetron.

To play, you just cd to this (`bindist` or `/usr/local/games/armagetron`) and type

    ./armagetron

### Advanced Compilation

If you wish to compile ArmageTron in a directory different from the location of the source, just create this directory, cd to it and tpye

    {Path to source}/configure
    make

and you are done.

## Compiling for Win9x

So you decided to build your own version of ArmageTron for Windows. Be warned: there lies a long and rocky path before you...

To compile ArmageTron for Win9x, you will need a Unix, a C++ cross-compiler and cross-compiled versions off all the libraries. Alternatively, get my development environment from WEBBASE/download_windows.html#src for MS Visual C++.

#### The cross compiler:

I use the Mingw32-version of gcc 2.95.2. Check www.devolution.com/~slouken/SDL/Xmingw32/index.html to learn how to install and configure it.
If that does not really help, you may try the GnuC++Win32-Page.

To use the cross compiler, you simply type

    EXPORT PATH={prefix}/i386-mingw32/bin:%PATH
    {do, whatever you would normally do, i.e. ./configute; make}

where `{prefix}` usually is `/usr/local/cross-tools`.

#### The libraries:

Check above for the sourcecode download locations. You can build all libraries from source (to test the compiler), but there are also binaries out there (://www.slothmud.org/~hayward/Xmingw32/). I chose to download the binary version of SDL (it saves a lot of work, i think), but built the other libs from source.

With libpng, there is a small problem: the Makefile fails to create `libpng.a`. You have to to it by hand typing

    ar rcs libpng.a *.o

#### Compilation:

After all the work above is done, this is as easy as it can be: set up your cross compiler, i.e. by typing

    EXPORT PATH=/usr/local/cross-tools/i386-mingw32/bin:%PATH

then follow the instructions above (normal case: type `./configure ; make`), copy or link your version of `SDL.DLL` to your build directory. Execute `armagetron.exe` to play.
Type

    make bindist

to recreate the files of the binary distribution in the directory `bindist`. Move it anywhere you want.

This document was created by Manuel Moos.

Last modification: Fre Mai 11 19:49:07 CEST 2001

First Start | Network Play | Configuration | FAQ | Bugs | Todo List | Changelog | Compilation