aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorMax Howell2012-02-17 13:34:06 +0000
committerMax Howell2012-02-17 13:34:06 +0000
commit607c13c32bcae86708101edeed32b7c0478fd5ea (patch)
tree879fcac493d54e58d571c571212faeaa0306fd58 /Library/Homebrew/extend
parent30cbb25147416620ff64e6ba6d047d5304dff25b (diff)
downloadbrew-607c13c32bcae86708101edeed32b7c0478fd5ea.tar.bz2
Find xcrun if user doesn't ever install Xcode 4.3 helper tools
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/ENV.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index b059927a6..8689d977a 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -89,7 +89,7 @@ module HomebrewEnvExtension
def xcrun tool
if File.executable? "/usr/bin/#{tool}"
"/usr/bin/#{tool}"
- elsif system "/usr/bin/xcrun -find #{tool} 2>1 1>/dev/null"
+ elsif system "#{MacOS.xcrun} -find #{tool} 2>1 1>/dev/null"
# xcrun was provided first with Xcode 4.3 and allows us to proxy
# tool usage thus avoiding various bugs
"/usr/bin/xcrun #{tool}"
@@ -106,10 +106,10 @@ module HomebrewEnvExtension
# if your formula doesn't like CC having spaces use this
def expand_xcrun
- ENV['CC'] =~ %r{/usr/bin/xcrun (.*)}
- ENV['CC'] = `/usr/bin/xcrun -find #{$1}`.chomp if $1
- ENV['CXX'] =~ %r{/usr/bin/xcrun (.*)}
- ENV['CXX'] = `/usr/bin/xcrun -find #{$1}`.chomp if $1
+ ENV['CC'] =~ %r{#{MacOS.xcrun} (.*)}
+ ENV['CC'] = `#{MacOS.xcrun} -find #{$1}`.chomp if $1
+ ENV['CXX'] =~ %r{#{MacOS.xcrun} (.*)}
+ ENV['CXX'] = `#{MacOS.xcrun} -find #{$1}`.chomp if $1
end
def gcc args = {}
@@ -126,7 +126,7 @@ module HomebrewEnvExtension
raise "GCC could not be found" if not File.exist? ENV['CC']
end
- if not ENV['CC'] =~ %r{^/usr/bin/xcrun}
+ if not ENV['CC'] =~ /^[^\s]*xcrun /
raise "GCC could not be found" if Pathname.new(ENV['CC']).realpath.to_s =~ /llvm/
end