]> git.mxchange.org Git - flightgear.git/blob - README.Unix
More reorganization.
[flightgear.git] / README.Unix
1 If you are reading this in hopes that you will find the answer to a
2 specific question, please send the question to curt@flightgear.org and
3 suggest that I include the answer here.
4
5
6 I. Compilers and Portability
7 ============================
8
9 Flight Gear is known to build with egcs-1.1 and higher, as well as
10 gcc-2.8 and higher.  Your mileage may vary with earlier versions of
11 these compilers although support for gcc-2.7.x is mostly there.
12
13 For other platforms where you may have access to native compilers,
14 again your mileage may vary.  We would like to support as many
15 different compilers and platforms as possible.  Please relay any
16 changes you make (or problems you encounter) back to
17 curt@flightgear.org, so that in the future we can better support your
18 platform and your compiler.  I have access to a few different
19 platforms, but I must depend on others to make sure their favorite
20 platform and compiler is well supported.
21
22
23 II. GLUT
24 ========
25
26 Flight Gear requires GLUT version 3.7 or later (aka GameGLUT._ GLUT
27 needs to be installed on your system before you can build Flight Gear.
28 GLUT can be found at:
29
30     http://reality.sgi.com/opengl/glut3/glut3.html
31
32 GLUT (pronounced like the glut in gluttony) is the OpenGL Utility
33 Toolkit, a window system independent toolkit for writing OpenGL
34 programs. It implements a simple windowing application programming
35 interface (API) for OpenGL. GLUT makes it considerably easier to learn
36 about and explore OpenGL programming.  GLUT provides a portable API so
37 you can write a single OpenGL program that works on both Win32 PCs and
38 X11 workstations.
39
40
41 III. Joystick Support
42 =====================
43
44 GLUT only has win32 joystick support but even at that, it is not well
45 implimented.  So we use Steve Backer's joystick library when possible,
46 and fall back to GLUT for win32 until Steve's library adds win32
47 support.
48
49 To make sure joystick support is included when building under Linux:
50
51   - make sure you have the proper joystick module installed.
52   - make sure the proper devices are created in /dev.
53   - /usr/include/linux/joystick.h must exist on your system.
54
55
56 IV. Procedure to build FGFS with Native SGI Irix Compilers from CVS Sources
57 ===========================================================================
58
59 (Contributed by Todd Smith <msmith@sikorsky.com> with modifications
60 and updates by Curt Olson)
61
62 Download the latest version of plib (1.0.18) from:
63
64     http://www.woodsoup.org/~sbaker/plib/
65
66 Configure it with the default prefix of /usr/local which places
67 everthing in a tree rooted at /usr/local/plib:
68
69     sh$ CC="cc -Xcpluscomm" CXX=CC ./configure
70
71 *Before* running make, fix up the plib Makefiles using the script
72 provided with the Flight Gear distribution:
73
74     find . -name Makefile -exec .../src/FlightGear-0.7.x/irix-hack.pl {} \;
75
76 This applies a fix in all the Makefiles to the lib creation command
77 (to use CC -ar rather than ar) as per a tip in the SGI pipeline
78 periodical.
79
80 Now, make and install plib.
81
82 Download the latest fgfs source snapshot from:
83
84     ftp://ftp.flightgear.org/pub/fgfs/Source/Snapshots/
85
86 Configure and build fgfs as you did plib:
87
88     sh$ CC="cc -Xcpluscomm" CXX=CC ./configure
89     sh$ find . -name Makefile -exec .../src/FlightGear-0.7.x/irix-hack.pl {} \;
90
91
92 V. Additional Notes for Building from CVS Sources
93 ==================================================
94
95 (Contributed by Todd Smith <msmith@sikorsky.com>)
96 and updates by Curt Olson)
97
98 Download the FlightGear-0.7.x via anonymous cvs as usual, then do:
99
100 > aclocal               # normal
101 > automake -a -i        # added '-i' flag to avoid dependency calc
102                         # that only sgi cc/CC doesn't support
103 > autoconf              # normal
104
105 Note the change in automake's command argument.
106
107 Now set env variables to use native compilers (csh syntax).
108
109 > setenv CC cc
110 > setenv CXX CC
111 > setenv CFLAGS '-Xcpluscomm -DEBUG:suppress=1001,1012,1014,
112                             1116,1172,1174,1401,1460,1551,1552'
113 > setenv CXXFLAGS '-DEBUG:suppress=1001,1012,1014,1116,1172,
114                           1174,1401,1460,1551,1552,3303,3322'
115
116 The '-DEBUG:suppress=' stuff just suppresses anonying warnings during
117 compile.  The meaning of each one is shown later in this file.
118 You can use all or none of these here.
119
120 > setenv CPPFLAGS '-woff 1014'
121
122 This is required so that configure will really believe that plib
123 is installed.  ( Otherwise a compiler warning makes configure
124 that plib/pu.h couldn't be found. )
125
126 > ./configure
127 > find . -name Makefile -exec irix-hack.pl {} \;        # normal irix hack
128 > gmake
129
130 Runs great.
131
132 Todd
133 msmith@sikorsky.com
134
135 -------------------------------------------
136 Warnings that I get. Ignore at your lesiure.
137
138 C and C++:
139 warning(1001): last line of file ends without a newline
140 warning(1012): parsing restarts here after previous syntax error
141 warning(1014): extra text after expected end of preprocessing directive         (breaks configure)
142 warning(1116): non-void function "poly_index_init" should return a value
143 warning(1172): subscript out of range
144 warning(1174): variable "j" was declared but never referenced
145 warning(1401): qualified name is not allowed in member declaration
146 warning(1460): function "..." redeclared "inline" after being called
147 warning(1551): variable "Altitude" is used before its value is set
148 warning(1552): variable "last" was set but never used
149
150 C++ only:
151 warning(3303): type qualifier on return type is meaningless
152 warning(3322): omission of explicit type is nonstandard ("int" assumed)
153
154
155 VI. Additional Native SGI Irix Compilers Notes
156 ==============================================
157
158 Fixing all the Makefiles' with irix-hack.pl is *VERY* important for
159 your success):
160
161   find . -name Makefile -exec irix-hack.pl {} \;
162
163 This touches up the Makefiles to build libfoo.a with 
164
165   CC -ar -o libfoo.a file1.o file2.o ...
166
167 The traditional method is to run:
168
169   ar cru libfoo.a file1.o file2.o
170
171 I wonder if this means that the native SGI "ar" is somewhat broke?
172
173 Note, you should make sure you have perl installed on your system.  The
174 "irix-hack.pl" script assumes that perl is located in /usr/bin/perl so
175 if this isn't the proper location on your system, change it in the first
176 line of "irix-hack.pl" before running the above command.  One way to see
177 if perl is on your system (and determine where) is to run:
178
179   which perl
180
181 Perl can be installed from "eoe.sw.gifts_perl" or can be fetched and
182 built from the net.
183
184 Finally you should run Gnu make.  The native Irix make utility just
185 can't handle the makefiles generated by the automake program.  Thus 
186 you will need to use Gnu make.  It's called "gmake" on my system so I 
187 just run:
188
189   gmake
190
191 Don't worry about the make failing in the Tools directory.  That's all
192 under construction stuff right now (10/7/99) and if you get that far, 
193 rejoice because it means the simulator was successfully built in the 
194 Simulator/Main subdirectory.
195
196 Special note for those Irix users using the native compilers *AND* checking
197 out the current source tree via CVS:
198
199 You will need to run "aclocal ; automake -a ; autoconf" as per 
200 README.autoconf, but you need an additional flag for automake to disable
201 automatic dependency building (which breaks the native Irix compilers.)
202 You should instead run:
203
204     aclocal ; automake -a --include-deps; autoconf
205
206 Then, proceed on to the configure step.  
207
208 Questions?  I realize this section is a big heap of random information so
209 if something isn't quite working for you, please ask.