diff options
| author | Jack Nagel | 2014-05-26 14:10:24 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-05-26 14:10:24 -0500 |
| commit | 1a083e8ad6e5f81ddce8f6c790cb9043b181e45a (patch) | |
| tree | b7f3ac0f6ed13bb2519c9d1963964260c4e51346 /Library/Homebrew/extend | |
| parent | 0a31bba3181b759e4defd12550af4627eaff85f7 (diff) | |
| download | homebrew-1a083e8ad6e5f81ddce8f6c790cb9043b181e45a.tar.bz2 | |
Share code for sanitizing ENV between both build environments
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/ENV/shared.rb | 13 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/std.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/super.rb | 13 |
3 files changed, 16 insertions, 17 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index 743c36fce..02a3b6dd3 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -14,6 +14,19 @@ module SharedEnvExtension 'llvm-gcc' => :llvm, 'clang' => :clang } + SANITIZED_VARS = %w[ + CDPATH GREP_OPTIONS CLICOLOR_FORCE + CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH + CC CXX OBJC OBJCXX CPP MAKE LD LDSHARED + CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS + MACOSX_DEPLOYMENT_TARGET SDKROOT DEVELOPER_DIR + CMAKE_PREFIX_PATH CMAKE_INCLUDE_PATH CMAKE_FRAMEWORK_PATH + ] + + def reset + SANITIZED_VARS.each { |k| delete(k) } + end + def remove_cc_etc keys = %w{CC CXX OBJC OBJCXX LD CPP CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS} removed = Hash[*keys.map{ |key| [key, self[key]] }.flatten] diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 9b1c6e369..f433e50bc 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -16,12 +16,7 @@ module Stdenv end def setup_build_environment(formula=nil) - # Clear CDPATH to avoid make issues that depend on changing directories - delete('CDPATH') - delete('GREP_OPTIONS') # can break CMake (lol) - delete('CLICOLOR_FORCE') # autotools doesn't like this - %w{CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH}.each { |k| delete(k) } - remove_cc_etc + reset if MacOS.version >= :mountain_lion # Mountain Lion's sed is stricter, and errors out when diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index d42aa4b57..c68e6eb86 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -27,19 +27,10 @@ module Superenv end def reset - %w{CC CXX OBJC OBJCXX CPP MAKE LD LDSHARED - CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS - MACOSX_DEPLOYMENT_TARGET SDKROOT DEVELOPER_DIR - CMAKE_PREFIX_PATH CMAKE_INCLUDE_PATH CMAKE_FRAMEWORK_PATH - CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH}. - each{ |x| delete(x) } - delete('CDPATH') # avoid make issues that depend on changing directories - delete('GREP_OPTIONS') # can break CMake - delete('CLICOLOR_FORCE') # autotools doesn't like this - + super # Configure scripts generated by autoconf 2.61 or later export as_nl, which # we use as a heuristic for running under configure - delete('as_nl') + delete("as_nl") end def setup_build_environment(formula=nil) |
