Compiling on mac os 10.5 intel
Posted: Mon Apr 12, 2010 11:20 pm
So I've been following Vega Strike for a while now, but am compiling from SVN for the first time. This isn't the first program I've compiled and I've also been a linux user for a while. The wiki cautioned that this would be considered difficult but I had no idea what I would be up against.
I checked out version 12760 source and data and followed the instructions here: http://vegastrike.sourceforge.net/wiki/ ... ile_on_OSX
- I already had SDL installed via MacPorts
- My OS is 10.5.8 and comes with OpenAL via apple
I soon discovered that the built-in GCC was not up to the task (giving errors with the templates in units.cpp).I Upgraded GCC and G++ to 4.4 via macports. This took a while. When this was done I next discovered a errors in the aldrv/ files. After some research I discovered that this was because Apple's OpenAL header is broken (so is the one from MacPorts) and will not work with C++. The fix is to edit the header (yikes) and replace all occurances after the first of "ALCvoid" wth "void". That done, I corrected a few more mistakes with my configuration and vegastrike compiled and linked successfully. The program now runs but segfaults early on with an error reading units.csv, and now I'm stumped. Any suggestions?
./vegastrike
In path /Users/danwaldron/vegastrike-dev/vegastrike
Vega Strike
See http://www.gnu.org/copyleft/gpl.html for license details.
GOT SUBDIR ARG =
Found data in /Users/danwaldron/vegastrike-dev/vegastrike/../data
Using /Users/danwaldron/vegastrike-dev/data as data directory
Using .vegastrike as the home directory
Found MODDIR = /Users/danwaldron/vegastrike-dev/data/mods
USING HOMEDIR : /Users/danwaldron/.vegastrike As the home directory
CONFIGFILE - No config found in home : /Users/danwaldron/.vegastrike/vegastrike.config
CONFIGFILE - No home config file found, using datadir config file : /Users/danwaldron/vegastrike-dev/data/vegastrike.config
DATADIR - No datadir specified in config file, using ; /Users/danwaldron/vegastrike-dev/data
SIMULATION_ATOM: 0.05
MISSION_NAME is empty using : main_menu.mission
Attempt to call ReadFull on a bad file units.csv units /Users/danwaldron/vegastrike-dev/data
Segmentation fault
- I have uploaded config.log as an attachment.
- The command used to run configure (from the file intel-mac-conf.sh) is this (may be of value to other mac users):
./configure CC=/opt/local/bin/gcc-mp-4.4 \
CPP=/opt/local/bin/cpp-mp-4.4 \
LDFLAGS=-L/opt/local/lib \
CPPFLAGS=-I/opt/local/include \
--with-expat-libs=/opt/local/lib --with-expat-inc=/opt/local/include \
--with-png-libs=/opt/local/lib --with-png-inc=/opt/local/include \
--with-jpeg-inc=/opt/local/include --with-jpeg-libs=/opt/local/lib \
--with-ogg-inc=/opt/local/include --with-ogg-libs=/opt/local/lib \
--with-vorbis-inc=/opt/local/include --with-vorbis-libs=/opt/local/lib \
--with-python-inc=/opt/local/include/python-2.5 --with-python-libs=/opt/local/lib/python2.5 \
--enable-macosx-bundle
- I also edited part of the configure script to help find the right libraries. I had some trouble because this part of the script was overriding arguments I passed by hand.
f test "x$is_macosx" = "xyes" ; then
CXXFLAGS="$CXXFLAGS -I/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes -DHAVE_PYTHON=1 -I$with_python_inc -I/System/Library/Frameworks/OpenAL.framework/Headers"
CPPFLAGS="$CPPFLAGS -Wno-long-double"
# VS_LIBS="$VS_LIBS -F/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks -framework OpenGL -framework GLUT -framework CoreAudio -framework OpenAL"
VS_LIBS="$VS_LIBS -F/System/Library/Frameworks -framework OpenGL -framework GLUT -framework CoreAudio -framework OpenAL"
with_gl_inc=/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes
with_gl_libs=/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks/OpenGL.framework/Libraries
with_al_inc="/System/Library/Frameworks/OpenAL.framework/Headers"
with_al_libs="/System/Library/Frameworks/OpenAL.framework"
# with_al_inc="/opt/local/include/openal"
# with_openal_libs="opt/local/lib"
# PYTHON_LDOPTS="-L/System/Library/Frameworks/Python.framework"
# with_python_inc="/System/Library/Frameworks/Python.framework/Headers"
VS_LIBS="$VS_LIBS -lobjc -L$with_python_libs"
fi
I checked out version 12760 source and data and followed the instructions here: http://vegastrike.sourceforge.net/wiki/ ... ile_on_OSX
- I already had SDL installed via MacPorts
- My OS is 10.5.8 and comes with OpenAL via apple
I soon discovered that the built-in GCC was not up to the task (giving errors with the templates in units.cpp).I Upgraded GCC and G++ to 4.4 via macports. This took a while. When this was done I next discovered a errors in the aldrv/ files. After some research I discovered that this was because Apple's OpenAL header is broken (so is the one from MacPorts) and will not work with C++. The fix is to edit the header (yikes) and replace all occurances after the first of "ALCvoid" wth "void". That done, I corrected a few more mistakes with my configuration and vegastrike compiled and linked successfully. The program now runs but segfaults early on with an error reading units.csv, and now I'm stumped. Any suggestions?
./vegastrike
In path /Users/danwaldron/vegastrike-dev/vegastrike
Vega Strike
See http://www.gnu.org/copyleft/gpl.html for license details.
GOT SUBDIR ARG =
Found data in /Users/danwaldron/vegastrike-dev/vegastrike/../data
Using /Users/danwaldron/vegastrike-dev/data as data directory
Using .vegastrike as the home directory
Found MODDIR = /Users/danwaldron/vegastrike-dev/data/mods
USING HOMEDIR : /Users/danwaldron/.vegastrike As the home directory
CONFIGFILE - No config found in home : /Users/danwaldron/.vegastrike/vegastrike.config
CONFIGFILE - No home config file found, using datadir config file : /Users/danwaldron/vegastrike-dev/data/vegastrike.config
DATADIR - No datadir specified in config file, using ; /Users/danwaldron/vegastrike-dev/data
SIMULATION_ATOM: 0.05
MISSION_NAME is empty using : main_menu.mission
Attempt to call ReadFull on a bad file units.csv units /Users/danwaldron/vegastrike-dev/data
Segmentation fault
- I have uploaded config.log as an attachment.
- The command used to run configure (from the file intel-mac-conf.sh) is this (may be of value to other mac users):
./configure CC=/opt/local/bin/gcc-mp-4.4 \
CPP=/opt/local/bin/cpp-mp-4.4 \
LDFLAGS=-L/opt/local/lib \
CPPFLAGS=-I/opt/local/include \
--with-expat-libs=/opt/local/lib --with-expat-inc=/opt/local/include \
--with-png-libs=/opt/local/lib --with-png-inc=/opt/local/include \
--with-jpeg-inc=/opt/local/include --with-jpeg-libs=/opt/local/lib \
--with-ogg-inc=/opt/local/include --with-ogg-libs=/opt/local/lib \
--with-vorbis-inc=/opt/local/include --with-vorbis-libs=/opt/local/lib \
--with-python-inc=/opt/local/include/python-2.5 --with-python-libs=/opt/local/lib/python2.5 \
--enable-macosx-bundle
- I also edited part of the configure script to help find the right libraries. I had some trouble because this part of the script was overriding arguments I passed by hand.
f test "x$is_macosx" = "xyes" ; then
CXXFLAGS="$CXXFLAGS -I/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes -DHAVE_PYTHON=1 -I$with_python_inc -I/System/Library/Frameworks/OpenAL.framework/Headers"
CPPFLAGS="$CPPFLAGS -Wno-long-double"
# VS_LIBS="$VS_LIBS -F/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks -framework OpenGL -framework GLUT -framework CoreAudio -framework OpenAL"
VS_LIBS="$VS_LIBS -F/System/Library/Frameworks -framework OpenGL -framework GLUT -framework CoreAudio -framework OpenAL"
with_gl_inc=/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes
with_gl_libs=/Developer/SDKs/MacOSX10.4.u.sdk/System/Library/Frameworks/OpenGL.framework/Libraries
with_al_inc="/System/Library/Frameworks/OpenAL.framework/Headers"
with_al_libs="/System/Library/Frameworks/OpenAL.framework"
# with_al_inc="/opt/local/include/openal"
# with_openal_libs="opt/local/lib"
# PYTHON_LDOPTS="-L/System/Library/Frameworks/Python.framework"
# with_python_inc="/System/Library/Frameworks/Python.framework/Headers"
VS_LIBS="$VS_LIBS -lobjc -L$with_python_libs"
fi