diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-01-09 18:41:02 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-01-09 10:46:02 +0000 |
commit | 0a2bf5f1e256de7f030668c6130379cbd0d6d708 (patch) | |
tree | 657fb09665a4982cfb5ac3f47934a05665f45a5a /ext | |
parent | 9d078fe4778d6ba60e1daba0d7172d027a1e7f4d (diff) | |
download | ruby-0a2bf5f1e256de7f030668c6130379cbd0d6d708.tar.gz |
[ruby/zlib] Check for functions with arguments and the header
With arguments, mkmf skips compilation check for the function as RHS.
https://github.com/ruby/zlib/commit/9ed9d6d36e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/zlib/extconf.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb index 5477f49178..1254c62a17 100644 --- a/ext/zlib/extconf.rb +++ b/ext/zlib/extconf.rb @@ -11,10 +11,9 @@ require 'rbconfig' dir_config 'zlib' libs = $libs -if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and - have_header('zlib.h') then - have_zlib = true -else +have_zlib = %w'z libz zlib1 zlib zdll zlibwapi'.any? {|z| have_library(z, 'deflateReset(NULL)', 'zlib.h')} + +unless have_zlib $libs = libs unless File.directory?(zsrc = "#{$srcdir}/zlib") dirs = Dir.open($srcdir) {|z| z.grep(/\Azlib-\d+[.\d]*\z/) {|x|"#{$srcdir}/#{x}"}} |