From 4dc1a7bdce4d2b311c2ca2507ecdd5654a813f2b Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 8 Apr 2012 11:10:22 -0500 Subject: 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 --- Library/Homebrew/cmd/doctor.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Library/Homebrew/cmd') 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? -- cgit v1.2.3