Skip to content

Commit 4325052

Browse files
committed
Update to MakeMaker 6.30
p4raw-id: //depot/perl@24524
1 parent b15aece commit 4325052

File tree

6 files changed

+84
-18
lines changed

6 files changed

+84
-18
lines changed

lib/ExtUtils/Changes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
6.30 Fri May 20 16:05:38 PDT 2005
2+
* PL_FILES behavior tweak again to restore old behavior. Sometimes its
3+
supposed to run before pm_to_blib, sometimes after.
4+
- Some tests shipped with 'no_plan' which will break on older
5+
Test::Harness.
6+
17
6.29 Thu May 19 14:15:21 PDT 2005
28
* The behavior of PL_FILES is restored to its pre-6.26 behavior as several
39
CPAN modules depend on this. PL programs run via PL_FILES have

lib/ExtUtils/MM_Unix.pm

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use vars qw($VERSION @ISA
2020

2121
use ExtUtils::MakeMaker qw($Verbose neatvalue);
2222

23-
$VERSION = '1.49';
23+
$VERSION = '1.50';
2424

2525
require ExtUtils::MM_Any;
2626
@ISA = qw(ExtUtils::MM_Any);
@@ -3046,13 +3046,29 @@ sub processPL {
30463046
$target = vmsify($target);
30473047
}
30483048

3049-
$m .= sprintf <<'MAKE_FRAG', ($target) x 2, ($plfile) x 2, $target;
3049+
# Normally a .PL file runs AFTER pm_to_blib so it can have
3050+
# blib in its @INC and load the just built modules. BUT if
3051+
# the generated module is something in $(TO_INST_PM) which
3052+
# pm_to_blib depends on then it can't depend on pm_to_blib
3053+
# else we have a dependency loop.
3054+
my $pm_dep;
3055+
my $perlrun;
3056+
if( defined $self->{PM}{$target} ) {
3057+
$pm_dep = '';
3058+
$perlrun = 'PERLRUN';
3059+
}
3060+
else {
3061+
$pm_dep = 'pm_to_blib';
3062+
$perlrun = 'PERLRUNINST';
3063+
}
30503064

3051-
all :: %s
3052-
$(NOECHO) $(NOOP)
3065+
$m .= <<MAKE_FRAG;
3066+
3067+
all :: $target
3068+
\$(NOECHO) \$(NOOP)
30533069
3054-
%s :: %s pm_to_blib
3055-
$(PERLRUNINST) %s %s
3070+
$target :: $plfile $pm_dep
3071+
\$($perlrun) $plfile $target
30563072
MAKE_FRAG
30573073

30583074
}

lib/ExtUtils/MakeMaker.pm

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: /local/schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 4531 2005-05-19T21:18:53.053398Z schwern $
1+
# $Id: /local/schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 4535 2005-05-20T23:08:34.937906Z schwern $
22
package ExtUtils::MakeMaker;
33

44
BEGIN {require 5.005_03;}
@@ -21,8 +21,8 @@ use vars qw(
2121
use vars qw($Revision);
2222
use strict;
2323

24-
$VERSION = '6.29';
25-
($Revision = q$Revision: 4531 $) =~ /Revision:\s+(\S+)/;
24+
$VERSION = '6.30';
25+
($Revision = q$Revision: 4535 $) =~ /Revision:\s+(\S+)/;
2626

2727
@ISA = qw(Exporter);
2828
@EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
@@ -1898,8 +1898,12 @@ In this case the program will be run multiple times using each target file.
18981898
perl bin/foobar.PL bin/foobar1
18991899
perl bin/foobar.PL bin/foobar2
19001900
1901-
PL files are run B<after> pm_to_blib and include INST_LIB and INST_ARCH
1902-
in its C<@INC> so the just built modules can be accessed.
1901+
PL files are normally run B<after> pm_to_blib and include INST_LIB and
1902+
INST_ARCH in its C<@INC> so the just built modules can be
1903+
accessed... unless the PL file is making a module (or anything else in
1904+
PM) in which case it is run B<before> pm_to_blib and does not include
1905+
INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior
1906+
is there for backwards compatibility (and its somewhat DWIM).
19031907
19041908
19051909
=item PM
@@ -2086,7 +2090,7 @@ MakeMaker object. The following lines will be parsed o.k.:
20862090
20872091
$VERSION = '1.00';
20882092
*VERSION = \'1.01';
2089-
$VERSION = sprintf "%d.%03d", q$Revision: 4531 $ =~ /(\d+)/g;
2093+
$VERSION = sprintf "%d.%03d", q$Revision: 4535 $ =~ /(\d+)/g;
20902094
$FOO::VERSION = '1.10';
20912095
*FOO::VERSION = \'1.11';
20922096
our $VERSION = 1.2.3; # new for perl5.6.0

lib/ExtUtils/t/FIRST_MAKEFILE.t

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/perl -w
2+
13
BEGIN {
24
if( $ENV{PERL_CORE} ) {
35
chdir 't' if -d 't';
@@ -10,7 +12,7 @@ BEGIN {
1012
chdir 't';
1113

1214
use strict;
13-
use Test::More 'no_plan';
15+
use Test::More tests => 7;
1416

1517
use MakeMaker::Test::Setup::BFD;
1618
use MakeMaker::Test::Utils;

lib/ExtUtils/t/PL_FILES.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BEGIN {
1212
chdir 't';
1313

1414
use strict;
15-
use Test::More 'no_plan';
15+
use Test::More tests => 9;
1616

1717
use File::Spec;
1818
use MakeMaker::Test::Setup::PL_FILES;
@@ -37,6 +37,6 @@ cmp_ok( $?, '==', 0 );
3737
my $make_out = run("$make");
3838
is( $?, 0 ) || diag $make_out;
3939

40-
foreach my $file (qw(single.out 1.out 2.out)) {
40+
foreach my $file (qw(single.out 1.out 2.out blib/lib/PL/Bar.pm)) {
4141
ok( -e $file, "$file was created" );
4242
}

t/lib/MakeMaker/Test/Setup/PL_FILES.pm

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,58 @@ use ExtUtils::MakeMaker;
1818
WriteMakefile(
1919
NAME => 'PL_FILES::Module',
2020
PL_FILES => { 'single.PL' => 'single.out',
21-
'multi.PL' => [qw(1.out 2.out)]
21+
'multi.PL' => [qw(1.out 2.out)],
22+
'Bar_pm.PL' => '$(INST_LIB)/PL/Bar.pm',
2223
}
2324
);
2425
END
2526

26-
'PL_FILES-Module/single.PL' => _gen_pl_files(),
27-
'PL_FILES-Module/multi.PL' => _gen_pl_files(),
27+
'PL_FILES-Module/single.PL' => _gen_pl_files(),
28+
'PL_FILES-Module/multi.PL' => _gen_pl_files(),
29+
'PL_FILES-Module/Bar_pm.PL' => _gen_pm_files(),
30+
'PL_FILES-Module/lib/PL/Foo.pm' => <<'END',
31+
# Module to load to ensure PL_FILES have blib in @INC.
32+
package PL::Foo;
33+
sub bar { 42 }
34+
1;
35+
END
36+
2837
);
2938

3039

3140
sub _gen_pl_files {
3241
my $test = <<'END';
3342
#!/usr/bin/perl -w
3443
44+
# Ensure we have blib in @INC
45+
use PL::Foo;
46+
die unless PL::Foo::bar() == 42;
47+
48+
# Had a bug where PL_FILES weren't sent the file to generate
49+
die "argv empty\n" unless @ARGV;
50+
die "too many in argv: @ARGV\n" unless @ARGV == 1;
51+
52+
my $file = $ARGV[0];
53+
open OUT, ">$file" or die $!;
54+
55+
print OUT "Testing\n";
56+
close OUT
57+
END
58+
59+
$test =~ s/^\n//;
60+
61+
return $test;
62+
}
63+
64+
65+
sub _gen_pm_files {
66+
my $test = <<'END';
67+
#!/usr/bin/perl -w
68+
69+
# Ensure we do NOT have blib in @INC when building a module
70+
eval { require PL::Foo; };
71+
#die $@ unless $@ =~ m{^Can't locate PL/Foo.pm in \@INC };
72+
3573
# Had a bug where PL_FILES weren't sent the file to generate
3674
die "argv empty\n" unless @ARGV;
3775
die "too many in argv: @ARGV\n" unless @ARGV == 1;

0 commit comments

Comments
 (0)