From fb5efbaaecc60145fe00d4b6e5240c4f542ef3ab Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 6 Aug 2003 08:28:52 +0000 Subject: [PATCH] * lib/mkmf.rb (have_library): treat nil function name as "main". (ruby-bugs:PR#1083) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 +++--- lib/mkmf.rb | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59f1536491..fab09cf0b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Wed Aug 6 12:11:10 2003 Nobuyoshi Nakada +Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada * ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137] @@ -11,8 +11,8 @@ Wed Aug 6 12:11:10 2003 Nobuyoshi Nakada * lib/mkmf.rb (macro_defined?): append newline to src unless ended with it. - * lib/mkmf.rb (have_library): allow nil function name to just - append a library. (ruby-bugs:PR#1083) + * lib/mkmf.rb (have_library): treat nil function name as "main". + (ruby-bugs:PR#1083) * lib/mkmf.rb (pkg_config): should append additional libraries to $libs but not $LIBS. [ruby-dev:21137] diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 5d63277db7..d21fa4f8b6 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -446,14 +446,14 @@ def checking_for(m) r end -def have_library(lib, func="main") - func &&= ((m = "#{func}() in "; func) unless func.empty?) - checking_for "#{m}-l#{lib}" do +def have_library(lib, func=nil) + func = "main" if !func or func.empty? + checking_for "#{func}() in -l#{lib}" do if COMMON_LIBS.include?(lib) true else libs = append_library($libs, lib) - if !func || try_func(func, libs) + if try_func(func, libs) $libs = libs true else