mxcl/homebrew — pull request #10510 by samueljohn (2012-02-26 20:57:40+00:00)
Title: Fix Xcode 4.3 only install (w/o CLT)

This is more a "*it might work this way, so let's discuss*" than a pull request.

Having Xcode 4.3 without the command line tools, it is currently not possible to build anything.
Sadly, downloading the CLT requires a Developer ID (free, but still).
Since everything needed is basically within /Applications/Xcode.app, it would be cool, if homebrew could just use that.
I made an *attempt* to set the correct paths. Therefore, I moved the xcrun method to MacOS.xcrun for the indirection. Further, I coded MacOS.macosxsdk to setup all the needed CFLAGS, CPPFLAGS, LDFLAGS, and so on using xcodebuild to query the path to the sdk.
For sure, I know much too few about homebrew's internals in order to make this good. But perhaps it can serve as a starting point.

Still ToDo:

- Fix ENV.x11 (not using hardcored /usr prefix.
- Only call MacOS.macosxsdk to add the paths if the CLT are missing. How to detect that? Missing `/usr/bin/cc`?
- Test build many more formulae.