aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorsamueljohn2012-06-26 11:21:46 +0200
committerAdam Vandenberg2012-06-27 11:50:43 -0700
commit13e14ef65ad16d650f89ea9c5f70b271b02ac781 (patch)
treebd5a9fcd46b75327db83189384f80a910aa207e5 /Library/Homebrew/extend
parentdcc276594799860e3ecd05f86f5e1d1b843b91bc (diff)
downloadbrew-13e14ef65ad16d650f89ea9c5f70b271b02ac781.tar.bz2
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>
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/ENV.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index ca0a51e99..374243343 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -231,7 +231,7 @@ Please take one of the following actions:
remove 'CPPFLAGS', "-isystem #{HOMEBREW_PREFIX}/include"
remove 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
sdk = MacOS.sdk_path(v)
- unless sdk.nil?
+ unless sdk.nil? or MacOS.clt_installed?
self['SDKROOT'] = nil
remove 'CPPFLAGS', "-isysroot #{sdk}"
remove 'CPPFLAGS', "-isystem #{sdk}/usr/include"
@@ -262,7 +262,7 @@ Please take one of the following actions:
append 'CPPFLAGS', "-isystem #{HOMEBREW_PREFIX}/include"
prepend 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
sdk = MacOS.sdk_path(v)
- unless sdk.nil?
+ unless sdk.nil? or MacOS.clt_installed?
# Extra setup to support Xcode 4.3+ without CLT.
self['SDKROOT'] = sdk
# Teach the preprocessor and compiler (some don't respect CPPFLAGS)