summaryrefslogtreecommitdiffstats
path: root/ext/digest/md5/extconf.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-26 16:27:23 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-26 16:27:23 +0000
commit94659b3edc461c3da419e8980d96b5c4ca74b13f (patch)
treeeb89a8fb185a9d774708897e779143f51ca752f1 /ext/digest/md5/extconf.rb
parentd29b165e2a2a228d21d2882f9978083ceb92f8d6 (diff)
downloadruby-94659b3edc461c3da419e8980d96b5c4ca74b13f.tar.gz
ruby-94659b3edc461c3da419e8980d96b5c4ca74b13f.tar.xz
ruby-94659b3edc461c3da419e8980d96b5c4ca74b13f.zip
* ext/digest/md5: Use OpenSSL's MD5 engine if available. It is
much faster than what we have now (md5.[ch]). Add a knob (--with-bundled-md5) to extconf.rb which makes it use the bundled one anyway. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 93a14025d..0db0404db 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")