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