2001-08-14 16:05:21 -04:00
|
|
|
# $RoughId: extconf.rb,v 1.4 2001/08/14 19:54:51 knu Exp $
|
2001-07-13 16:06:14 -04:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
require "mkmf"
|
|
|
|
|
2006-05-25 19:44:08 -04:00
|
|
|
$defs << "-DHAVE_CONFIG_H"
|
|
|
|
$INCFLAGS << " -I$(srcdir)/.."
|
2001-07-13 16:06:14 -04:00
|
|
|
|
2010-02-21 21:21:22 -05:00
|
|
|
$objs = [ "sha2init.#{$OBJEXT}" ]
|
|
|
|
|
|
|
|
dir_config("openssl")
|
2012-04-30 17:03:38 -04:00
|
|
|
pkg_config("openssl")
|
|
|
|
require_relative '../../openssl/deprecation'
|
2010-02-21 21:21:22 -05:00
|
|
|
|
|
|
|
if !with_config("bundled-sha2") &&
|
2010-02-23 19:31:37 -05:00
|
|
|
have_library("crypto") &&
|
2012-04-30 17:03:38 -04:00
|
|
|
%w[SHA256 SHA512].all? {|d| OpenSSL.check_func("#{d}_Transform", "openssl/sha.h")} &&
|
2010-04-21 08:25:29 -04:00
|
|
|
%w[SHA256 SHA512].all? {|d| have_type("#{d}_CTX", "openssl/sha.h")}
|
2010-02-21 21:21:22 -05:00
|
|
|
$objs << "sha2ossl.#{$OBJEXT}"
|
2010-02-23 19:31:37 -05:00
|
|
|
$defs << "-DSHA2_USE_OPENSSL"
|
2010-02-21 21:21:22 -05:00
|
|
|
else
|
|
|
|
have_type("u_int8_t")
|
|
|
|
$objs << "sha2.#{$OBJEXT}"
|
|
|
|
end
|
2001-07-13 16:06:14 -04:00
|
|
|
|
|
|
|
have_header("sys/cdefs.h")
|
|
|
|
|
2004-01-07 17:06:38 -05:00
|
|
|
$preload = %w[digest]
|
|
|
|
|
2005-09-06 19:23:04 -04:00
|
|
|
if have_type("uint64_t", "defs.h", $defs.join(' '))
|
2001-08-14 13:04:00 -04:00
|
|
|
create_makefile("digest/sha2")
|
2001-08-14 08:15:21 -04:00
|
|
|
end
|