File Coverage

Makefile.PL
Criterion Covered Total %
statement n/a
branch n/a
condition n/a
subroutine n/a
pod n/a
total n/a


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2              
3             use 5.006;
4             use strict;
5              
6             use lib ".";
7             use my::bundles; # Must be used before anything else to set up bundled dependencies
8              
9             use lib qw(lib); # build ourself with ourself
10              
11             use File::Spec;
12             use ExtUtils::MakeMaker 6.50;
13              
14             my $BUILDING_AS_PACKAGE = $ENV{BUILDING_AS_PACKAGE} || ( grep { m!^\-\-release$! } @ARGV );
15              
16             my $Is_VMS = $^O eq 'VMS';
17              
18             check_environment();
19              
20             my (%Extra_Params, %Extra_Prereqs, %Extra_Test_Prereqs);
21              
22             # Special case for MakeMaker being built as a vendor package
23             if( $BUILDING_AS_PACKAGE ) {
24             # Some of these are lower than what we bundle. That's ok, we
25             # bundle the latest because we might as well, but we don't want to
26             # burden vendors with having to update everything.
27             %Extra_Prereqs = (
28             'CPAN::Meta' => '2.143240', # compat with CMR 2.130
29             'ExtUtils::Install' => '1.52',
30             'ExtUtils::Manifest' => '1.70',
31             'version' => '0',
32             );
33             $Extra_Prereqs{'JSON::PP::Compat5006'} = '1.09' if "$]" < 5.008;
34              
35             %Extra_Test_Prereqs = (
36             'File::Temp' => '0.22',
37             'Scalar::Util' => '1.13',
38             );
39             }
40             else {
41             eval {
42             require ExtUtils::Manifest;
43             require ExtUtils::Install;
44             }
45             or do {
46             $Extra_Params{PERL} = "$^X -Iinc";
47             };
48              
49             my::bundles::copy_bundles("bundled", "inc");
50             }
51              
52             # Test::Harnesses prior to 2.00 shoved all of @INC onto the command line
53             # when a test had -T. This made it too long. So we need a Test::Harness
54             # > 2.00 on VMS for t/testlib.t
55             $Extra_Prereqs{'Test::Harness'} = 2.00 if $^O eq 'VMS';
56              
57             my $MM = WriteMakefile(
58             NAME => 'ExtUtils::MakeMaker',
59             VERSION_FROM => "lib/ExtUtils/MakeMaker.pm",
60             ABSTRACT_FROM => "lib/ExtUtils/MakeMaker.pm",
61              
62             PREREQ_PM => {
63             %Extra_Prereqs,
64             'File::Spec' => 0.8, # splitpath(), rel2abs()
65             'Pod::Man' => 0, # manifypods needs Pod::Man
66             'File::Basename' => 0,
67             'Data::Dumper' => 0,
68             ("$]" > 5.008 ? (Encode => 0) : ()),
69             },
70             TEST_REQUIRES => \%Extra_Test_Prereqs,
71              
72             MIN_PERL_VERSION => '5.006',
73             PMLIBDIRS => [qw(lib inc)],
74             PMLIBPARENTDIRS => [qw(lib inc)], # PMLIBPARENTDIRS is an experimental feature
75             EXE_FILES => [qw(bin/instmodsh)],
76              
77             META_MERGE => {
78             no_index => {
79             # Module::Metadata is inferring version from $version::VERSION
80             # "in" is a PAUSE misparse.
81             package => [ qw(DynaLoader in version) ],
82             directory => [ qw(bundled my) ],
83             },
84             resources => {
85             license => 'https://dev.perl.org/licenses/',
86             homepage => 'https://metacpan.org/release/ExtUtils-MakeMaker',
87             bugtracker => 'https://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker',
88             repository => 'https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker',
89             MailingList => 'makemaker@perl.org',
90             },
91             },
92              
93             CONFIGURE_REQUIRES => {}, # We don't need ourself to install ourself.
94             BUILD_REQUIRES => {}, # We don't need ourself to build ourself.
95             INSTALLDIRS => ( "$]" < 5.012 ? 'perl' : 'site' ),
96             LICENSE => 'perl',
97             AUTHOR => 'Michael G Schwern ',
98              
99             realclean => {
100             FILES => "inc"
101             },
102              
103             %Extra_Params,
104              
105             $^O =~ /win/i
106             ? (
107             dist => {
108             TAR => 'ptar',
109             TARFLAGS => '-c -C -f',
110             },
111             )
112             : (),
113             );
114              
115             # Display warnings about the environment.
116             sub check_environment {
117             if ( $Is_VMS && $ENV{bin} ) {
118             print <
119              
120             The logical name BIN may be present. This may interfere with MakeMaker's
121             tests and operations. GNV is the prime suspect for setting this.
122              
123             BIN_WARN
124              
125             sleep 2;
126             }
127             }
128              
129             {
130             package MY;
131              
132             # Make sure PERLRUN uses the MakeMaker about to be installed
133             # and not the currently installed one.
134             sub init_PERL {
135             my ( $self ) = shift;
136             $self->SUPER::init_PERL;
137              
138             $self->{$_} .= q[ "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"] for qw( PERLRUN FULLPERLRUN ABSPERLRUN );
139             }
140              
141             sub special_targets {
142             my ( $self ) = shift;
143             my $make_frag = $self->SUPER::special_targets(@_);
144             return $make_frag if $Is_VMS or $self->is_make_type('dmake'); # not supported in MMS, MMK or by `dmake`
145             $make_frag .= <<'MAKE_FRAG';
146             .NOTPARALLEL: pure_all
147              
148             MAKE_FRAG
149             return $make_frag;
150             }
151              
152             }