From e6709f0a62215ca4e9dd0d29a546a77cda4a8cb6 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 9 May 2016 00:05:33 +0000 Subject: [PATCH] openssl/extconf.rb: NO SSL macros first * ext/openssl/extconf.rb: check OPENSSL_NO_SSL{2,3} macros before checking related functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/extconf.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index e293b730df..9b3bdef085 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -97,12 +97,16 @@ have_func("OBJ_NAME_do_all_sorted") have_func("SSL_SESSION_get_id") have_func("SSL_SESSION_cmp") have_func("OPENSSL_cleanse") -have_func("SSLv2_method") -have_func("SSLv2_server_method") -have_func("SSLv2_client_method") -have_func("SSLv3_method") -have_func("SSLv3_server_method") -have_func("SSLv3_client_method") +unless have_macro("OPENSSL_NO_SSL2","openssl/opensslconf.h") + have_func("SSLv2_method") + have_func("SSLv2_server_method") + have_func("SSLv2_client_method") +end +unless have_macro("OPENSSL_NO_SSL3_METHOD","openssl/opensslconf.h") + have_func("SSLv3_method") + have_func("SSLv3_server_method") + have_func("SSLv3_client_method") +end have_func("TLSv1_1_method") have_func("TLSv1_1_server_method") have_func("TLSv1_1_client_method") @@ -152,8 +156,6 @@ have_struct_member("EVP_CIPHER_CTX", "engine", "openssl/evp.h") have_struct_member("X509_ATTRIBUTE", "single", "openssl/x509.h") have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS") have_macro("EVP_CTRL_GCM_GET_TAG", ['openssl/evp.h']) && $defs.push("-DHAVE_AUTHENTICATED_ENCRYPTION") -have_macro("OPENSSL_NO_SSL2","openssl/opensslconf.h") && $defs.reject!{|x|/HAVE_SSLV2_/===x} -have_macro("OPENSSL_NO_SSL3_METHOD","openssl/opensslconf.h") && $defs.reject!{|x|/HAVE_SSLV3_/===x} Logging::message "=== Checking done. ===\n"