aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/--config.rb21
-rw-r--r--Library/Homebrew/cmd/doctor.rb60
2 files changed, 57 insertions, 24 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb
index 5fb455d23..a4431eb5e 100644
--- a/Library/Homebrew/cmd/--config.rb
+++ b/Library/Homebrew/cmd/--config.rb
@@ -25,8 +25,21 @@ module Homebrew extend self
@clang_build ||= MacOS.clang_build_version
end
- def xcode_version
- @xcode_version || MacOS.xcode_version
+ def describe_xcode
+ @describe_xcode ||= begin
+ xcode = MacOS.xcode_version
+ if MacOS.xcode_installed?
+ xcode += " in '#{MacOS.xcode_prefix}'" unless MacOS.xcode_prefix.to_s == '/Applications/Xcode.app/Contents/Developer'
+ else
+ xcode += ' (guessed)' unless MacOS.xcode_installed?
+ end
+ xcode += ", CLT #{MacOS.clt_version}" if MacOS.clt_installed?
+ xcode
+ end
+ end
+
+ def describe_default_sdk
+ @describe_default_sdk ||= if MacOS.sdk_path.nil? then "N/A" else MacOS.sdk_path end
end
def sha
@@ -90,7 +103,7 @@ module Homebrew extend self
puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar"
puts hardware
puts "MacOS: #{MACOS_FULL_VERSION}-#{kernel}"
- puts "Xcode: #{xcode_version}"
+ puts "Xcode: #{describe_xcode}"
puts "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8
ponk = macports_or_fink_installed?
@@ -108,7 +121,7 @@ module Homebrew extend self
#{hardware}
OS X: #{MACOS_FULL_VERSION}
Kernel Architecture: #{kernel}
- Xcode: #{xcode_version}
+ Xcode: #{describe_xcode}
GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"}
GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"}
LLVM: #{llvm ? "build #{llvm}" : "N/A"}
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 8aa229b28..a19a2d17e 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -217,16 +217,31 @@ def check_for_broken_symlinks
end
def check_for_latest_xcode
- if MacOS.xcode_version.nil?
- if MacOS.version >= 10.7 then return <<-EOS.undent
- We couldn't detect any version of Xcode.
- The latest Xcode can be obtained from the Mac App Store.
- Alternatively, the Command Line Tools package can be obtained from
- http://connect.apple.com
- EOS
- else return <<-EOS.undent
- We couldn't detect any version of Xcode.
- The latest Xcode can be obtained from http://connect.apple.com
+ if not MacOS.xcode_installed?
+ # no Xcode, now it depends on the OS X version...
+ if MacOS.version >= 10.7 then
+ if not MacOS.clt_installed?
+ return <<-EOS.undent
+ No Xcode version found!
+ No compiler found in /usr/bin!
+
+ To fix this, either:
+ - Install the "Command Line Tools for Xcode" from http://connect.apple.com/
+ Homebrew does not require all of Xcode, you only need the CLI tools package!
+ (However, you need a (free) Apple Developer ID.)
+ - Install Xcode from the Mac App Store. (Normal Apple ID is sufficient, here)
+ EOS
+ else
+ return <<-EOS.undent
+ Experimental support for using the "Command Line Tools" without Xcode.
+ Some formulae need Xcode to be installed (for the Frameworks not in the CLT.)
+ EOS
+ end
+ else
+ # older Mac systems should just install their old Xcode. We don't advertize the CLT.
+ return <<-EOS.undent
+ We couldn't detect any version of Xcode.
+ If you downloaded Xcode from the App Store, you may need to run the installer.
EOS
end
end
@@ -236,21 +251,24 @@ def check_for_latest_xcode
when 10.6 then "3.2.6"
else "4.3"
end
- if MacOS.xcode_version < latest_xcode then <<-EOS.undent
- You have Xcode #{MacOS.xcode_version}, which is outdated.
+ if MacOS.xcode_installed? and MacOS.xcode_version < latest_xcode then <<-EOS.undent
+ You have Xcode-#{MacOS.xcode_version}, which is outdated.
Please install Xcode #{latest_xcode}.
EOS
end
end
def check_cc
- unless File.exist? '/usr/bin/cc' then <<-EOS.undent
- You have no /usr/bin/cc.
- This means you probably can't build *anything*. You need to install the Command
- Line Tools for Xcode. You can either download this from http://connect.apple.com
- or install them from inside Xcode's Download preferences. Homebrew does not
- require all of Xcode! You only need the Command Line Tools package!
- EOS
+ unless MacOS.clt_installed?
+ if MacOS.xcode_version >= "4.3"
+ return <<-EOS.undent
+ Experimental support for using Xcode without the "Command Line Tools".
+ EOS
+ else
+ return <<-EOS.undent
+ No compiler found in /usr/bin!
+ EOS
+ end
end
end
@@ -386,7 +404,9 @@ end
def check_xcode_select_path
path = `xcode-select -print-path 2>/dev/null`.chomp
- unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild"
+ # with the advent of CLT-only support, we don't need xcode-select
+ return if MacOS.clt_installed?
+ unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild" and not MacOS.xctools_fucked?
# won't guess at the path they should use because it's too hard to get right
# We specify /Applications/Xcode.app/Contents/Developer even though
# /Applications/Xcode.app should work because people don't install the new CLI