Compiling xoreos: Difference between revisions

From xoreos Wiki
Jump to navigation Jump to search
m (→‎Libraries: Boost was bumped to 1.48.0)
(Update build HOWTO with information about CMake)
Line 4: Line 4:
==Compiler and build system==
==Compiler and build system==


xoreos is written in C++, so a C++ compiler, like [https://gcc.gnu.org/ GCC] or [http://clang.llvm.org/ clang] is required. Its build system is based on [https://en.wikipedia.org/wiki/GNU_build_system Autotools], more specifically [https://www.gnu.org/software/autoconf/ Autoconf], [https://www.gnu.org/software/automake/ Automake] and [https://www.gnu.org/software/libtool/ Libtool].
xoreos is written in C++, so a C++ compiler, like [https://gcc.gnu.org/ GCC] or [http://clang.llvm.org/ clang] is required. It has two build systems: [https://en.wikipedia.org/wiki/GNU_build_system Autotools] ([https://www.gnu.org/software/autoconf/ Autoconf], [https://www.gnu.org/software/automake/ Automake] and [https://www.gnu.org/software/libtool/ Libtool]) and [https://en.wikipedia.org/wiki/CMake CMake]. Use whichever you feel more comfortable with.


===GNU/Linux===
===GNU/Linux===
Line 20: Line 20:
===Windows===
===Windows===


Our build system is autotools-based, so we unfortunately do not support Visual Studio. Windows users need to install [http://www.mingw.org/ MinGW]. For further information, please read [[#A note on build systems and Visual Studio|this note]].
Since Visual Studio does not work with autotools, you have to use the CMake build system if you want to compile xoreos with Visual Studio. If you're using [http://www.mingw.org/ MinGW], however, you're free to choose either build system.


==Libraries==
==Libraries==
Line 61: Line 61:
==Compiling xoreos==
==Compiling xoreos==


Open a terminal, change into the directory of your sources and type
Make you have your compiler, build system and libraries installed correctly. Then open a terminal and change into the directory of your sources.
 
===autotools===
 
Type


  <nowiki>./autogen.sh && ./configure && make</nowiki>
  <nowiki>./autogen.sh && ./configure && make</nowiki>


This ''should'' compile xoreos successfully if the compiler, build system and libraries have been installed correctly. The binary can be found in the src subdirectory, called "xoreos" or, on Windows, "xoreos.exe". Alternatively, you can install it system-wide with
The binary can be found in the src subdirectory, called "xoreos" or, on Windows, "xoreos.exe".
 
===CMake ===
 
Type


  <nowiki>make install</nowiki>
  <nowiki>cmake . && make</nowiki>


Please also have a look at the [[Running xoreos]] page.
The binary can be found in the bin subdirectory, called "xoreos" or, on Windows, "xoreos.exe".


==A note on build systems and Visual Studio==
Please read [http://www.cmake.org/runningcmake/ Running CMake] on the CMake website for in-depth information on invoking CMake.


There are certain build systems that promise to generate both standard Makefiles and Visual Studio project files. I have tried CMake, SCons and qmake, and found them all lacking, so they're unfortunately not an option for xoreos.
==Running xoreos==


Another options would be to parse our Automake files, and generate Visual Studio project files out of them. ScummVM does something similar with its [https://github.com/scummvm/scummvm/tree/master/devtools/create_project create_project], but their Makefiles are a bit different than ours. Somebody™ "just" needs to adapt ScummVM's create_project. So far, no one has.
Please have a look at the [[Running xoreos]] page.

Revision as of 22:34, 20 April 2015

This page gives a few tips and pointers on how to compile xoreos on various platforms.

Compiler and build system

xoreos is written in C++, so a C++ compiler, like GCC or clang is required. It has two build systems: Autotools (Autoconf, Automake and Libtool) and CMake. Use whichever you feel more comfortable with.

GNU/Linux

On Debian-based distributions (including Ubuntu), you should be able to install the required compiler and build system packages with

apt-get install libc6-dev g++ make autoconf automake libtool

On other distributions, it should work similarily.

Mac OS X

Due to the dependency on SDL2 (see below), you need at least Mac OS X 10.5 if you use a precompiled SDL2 library, and at least Mac OS X 10.7 if you're compiling SDL2 yourself.

Windows

Since Visual Studio does not work with autotools, you have to use the CMake build system if you want to compile xoreos with Visual Studio. If you're using MinGW, however, you're free to choose either build system.

Libraries

xoreos uses the following libraries to function:

  • iconv
  • zlib (>= 1.2.3.4)
  • liblzma (>= 5.0.5)
  • Boost (>= 1.48.0)
    • Boost.StringAlgo
    • Boost.System
    • Boost.Filesystem
    • Boost.Regex
    • Boost.Unordered
    • Boost.Hash
    • Boost.Date_Time
    • Boost.Function
    • Boost.Bind
    • Boost.Uuid
    • Boost.Smart_Ptr
    • Boost.Atomic
  • OpenGL (>= 2.1)
  • SDL2 (>= 2.0.0)
  • FreeType 2 (>= 2.4.0 (libtool number >= 11.0.5))
  • OpenAL (>= 1.12)
  • MAD (>= 1.15.1b)
  • libogg (>= 1.2.0)
  • libvorbis (>= 1.3.1)
  • libfaad (>= 2.7)
  • libxvidcore (>= 1.2.2)

On Debian-based GNU/Linux distribution (including Ubuntu), you should be able to install these libraries and their development packages with

apt-get install zlib1g-dev liblzma-dev libboost-all-dev libsdl2-dev libfreetype6-dev \
    libopenal-dev libmad0-dev libogg-dev libvorbis-dev libfaad-dev libxvidcore-dev

Other GNU/Linux distributions should work similarily. Windows users have to visit each website manually and download a precompiled version, or, if not available, download the source and compile the library themselves.

Compiling xoreos

Make you have your compiler, build system and libraries installed correctly. Then open a terminal and change into the directory of your sources.

autotools

Type

./autogen.sh && ./configure && make

The binary can be found in the src subdirectory, called "xoreos" or, on Windows, "xoreos.exe".

CMake

Type

cmake . && make

The binary can be found in the bin subdirectory, called "xoreos" or, on Windows, "xoreos.exe".

Please read Running CMake on the CMake website for in-depth information on invoking CMake.

Running xoreos

Please have a look at the Running xoreos page.