summaryrefslogtreecommitdiff
path: root/ext/digest/md5/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/md5/extconf.rb')
-rw-r--r--ext/digest/md5/extconf.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb
index 93a14025d0..0db0404dbe 100644
--- a/ext/digest/md5/extconf.rb
+++ b/ext/digest/md5/extconf.rb
@@ -5,10 +5,18 @@ require "mkmf"
$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(__FILE__)}/.."
-$objs = [
- "md5.#{$OBJEXT}",
- "md5init.#{$OBJEXT}",
-]
+$objs = [ "md5init.#{$OBJEXT}" ]
+
+dir_config("openssl")
+
+if !with_config("bundled-md5") &&
+ have_library("crypto") && have_header("openssl/md5.h")
+ $objs << "md5ossl.#{$OBJEXT}"
+
+ $libs << " -lcrypto"
+else
+ $objs << "md5.#{$OBJEXT}"
+end
have_header("sys/cdefs.h")