gcc on Lion

If you’re using rvm or anything else that specifically wants gcc on Lion. Install Xcode as usual, but also do this:

  1. Download Apple’s gcc: http://www.opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz
  2. Build it http://www.opensource.apple.com/source/gcc/

From within the source directory:

mkdir -p build/obj build/dst build/sym
gnumake install RC_OS=macos RC_ARCHS="i386 x86_64"
TARGETS="i386 x86_64" SRCROOT=`pwd`
OBJROOT=`pwd`/build/obj DSTROOT=`pwd`/build/dst
sudo ditto build/dst /
ln -s /usr/bin/gcc-4.2 /usr/local/bin/gcc
Ryan Booker @ryanbooker