1require 5.003000;
2
3use ExtUtils::MakeMaker;
4use Getopt::Std;
5use Config;
6
7my %opts;
8getopts('tx', \%opts);
9
10my @defines;
11push(@defines, '-DSHA_PERL_MODULE') if $] >= 5.004;
12push(@defines, '-DSHA_THREAD_SAFE') if $opts{'t'};
13push(@defines, '-DNO_SHA_384_512')  if $opts{'x'};
14
15	# Configure SHA source to use static arrays for
16	# message schedules if compiling on Intel platforms.
17	# This seems to speed things up a bit.  However,
18	# DON'T do this if thread-safe option is in force.
19
20if ($Config{archname} =~ /^i[3456]86/) {
21	push(@defines, '-DSHA_STO_CLASS=static') unless $opts{'t'};
22}
23
24my $define = join(' ', @defines);
25
26my %att = (
27	'NAME'		=> 'Digest::SHA',
28	'VERSION_FROM'	=> 'SHA.pm',
29	'LIBS'		=> [''],
30	'DEFINE'	=> $define,
31	'INC'		=> '-I.',
32	'EXE_FILES'	=> [ 'shasum' ],
33);
34
35$att{NO_META} = 1
36	unless $ExtUtils::MakeMaker::VERSION < 6.10_03;
37
38WriteMakefile(%att);
39