title: Setting environment variables to compile node on Mountain Lion with XCode4.4
body: <p>After upgrading to Mountain Lion (10.8) and XCode 4.4, and installing the XCode Command Line utilities from the XCode Preferences pane, I was unable to compile node.js (0.8.5) from source.  Specifically, the configure script believed that I did not have a C compiler installed.</p>
  
  <p>It looks to me like the environment variables required for the command line tools were lost somewhere along the way.</p>
  
  <p>I tried <code>sudo xcode-select --switch /Applications/Xcode.app</code> but this did not appear to clear up the problem.</p>
  
  <p>I had to perform these steps to make the node build system happy:</p>
  
  <ul>
  <li><code>export PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin</code></li>
  <li><code>export CC='gcc --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/'</code></li>
  <li><code>export CXX='g++ --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/'</code></li>
  </ul>
  
  <p>After that I was able to compile and link.</p>
  
  <p>So... why did I have to do this?  Am I missing some easy step that could have done this for me automatically?  Or am I in some bad state because I installed XCode before upgrading to Mountain Lion, and the XCode updater went off the rails?</p>