summaryrefslogtreecommitdiff
path: root/ext/digest/rmd160/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/rmd160/extconf.rb')
-rw-r--r--ext/digest/rmd160/extconf.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb
index ce53c77b557..3f6a88e7567 100644
--- a/ext/digest/rmd160/extconf.rb
+++ b/ext/digest/rmd160/extconf.rb
@@ -5,11 +5,17 @@ require "mkmf"
$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(__FILE__)}/.."
-$objs = [
- "rmd160.#{$OBJEXT}",
- "rmd160hl.#{$OBJEXT}",
- "rmd160init.#{$OBJEXT}",
-]
+$objs = [ "rmd160init.#{$OBJEXT}" ]
+
+dir_config("openssl")
+
+if !with_config("bundled-rmd160") &&
+ have_library("crypto") && have_header("openssl/ripemd.h")
+ $objs << "rmd160ossl.#{$OBJEXT}"
+ $libs << " -lcrypto"
+else
+ $objs << "rmd160.#{$OBJEXT}" << "rmd160hl.#{$OBJEXT}"
+end
have_header("sys/cdefs.h")