forked from bookshelfdave/wings
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.unix
270 lines (179 loc) · 6.95 KB
/
BUILD.unix
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
BUILDING WINGS 3D ON UNIX-LIKE SYSTEMS (including MacOS X)
==========================================================
This guide describes how you can build Wings on unix-like
systems, such as GNU Linux, FreeBSD, Solaris, and MacOS X.
After the general build instructions, there are separate
instructions for building a complete, standalone installation
package for MacOS X and for other Unix systems.
Required software
=================
The following software is needed to get Wings running
at all. Additional software is required if you want to
run all plug-ins and to build an installation package.
- The Wings source files. http://www.wings3d.com
- Erlang/OTP R13B02 or later. http://www.erlang.org
- SDL development library. http://www.libsdl.org.
(There are pre-built libraries for most platforms.)
- ESDL 1.0.1 or later. http://esdl.sf.net
- A GNU compatible "make" program. Included with most unix-like
systems; otherwise get it from http://www.gnu.org.
- bunzip2 for unpacking the Wings source tar file.
Included with most unix-like systems; otherwise get it
from http://sources.redhat.com/bzip2.
- OpenGL header files and libraries.
Summary of build process
========================
The following is a quick summary of the build process.
* Download and install Erlang/OTP.
* Download and install SDL.
* Install OpenGL header files (if needed).
* Download and install ESDL.
* Download and upnpack the Wings source file.
* Run "make".
Installing Erlang/OTP
=====================
Build Erlang/OTP according to the instructions in the README file.
I recommend running "configure" with the following options:
./configure --enable-threads --disable-hipe
Threads must be enabled to make sure that Erlang emulator is linked with
reentrant libraries. (--enable-threads is default on *most* platforms nowadays,
but better safe than sorry.)
HiPE is not used by Wings; but the reason I recommend disabling it is
that disabling HiPE also disables the use of floating point exceptions.
Floating point exceptions have caused Wings to crash occasionally.
When you have built Erlang/OTP, modify the PATH environment variable
so that the "erl" and "erlc" programs can be started from a shell prompt.
Installing SDL
==============
Install SDL, if not already installed. On Linux systems, the SDL may be
already pre-installed. You'll probably need to install header files,
though, by installing the "SDL-devel" package.
Make sure that the "sdl-config" program is found in PATH.
I build SDL from source, using the following configure commands:
./configure --disable-video-aalib --disable-video-directfb --prefix=$HOME
make
make install
That will install the library and header files in my home directory,
not disturbing the pre-installed SDL libraries installed in the system.
The --disable-video-aalib option disables use of aalib, to avoid problems
running the built Wings on other Linux distributions that don't have
aalib. I use --disable-video-directfb because the directfb stuff
caused build problems and it is not required by Wings anyway.
Installing OpenGL header files
==============================
Even though OpenGL support comes pre-installed in many Linux distributions,
you may need to install header files to be able to succefully compile
ESDL.
For instance, in openSuse you'll need to install the "mesa-devel" package.
Installing ESDL
===============
Download ESDL and unpack it.
Make sure that the "sdl-config" program can be found in PATH.
Verify like this:
which sdl-config
sdl-config --libs
Compile by running "make" from the source directory of ESDL.
Set the environment variable ESDL_PATH to point to top of the
compiled ESDL installation.
Unpacking the Wings source code
===============================
If you have the GNU tar program, use the "tar" program with
the "j" flag to tell it to decompress using the "bunzip2" program.
Example:
$ tar jxf wings-1.0.tar.bz2
Otherwise, feed the output of "bzcat" to tar:
$ bzcat wings-0.1.0.tar.bz2 | tar xf -
The build steps that follow assume that you are in the wings source
directory.
Example:
$ cd wings-1.0.tar.bz2
Building Wings
==============
Build Wings from the directory where the sources where unpacked.
Example:
$ pwd
/home/bjorng/wings-1.0
$ make
.
.
.
<A lot of output follows>
.
.
.
$
To run the Wings you have just build, you'll need to write a command line
similar to this:
erl -smp disable -pa $ESDL_PATH/ebin -pa <MY_WINGS_PATH>/ebin -run wings_start start_halt
where you should substitute <MY_WINGS_PATH> with the path to the Wings
source directory.
Example:
$ erl -smp disable -pa $ESDL_PATH/ebin -pa /home/bjorng/wings-1.0/ebin -run wings_start start_halt
$
Instead of writing the command line every time you want to start Wings,
you can package it in a script like this:
#!/bin/sh
exec erl -smp disable -pa $ESDL_PATH/ebin -pa /home/bjorng/wings-1.0/ebin -run wings_start start_halt ${1+"$@"}
Notes:
[1] "exec" kills the shell process running the script, saving a
tiny amount of system memory.
[2] The "${1+"$@"}" thing passes along any arguments (or none) to Wings,
allowing Wings to open up a wings file when it starts.
[3] The "-smp disable" flag is necessary if you have a multi-core/multi-CPU
computer. Wings will only work with the single-threaded Erlang emulator.
Building an installation package for MacOS X
============================================
To build everything and pack it into a DMG file, you'll need:
- Xcode 3.2 (running on Snow Leopard). Xcode 3.x running on Leopard will
probably also work, but I have not tested to build any Wings version after
1.1.12 with that configuration.
- The FBX library. http://www.autodesk.com/fbx
Make sure that your current directory is the directory in which the
sources were unpacked.
Example:
$ pwd
/Users/bjorng/wings_releases/wings-1.0
$
To build all (including the installer), run the following command:
$ make macosx
.
.
.
<A lot of output follows>
.
.
.
$
When everything is done, there should be a file named like
wings-1.0-macosx.dmg
in the current directory.
Building an installation package for Linux (and other Unix systems)
===================================================================
To build everything and put it into an installation package,
you'll need the following additional software:
- makeself.sh for building the installation package
(a self-extractable bzip2 archive). http://megastep.org/makeself
- libjpeg for build the jpeg plug-in. libjpeg is pre-installed in most Linux
distributions. You'll probably need to install header files, though, by
installing the package libjpg-devel. Otherwise, get the sources from:
http://www.ijg.org
Make sure that your current directory is the directory in which the
sources were unpacked.
Example:
$ pwd
/Users/bjorng/wings_releases/wings-1.0
$
To build all (including the installation package),
run the following command:
$ make unix
.
.
.
<A lot of output follows>
.
.
.
$
When everything is done, there should be a file named like
wings-1.0-linux.bzip2.run
in the current directory.