Building:Linux:SCons

From FIFE development wiki
(Redirected from Linux compile guide)
Jump to: navigation, search

Tux-32x32.png Platform-dependent information: Linux.

The following passage contains information that is specific to Linux and other POSIX-based operating systems.

Introduction

This guide describes how you can compile the FIFE sourcecode into a binary on your Linux (and basically on every other POSIX) system.

Dependencies

There is a separate article listing all build dependencies.

Getting the latest version with svn

Instructions how to get the latest version is described in Subversion repository.

Customize dependency paths

Edit the build/linux2-config.py file to customize dependency paths and other build options.

Compiling

FIFE uses scons as a build-wrapper. If you have GNU/Debian install scons with 'apt-get install scons'. If you are feeling lucky, just change into the trunk directory of the checked out sources and run:

scons ext

This will compile guichan and libpng and install them to <FIFE>/ext/install/lib

After ext has been successfully (check for any errors) built you will no longer have to build it again!

To compile FIFE type:

scons

Compile flags

You can see them, the descriptions, default and actual values by running:

scons -h

Possible builds problems

Required lib XXX not found :(

Check:

  • Make sure both the library and the headers (-dev package?) are installed!!!
  • Are the libs registered system-wide (is the directory listed in /etc/ld.so.conf)? Does the linker find them (ld -l$libname)?
  • Ensure that a pkg-config .pc file is available for the missing library (see section for lib SDL_ttf below)
    • try copying a .pc file from a subdir of the FIFE tree to /usr/lib/pkgconfig
    • try editing the .pc file to set the prefix to the correct location
    • run 'pkg-config --libs LIBNAME' to test it
    • use 'ln' to create a link from a specific lib file to one required by FIFE (for example, I had to create a link from libboost_filesystem.so to

libboost_filesystem-mt.so)

Required lib SDL_ttf not found

  • Try and create a symbolic link for the pkg config file SDL.pc to sdl.pc for case sensitivity:
ln -s /usr/lib/pkgconfig/sdl.pc /usr/lib/pkgconfig/SDL.pc

NOTE: If you are getting a message that scons cant find SDL_ttf and you are using a debian based system you should also install the libsdl-ttf2.0-dev and python2.6-dev packages.

If you have installed SDL_ttf and tips above don't help. Try this tutorial [1], download source code and compile with: g++ lesson07.cpp -lSDL -lSDL_ttf -lSDL_image, to check if SDL_ttf works. If so, copy all *.pc files to directory that keeps them in your system (my was /usr/lib/pkgconfig/) and edit them to show directory that contain placeholders for libs. Easiest way is to find SDL.h file (if in /usr/locale/include do not change *.pc files) and than change paths in *.pc files.

Installation shortcuts

Debian based systems (e.g. Ubuntu)

Note! the list is not anywhere near complete at the moment due to need for a fresh install to check this. Also, out-dated versions of these packages can cause problems. One common issue is SWIG: Packages version 1.3.29 and older will not work. SWIG version can be checked with 'swig -version'.

  • Command.png
    sudo apt-get install build-essential scons libsdl1.2-dev libboost-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libvorbis-dev libalut-dev python-dev libboost-regex-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev swig zlib1g-dev libxcursor-dev libopenal-dev libasound2-dev libguichan-dev
     

Additional information.

There are separate articles that cover the topics how to launch FIFE, what the available key bindings are and how the ingame console works.

Personal tools