diff options
| author | Jack Nagel | 2014-05-18 14:34:31 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-05-18 14:34:31 -0500 |
| commit | 930cf4c768c017b25f3bee5d96cde4be384b74dc (patch) | |
| tree | 85242d9566ae69e6d7e0be9730b43866d2c7e249 /Library/Homebrew | |
| parent | ff9bbe941bb4a48ebf6c35ffe67ac3032a3fd707 (diff) | |
| download | brew-930cf4c768c017b25f3bee5d96cde4be384b74dc.tar.bz2 | |
Add accessor for HOMEBREW_CC
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/ENV/shared.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/super.rb | 8 |
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 |
