Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pkg_config for OpenSSL if available #2648

Merged
merged 1 commit into from Jun 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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