samueljohn 13e14ef65a Fix Homebrew/homebrew#13012 properly and don't set the SDK if CLT
Undoing parts of the hot fix 78b9e8548e771a59e382e6f13339664ec5498391.

The only thing missing was to check for `system "/usr/bin/xcrun -find make 1>/dev/null 2>&1"`
and then it's safe to call locate.

This commit restores the original functionality but without the risk for recursion
and improves the logic of `MacOS.locate`. See below.

To important changes in this commit:

- For Xcode _and_ CLT: don't add the SDK and leave things as before.
So if `MacOS.clt_installed?`, then no `SDKROOT` and `-L` and `-I`
directories are set in `ENV.macosxsdk`.

- Improved the logic for `MacOS.locate` for Xcode-only situations
by assuring that the xcode-select path is correct. This is done
by checking that `bin/make` exists and is executable. Otherwise it
was possible to set xcode-select to an empty dir.
This check is done in `MacOS.sdk_path` too.
We are now able to use Xcode wherever it is and can work even, if
xcode-select is set to invalid values. (Remember some users don't
have sudo access and that is needed to fix xcode-select).

Some minor whitespace fixes.
Minor backtick fix in doctor.rb's printout.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-27 11:50:43 -07:00
..
2011-03-19 11:06:51 -07:00
2012-02-04 00:27:05 -06:00
2012-04-30 21:37:58 +08:00
2012-04-11 18:24:46 -05:00
2011-03-12 11:55:07 -08:00
2012-03-16 21:06:15 +00:00
2011-08-24 22:30:43 +01:00
2012-05-13 19:28:03 -05:00
2011-03-12 19:36:37 -08:00
2012-06-12 20:03:26 -07:00
2012-02-04 00:27:05 -06:00
2012-04-05 13:06:36 -04:00
2012-05-13 19:28:03 -05:00
2012-03-23 00:16:08 +00:00
2012-03-16 22:00:59 -07:00