From bb318692a6f6ce10428ad92d330164eacf414d23 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 5 Oct 2014 02:03:55 +0000 Subject: digest/*/extconf.rb: do not link openssl when using bundled * ext/digest/{md5,rmd160,sha1,sha2}/extconf.rb: configure OpenSSL only if bundled libraries is not used, so that OpenSSL is not linked unnecessarily. [ruby-core:65404] [Bug #10324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ ext/digest/md5/extconf.rb | 11 +++++------ ext/digest/rmd160/extconf.rb | 10 +++++----- ext/digest/sha1/extconf.rb | 10 +++++----- ext/digest/sha2/extconf.rb | 9 ++++----- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 697a0b82d0..24e9503c15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 5 11:04:13 2014 Luiz Angelo Daros de Luca + + * ext/digest/{md5,rmd160,sha1,sha2}/extconf.rb: configure OpenSSL + only if bundled libraries is not used, so that OpenSSL is not + linked unnecessarily. [ruby-core:65404] [Bug #10324] + Sun Oct 5 10:39:11 2014 Luiz Angelo Daros de Luca * ext/digest/rmd160/extconf.rb: fix transform function name to diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb index 5a57fd3eea..dbef0878ca 100644 --- a/ext/digest/md5/extconf.rb +++ b/ext/digest/md5/extconf.rb @@ -9,14 +9,13 @@ $INCFLAGS << " -I$(srcdir)/.." $objs = [ "md5init.#{$OBJEXT}" ] -dir_config("openssl") -pkg_config("openssl") -require File.expand_path('../../../openssl/deprecation', __FILE__) - if !with_config("bundled-md5") && - have_library("crypto") && OpenSSL.check_func("MD5_Transform", "openssl/md5.h") + (dir_config("openssl") + pkg_config("openssl") + require File.expand_path('../../../openssl/deprecation', __FILE__) + have_library("crypto")) && + OpenSSL.check_func("MD5_Transform", "openssl/md5.h") $objs << "md5ossl.#{$OBJEXT}" - else $objs << "md5.#{$OBJEXT}" end diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb index 60131aa554..64ffbd7dc8 100644 --- a/ext/digest/rmd160/extconf.rb +++ b/ext/digest/rmd160/extconf.rb @@ -9,12 +9,12 @@ $INCFLAGS << " -I$(srcdir)/.." $objs = [ "rmd160init.#{$OBJEXT}" ] -dir_config("openssl") -pkg_config("openssl") -require File.expand_path('../../../openssl/deprecation', __FILE__) - if !with_config("bundled-rmd160") && - have_library("crypto") && OpenSSL.check_func("RIPEMD160_Transform", "openssl/ripemd.h") + (dir_config("openssl") + pkg_config("openssl") + require File.expand_path('../../../openssl/deprecation', __FILE__) + have_library("crypto")) && + OpenSSL.check_func("RIPEMD160_Transform", "openssl/ripemd.h") $objs << "rmd160ossl.#{$OBJEXT}" else $objs << "rmd160.#{$OBJEXT}" diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb index d7e52fe731..c230270e1b 100644 --- a/ext/digest/sha1/extconf.rb +++ b/ext/digest/sha1/extconf.rb @@ -9,12 +9,12 @@ $INCFLAGS << " -I$(srcdir)/.." $objs = [ "sha1init.#{$OBJEXT}" ] -dir_config("openssl") -pkg_config("openssl") -require File.expand_path('../../../openssl/deprecation', __FILE__) - if !with_config("bundled-sha1") && - have_library("crypto") && OpenSSL.check_func("SHA1_Transform", "openssl/sha.h") + (dir_config("openssl") + pkg_config("openssl") + require File.expand_path('../../../openssl/deprecation', __FILE__) + have_library("crypto")) && + OpenSSL.check_func("SHA1_Transform", "openssl/sha.h") $objs << "sha1ossl.#{$OBJEXT}" else $objs << "sha1.#{$OBJEXT}" diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb index 5ab2d35af5..ac35132250 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}" -- cgit v1.2.3