aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-10-08 23:40:31 +0100
committerMax Howell2009-10-09 00:09:05 +0100
commitc2fbc971000e8e4628bb63e835bf1cebba9544c8 (patch)
tree68ac4feb3a1266e1fbd9522c54a14f1787d93301 /Library
parentc2f8494b2b9bfac9e071ef184a45d558d84a88fd (diff)
downloadhomebrew-c2fbc971000e8e4628bb63e835bf1cebba9544c8.tar.bz2
Determine LLVM location programmatically
Xcode can be installed anywhere, not just /Developer.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brewkit.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 3d25edc92..2dfa27a97 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -46,7 +46,11 @@ else
end
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['CXX'] = 'llvm-g++-4.2'
cflags = ['-O4'] # O4 baby!