aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-09-26 19:59:47 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-09-26 19:59:58 +0900
commitcc4b8790ad74fd7def09a5560ae4b95a5d9fa46a (patch)
treeafd866d266280df4444c794a3ecca2ecb133ab52
parent98375ec94127df19d70c80756374a33b05617d14 (diff)
downloadruby-openssl-cc4b8790ad74fd7def09a5560ae4b95a5d9fa46a.tar.gz
ext/openssl/extconf.rb: do not use -Werror=deprecated-declarations
This is a combined commit of the following commits by mame and nobu: - 0d7d8b2989e1 ("ext/openssl/extconf.rb: do not use -Werror=deprecated-declarations", 2019-12-05) - c3abbc1b2f52 ("ext/openssl/extconf.rb: check with -Werror=deprecated-declarations", 2019-12-05) -Werror=deprecated-declarations should only be used while checking available features, and not for compiling the extension itself. This is a backport to the 2.1 branch from ruby.git. Note that current master (targeting 3.0) completely removed ext/openssl/deprecation.rb.
-rw-r--r--ext/openssl/deprecation.rb6
-rw-r--r--ext/openssl/extconf.rb3
2 files changed, 7 insertions, 2 deletions
diff --git a/ext/openssl/deprecation.rb b/ext/openssl/deprecation.rb
index 1d51d065..afe989ea 100644
--- a/ext/openssl/deprecation.rb
+++ b/ext/openssl/deprecation.rb
@@ -3,7 +3,7 @@ module OpenSSL
def self.deprecated_warning_flag
unless flag = (@deprecated_warning_flag ||= nil)
if try_compile("", flag = "-Werror=deprecated-declarations")
- $warnflags << " #{flag}"
+ $warnflags = "#{@warnflags = $warnflags}" #{flag}"
else
flag = ""
end
@@ -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 4f218562..264130bb 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
##
@@ -169,5 +169,6 @@ have_func("EVP_PBE_scrypt")
Logging::message "=== Checking done. ===\n"
create_header
+OpenSSL.restore_warning_flag
create_makefile("openssl")
Logging::message "Done.\n"