diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-06 08:28:52 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-06 08:28:52 +0000 |
| commit | fb5efbaaecc60145fe00d4b6e5240c4f542ef3ab (patch) | |
| tree | 4f9f818a03dea4cdc77eaf95cef3aa27e2e25e4f | |
| parent | 94d17c1f1fbacf7dffcdbbe508b37c7719ba6778 (diff) | |
* 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
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | lib/mkmf.rb | 8 |
2 files changed, 7 insertions, 7 deletions
@@ -1,4 +1,4 @@ -Wed Aug 6 12:11:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> +Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> * 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 <nobu@ruby-lang.org> * 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 |
