MG/Linux Compiling

From MegaGlest
Revision as of 18:10, 1 May 2011 by SoftCoder (talk)
Jump to: navigation, search

This page explains how to compile MegaGlest on linux platforms.

Requirements

  • Get the project from the SVN using the command line or your favorite SVN tool (such as RabbitVCS or TortoiseSVN).
  • Download package dependencies for your Linux distribution (see mk/linux/setupBuildDeps.sh which can do that for Debian, Ubuntu, Fedora and Open SuSE based distro's). The following is the current dependency list (and the tools require wx):
    • jpeg
    • lua5.1
    • png
    • SDL
    • openal
    • curl
    • xerces-c
    • ogg
    • vorbis
    • vorbisfile
    • vorbisenc
    • z
    • GL
    • GLU
    • SDLmain
    • ircclient

Building using CMake by Script

  • Go to the directory megaglest
  • On linux run build-mg.sh
  • On windows run build-mg.bat
  • To compile for windows under linux run build-mg-win32.sh

Building using CMake by Hand

  • Open a terminal window and navigate to trunk (or the specified branch) and type the following:
mkdir build
cd build
cmake ..
make
  • If nothing goes wrong you will see megaglest.bin (and other binaries) in the same folder (mk/linux).

Notes: The follow are build types supported using cmake:

  • Release
  • Debug
  • RelWithDebInfo
  • MinSizeRel

To change the build type execute cmake (default is Release) using:

cmake -D CMAKE_BUILD_TYPE=<...>

e.g.

cmake -D CMAKE_BUILD_TYPE=Debug

Cross Compiling Windows binaries on Linux using MingW:

  • Download and extract the MingW win32 dependency archive from Sourceforge and extract into the source folder.
  • Install the MingW cross compiler for your distro. In Ubuntu run:
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
  • Open a terminal and cd to the root folder of your Mega-Glest folder (usually trunk).
  • Modify the script. You also need to change win32_deps/curl-7.20.1 to win32_deps/curl-7.21.3
  • Run the script:
./build-mg-win.sh
  • If all goes well you should see the Windows .exe binaries produced in the data/glest_game folder.

Test binaries

To test running the game, run the binary in mk/linux like this:

./megaglest.bin

These are some commandline options:

./megaglest.bin --help
./megaglest.bin --version
./megaglest.bin --opengl-info

See Also