mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d6d8ea91e9
commit
6ff3a8e3bb
2 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu May 12 01:54:08 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Thu May 12 00:18:19 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/Makefile.sub (HAVE_QSORT_S): use qsort_s only for Visual Studio
|
* win32/Makefile.sub (HAVE_QSORT_S): use qsort_s only for Visual Studio
|
||||||
|
|
13
lib/mkmf.rb
13
lib/mkmf.rb
|
@ -748,6 +748,8 @@ int main() {printf("%"PRI_CONFTEST_PREFIX"#{neg ? 'd' : 'u'}\\n", conftest_const
|
||||||
decltype = proc {|x|"const volatile void *#{x}"}
|
decltype = proc {|x|"const volatile void *#{x}"}
|
||||||
when /\)$/
|
when /\)$/
|
||||||
call = func
|
call = func
|
||||||
|
when nil
|
||||||
|
call = ""
|
||||||
else
|
else
|
||||||
call = "#{func}()"
|
call = "#{func}()"
|
||||||
decltype = proc {|x| "void ((*#{x})())"}
|
decltype = proc {|x| "void ((*#{x})())"}
|
||||||
|
@ -956,7 +958,10 @@ SRC
|
||||||
break noun = noun.send(meth, *args)
|
break noun = noun.send(meth, *args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
msg << " #{pre} #{noun}" unless noun.empty?
|
unless noun.empty?
|
||||||
|
msg << " #{pre} " unless msg.empty?
|
||||||
|
msg << noun
|
||||||
|
end
|
||||||
end
|
end
|
||||||
msg
|
msg
|
||||||
end
|
end
|
||||||
|
@ -987,9 +992,8 @@ SRC
|
||||||
# <code>--with-FOOlib</code> configuration option.
|
# <code>--with-FOOlib</code> configuration option.
|
||||||
#
|
#
|
||||||
def have_library(lib, func = nil, headers = nil, opt = "", &b)
|
def have_library(lib, func = nil, headers = nil, opt = "", &b)
|
||||||
func = "main" if !func or func.empty?
|
|
||||||
lib = with_config(lib+'lib', lib)
|
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)
|
if COMMON_LIBS.include?(lib)
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
|
@ -1013,10 +1017,9 @@ SRC
|
||||||
# library paths searched and linked against.
|
# library paths searched and linked against.
|
||||||
#
|
#
|
||||||
def find_library(lib, func, *paths, &b)
|
def find_library(lib, func, *paths, &b)
|
||||||
func = "main" if !func or func.empty?
|
|
||||||
lib = with_config(lib+'lib', lib)
|
lib = with_config(lib+'lib', lib)
|
||||||
paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
|
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
|
libpath = $LIBPATH
|
||||||
libs = append_library($libs, lib)
|
libs = append_library($libs, lib)
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue