diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-07-05 23:22:44 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-07-06 01:17:38 +0900 |
commit | eecc4570cd0f775cc83b3ce9c811cd5142e838f2 (patch) | |
tree | a7eaf188b281d542e05e7affbddb3aeb164e6bda | |
parent | e359d637eeb47cd900e01f63632fa1d3c6604be4 (diff) |
Found library is not usable if the header is not found
-rw-r--r-- | ext/zlib/extconf.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb index 13d0ee2052..d674544f22 100644 --- a/ext/zlib/extconf.rb +++ b/ext/zlib/extconf.rb @@ -10,11 +10,12 @@ 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 + $libs = libs unless File.directory?(zsrc = "#{$srcdir}/zlib") dirs = Dir.open($srcdir) {|z| z.grep(/\Azlib-\d+[.\d]*\z/) {|x|"#{$srcdir}/#{x}"}} dirs.delete_if {|x| !File.directory?(x)} |