Compiling xoreos-tools: Difference between revisions
(→GNU/Linux: Add pacman command line) |
(Add a few notes about MSYS2 on Windows) |
||
Line 21: | Line 21: | ||
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. | 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. | ||
On Windows, it is recommended that instead of Visual Studio, you use [https://msys2.github.io/ MSYS2] together with [https://mingw-w64.org/ Mingw-w64] (which can produce both 32-bit and 64-bit binaries). MSYS2 provides a package manager, with which you can install xoreos' library dependencies very easily. | |||
You can install the 32-bit toolchain in MSYS2 with | |||
<nowiki>pacman -S base-devel git mingw-w64-i686-toolchain mingw-w64-i686-cmake</nowiki> | |||
You can install the 64-bit toolchain in MSYS2 with | |||
<nowiki>pacman -S base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake</nowiki> | |||
==Libraries== | ==Libraries== | ||
Line 52: | Line 62: | ||
sudo pacman -S zlib libxml2 boost boost-libs | sudo pacman -S zlib libxml2 boost boost-libs | ||
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. | Other GNU/Linux distributions should work similarily. | ||
On Windows, if you're using MSYS2, you can install these dependencies for 32-bit with | |||
pacman -S mingw-w64-i686-zlib mingw-w64-i686-libxml2 mingw-w64-i686-boost | |||
On Windows, if you're using MSYS2, you can install these dependencies for 32-bit with | |||
pacman -S mingw-w64-x86_64-zlib mingw-w64-x86_64-libxml2 mingw-w64-x86_64-boost | |||
Windows users not using MSYS2 will 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== | ==Compiling xoreos== |
Revision as of 21:02, 30 November 2016
This page gives a few tips and pointers on how to compile xoreos-tools on various platforms.
Compiler and build system
xoreos-tools 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 gettext
On Arch Linux, you can install the necessary packages with
sudo pacman -S base-devel cmake
On other distributions, it should work similarily.
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.
On Windows, it is recommended that instead of Visual Studio, you use MSYS2 together with Mingw-w64 (which can produce both 32-bit and 64-bit binaries). MSYS2 provides a package manager, with which you can install xoreos' library dependencies very easily.
You can install the 32-bit toolchain in MSYS2 with
pacman -S base-devel git mingw-w64-i686-toolchain mingw-w64-i686-cmake
You can install the 64-bit toolchain in MSYS2 with
pacman -S base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
Libraries
xoreos-tools uses the following libraries to function:
- iconv
- zlib (>= 1.2.3.4)
- libxml2 (>= 2.8.0)
- Boost (>= 1.53.0)
- Boost.Utility
- Boost.StringAlgo
- Boost.System
- Boost.Filesystem
- Boost.Regex
- Boost.Hash
- Boost.Function
- Boost.Bind
- Boost.Uuid
- Boost.Smart_Ptr
- Boost.ScopeExit
- Boost.Atomic
- Boost.Locale
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 libxml2-dev libboost-all-dev
On Arch Linux, you can install these dependencies with
sudo pacman -S zlib libxml2 boost boost-libs
Other GNU/Linux distributions should work similarily.
On Windows, if you're using MSYS2, you can install these dependencies for 32-bit with
pacman -S mingw-w64-i686-zlib mingw-w64-i686-libxml2 mingw-w64-i686-boost
On Windows, if you're using MSYS2, you can install these dependencies for 32-bit with
pacman -S mingw-w64-x86_64-zlib mingw-w64-x86_64-libxml2 mingw-w64-x86_64-boost
Windows users not using MSYS2 will 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 binaries can then be found in the src subdirectory.
Optional, non-conventional ./configure flags:
|
Compile with -Werror |
|
Compile without the extra warnings enabled |
|
Compile with link-time optimization |
CMake
Type
cmake . && make
The binaries can then be found in the bin subdirectory.
Please read Running CMake on the CMake website for in-depth information on invoking CMake.