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