What is the best way to get gcc-4.2 on my Macbook with Snow Leopard and Xcode 4.2?
Xcode 4.2 no longer ships with gcc. Apparently if you upgrade Xcode to version 4.2 it leaves the gcc from 4.1 around, but I did a new install on a new hard drive, and now no longer have gcc. I am not a C programmer myself, but I have quite a few homebrew packages/python c modules that depend on gcc. I am surprised at how difficult it proves to be to install gcc 4.2 on my macbook.
I followed
these steps, but with a different install dmg because I do not have access to the one on apple.com that is linked in the StackOverflow answer (I assume that that is only available to developers who have a paid account with Apple?). That worked, but, afterwards my system was borked. iTunes didn't work correctly anymore, many apps on my iPhone were suddenly "waiting....", and Path Finder (my Finder replacement) stopped working. I tried the solutions on Apple.com for the iTunes problem, nothing worked, and I decided to restore to a Time Machine backup.
So, now I am back to step one (an installation without any Xcode) and I want to do it right this time. I
think my best step is to install Xcode 3 from the Snow Leopard CD and then install Xcode 4.2 from the app store. This should move Xcode 3 to /Developer-old and leave the compilers around. I'd hate to leave Xcode 3 around though (my only hard drive is a relatively small SSD so I could use the space). I'm afraid though that if I just delete the Developer-old directory that that will somehow break gcc and I'll be back to square one again.
I did find
this osx gcc installer, but that's geared towards people who don't want Xcode at all. I also saw some problems with that approach
here. That author gives a new approach, but that seems to depend on gcc being installed by Xcode.
So, I'm a bit stumped, and would really like to hear input on what is the best way, with minimum overhead, to install gcc 4.2 on my macbook.
posted by mkb at 2:14 AM on November 6, 2011 [1 favorite]