1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Found library is not usable if the header is not found

This commit is contained in:
Nobuyoshi Nakada 2021-07-05 23:22:44 +09:00
parent e359d637ee
commit eecc4570cd
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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)}