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

ruby-changes:30384

From: usa <ko1@a...>
Date: Fri, 9 Aug 2013 16:38:27 +0900 (JST)
Subject: [ruby-changes:30384] usa:r42463 (ruby_1_9_3): merge revision(s) 42223: [Backport #8702]

usa	2013-08-09 16:38:15 +0900 (Fri, 09 Aug 2013)

  New Revision: 42463

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

  Log:
    merge revision(s) 42223: [Backport #8702]
    
    * 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.

  Added files:
    branches/ruby_1_9_3/test/mkmf/test_framework.rb
  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/lib/mkmf.rb
    branches/ruby_1_9_3/version.h
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 42462)
+++ ruby_1_9_3/ChangeLog	(revision 42463)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Fri Aug  9 16:29:22 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.
+
 Fri Aug  9 15:59:22 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_peek_variable_name): treat invalid global, class,
Index: ruby_1_9_3/lib/mkmf.rb
===================================================================
--- ruby_1_9_3/lib/mkmf.rb	(revision 42462)
+++ ruby_1_9_3/lib/mkmf.rb	(revision 42463)
@@ -300,7 +300,7 @@ end https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/mkmf.rb#L300
 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: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 42462)
+++ ruby_1_9_3/version.h	(revision 42463)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 463
+#define RUBY_PATCHLEVEL 464
 
 #define RUBY_RELEASE_DATE "2013-08-09"
 #define RUBY_RELEASE_YEAR 2013
Index: ruby_1_9_3/test/mkmf/test_framework.rb
===================================================================
--- ruby_1_9_3/test/mkmf/test_framework.rb	(revision 0)
+++ ruby_1_9_3/test/mkmf/test_framework.rb	(revision 42463)
@@ -0,0 +1,46 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/mkmf/test_framework.rb#L1
+require_relative 'base'
+
+class TestMkmf
+  class TestHaveFramework < TestMkmf
+    def create_framework(fw, hdrname = "#{fw}.h")
+      Dir.mktmpdir("frameworks") do |dir|
+        fwdir = "#{dir}/#{fw}.framework"
+        hdrdir = "#{fwdir}/Headers"
+        FileUtils.mkdir_p(hdrdir)
+        File.write("#{hdrdir}/#{hdrname}", "")
+        src = "#{fwdir}/main.c"
+        File.write(src, "void #{fw}(void) {}")
+        cmd = LINK_SO.dup
+        RbConfig.expand(cmd, RbConfig::CONFIG.merge("OBJS"=>src))
+        cmd.gsub!("$@", "#{fwdir}/#{fw}")
+        cmd.gsub!(/ -bundle /, ' -dynamiclib ')
+        assert(xsystem(cmd), MKMFLOG)
+        $INCFLAGS << " " << "-F#{dir}".quote
+        yield fw, hdrname
+      end
+    end
+
+    def test_core_foundation_framework
+      assert(have_framework("CoreFoundation"), mkmflog("try as Objective-C"))
+    end
+
+    def test_multi_frameworks
+      assert(have_framework("CoreFoundation"), mkmflog("try as Objective-C"))
+      assert(have_framework("Cocoa"), mkmflog("try as Objective-C"))
+    end
+
+    def test_empty_framework
+      create_framework("MkmfTest") do |fw|
+        assert(have_framework(fw), MKMFLOG)
+      end
+    end
+
+    def test_different_name_header
+      bug8593 = '[ruby-core:55745] [Bug #8593]'
+      create_framework("MkmfTest", "test_mkmf.h") do |fw, hdrname|
+        assert(!have_framework(fw), MKMFLOG)
+        assert(have_framework([fw, hdrname]), MKMFLOG)
+      end
+    end
+  end
+end if /darwin/ =~ RUBY_PLATFORM

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r42223


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

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