Adding note about optional glbinding dependency and how to configure for it
[supertux.git] / INSTALL.md
1 Install instructions for SuperTux - <http://supertux.lethargik.org/>
2 ====================================================================
3 Last update: December 20, 2007 by Christoph Sommer
4
5 Binaries
6 --------
7
8 We try to provide precompiled binaries of SuperTux for a number of
9 platforms. You should check <http://supertux.lethargik.org/wiki/Download>
10 for the packages and instructions on how to install them. If there are
11 no prebuilt binaries for your platform, then you might still be able
12 to compile the source code yourself. In this case read the next
13 sections.
14
15
16 Requirements
17 ------------
18
19 To build SuperTux from source, you need to have a number of tools and
20 libraries installed. Note that most of these things should already be
21 available prepackaged and optimized for your distribution, it is
22 recommended that you check your distribution first before downloading
23 from the websites. You can also check
24 <http://supertux.lethargik.org/wiki/Building_SuperTux> for up-to-date
25 build instructions for a variety of different platforms and
26 distributions.
27
28 * Linux development tools (your distribution should come with these):
29   - gcc compiler suite version 3.2 or newer (you need the c++ compiler
30     g++) <http://gcc.gnu.org>
31   - gnu binutils <http://www.gnu.org/software/binutils>
32   - a shell and POSIX commandline tools
33 * CMake 2.6 or later:
34   [Download](http://www.cmake.org/HTML/Download.html);
35   [Homepage](http://www.cmake.org/)
36 * OpenGL headers and libraries: OpenGL libraries and headers are
37   specific to your graphics card. Make sure that you have hardware
38   accelerated OpenGL drivers installed. Software renderers like Mesa
39   will make SuperTux unplayable slow.
40 * SDL 1.2.5 or later (1.2.8 is recommended on Mac OS X)
41   <http://www.libsdl.org>
42 * SDL_image (any version that includes PNG and JPEG support)
43   <http://www.libsdl.org/projects/SDL_image>
44 * PhysicsFS (1.0.x or 2.0.x) <http://www.icculus.org/physfs>
45 * OpenAL: There are no official Linux releases of OpenAL yet, you
46   should grab the latest CVS snapshot (any snapshot from 2005 should
47   work, earlier snapshots tend to have bugs). OpenAL 1.0 or later
48   implementations on other systems like Mac OS X or windows should
49   work. <http://www.openal.org>
50 * GLEW <http://glew.sourceforge.net/>
51 OR
52 * glbinding <https://github.com/hpicgs/glbinding>
53 * Boost's smart_ptr and format headers <http://www.boost.org/>
54 * cURL <http://curl.haxx.se/libcurl/>
55
56 Note: We tried to write our code clean, portable and platform neutral,
57 so it should be possible to compile it on a wide range of platforms
58 and also with other compilers than gcc. However we have no resources
59 to test other setups and it is likely that you hit small problems.
60 Reports and binary compiled packages are of course always welcome.
61 Send them to supertux-devel@lists.lethargik.org
62
63 Note about glbinding: To use glbinding instead of GLEW, open 
64 CMakeLists.txt and change this line from
65 OPTION(GLBINDING_ENABLED "Use glbinding instead of GLEW" OFF)
66 to
67 OPTION(GLBINDING_ENABLED "Use glbinding instead of GLEW" ON)
68
69
70 Installing under Linux/UNIX using CMake
71 ---------------------------------------
72
73 SuperTux uses CMake to generate a set of Makefiles for the build
74 process. To generate these Makefiles and build SuperTux, perform the
75 following steps:
76
77 1. `cd' to the directory where you unpacked the SuperTux source
78    archive, i.e. to the directory containing `src' and `data'.
79
80 2. Create and change to a new, empty build directory by running `mkdir
81    build', `cd build'.
82
83 3. Run `cmake ..' to create the Makefiles needed to build SuperTux
84    with standard options. If you are missing any libraries needed to
85    build SuperTux, install those first, then try running CMake again.
86    See below for instructions on how to change to standard options.
87
88 4. Type `make' to start the build process.
89
90 5. Type `make install' to install the programs and any data files and
91    documentation. (You should be a root user on Linux systems. You can
92    become a root user with the `su' command or by using `sudo make
93    install') Note that there is no uninstall target, so you might wish
94    to create a package or other system-specific installation instead.
95    
96 6. The game should work now and you can remove the source directory.
97
98 You can customize the build process by setting additional options for
99 CMake. The easiest way to do this is to use run `ccmake ..` instead of
100 `cmake ..` to bring up the curses-based user interface of CMake.
101 Select an option using the arrow keys, change the selected option by
102 pressing the Enter key, then hit the `c` (repeatedly, if necessary) to
103 apply your changes and bring up new options resulting from your newly
104 set ones. When you are done, press the `g` key to generate a new set
105 of Makefiles and exit.
106
107 Alternatively, you can pass options to `cmake ..' via the command
108 line. Some common command line switches are:
109
110 `-DCMAKE_VERBOSE_MAKEFILE=ON`
111 : Generates Makefiles that print all commands prior to executing them.
112
113 `-Dxxx_LIBRARY=/path/to/library.so -Dxxx_INCLUDE_DIR=/path/to/headerfiles`
114 : Manually specify the installation directory of a library.
115
116 `-DCMAKE_BUILD_TYPE=DEBUG`
117 : Enables debug mode and compiles extra debug symbols into the SuperTux
118 executable. This is useful when sending in bug reports to the
119 developers.
120
121 `-DCMAKE_BUILD_TYPE=RELEASE`
122 : Enables release mode and compiles some sanity checks out of the build.
123
124 Note for GIT users: SuperTux does not need to be installed on the
125 system, you can run it from its own directory.
126
127
128 Support
129 -------
130
131 You can contact us at [supertux-devel@lists.lethargik.org](mailto:supertux-devel@lists.lethargik.org)
132 and in the [#supertux](irc://chat.freenode.net/supertux) channel on
133 the chat.freenode.net IRC server.