diff options
| author | Max Howell | 2012-08-28 19:29:10 -0400 |
|---|---|---|
| committer | Max Howell | 2012-08-29 12:41:37 -0400 |
| commit | 7d8954d74caf59fdc93dae255e3b5fee328c5972 (patch) | |
| tree | f6e9a6ed7953b1afb688ce89464540c647bfa759 /Library/Homebrew | |
| parent | 24bcc694e58024f47315474610ff8514fc65d074 (diff) | |
| download | brew-7d8954d74caf59fdc93dae255e3b5fee328c5972.tar.bz2 | |
Warn user if they set CFLAGS, etc. with superenv
Since we remove some CFLAGS under their noses, this would otherwise be quite confusing.
Notably, this will now trigger in numerous formula. Sucks.
Diffstat (limited to 'Library/Homebrew')
| -rwxr-xr-x | Library/Homebrew/build.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 3c15be352..77960f8ee 100755 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -57,7 +57,9 @@ def install f # Python etc. build but then pip can't build stuff. # Scons resets ENV and then can't find superenv's build-tools. stdenvs = %w{fontforge python python3 ruby ruby-enterprise-edition jruby} - ARGV.unshift '--env=std' if stdenvs.include?(f.name) or f.recursive_deps.detect{|d| d.name == 'scons' } + ARGV.unshift '--env=std' if (stdenvs.include?(f.name) or + f.recursive_deps.detect{|d| d.name == 'scons' }) and + not ARGV.include? '--env=super' keg_only_deps = f.recursive_deps.uniq.select{|dep| dep.keg_only? } @@ -82,6 +84,14 @@ def install f if superenv? ENV.deps = keg_only_deps.map(&:to_s) ENV.setup_build_environment + class << ENV + def []=(key, value) + case key when 'CFLAGS', 'CPPFLAGS', 'LDFAGS' + opoo "#{key} set with --env=super! Flags may not take effect!" + end + store(key, value) + end + end end f.recursive_requirements.each { |req| req.modify_build_environment } |
