Hello !
Ryan Gordon and maybe others had the idea to create a gcc replacement
to allow on Mac OSX to run gcc one time with the necessary PPC settings
and the second time with the necessary X86 settings and then finally
combine these generated object files or other files with lipo.
http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL_mixer/gcc-fat.sh?revision=2289&view=markup
Yesterday i hacked this gcc-fat version, it does some things different
than gcc-fat.sh, but basically works the same way. gcc-fat.sh created
ppc and x86 directorys for the files, which keeps the build directorys
clean, but needs a lot of hacking when you have something like this :
-o …/bin/test.exe
The two cases then would be
mv …/bin/test.exe …/bin/ppc/test.exe
mv …/bin/test.exe …/bin/x86/test.exe
Now my idea is to simply add _ppc for the ppc version
and _x86 for the x86 version. Also my version supports
more styles for example -c test1.cxx test2.cxx
and also -c test1.cxx test2.cxx -o test.
With my gcc-fat version i was able to compile Universal Binaries
from SDL-1.2 and FLTK-1.1 Other things should work too, but i had not
more time.
So how to use it now :
Download :
http://www.syntheticsw.com/~wizard/tmp/gcc-fat-v0.0.1.tar.gz
Unpack it into for example /tmp
Load main.cxx with an Editor and make changs to the SDK Settings.
( In the next version you will be able to dynamically select which
SDK to use for PPC and which SDK to use for X86 with environment
variables, the same way XCode does )
Then :
c++ GLB_basic.cxx main.cxx -o gcc-fat -DUSE_CC
c++ GLB_basic.cxx main.cxx -o g+±fat -DUSE_CXX
Now we have two replacements, one for gcc and one for g++.
Then type into your commandline :
export CC=/tmp/gcc-fat
export CXX=/tmp/g+±fat
Then you can build SDL and FLTK the normal way.
I know that my usage of String Pointer causes memory leaks.
But every modern OS frees the used memory after the app quits
and it is also no server daemon, so what the heck.
I tested this on a PPC Mac with latest Mac OSX 10.4.x with latest
XCode 2.4.1
Waiting for feedback
CU