This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Digest-SHA to CPAN version 5.82
[perl5.git] / cpan / Digest-SHA / Makefile.PL
1 require 5.003000;
2
3 use strict;
4 use ExtUtils::MakeMaker;
5 use Getopt::Std;
6 use Config qw(%Config);
7
8 my $PM = 'lib/Digest/SHA.pm';
9
10 my %opts;
11 getopts('tx', \%opts);  # -t is no longer used, but allow it anyway
12
13 my @defines;
14 push(@defines, '-DSHA_PERL_MODULE') if $] >= 5.004;
15 push(@defines, '-DNO_SHA_384_512')  if $opts{'x'};
16 my $define = join(' ', @defines);
17
18         # Workaround for DEC compiler bug, adapted from Digest::MD5
19
20 my @extra = ();
21 if ($^O eq 'VMS') {
22         if (defined($Config{ccname})) {
23                 if (grep(/VMS_VAX/, @INC) && ($Config{ccname} eq 'DEC')) {
24                         # VAX compiler optimizer even up to v6.4 gets stuck
25                         push(@extra, OPTIMIZE => "/Optimize=(NODISJOINT)");
26                 }
27         }
28 }
29
30         # Enhance performance on Intel when using gcc
31
32 if ($Config{archname} =~ /^i[3456]86/ && $Config{ccname} eq 'gcc') {
33         push(@extra, OPTIMIZE => '-O1 -fomit-frame-pointer');
34 }
35
36 my %att = (
37         'NAME'          => 'Digest::SHA',
38         'VERSION_FROM'  => $PM,
39         'LIBS'          => [''],
40         'DEFINE'        => $define,
41         'INC'           => '-I.',
42         'EXE_FILES'     => [ 'shasum' ],
43         'INSTALLDIRS'   => ($] >= 5.010 and $] < 5.011) ? 'perl' : 'site',
44         @extra,
45 );
46
47 my $MMversion = $ExtUtils::MakeMaker::VERSION || 0;
48 $att{NO_META} = 1 unless $MMversion < 6.10_03;
49
50 WriteMakefile(%att);