Attempt to fix core-specific logic in IPC::Open2 tests
[p5sagit/p5-mst-13.2.git] / ext / Digest-SHA / Makefile.PL
1 require 5.003000;
2
3 use ExtUtils::MakeMaker;
4 use Getopt::Std;
5 use Config;
6
7 my $PM = 'lib/Digest/SHA.pm';
8
9 my $PERL_CORE = 0;
10 $PERL_CORE = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
11
12 my %opts;
13 getopts('tx', \%opts);
14
15 my @defines;
16 push(@defines, '-DSHA_PERL_MODULE') if $] >= 5.004;
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
31 my %att = (
32         'NAME'          => 'Digest::SHA',
33         'VERSION_FROM'  => $PM,
34         'LIBS'          => [''],
35         'DEFINE'        => $define,
36         'INC'           => '-I.',
37         $PERL_CORE ? () : (
38             'EXE_FILES'         => [ 'shasum' ],
39             'INSTALLDIRS'       => ($] >= 5.010) ? 'perl' : 'site',
40         ),
41 );
42
43 my $MMversion = $ExtUtils::MakeMaker::VERSION || 0;
44 $att{NO_META} = 1 unless $MMversion < 6.10_03;
45
46 WriteMakefile(%att);