* lib/mkmf.rb (xsystem): expand macros like as make.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-02-08 06:09:23 +00:00
parent 52a757686d
commit f3d18d8c4c
2 changed files with 10 additions and 0 deletions

View file

@ -267,6 +267,12 @@ module Logging
end
def xsystem command
varpat = /\$\((\w+)\)|\$\{(\w+)\}/
if varpat =~ command
vars = Hash.new {|h, k| h[k] = ''; ENV[k]}
command = command.dup
nil while command.gsub!(varpat) {vars[$1||$2]}
end
Logging::open do
puts command.quote
system(command)