aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/macos.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/macos.rb')
-rw-r--r--Library/Homebrew/macos.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index 8e379ad2a..de109ade3 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -151,6 +151,16 @@ module MacOS extend self
end
end
+ def non_apple_gcc_version(cc)
+ return unless path = locate(cc)
+
+ ivar = "@#{cc.gsub(/(-|\.)/, '')}_version"
+ return instance_variable_get(ivar) if instance_variable_defined?(ivar)
+
+ `#{path} --version` =~ /gcc-\d.\d \(GCC\) (\d\.\d\.\d)/
+ instance_variable_set(ivar, $1)
+ end
+
# See these issues for some history:
# http://github.com/mxcl/homebrew/issues/#issue/13
# http://github.com/mxcl/homebrew/issues/#issue/41