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

ruby-changes:34927

From: nobu <ko1@a...>
Date: Thu, 31 Jul 2014 01:18:07 +0900 (JST)
Subject: [ruby-changes:34927] nobu:r47010 (trunk): mkmf.rb: try without -ObjC option

nobu	2014-07-31 01:17:55 +0900 (Thu, 31 Jul 2014)

  New Revision: 47010

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

  Log:
    mkmf.rb: try without -ObjC option
    
    * lib/mkmf.rb (have_framework): try without -ObjC option first as
      MacPorts GCCs do not support it.

  Modified files:
    trunk/lib/mkmf.rb
    trunk/test/mkmf/test_framework.rb
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 47009)
+++ lib/mkmf.rb	(revision 47010)
@@ -1092,11 +1092,11 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1092
     checking_for fw do
       src = cpp_include("#{fw}/#{header}") << "\n" "int main(void){return 0;}"
       opt = " -framework #{fw}"
-      if try_link(src, "-ObjC#{opt}", &b)
+      if try_link(src, opt, &b) or (objc = try_link(src, "-ObjC#{opt}", &b))
         $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
         # TODO: non-worse way than this hack, to get rid of separating
         # option and its argument.
-        $LDFLAGS << " -ObjC" unless /(\A|\s)-ObjC(\s|\z)/ =~ $LDFLAGS
+        $LDFLAGS << " -ObjC" if objc and /(\A|\s)-ObjC(\s|\z)/ !~ $LDFLAGS
         $LIBS << opt
         true
       else
Index: test/mkmf/test_framework.rb
===================================================================
--- test/mkmf/test_framework.rb	(revision 47009)
+++ test/mkmf/test_framework.rb	(revision 47010)
@@ -26,7 +26,9 @@ class TestMkmf https://github.com/ruby/ruby/blob/trunk/test/mkmf/test_framework.rb#L26
 
     def test_multi_frameworks
       assert(have_framework("CoreFoundation"), mkmflog("try as Objective-C"))
-      assert(have_framework("Cocoa"), mkmflog("try as Objective-C"))
+      create_framework("MkmfTest") do |fw|
+        assert(have_framework(fw), MKMFLOG)
+      end
     end
 
     def test_empty_framework

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

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