aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMisty De Meo2012-04-08 11:10:22 -0500
committerMisty De Meo2012-04-11 10:08:46 -0500
commit4dc1a7bdce4d2b311c2ca2507ecdd5654a813f2b (patch)
tree5e1b5a8eca54eb76f693b8c0d2b1bf872f55ac69 /Library/Homebrew/cmd
parent9d172f85c62f640ab4a1ff367c2eba654d5f0bcd (diff)
downloadbrew-4dc1a7bdce4d2b311c2ca2507ecdd5654a813f2b.tar.bz2
brew doctor: add check for outdated compilers
A common source of build problems on Xcode 4.3+ is outdated compilers, usually when a user has installed over top of an old version and hasn't installed the CLT. Since the compilers from the previous Xcode are still around, brew doctor wouldn't complain. This adds a hash containing a list of the canonical compiler versions for supported versions of Xcode, and adds a check against that to determine whether a given installation has any compilers which are out of date. Closes Homebrew/homebrew#11518. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/doctor.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 3a47b7133..bef15afff 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -232,6 +232,17 @@ def check_cc
end
end
+def check_standard_compilers
+ return if check_for_latest_xcode # only check if Xcode is up to date
+ if !MacOS.compilers_standard? then <<-EOS.undent
+ Your compilers are different from the standard versions for your Xcode.
+ If you have Xcode 4.3 or newer, you should install the Command Line Tools for
+ Xcode from within Xcode's Download preferences.
+ Otherwise, you should reinstall Xcode.
+ EOS
+ end
+end
+
def __check_subdir_access base
target = HOMEBREW_PREFIX+base
return unless target.exist?