summaryrefslogtreecommitdiff
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
commitf3d18d8c4c6f7cd3c2065ca75a2553553e9ae31c (patch)
treede3b49de72b5eb61b7396f48102974edcbb2c5bb
parent52a757686ddb4f0d848f5b707a39f131fc73801d (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--lib/mkmf.rb6
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 31072a8b10..1c0bded820 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Feb 8 15:09:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (xsystem): expand macros like as make.
+
Fri Feb 8 09:27:57 2008 NARUSE, Yui <naruse@ruby-lang.org>
* lib/rdoc/ri/driver.rb (read_yaml): remove SM* for compatibility.
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 96696b1f3b..45bf90872d 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -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)