summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-29 05:52:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-29 05:52:53 +0000
commitfcb58bdb3826a3ba6eaeb133313fea148d843926 (patch)
treed3bf62030a08d1d0c93d1c08ca867fe06ab0046c
parent3168bfe85661c5927240e31ca7f00b046e459667 (diff)
mkmf.rb: expand all macros
* lib/mkmf.rb (xsystem): expand environment variable in all macros not expanded with RbConfig. [Bug #8702] * test/mkmf/test_framework.rb (create_framework): replace all $@ not only once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--lib/mkmf.rb2
-rw-r--r--test/mkmf/test_framework.rb4
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 07b8caf31de..7709123933d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jul 29 14:52:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (xsystem): expand environment variable in all macros not
+ expanded with RbConfig. [Bug #8702]
+
+ * test/mkmf/test_framework.rb (create_framework): replace all $@ not
+ only once.
+
Mon Jul 29 06:54:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (rb_w32_pipe): use enum for compile time constants,
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 0e78d74e1b0..682eb465721 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -378,7 +378,7 @@ module MakeMakefile
def xsystem command, opts = nil
varpat = /\$\((\w+)\)|\$\{(\w+)\}/
if varpat =~ command
- vars = Hash.new {|h, k| h[k] = ''; ENV[k]}
+ vars = Hash.new {|h, k| h[k] = ENV[k]}
command = command.dup
nil while command.gsub!(varpat) {vars[$1||$2]}
end
diff --git a/test/mkmf/test_framework.rb b/test/mkmf/test_framework.rb
index 1b595aab7aa..48e8bf7213d 100644
--- a/test/mkmf/test_framework.rb
+++ b/test/mkmf/test_framework.rb
@@ -12,8 +12,8 @@ class TestMkmf
File.write(src, "void #{fw}(void) {}")
cmd = LINK_SO.dup
RbConfig.expand(cmd, RbConfig::CONFIG.merge("OBJS"=>src))
- cmd.sub!("$@", "#{fwdir}/#{fw}")
- cmd.sub!(/ -bundle /, ' -dynamiclib ')
+ cmd.gsub!("$@", "#{fwdir}/#{fw}")
+ cmd.gsub!(/ -bundle /, ' -dynamiclib ')
assert(xsystem(cmd), MKMFLOG)
$INCFLAGS << " " << "-F#{dir}".quote
yield fw, hdrname