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