textmate/textmate — pull request #64 by whitlockjc (2012-08-10 16:42:33+00:00)
Title: Fix clang searching to search Homebrew and MacPorts before defaulting to Xcode/Apple version

When fixing Issue 39 (a94ad3cc4c6c755c0740b2e6b0bf36bad59e5454), it seems the new code actually defaults to whatever xcrun finds which is not exactly correct. Right now, I have the latest version of clang installed via Homebrew and the current configure will find and attempt to use clang that is located at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin instead of the clang in /usr/local/bin. We want to explicitly search /opt/local/bin (MacPorts) and /usr/local/bin (Homebrew) prior to defaulting to Xcode. This pull request addresses the situation and correctly searches in the following order:

* MacPorts: /opt/local/bin
* Homebrew: /usr/local/bin
* Xcode Command Line Tools: /usr/bin
* Xcode: Whatever xcrun provides, which as of Xcode 4.4.1 would be /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang and anything before would be /Developer/usr/bin