diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-26 16:27:23 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-26 16:27:23 +0000 |
commit | 965393cbb848ddb869543a5ca8f6e7fba1d0f130 (patch) | |
tree | eb89a8fb185a9d774708897e779143f51ca752f1 /ext/digest/md5/extconf.rb | |
parent | b00af5f83acfe4c8fd76f1e5c13c1b0cd469daad (diff) | |
download | ruby-965393cbb848ddb869543a5ca8f6e7fba1d0f130.tar.gz |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/md5/extconf.rb')
-rw-r--r-- | ext/digest/md5/extconf.rb | 16 |
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") |