summaryrefslogtreecommitdiff
path: root/ext/digest/sha2/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/sha2/extconf.rb')
-rw-r--r--ext/digest/sha2/extconf.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb
index 5ab2d35af53..ac351322509 100644
--- a/ext/digest/sha2/extconf.rb
+++ b/ext/digest/sha2/extconf.rb
@@ -9,12 +9,11 @@ $INCFLAGS << " -I$(srcdir)/.."
$objs = [ "sha2init.#{$OBJEXT}" ]
-dir_config("openssl")
-pkg_config("openssl")
-require File.expand_path('../../../openssl/deprecation', __FILE__)
-
if !with_config("bundled-sha2") &&
- have_library("crypto") &&
+ (dir_config("openssl")
+ pkg_config("openssl")
+ require File.expand_path('../../../openssl/deprecation', __FILE__)
+ have_library("crypto")) &&
%w[SHA256 SHA512].all? {|d| OpenSSL.check_func("#{d}_Transform", "openssl/sha.h")} &&
%w[SHA256 SHA512].all? {|d| have_type("#{d}_CTX", "openssl/sha.h")}
$objs << "sha2ossl.#{$OBJEXT}"