From 97c5909aac1b1cc9ecdd0f3930b56f4cadb7775d Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Sun, 27 Jun 2021 12:32:43 -0500 Subject: [PATCH] extconf.rb - allow pkg_config for OpenSSL (#2648) --- ext/puma_http11/extconf.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/puma_http11/extconf.rb b/ext/puma_http11/extconf.rb index 2ceb644d99..e17eb2cd61 100644 --- a/ext/puma_http11/extconf.rb +++ b/ext/puma_http11/extconf.rb @@ -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