Determine LLVM location programmatically

Xcode can be installed anywhere, not just /Developer.
This commit is contained in:
Max Howell 2009-10-08 23:40:31 +01:00
parent e2bed20d21
commit 4c6e23c28f

View File

@ -46,7 +46,11 @@ else
end end
if MACOS_VERSION >= 10.6 or ENV['HOMEBREW_USE_LLVM'] if MACOS_VERSION >= 10.6 or ENV['HOMEBREW_USE_LLVM']
ENV['PATH'] = "/Developer/usr/llvm-gcc-4.2/bin:#{ENV['PATH']}" # you can install Xcode wherever you like you know.
prefix = `/usr/bin/xcode-select -print-path`.chomp
prefix = "/Developer" if prefix.to_s.empty?
ENV['PATH'] = "#{prefix}/usr/llvm-gcc-4.2/bin:#{ENV['PATH']}"
ENV['CC'] = 'llvm-gcc-4.2' ENV['CC'] = 'llvm-gcc-4.2'
ENV['CXX'] = 'llvm-g++-4.2' ENV['CXX'] = 'llvm-g++-4.2'
cflags = ['-O4'] # O4 baby! cflags = ['-O4'] # O4 baby!