Skip to content

Commit

Permalink
extconf.rb - allow pkg_config for OpenSSL (#2648)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Jun 27, 2021
1 parent 6a085e6 commit 4ff7d75
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ext/puma_http11/extconf.rb
Expand Up @@ -11,9 +11,18 @@
unless ENV["DISABLE_SSL"]
dir_config("openssl")

if %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} and
found_ssl = if pkg_config 'openssl'
puts 'using OpenSSL pkgconfig (openssl.pc)'
true
elsif %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} &&
%w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
true
else
puts '** Puma will be compiled without SSL support'
false
end

if found_ssl
have_header "openssl/bio.h"

# below is yes for 1.0.2 & later
Expand Down

0 comments on commit 4ff7d75

Please sign in to comment.