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

ruby-changes:42908

From: nobu <ko1@a...>
Date: Thu, 12 May 2016 01:54:14 +0900 (JST)
Subject: [ruby-changes:42908] nobu:r54982 (trunk): mkmf.rb: fix conflict in have_library

nobu	2016-05-12 01:54:10 +0900 (Thu, 12 May 2016)

  New Revision: 54982

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

  Log:
    mkmf.rb: fix conflict in have_library
    
    * lib/mkmf.rb (try_func): get rid of conflict of declarations of
      main().  checking local symbol reference does not make sense.

  Modified files:
    trunk/ChangeLog
    trunk/lib/mkmf.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54981)
+++ ChangeLog	(revision 54982)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu May 12 01:54:08 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/mkmf.rb (try_func): get rid of conflict of declarations of
+	  main().  checking local symbol reference does not make sense.
+
 Thu May 12 00:18:19 2016  NAKAMURA Usaku  <usa@r...>
 
 	* win32/Makefile.sub (HAVE_QSORT_S): use qsort_s only for Visual Studio
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 54981)
+++ lib/mkmf.rb	(revision 54982)
@@ -748,6 +748,8 @@ int main() {printf("%"PRI_CONFTEST_PREFI https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L748
       decltype = proc {|x|"const volatile void *#{x}"}
     when /\)$/
       call = func
+    when nil
+      call = ""
     else
       call = "#{func}()"
       decltype = proc {|x| "void ((*#{x})())"}
@@ -956,7 +958,10 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L958
             break noun = noun.send(meth, *args)
           end
         end
-        msg << " #{pre} #{noun}" unless noun.empty?
+        unless noun.empty?
+          msg << " #{pre} " unless msg.empty?
+          msg << noun
+        end
       end
       msg
     end
@@ -987,9 +992,8 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L992
   # <code>--with-FOOlib</code> configuration option.
   #
   def have_library(lib, func = nil, headers = nil, opt = "", &b)
-    func = "main" if !func or func.empty?
     lib = with_config(lib+'lib', lib)
-    checking_for checking_message(func.funcall_style, LIBARG%lib, opt) do
+    checking_for checking_message(func && func.funcall_style, LIBARG%lib, opt) do
       if COMMON_LIBS.include?(lib)
         true
       else
@@ -1013,10 +1017,9 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1017
   # library paths searched and linked against.
   #
   def find_library(lib, func, *paths, &b)
-    func = "main" if !func or func.empty?
     lib = with_config(lib+'lib', lib)
     paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
-    checking_for checking_message(func.funcall_style, LIBARG%lib) do
+    checking_for checking_message(func && func.funcall_style, LIBARG%lib) do
       libpath = $LIBPATH
       libs = append_library($libs, lib)
       begin

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

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