forked from OctaForge/OF-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
174 lines (111 loc) · 7.74 KB
/
INSTALL.txt
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Compiling OctaForge
********************
Officially supported platforms for OctaForge (those which include/will include binaries) are currently Linux, FreeBSD, Windows and Mac OS X.
It should work without problems also on Solaris and other UNIX-like or UNIX systems.
For different platforms, compilation instructions might differ a bit, so separate OSes will be explained separately.
For all OSes
============
1. In all cases, you need to get source code.
You can use either release tarball or Git source versioning system to get source code.
(Git will get you most recent source)
To get source from Git, use:
.. code-block :: bash
$ git clone git://github.com/OctaForge/OF-Engine.git
It assumes you have Git installed. (http://git-scm.com).
If you're using Windows, you can use TortoiseGit GUI to make download easier.
On Mac, you can get packages for example here http://code.google.com/p/git-osx-installer/
Linux, BSD, Solaris and other UNIX-like or UNIX systems (excluding Darwin)
==========================================================================
On these OSes compilation should be really trivial.
Instructions assume Linux with deb packaging system,
with little modifications it should work everywhere.
1. Open terminal window and get some dependencies to build.
.. code-block :: bash
$ sudo apt-get install cmake build-essential libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev zlib1g-dev liblua5.1-dev uuid-dev
If I list the dependencies (for other OSes), they are:
1. CMake - http://cmake.org - this is a build system.
2. build-essential - on Debian, metapackage installing GNU compiler set and a few other things.
Basically basic things you need to build sources.
3. SDL dev package, SDL_image dev package, SDL_mixer dev package
4. Zlib dev libraries and headers
5. Lua dev libraries and headers
6. e2fsprogs for uuid generator, is part of almost every Linux distro by default,
on FreeBSD it's available in ports as e2fsprogs-libuuid
2. Open a terminal, build OF:
.. code-block :: bash
$ cd $HOME/OctaForge_source/cbuild
$ cmake ..
$ make
$ make install
If you have a multicore processor, you can use -jNUMCORES+1 as make argument.
3. You're done, you should have binaries in OFROOT/bin_unix.
You can as well crosscompile Windows binaries on that environment.
In order to do so, install mingw32 environment (gcc/g++, libraries etc.)
and proceed normally as when compiling ELF binaries, just append
required argument when running cmake:
.. code-block :: bash
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../src/tools/mingw32-toolchain.cmake
The toolchain file possibly won't work on your system without modification
because of different path to MinGW install, so modify the toolchain file
if required. Variables to modify are clearly commented.
Remember that resulting binaries won't go to bin_unix, they'll go to bin_win.
Windows
=======
On Windows, you don't need to get dependencies, they're bundled.
You have to get CMake though, so install it from www.cmake.org and let it write PATH.
Then you can proceed with compilation, which is done using MinGW
(you should be as well able to use code::blocks to build)
Remember that Visual Studio is NOT supported because of its lack of standards conformance.
Also, OF supports just 32bit binaries currently. You can use/build 32bit binaries on
64-bit Windows too, so it's not a big problem for now. The guide assumes 32bit Windows,
but it should be the same or almost the same on 64bit Windows too.
You can also crosscompile Windows binaries on Linux/BSD box. See UNIX/UNIX-like part to see how to do that.
So next steps are:
1. Install latest MinGW distribution whichever way you want. You need just the core (C/C++ support).
You can install it wherever you want, but make sure to change steps of this guide accordingly after that.
2. Append this into your PATH environment variable. (modify path if needed)
.. code-block :: bash
;C:\mingw\bin
1. Run CMake GUI. As "Where is source code", set path to your OF directory. As "Where to build binaries",
set cbuild directory of your OF directory.
Hit "Configure" button. It will ask you what type of build files it should generate.
Select MinGW Makefiles.
You'll see some variables in red. Set CMAKE_INSTALL_PREFIX to same value as "Where is source code" is.
Hit Configure once again, and Generate.
Or instead of running GUI for CMake, open cmd, go into cbuild directory, and do "cmake .. -DCMAKE_INSTALL_PREFIX=. -G 'MinGW Makefiles'",
that will take care of both configuring and generating.
If you prefer to use code::blocks IDE, you can use CodeBlocks MinGW Makefiles generator and build using the cbp project file that'll
appear in cbuild directory, but that's untested around now and might NOT work (though should work just fine).
If you use code::block, specify CMAKE_CODEBLOCKS_EXECUTABLE variable when running cmake and point it to your codeblocks.exe path.
See how you're setting CMAKE_INSTALL_PREFIX, it's the same thing.
Example cmake command for cbp is
.. code-block :: bash
cmake .. -DCMAKE_INSTALL_PREFIX=. -DCMAKE_CODEBLOCKS_EXECUTABLE='C:\\Program Files\\CodeBlocks\\codeblocks.exe' -G 'CodeBlocks - MinGW Makefiles'
After building in cbp, make sure to "build" INSTALL target as well. After that, binaries should be in CCROOT\\bin_win.
Mac OS X (Darwin)
=================
**Note:** Might not work (untested with lua)
1. You'll need to get some dependencies, first. (I assume you've got OF repository already downloaded)
1. The XCode developer DVD. I got it after registration on Mac developer portal, filename of xcode dvd i downloaded was "xcode322_2148_developerdvd.dmg"
at this URL http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/5.1.17.2.1.3.3.1.0.1.1.0.3.3.3.3.1
2. The needed SDL dmg files - http://www.libsdl.org/release/SDL-1.2.14.dmg ,
http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.dmg ,
http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.dmg
Put the SDL.framework, SDL_mixer.framework and SDL_image.framework from the dmgs to /Library/Frameworks
3. Get CMake here http://www.cmake.org/files/v2.8/cmake-2.8.2-Darwin-universal.dmg
4. Install Lua libraries / headers using your preferred way (i.e. with fink)
2. If you don't want to use xcode IDE, then simply go to "cbuild" directory in your OF tree in terminal and do
.. code-block :: bash
$ cmake ..
$ make -j3 install // you don't need to put the -j3 if you have single core CPU, for dualcore, put -j3, for quad, -j5 (numcores + 1)
If you want, you can run the CMake GUI from Applications instead and hit Configure, select Unix Makefiles generator and Generate,
and then do the "make -j3 install" from terminal - it has the same effect.
After everything goes OK, you should have binaries and you can launch (run_client.command file from Finder)
3. If you want to use the xcode IDE, then it's as easy as first method. Simply go into "cbuild" dir in your OF tree in terminal and do
.. code-block :: bash
$ cmake .. -G Xcode
If you want, you can run the CMake GUI from Applications instead and hit Configure, select Xcode generator and Generate instead.
After having things generated, go to cbuild directory in Finder and open the xcodeproj file. In combobox on top left, set Active Configuration
to Release in order to get proper binaries. Then, in the tree on the left, open Targets tree, right-click ALL_BUILD, and select "Build ALL_BUILD".
Then wait some time and after it's built, right-click target "install" and select "Build install"
Then, you should have binaries in your bin_unix/ directory same as with normal "make" building. Then, just run OF.