mxcl/homebrew — Issue #10290: Self-contained Xcode, missing libs and headers
Author: kylef
Created: 2012-02-18 00:41:17+00:00
State: open

With a clean install with just Homebrew and Xcode, homebrew failed to build many packages. Since the /usr/lib and /usr/include folder is missing. The following has solved these issues:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include /usr/include
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib /usr/lib

Perhaps we can detect the current OS X version and find the appropriate SDK in Xcode app bundle if these paths are missing. I didn't have much luck with setting these paths on via the appropriate compiler flags.