Apple Xcode, compilers and make and perl, oh my!
Yet another instance of Apple telling me what they are doing, and me failing to pay attention. sigh...
In this case, I recently "upgraded" my system at work, from the 3rd newest to the 2nd newest version of OS X. But after I did so, I lost all my developer tools (compiler, make, perl's CPAN, etc.)
It turns out that all I needed to do was reinstall Xcode, but that's now done via the App Store instead of the interwebz. Also, after installing Xcode, you need to run it so that you can have Xcode install the command line tools.
Go to /Applications/App Store and download/install Xcode
Launch Xcode (Applications/Xcode)
Open Xcode preferences, Downloads, Components.
On the Command Line Tools line, click the "Install" button.
Make sure the command line tools are in your PATH
Steps #1 and #4 take a bit of time, but once they were done I had a config.h and CPAN was working again.
Step #5 might take a little explanation. The command line tools that I was missing were make(1) and cc(1). I thought cc might be a little easier to find, so here's what I did:
$ which cc (nothing returned) $ locate cc | grep /cc$ /Developer/usr/bin/cc $ export PATH="$PATH:/Developer/usr/bin"
The first command verified that my PATH did not include the cc command. The second one (locate) showed me which directory it was in. And the third one added that directory to my PATH for the current session. Once you've verified that your tools are all working, copy that "export PATH..." command to your .bashrc file.
I might have avoided some of this trouble if I had kept up with What's New in Xcode