aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-08-09 21:06:33 -0700
committerAdam Vandenberg2010-08-09 21:06:33 -0700
commita62c16e77f7387761a61ccf6abdbd1da31abbad1 (patch)
tree786bf311f7dd75f3fe293d2189a917eff6502b55 /Library
parent80c090aaaeefb0d573ec2c633795eba5b2a4a900 (diff)
downloadbrew-a62c16e77f7387761a61ccf6abdbd1da31abbad1.tar.bz2
brew doctor - add check for /usr/bin/cc symlinks.
If you symlink /usr/bin/cc to llvm, then Homebrew's "fails_with_llvm" checks are bypassed. So add a warning to "brew doctor".
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew_doctor.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/Library/Homebrew/brew_doctor.rb b/Library/Homebrew/brew_doctor.rb
index fddd33a44..fa86dba5d 100644
--- a/Library/Homebrew/brew_doctor.rb
+++ b/Library/Homebrew/brew_doctor.rb
@@ -98,7 +98,7 @@ def check_gcc_versions
if gcc_42 == nil
puts <<-EOS.undent
- We couldn't detect gcc 4.2.x. Some formulas require this compiler.
+ We couldn't detect gcc 4.2.x. Some formulae require this compiler.
EOS
elsif gcc_42 < RECOMMENDED_GCC_42
@@ -111,7 +111,7 @@ def check_gcc_versions
if gcc_40 == nil
puts <<-EOS.undent
- We couldn't detect gcc 4.0.x. Some formulas require this compiler.
+ We couldn't detect gcc 4.0.x. Some formulae require this compiler.
EOS
elsif gcc_40 < RECOMMENDED_GCC_40
@@ -123,6 +123,21 @@ def check_gcc_versions
end
end
+def check_cc_symlink
+ which_cc = Pathname.new('/usr/bin/cc').realpath.basename.to_s
+ if which_cc == "llvm-gcc-4.2"
+ puts <<-EOS.undent
+ You changed your cc to symlink to llvm.
+ This bypasses LLVM checks, and some formulae may mysteriously fail to work.
+ You may want to change /usr/bin/cc to point back at gcc.
+
+ To force Homebrew to use LLVM, you can set the "HOMEBREW_LLVM" environmental
+ variable, or pass "--use-lvm" to "brew install".
+
+ EOS
+ end
+end
+
def __check_subdir_access base
target = HOMEBREW_PREFIX+base
return unless target.exist?
@@ -427,6 +442,7 @@ def brew_doctor
check_homebrew_prefix
check_for_stray_dylibs
check_gcc_versions
+ check_cc_symlink
check_for_other_package_managers
check_for_x11
check_for_nonstandard_x11