Hello everyone,
I have finally (actually about a week ago but I've been out of town)
gotten FlightGear to compile under Mac OS X 10.2.4. The results were
surprising and I am probably going to rub a few feathers the wrong way in
the process of explanation. I don't mean to offend but I need to be clear
about what I see happening and sometimes plain language offends people.
As you may recall, I was getting a linker error when linking fgfs.
As someone more wise in the ways of ld than I pointed out, the method
as compiled in tr.cxx was different from how the method call was being
compiled in gui_funcs.cxx. The reason was that in tr.cxx, GLint was
being defined as an integer, but in gui_funcs.cxx it was being defined
as a long. Further exploration with the precompiler showed that SimGear
was finding Apple's OpenGL gl.h, but FlightGear was finding XFree86's
gl.h, and the two define GLint differently.
Now I could just degenerate into name-calling about Apple's headers but
as I looked around more in all the code that FlightGear uses I discovered
that plib was not having any problems with the situation and that the
linker wasn't complaining about the plib libraries. I found that plib's
configure script was handling Mac OS X differently and specifically
defining the location of glut.h to use Apple's OpenGL glut.h (which in
turn includes gl.h).
I am not a configure hacker but decided that I could emulate what plib
was doing with some judicious complier defines in SimGear and FlightGear,
just to see if it would work. I did and it did.
It also took care of the error below that I had absolutely no idea how
to address:
ld: Undefined symbols:
ssgVtxTable::ssgVtxTable[in-charge](unsigned, ssgVertexArray*, ssgNormalArray*,
ssgTexCoordArray*, ssgColourArray*)
Although, I still get this on my G4 tower where X, etc. are installed,
even after I make the code changes in the attached patches.
I was able to get FlightGear to compile from CVS by doing the following:
- fresh install of Mac OS 10.2 (Jaguar)
- install the 10.2.4 combined update
- install the December 2002 Developer Tools
- install the Apple update to GLUT, which just came out recently
(just for kicks, probably isn't needed)
- pull down CVS versions of plib, metakit, SimGear, and FlightGear
- apply the attached patches
- the patches to plib are per Jonathan Polley
- the patches are against CVS from a few days ago
- run the attached build scripts
The compile does stop at one point, I haven't figured out why this is
happening, but here is the event and the workaround (change gcc to g++):
bash-2.05a$ cd SimGear/simgear/xgl/
bash-2.05a$ make clean
test -z "libsgxgl.a" || rm -f libsgxgl.a
rm -f *.o core *.core
bash-2.05a$ make
source='xgl.c' object='xgl.o' libtool=no \
depfile='.deps/xgl.Po' tmpdepfile='.deps/xgl.TPo' \
depmode=gcc /bin/sh ../../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I../../simgear -I../..
-I/Users/david/Desktop/FlightGear-CVS/include -g -O1 -finline-limit=6
-finline-functions -faltivec -D_REENTRANT -c `test -f 'xgl.c' || echo './'`xgl.c
xgl.c:10: header file 'GLUT/glut.h' not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make: *** [xgl.o] Error 1
bash-2.05a$ source='xgl.c' object='xgl.o' libtool=no \
> depfile='.deps/xgl.Po' tmpdepfile='.deps/xgl.TPo' \
> depmode=gcc /bin/sh ../../depcomp \
> g++ -DHAVE_CONFIG_H -I. -I. -I../../simgear -I../..
> -I/Users/david/Desktop/FlightGear-CVS/include -g -O1 -finline-limit=6
> -finline-functions -faltivec -D_REENTRANT -c `test -f 'xgl.c' || echo './'`xgl.c
bash-2.05a$ make
source='xglUtils.c' object='xglUtils.o' libtool=no \
depfile='.deps/xglUtils.Po' tmpdepfile='.deps/xglUtils.TPo' \
depmode=gcc /bin/sh ../../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I../../simgear -I../..
-I/Users/david/Desktop/FlightGear-CVS/include -g -O1 -finline-limit=6
-finline-functions -faltivec -D_REENTRANT -c `test -f 'xglUtils.c' || echo
'./'`xglUtils.c
rm -f libsgxgl.a
ar cru libsgxgl.a xgl.o xglUtils.o
ranlib libsgxgl.a
No X, Apple or XFree86, no OpenGL, no freeglut, or glut, or fink.
Which may bother people. Some Mac OS X users may not want to bother with
these, understandably, in which case the SimGear and FlightGear code
will have to be changed to compile this way. Others, more inclined to
compile everything from source, will not want these changes in the code
(even though they are already in plib) or will insist on a configure-time
switch determining one behavior or the other.
But the code (i.e. configure scripts and #include statements) is going
to have to be changed/updated/complicated to accommodate the fact that
Mac OS X may not have X, may have Apple's X, or may have XFree86; that
it may have Apple's OpenGL and GLUT or not, or any combination of the
above, so long as these header discrepancies exist.
One issue that I am dealing with is that the frame rate is poor, even
though precompiled versions I have had in the past had good (~30 fps)
rates. It cou