Use same LLVM binary to check build # as we do to build with.
Different llvm binaries were used to check build numbers and to compile with. Normalize this, and normalize the variable name used to hold the xcode location. (Calling it "prefix" is confusing, since there are already concepts in Homebrew called "prefx".)
This commit is contained in:
parent
76168e8e87
commit
2dbc6b977f
@ -560,7 +560,7 @@ def llvm_build
|
||||
if MACOS_VERSION >= 10.6
|
||||
xcode_path = `/usr/bin/xcode-select -print-path`.chomp
|
||||
return nil if xcode_path.empty?
|
||||
`#{xcode_path}/usr/bin/llvm-gcc-4.2 -v 2>&1` =~ /LLVM build (\d{4,})/
|
||||
`#{xcode_path}/usr/bin/llvm-gcc -v 2>&1` =~ /LLVM build (\d{4,})/
|
||||
$1.to_i
|
||||
end
|
||||
end
|
||||
|
||||
@ -20,11 +20,11 @@ module HomebrewEnvExtension
|
||||
|
||||
if MACOS_VERSION >= 10.6 and (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm')
|
||||
# you can install Xcode wherever you like you know.
|
||||
prefix = `/usr/bin/xcode-select -print-path`.chomp
|
||||
prefix = "/Developer" if prefix.to_s.empty?
|
||||
xcode_path = `/usr/bin/xcode-select -print-path`.chomp
|
||||
xcode_path = "/Developer" if xcode_prefix.to_s.empty?
|
||||
|
||||
ENV['CC'] = "#{prefix}/usr/bin/llvm-gcc"
|
||||
ENV['CXX'] = "#{prefix}/usr/bin/llvm-g++"
|
||||
ENV['CC'] = "#{xcode_path}/usr/bin/llvm-gcc"
|
||||
ENV['CXX'] = "#{xcode_path}/usr/bin/llvm-g++"
|
||||
cflags = %w{-O4} # link time optimisation baby!
|
||||
else
|
||||
# if we don't set these, many formula fail to build
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user