aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-05-18 14:34:31 -0500
committerJack Nagel2014-05-18 14:34:31 -0500
commit412b69d5084bb7619843fe06f2743017cdd34d07 (patch)
tree4a90e5304b03958c562fc0cba00cff392e82cd81
parent5d384651e193787255ea41fb3df17beaab7ba607 (diff)
downloadhomebrew-412b69d5084bb7619843fe06f2743017cdd34d07.tar.bz2
Add accessor for HOMEBREW_CC
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb8
-rw-r--r--Library/Homebrew/extend/ENV/super.rb8
2 files changed, 10 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index 7c68ae5e3..c258e9f34 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -101,8 +101,8 @@ module SharedEnvExtension
:llvm
elsif ARGV.include? '--use-clang'
:clang
- elsif self['HOMEBREW_CC']
- cc = COMPILER_ALIASES.fetch(self['HOMEBREW_CC'], self['HOMEBREW_CC'])
+ elsif homebrew_cc
+ cc = COMPILER_ALIASES.fetch(homebrew_cc, homebrew_cc)
COMPILER_SYMBOL_MAP.fetch(cc) { MacOS.default_compiler }
else
MacOS.default_compiler
@@ -245,4 +245,8 @@ module SharedEnvExtension
def cxx= val
self["CXX"] = self["OBJCXX"] = val.to_s
end
+
+ def homebrew_cc
+ self["HOMEBREW_CC"]
+ end
end
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index 5b3b8c5c5..cb05ec964 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -87,7 +87,7 @@ module Superenv
# s - apply fix for sed's Unicode support
# a - apply fix for apr-1-config path
- warn_about_non_apple_gcc($1) if self["HOMEBREW_CC"] =~ GNU_GCC_REGEXP
+ warn_about_non_apple_gcc($1) if homebrew_cc =~ GNU_GCC_REGEXP
end
private
@@ -125,7 +125,7 @@ module Superenv
# Homebrew's apple-gcc42 will be outside the PATH in superenv,
# so xcrun may not be able to find it
- case self["HOMEBREW_CC"]
+ case homebrew_cc
when "gcc-4.2"
begin
apple_gcc42 = Formulary.factory('apple-gcc42')
@@ -272,14 +272,14 @@ module Superenv
end
def cxx11
- case self["HOMEBREW_CC"]
+ case homebrew_cc
when "clang"
append 'HOMEBREW_CCCFG', "x", ''
append 'HOMEBREW_CCCFG', "g", ''
when /gcc-4\.(8|9)/
append 'HOMEBREW_CCCFG', "x", ''
else
- raise "The selected compiler doesn't support C++11: #{self['HOMEBREW_CC']}"
+ raise "The selected compiler doesn't support C++11: #{homebrew_cc}"
end
end