On Sun, Jul 31, 2011 at 8:42 PM, Raffael Cavallaro <raffaelcavallaro@mac.com
wrote:
Adam, maybe you could email your scripts to Marc and he could incorporate them into the the gambit releases since you seem to be having more consistent success at getting it to build for all platforms under Xcode.
I've copied each script below. It actually doesn't need to be two scripts for each platform afterall - I've just updated them (and rebuilt all) with the scripts below under the latest beta of Xcode 4.2 and ran each with my code without issue. However, my setup is probably unique to me but may be of use. I place the primary OSX build under /usr/local/Gambit-C and then the two iOS builds are installed under /usr/local/Gambit-C/iPhoneOS and /usr/local/Gambit-C/iPhoneSimulator - and I've setup Xcode to pick the correct -lgambc to link based on the current target. The 3 scripts are:
OSX:
export CC='clang' export CXX='clang++'
./configure --prefix=/usr/local/Gambit-C CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --prefix=/usr/local/Gambit-C --enable-single-host --host=i386 make sudo make install
iPhoneSimulator:
export CC='/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk' export CXX='/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk'
CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --prefix=/usr/local/Gambit-C/iPhoneSimulator --host=i386 CFLAGS="-arch i386" LDFLAGS="-arch i386" make sudo make install
iPhoneOS:
export PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" export CC="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk" export CXX="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk"
CFLAGS="-arch armv7" LDFLAGS="-arch armv7" ./configure --host=arm --prefix=/usr/local/Gambit-C/iPhoneOS CFLAGS="-arch armv7" LDFLAGS="-arch armv7" make sudo make install
Note: I have compiled both iPhoneOS and iPhoneSim with '--enable-single-host' in the past, but as it takes a couple of _hours_ to compile with that option, I don't both for those two. But I do for the osx as that's what I use for compiling the scm source to C that get's compiled/linked in the iOS builds. Hope this helps!
Adam