-
Notifications
You must be signed in to change notification settings - Fork 0
/
Compiling_xoreos-tools.mw
127 lines (76 loc) · 4.36 KB
/
Compiling_xoreos-tools.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
This page gives a few tips and pointers on how to compile xoreos-tools on various platforms.
__TOC__
==Compiler and build system==
xoreos-tools is written in C++, so a C++ compiler, like [https://gcc.gnu.org/ GCC] or [http://clang.llvm.org/ clang] is required. xoreos-tools follows the C++14 standard. 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===
On Debian-based distributions (including Ubuntu), you should be able to install the required compiler and build system packages with
<nowiki>apt-get install libc6-dev g++ make autoconf automake libtool gettext</nowiki>
On Arch Linux, you can install the necessary packages with
<nowiki>sudo pacman -S base-devel cmake</nowiki>
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 [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==
xoreos-tools uses the following libraries to function:
* [https://en.wikipedia.org/wiki/Iconv iconv]
* [http://www.zlib.net/ zlib] (>= 1.2.3.4)
* [http://tukaani.org/xz/ liblzma] (>= 5.0.5)
* [http://www.xmlsoft.org/ libxml2] (>= 2.8.0)
* [http://www.boost.org/ Boost] (>= 1.53.0)
** Boost.Utility
** Boost.StringAlgo
** Boost.System
** Boost.Filesystem
** Boost.Uuid
** Boost.Smart_Ptr
** Boost.ScopeExit
** 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 liblzma-dev libxml2-dev libboost-all-dev
On Arch Linux, you can install these dependencies with
sudo pacman -S zlib xz 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-xz mingw-w64-i686-libxml2 mingw-w64-i686-boost
On Windows, if you're using MSYS2, you can install these dependencies for 64-bit with
pacman -S mingw-w64-x86_64-zlib mingw-w64-x86_64-xz 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-tools==
Make sure 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>
The binaries can then be found in the src subdirectory.
Optional, non-conventional ./configure flags:
{|
|
* --with-werror
|| Compile with -Werror
|-
|
* --without-warnings
|| Compile without the extra warnings enabled
|-
|
* --with-lto
|| Compile with link-time optimization
|}
===CMake ===
Type
<nowiki>cmake . && make</nowiki>
The binaries can then be found in the bin subdirectory.
This builds xoreos-tools without any optimizations, so you might want to use
<nowiki>cmake -DCMAKE_BUILD_TYPE=Release . && make</nowiki>
(optimized, no debug information) or
<nowiki>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . && make</nowiki>
(optimized, with debug information) instead.
Please read [http://www.cmake.org/runningcmake/ Running CMake] on the CMake website for in-depth information on invoking CMake.
==Unit tests==
On both build systems,
<nowiki>make check</nowiki>
compiles and runs our unit tests.