summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-02-16 19:14:23 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-02-16 19:14:23 +0900
commit0b55f8a14f28b070177ee0ddcd76edb46af9a395 (patch)
tree2175706176b9e945bd7bd46f63b95fcde61d8c3d /ext/openssl
parent301457480039a7087129f291578a872f6e653ab6 (diff)
ext/openssl/extconf.rb: avoid -Werror=deprecated-declarations
It fails to build on Solaris: https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200216T090008Z.log.html.gz ``` ossl_cipher.c: 関数 ‘ossl_cipher_init’ 内: ossl_cipher.c:228:2: エラー: ‘EVP_md5’ is deprecated [-Werror=deprecated-declarations] 228 | EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), EVP_md5(), iv, | ^~~~~~~~~~~~~~ In file included from /usr/include/openssl/x509.h:73, from /usr/include/openssl/x509v3.h:63, from ossl.h:23, from ossl_cipher.c:10: /usr/include/openssl/evp.h:732:26: 備考: ここで宣言されています 732 | DEPRECATED const EVP_MD *EVP_md5(void); | ^~~~~~~ ```
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/deprecation.rb4
-rw-r--r--ext/openssl/extconf.rb3
2 files changed, 6 insertions, 1 deletions
diff --git a/ext/openssl/deprecation.rb b/ext/openssl/deprecation.rb
index 6af7d562fbd..fdf2d30ed0c 100644
--- a/ext/openssl/deprecation.rb
+++ b/ext/openssl/deprecation.rb
@@ -12,6 +12,10 @@ module OpenSSL
flag
end
+ def self.restore_warning_flag
+ $warnflags = @warnflags
+ end
+
def self.check_func(func, header)
have_func(func, header, deprecated_warning_flag)
end
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 344d7596520..87a682b4abd 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -19,7 +19,7 @@ dir_config("kerberos")
Logging::message "=== OpenSSL for Ruby configurator ===\n"
-# Add -Werror=deprecated-declarations to $warnflags if available
+# Check with -Werror=deprecated-declarations if available
OpenSSL.deprecated_warning_flag
##
@@ -185,5 +185,6 @@ have_func("SSL_CTX_set_post_handshake_auth")
Logging::message "=== Checking done. ===\n"
create_header
+OpenSSL.restore_warning_flag
create_makefile("openssl")
Logging::message "Done.\n"