+6.30 Fri May 20 16:05:38 PDT 2005
+ * PL_FILES behavior tweak again to restore old behavior. Sometimes its
+ supposed to run before pm_to_blib, sometimes after.
+ - Some tests shipped with 'no_plan' which will break on older
+ Test::Harness.
+
6.29 Thu May 19 14:15:21 PDT 2005
* The behavior of PL_FILES is restored to its pre-6.26 behavior as several
CPAN modules depend on this. PL programs run via PL_FILES have
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.49';
+$VERSION = '1.50';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
$target = vmsify($target);
}
- $m .= sprintf <<'MAKE_FRAG', ($target) x 2, ($plfile) x 2, $target;
+ # Normally a .PL file runs AFTER pm_to_blib so it can have
+ # blib in its @INC and load the just built modules. BUT if
+ # the generated module is something in $(TO_INST_PM) which
+ # pm_to_blib depends on then it can't depend on pm_to_blib
+ # else we have a dependency loop.
+ my $pm_dep;
+ my $perlrun;
+ if( defined $self->{PM}{$target} ) {
+ $pm_dep = '';
+ $perlrun = 'PERLRUN';
+ }
+ else {
+ $pm_dep = 'pm_to_blib';
+ $perlrun = 'PERLRUNINST';
+ }
-all :: %s
- $(NOECHO) $(NOOP)
+ $m .= <<MAKE_FRAG;
+
+all :: $target
+ \$(NOECHO) \$(NOOP)
-%s :: %s pm_to_blib
- $(PERLRUNINST) %s %s
+$target :: $plfile $pm_dep
+ \$($perlrun) $plfile $target
MAKE_FRAG
}
-# $Id: /local/schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 4531 2005-05-19T21:18:53.053398Z schwern $
+# $Id: /local/schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 4535 2005-05-20T23:08:34.937906Z schwern $
package ExtUtils::MakeMaker;
BEGIN {require 5.005_03;}
use vars qw($Revision);
use strict;
-$VERSION = '6.29';
-($Revision = q$Revision: 4531 $) =~ /Revision:\s+(\S+)/;
+$VERSION = '6.30';
+($Revision = q$Revision: 4535 $) =~ /Revision:\s+(\S+)/;
@ISA = qw(Exporter);
@EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
perl bin/foobar.PL bin/foobar1
perl bin/foobar.PL bin/foobar2
-PL files are run B<after> pm_to_blib and include INST_LIB and INST_ARCH
-in its C<@INC> so the just built modules can be accessed.
+PL files are normally run B<after> pm_to_blib and include INST_LIB and
+INST_ARCH in its C<@INC> so the just built modules can be
+accessed... unless the PL file is making a module (or anything else in
+PM) in which case it is run B<before> pm_to_blib and does not include
+INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior
+is there for backwards compatibility (and its somewhat DWIM).
=item PM
$VERSION = '1.00';
*VERSION = \'1.01';
- $VERSION = sprintf "%d.%03d", q$Revision: 4531 $ =~ /(\d+)/g;
+ $VERSION = sprintf "%d.%03d", q$Revision: 4535 $ =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
+#!/usr/bin/perl -w
+
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't' if -d 't';
chdir 't';
use strict;
-use Test::More 'no_plan';
+use Test::More tests => 7;
use MakeMaker::Test::Setup::BFD;
use MakeMaker::Test::Utils;
chdir 't';
use strict;
-use Test::More 'no_plan';
+use Test::More tests => 9;
use File::Spec;
use MakeMaker::Test::Setup::PL_FILES;
my $make_out = run("$make");
is( $?, 0 ) || diag $make_out;
-foreach my $file (qw(single.out 1.out 2.out)) {
+foreach my $file (qw(single.out 1.out 2.out blib/lib/PL/Bar.pm)) {
ok( -e $file, "$file was created" );
}
WriteMakefile(
NAME => 'PL_FILES::Module',
PL_FILES => { 'single.PL' => 'single.out',
- 'multi.PL' => [qw(1.out 2.out)]
+ 'multi.PL' => [qw(1.out 2.out)],
+ 'Bar_pm.PL' => '$(INST_LIB)/PL/Bar.pm',
}
);
END
- 'PL_FILES-Module/single.PL' => _gen_pl_files(),
- 'PL_FILES-Module/multi.PL' => _gen_pl_files(),
+ 'PL_FILES-Module/single.PL' => _gen_pl_files(),
+ 'PL_FILES-Module/multi.PL' => _gen_pl_files(),
+ 'PL_FILES-Module/Bar_pm.PL' => _gen_pm_files(),
+ 'PL_FILES-Module/lib/PL/Foo.pm' => <<'END',
+# Module to load to ensure PL_FILES have blib in @INC.
+package PL::Foo;
+sub bar { 42 }
+1;
+END
+
);
my $test = <<'END';
#!/usr/bin/perl -w
+# Ensure we have blib in @INC
+use PL::Foo;
+die unless PL::Foo::bar() == 42;
+
+# Had a bug where PL_FILES weren't sent the file to generate
+die "argv empty\n" unless @ARGV;
+die "too many in argv: @ARGV\n" unless @ARGV == 1;
+
+my $file = $ARGV[0];
+open OUT, ">$file" or die $!;
+
+print OUT "Testing\n";
+close OUT
+END
+
+ $test =~ s/^\n//;
+
+ return $test;
+}
+
+
+sub _gen_pm_files {
+ my $test = <<'END';
+#!/usr/bin/perl -w
+
+# Ensure we do NOT have blib in @INC when building a module
+eval { require PL::Foo; };
+#die $@ unless $@ =~ m{^Can't locate PL/Foo.pm in \@INC };
+
# Had a bug where PL_FILES weren't sent the file to generate
die "argv empty\n" unless @ARGV;
die "too many in argv: @ARGV\n" unless @ARGV == 1;