summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-08 06:09:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-08 06:09:23 +0000
commite581890816385d703dee109eecc79dbb5825878a (patch)
treee3609978270f67fe5a1c50bdd7d58f35a9fded2a /lib
parent9f0fe90cd37196de476615a6e0b98a3f1fbcf7ed (diff)
* lib/mkmf.rb (xsystem): expand macros like as make.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 9e461b42ad..7422a11a50 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -228,6 +228,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)