[前][次][番号順一覧][スレッド一覧]

ruby-changes:30171

From: nobu <ko1@a...>
Date: Mon, 29 Jul 2013 14:53:07 +0900 (JST)
Subject: [ruby-changes:30171] nobu:r42223 (trunk): mkmf.rb: expand all macros

nobu	2013-07-29 14:52:53 +0900 (Mon, 29 Jul 2013)

  New Revision: 42223

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42223

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/lib/mkmf.rb
    trunk/test/mkmf/test_framework.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42222)
+++ ChangeLog	(revision 42223)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul 29 14:52:46 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* win32/win32.c (rb_w32_pipe): use enum for compile time constants,
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 42222)
+++ lib/mkmf.rb	(revision 42223)
@@ -378,7 +378,7 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L378
   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
Index: test/mkmf/test_framework.rb
===================================================================
--- test/mkmf/test_framework.rb	(revision 42222)
+++ test/mkmf/test_framework.rb	(revision 42223)
@@ -12,8 +12,8 @@ class TestMkmf https://github.com/ruby/ruby/blob/trunk/test/mkmf/test_framework.rb#L12
         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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]