diff options
Diffstat (limited to 'enc/make_encmake.rb')
-rwxr-xr-x | enc/make_encmake.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb index a0bf4be969..09e19f6551 100755 --- a/enc/make_encmake.rb +++ b/enc/make_encmake.rb @@ -129,7 +129,12 @@ else dep = "" end mkin = File.read(File.join($srcdir, "Makefile.in")) -mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]} +# Variables that should not be expanded in Makefile.in to allow +# overriding inherited variables at make-time. +not_expand_vars = %w(CFLAGS) +mkin.gsub!(/@(#{RbConfig::CONFIG.keys.join('|')})@/) do + not_expand_vars.include?($1) ? CONFIG[$1] : RbConfig::CONFIG[$1] +end File.open(ARGV[0], 'wb') {|f| f.puts mkin, dep } |