shadowm

Untitled

Apr 7th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.62 KB | None | 0 0
  1. Contents
  2. ========
  3.  
  4. 1. Prerequisites
  5. 2. Build Environment
  6. 3. SCons Build
  7. 4. CMake Build
  8. 5. Build Options
  9.  
  10.  
  11. 1. Prerequisites
  12. ================
  13.  
  14. You'll need to have these libraries and their development headers installed in
  15. order to build Wesnoth:
  16.  
  17. * Boost libraries:
  18. * Filesystem >= 1.44.0
  19. * Locale >= 1.48.0
  20. * Iostreams >= 1.36.0
  21. * Multi-index >= 1.36.0 (header only)
  22. * Random >= 1.48.0
  23. * Regex >= 1.36.0
  24. * Serialization >= 1.36.0 (header only)
  25. * Asio >= 1.36.0 (header only)
  26. * Program Options >= 1.36.0
  27. * System >= 1.36.0
  28. * SDL libraries:
  29. * SDL >= 1.2.10
  30. * SDL_image >= 1.2.0 (with PNG and JPEG support)
  31. * SDL_mixer >= 1.2.12 (with Ogg Vorbis support)
  32. * SDL_ttf >= 2.0.8
  33. * SDL_net
  34. * Vorbisfile
  35. * libbz2
  36. * libz
  37.  
  38. The following libraries are optional dependencies that enable additional
  39. features:
  40.  
  41. * D-Bus (libdbus-1):
  42. Desktop notifications on Linux, *BSD, etc.
  43.  
  44. * libpng:
  45. PNG screenshots, otherwise only BMP is supported
  46.  
  47. * GNU history (libreadline):
  48. Command history and history expansion in the built-in Lua console.
  49.  
  50. Note that although different Boost version requirements are listed, individual
  51. libraries from different releases are generally incompatible with each other
  52. and you should not mix and match.
  53.  
  54. Also note that SDL 1.2.14 is known to have problems on Windows, so we advise
  55. you to use SDL 1.2.15 instead.
  56.  
  57. Although not recommended, you may use libintl on platforms other than Windows
  58. instead of Boost.Locale. For scons, set the `libintl` option to `true`.
  59.  
  60. It is possible, but unsupported, to compile the game with any previous version
  61. of SDL_mixer >= 1.2.0, at the cost of reduced Unicode support.
  62.  
  63.  
  64. 2. Build Environment
  65. ====================
  66.  
  67. The following build systems are fully supported for compiling Wesnoth on most
  68. platforms:
  69.  
  70. * SCons >= 0.98.3
  71. * CMake >= 2.6.0
  72.  
  73. You will also need to have a working installation of GNU gettext to build the
  74. translations.
  75.  
  76. While Wesnoth may be easily installed system-wide using SCons or CMake, it is
  77. also possible to run it directly from the source directory after building. This
  78. may be useful in situations where you don't have root access or need to
  79. rebuild Wesnoth frequently (i.e. for development and testing).
  80.  
  81. Note: It has been reported that using GCC 3.3.6 and earlier versions with
  82. optimizations enabled will result in a build that is incapable of using
  83. multiplayer. See <https://gna.org/bugs/?10326> for further details. We
  84. recommend using GCC 4.x to build Wesnoth.
  85.  
  86.  
  87. 3. SCons Build
  88. ==============
  89.  
  90. Unlike CMake or the classic "autotools" build-system (configure && make),
  91. configuration and building are done in the same step with SCons.
  92.  
  93. Simply type `scons` in the top-level directory to build the game client and
  94. MP server:
  95.  
  96. $ scons
  97.  
  98. It is possible to select individual targets to build by naming them in the
  99. command line separated by spaces.
  100.  
  101. To build the game client only:
  102.  
  103. $ scons wesnoth
  104.  
  105. Building the MP server only:
  106.  
  107. $ scons wesnothd
  108.  
  109. The `install` target will install any binaries that were previously compiled
  110. (use su or sudo if necessary to write files into the installation prefix):
  111.  
  112. # scons install
  113.  
  114. SCons takes a `prefix=` argument that specifies where to install the game and
  115. its resource files. The prefix defaults to `/usr/local`; for production builds,
  116. you may wish to use `/usr` instead:
  117.  
  118. $ scons prefix=/usr
  119.  
  120.  
  121. 4. CMake Build
  122. ==============
  123.  
  124. Unlike SCons, CMake has separate configuration and build steps. Configuration
  125. is done using CMake itself, and build is done using 'make'.
  126.  
  127. There are two ways to build Wesnoth with CMake: inside the source tree or
  128. outside of it. Out-of-source builds have the advantage that you can have
  129. multiple builds with different options from one source directory.
  130.  
  131. To build Wesnoth out of source:
  132.  
  133. $ mkdir build && cd build
  134. $ cmake .. -DCMAKE_BUILD_TYPE=Release
  135. $ make
  136.  
  137. To build Wesnoth in the source directory:
  138.  
  139. $ cmake . -DCMAKE_BUILD_TYPE=Release
  140. $ make
  141.  
  142. To install Wesnoth after building (as root using su or sudo if necessary):
  143.  
  144. # make install
  145.  
  146. To change build options, you can either pass the options on the commandl ine:
  147.  
  148. $ cmake .. -DOPTION_NAME=option_value
  149.  
  150. Or use the ccmake front-end which displays all options with their cached values
  151. on a console UI:
  152.  
  153. $ ccmake ..
  154.  
  155. Another possibility is to use a question-based interface, which may be more
  156. convenient for some cases:
  157.  
  158. $ cmake -i ..
  159.  
  160.  
  161. 5. Build Options
  162. ================
  163.  
  164. A full list of options supported by SCons along with their descriptions and
  165. defaults is available by running `scons --help` from the Wesnoth source. For
  166. CMake, you may either run the ccmake front-end or run cmake and open
  167. CMakeCache.txt from the build directory in a text editor.
  168.  
  169. $ scons option_name1=option_value1 [option_name2=option_value2 [...]]
  170. $ cmake -DOPTION_NAME1=option_value1 [-DOPTION_NAME2=option_value2 [...]]
  171.  
  172. With SCons, boolean options take 'yes' or 'true' for a true value, and 'no' or
  173. 'false' for a false value. CMake uses 'ON' for a true value, and 'OFF' for a
  174. false value.
  175.  
  176. Some of the most important options follow.
  177.  
  178. * build=<build type> (SCons)
  179. CMAKE_BUILD_TYPE=<build type> (CMake)
  180.  
  181. Selects a specific build configuration when compiling. 'release' produces
  182. the default, optimized (-O2) build for regular use. 'debug' produces a
  183. slower and larger unoptimized (-O0) build with full debug symbols, which is
  184. often needed for obtaining detailed backtraces when reporting bugs.
  185.  
  186. NOTE: By default, CMake will produce 'debug' builds unless a different
  187. configuration option is passed in the command line.
  188.  
  189. * ENABLE_GAME=<boolean> (CMake)
  190.  
  191. Whether to build the game client binary. Use command line target selection
  192. selection with SCons.
  193.  
  194. * ENABLE_SERVER=<ON/OFF> (CMake)
  195.  
  196. Whether to build the MP server binary. Use command line target selection
  197. selection with SCons.
  198.  
  199. * prefix=<full path> (SCons)
  200. CMAKE_INSTALL_PREFIX=<full path> (CMake)
  201.  
  202. Installation prefix for binaries, resources, and documentation files.
  203.  
  204. * nls=<boolean>
  205. ENABLE_NLS=<boolean> (CMake)
  206.  
  207. Whether to compile and install translations.
  208.  
  209. * strict=<boolean> (SCons)
  210. ENABLE_STRICT_COMPILATION=<ON/OFF> (CMake)
  211.  
  212. Whether to treat compiler warnings as errors or not. Primarily intended for
  213. developers.
  214.  
  215. * prefsdir=<directory name> (SCons)
  216. PREFERENCES_DIR=<directory name> (CMake)
  217.  
  218. Hardcoded user preferences and user data directory. The default is to leave
  219. this unspecified so that Wesnoth will use separate XDG paths such as
  220. .config/wesnoth and .local/share/wesnoth/<version> for its user preferences
  221. and data, respectively.
  222.  
  223. * cxxtool=<program> (SCons)
  224. CMAKE_CXX_COMPILER=<program> (CMake)
  225.  
  226. Specifies which C++ compiler to use. By default, the system's default C++
  227. compiler will be selected automatically during configuration.
  228.  
  229. * ccache=<boolean> (SCons)
  230.  
  231. Whether to run the compiler through ccache first. Useful if the compiler
  232. executable is not a symbolic link to ccache. Requires ccache to be
  233. installed first.
  234.  
  235. If using CMake, use CMAKE_CXX_COMPILER instead.
  236.  
  237. * extra_flags_<build>=<compiler flags> (SCons)
  238.  
  239. extra_flags_config=<compiler flags> (SCons)
  240. CXX_FLAGS_USER=<compiler flags> (CMake)
  241.  
  242. Additional compiler flags to use when compiling a specific build type
  243. (SCons-only). To apply the same flags to all builds, use extra_flags_config
  244. (SCons) or CXX_FLAGS_USER (CMake) without a build type suffix.
  245.  
  246. Alternatively, you may specify your flags in the CXXFLAGS environment
  247. variable.
  248.  
  249. * fifodir=<full path> (SCons)
  250. FIFO_DIR=<full path> (CMake)
  251.  
  252. server_uid=<UID> server_gid=<GID> (SCons)
  253. SERVER_UID=<UID> SERVER_GID=<GID> (CMake)
  254.  
  255. Directory and owner id for the wesnothd control FIFO file. This is relevant
  256. only if you wish to be able to communicate with a locally-running wesnothd
  257. instance through a named pipe. You must run wesnothd with the same UID
  258. specified at build time for this to work.
Advertisement
Add Comment
Please, Sign In to add comment