diff options
-rw-r--r-- | ext/openssl/deprecation.rb | 6 | ||||
-rw-r--r-- | ext/openssl/extconf.rb | 3 |
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" |