lib/ExtUtils/testlib.pm Fixes up @INC to use just-built extension
lib/ExtUtils/t/FIRST_MAKEFILE.t See if FIRST_MAKEFILE works
lib/ExtUtils/t/hints.t See if hint files are honored.
-lib/ExtUtils/t/installbase.t Test INSTALLBASE in MakeMaker
+lib/ExtUtils/t/INSTALL_BASE.t Test INSTALL_BASE in MakeMaker
lib/ExtUtils/t/Installed.t See if ExtUtils::Installed works
lib/ExtUtils/t/Install.t See if ExtUtils::Install works
lib/ExtUtils/t/INST_PREFIX.t See if MakeMaker can apply PREFIXs
lib/ExtUtils/t/INST.t Check MakeMaker INST_* macros
lib/ExtUtils/t/Liblist.t See if ExtUtils::Liblist works
+lib/ExtUtils/t/make.t See if make detection works
lib/ExtUtils/t/Manifest.t See if ExtUtils::Manifest works
lib/ExtUtils/t/Mkbootstrap.t See if ExtUtils::Mkbootstrap works
lib/ExtUtils/t/MM_Any.t See if ExtUtils::MM_Any works
lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems
lib/ExtUtils/t/prompt.t See if E::MM::prompt() works
lib/ExtUtils/t/recurs.t See if recursive builds work
+lib/ExtUtils/t/revision.t See if $Revision is correct
lib/ExtUtils/t/split_command.t See if MM's xargs-like function works
lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works
lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works
+6.30_01 Tue Aug 16 23:53:27 PDT 2005
+ * Fixed compiling modules using an uninstalled Perl on Win32 by using
+ the proper perl header location for Windows (which is different from
+ Unix). Looks like a very old bug. [bugs.perl.org 36128]
+ - $ExtUtils::MakeMaker::Revision accidentally left in a stray "Revision".
+ [thanks pdx.pm for noticing this]
+ - Fixed the $VERSION = $Revision$ example in the MakeMaker docs and the
+ FAQ. [thanks again, pdx.pm]
+ - Elaborated on the differences between CVS, SVN and others when using
+ $Revision$ based $VERSIONs.
+ * ExtUtils::Command, ExtUtils::Install, ExtUtils::Manifest,
+ ExtUtils::Mkbootstrap, ExtUtils::Mksymlists and ExtUtils::Packlist
+ are all now considered to be separate distributions. To avoid a
+ circular dependency, MakeMaker distributes its own versions but CPAN
+ should not index them and they will not overwrite a newer, installed
+ version.
+ * Added EXTRA_META option to allow module authors to append extra
+ text to the generated META.yml.
+ * Added a LICENSE field mirroring Module::Build's license.
+ * META.yml support updated to version 1.1. All required fields
+ now generated. (NOTE: 1.1 isn't yet complete but we're going with
+ it anyway. MakeMaker uses "author" instead of "authored_by" as its
+ expected the former will be used in 1.1 final).
+ * Non-conforming version_from and installdirs META.yml fields removed.
+ * META.yml distribution_type field now intelligent enough to guess at
+ the type rather than hard code 'module'.
+ * INSTALLBASE changed to INSTALL_BASE to match Module::Build.
+ * Added a MAKE parameter for Windows users to say if they're using
+ dmake or nmake.
+
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.
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: ExtUtils-MakeMaker
-version: 6.28
-version_from: lib/ExtUtils/MakeMaker.pm
-installdirs: perl
-requires:
+--- #YAML:1.0
+name: ExtUtils-MakeMaker
+version: 6.30_01
+abstract: Create a module Makefile
+license: perl
+generated_by: ExtUtils::MakeMaker version 6.30_01
+author: Michael G Schwern <schwern@pobox.com>
+distribution_type: module
+requires:
DirHandle: 0
File::Basename: 0
File::Spec: 0.8
Pod::Man: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.28
+meta-spec:
+ url: <http://module-build.sourceforge.net/META-spec-new.html>;
+ version: 1.1
+no_index:
+ dir:
+ - inc
use strict;
use vars qw($VERSION @ISA);
-$VERSION = '0.13_01';
+$VERSION = '0.13_02';
+use Carp;
use File::Spec;
BEGIN { @ISA = qw(File::Spec); }
$self->{_MAX_EXEC_LEN} is set by this method, but only for testing purposes.
+=head3 make
+ my $make = $MM->make;
+
+Returns the make variant we're generating the Makefile for. This attempts
+to do some normalization on the information from %Config or the user.
+
+=cut
+
+sub make {
+ my $self = shift;
+
+ my $make = lc $self->{MAKE};
+
+ # Truncate anything like foomake6 to just foomake.
+ $make =~ s/^(\w+make).*/$1/;
+
+ # Turn gnumake into gmake.
+ $make =~ s/^gnu/g/;
+
+ return $make;
+}
=head2 Targets
my $prereq_pm = '';
foreach my $mod ( sort { lc $a cmp lc $b } keys %{$self->{PREREQ_PM}} ) {
my $ver = $self->{PREREQ_PM}{$mod};
- $prereq_pm .= sprintf " %-30s %s\n", "$mod:", $ver;
+ $prereq_pm .= sprintf "\n %-30s %s", "$mod:", $ver;
}
- my $meta = <<YAML;
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: $self->{DISTNAME}
-version: $self->{VERSION}
-version_from: $self->{VERSION_FROM}
-installdirs: $self->{INSTALLDIRS}
-requires:
-$prereq_pm
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION
+ # Use a list to preserve order.
+ my @meta_to_mm = (
+ name => $self->{DISTNAME},
+ version => $self->{VERSION},
+ abstract => $self->{ABSTRACT},
+ license => $self->{LICENSE} || 'unknown',
+ generated_by =>
+ "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ author => $self->{AUTHOR},
+ distribution_type => $self->{PM} ? 'module' : 'script',
+ );
+
+ my $meta = "--- #YAML:1.0\n";
+
+ while( @meta_to_mm ) {
+ my($key, $val) = splice @meta_to_mm, 0, 2;
+
+ $val = '~' unless defined $val;
+
+ $meta .= sprintf "%-20s %s\n", "$key:", $val;
+ };
+
+ $meta .= <<YAML;
+requires: $prereq_pm
+meta-spec:
+ url: <http://module-build.sourceforge.net/META-spec-new.html>;
+ version: 1.1
YAML
+ $meta .= $self->{EXTRA_META} if $self->{EXTRA_META};
+
my @write_meta = $self->echo($meta, 'META_new.yml');
return sprintf <<'MAKE_FRAG', join("\n\t", @write_meta);
Methods which help initialize the MakeMaker object and macros.
+=head3 init_ABSTRACT
+
+ $mm->init_ABSTRACT
+
+=cut
+
+sub init_ABSTRACT {
+ my $self = shift;
+
+ if( $self->{ABSTRACT_FROM} and $self->{ABSTRACT} ) {
+ warn "Both ABSTRACT_FROM and ABSTRACT are set. ".
+ "Ignoring ABSTRACT_FROM.\n";
+ return;
+ }
+
+ if ($self->{ABSTRACT_FROM}){
+ $self->{ABSTRACT} = $self->parse_abstract($self->{ABSTRACT_FROM}) or
+ carp "WARNING: Setting ABSTRACT via file ".
+ "'$self->{ABSTRACT_FROM}' failed\n";
+ }
+}
+
=head3 init_INST
$mm->init_INST;
sub init_INSTALL {
my($self) = shift;
- if( $self->{ARGS}{INSTALLBASE} and $self->{ARGS}{PREFIX} ) {
- die "Only one of PREFIX or INSTALLBASE can be given. Not both.\n";
+ if( $self->{ARGS}{INSTALL_BASE} and $self->{ARGS}{PREFIX} ) {
+ die "Only one of PREFIX or INSTALL_BASE can be given. Not both.\n";
}
- if( $self->{ARGS}{INSTALLBASE} ) {
- $self->init_INSTALL_from_INSTALLBASE;
+ if( $self->{ARGS}{INSTALL_BASE} ) {
+ $self->init_INSTALL_from_INSTALL_BASE;
}
else {
$self->init_INSTALL_from_PREFIX;
}
-=head3 init_from_INSTALLBASE
+=head3 init_from_INSTALL_BASE
- $mm->init_from_INSTALLBASE
+ $mm->init_from_INSTALL_BASE
=cut
);
$map{script} = $map{bin};
-sub init_INSTALL_from_INSTALLBASE {
+sub init_INSTALL_from_INSTALL_BASE {
my $self = shift;
@{$self}{qw(PREFIX VENDORPREFIX SITEPREFIX PERLPREFIX)} =
- '$(INSTALLBASE)';
+ '$(INSTALL_BASE)';
my %install;
foreach my $thing (keys %map) {
my $key = "INSTALL".$dir.$uc_thing;
$install{$key} ||=
- $self->catdir('$(INSTALLBASE)', @{$map{$thing}});
+ $self->catdir('$(INSTALL_BASE)', @{$map{$thing}});
}
}
if ($self->{VERSION_FROM}){
$self->{VERSION} = $self->parse_version($self->{VERSION_FROM});
if( $self->{VERSION} eq 'undef' ) {
- require Carp;
- Carp::carp("WARNING: Setting VERSION via file ".
- "'$self->{VERSION_FROM}' failed\n");
+ carp("WARNING: Setting VERSION via file ".
+ "'$self->{VERSION_FROM}' failed\n");
}
}
MAKEFILE_OLD
MAKE_APERL_FILE File used by MAKE_APERL
- SHELL Program used to run
- shell commands
+ SHELL Program used to run shell commands
ECHO Print text adding a newline on the end
RM_F Remove a file
}
+=head3 init_MAKE
+
+ $mm->init_MAKE
+Initialize MAKE from either a MAKE environment variable or $Config{make}.
+
+=cut
+
+sub init_MAKE {
+ my $self = shift;
+
+ $self->{MAKE} ||= $ENV{MAKE} || $Config{make};
+}
=head2 Tools
use File::Basename;
use vars qw(@ISA $VERSION);
-$VERSION = '2.08';
+$VERSION = '2.08_01';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
my $BORLAND = $Config{'cc'} =~ /^bcc/i;
my $GCC = $Config{'cc'} =~ /^gcc/i;
-my $DMAKE = $Config{'make'} =~ /^dmake/i;
=item os_flavor
use strict;
-use Exporter ();
use Carp;
use ExtUtils::MakeMaker::Config;
use File::Basename qw(basename dirname);
$Is_OS2 $Is_VMS $Is_Win32 $Is_Dos
$Is_OSF $Is_IRIX $Is_NetBSD $Is_BSD
$Is_SunOS4 $Is_Solaris $Is_SunOS $Is_Interix
- $Verbose %pm
%Config_Override
);
INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB
INST_MAN1DIR INST_MAN3DIR
MAN1EXT MAN3EXT
- INSTALLDIRS INSTALLBASE DESTDIR PREFIX
+ INSTALLDIRS INSTALL_BASE DESTDIR PREFIX
PERLPREFIX SITEPREFIX VENDORPREFIX
),
(map { ("INSTALL".$_,
print "Using PERL=$abs\n" if $trace;
return $abs;
} elsif ($trace >= 2) {
- print "Result: '$val'\n";
+ print "Result: '$val' ".($? >> 8)."\n";
}
}
}
=item init_dirscan
-Scans the directory structure and initializes DIR, XS, XS_FILES, PM,
-C, C_FILES, O_FILES, H, H_FILES, PL_FILES, MAN*PODS, EXE_FILES.
+Scans the directory structure and initializes DIR, XS, XS_FILES,
+C, C_FILES, O_FILES, H, H_FILES, PL_FILES, EXE_FILES.
Called by init_main.
sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
my($self) = @_;
- my($name, %dir, %xs, %c, %h, %pl_files, %manifypods);
- my %pm;
+ my($name, %dir, %xs, %c, %h, %pl_files, %pm);
my %ignore = map {( $_ => 1 )} qw(Makefile.PL Build.PL test.pl t);
}
}
+ $self->{PL_FILES} ||= \%pl_files;
+ $self->{DIR} ||= [sort keys %dir];
+ $self->{XS} ||= \%xs;
+ $self->{C} ||= [sort keys %c];
+ $self->{H} ||= [sort keys %h];
+ $self->{PM} ||= \%pm;
+
+ my @o_files = @{$self->{C}};
+ $self->{O_FILES} = [grep s/\.c(pp|xx|c)?\z/$self->{OBJ_EXT}/i, @o_files];
+}
+
+
+=item init_MANPODS
+
+Determines if man pages should be generated and initializes MAN1PODS
+and MAN3PODS as appropriate.
+
+=cut
+
+sub init_MANPODS {
+ my $self = shift;
+
+ # Set up names of manual pages to generate from pods
+ foreach my $man (qw(MAN1 MAN3)) {
+ $self->{"BUILD${man}PODS"} = 1;
+
+ unless ($self->{"${man}PODS"}) {
+ $self->{"${man}PODS"} = {};
+ $self->{"BUILD${man}PODS"} = 0 if
+ $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/;
+ }
+ }
+
+ $self->init_MAN1PODS() if $self->{BUILDMAN1PODS};
+ $self->init_MAN3PODS() if $self->{BUILDMAN3PODS};
+}
+
+
+sub _has_pod {
+ my($self, $file) = @_;
+
+ local *FH;
+ my($ispod)=0;
+ if (open(FH,"<$file")) {
+ while (<FH>) {
+ if (/^=(?:head\d+|item|pod)\b/) {
+ $ispod=1;
+ last;
+ }
+ }
+ close FH;
+ } else {
+ # If it doesn't exist yet, we assume, it has pods in it
+ $ispod = 1;
+ }
+
+ return $ispod;
+}
+
+
+=item init_MAN1PODS
+
+Initializes MAN1PODS from the list of EXE_FILES.
+
+=cut
+
+sub init_MAN1PODS {
+ my($self) = @_;
+
+ if ( exists $self->{EXE_FILES} ) {
+ foreach my $name (@{$self->{EXE_FILES}}) {
+ next unless $self->_has_pod($name);
+
+ $self->{MAN1PODS}->{$name} =
+ $self->catfile("\$(INST_MAN1DIR)",
+ basename($name).".\$(MAN1EXT)");
+ }
+ }
+}
+
+
+=item init_MAN3PODS
+
+Initializes MAN3PODS from the list of PM files.
+
+=cut
+
+sub init_MAN3PODS {
+ my $self = shift;
+
+ my %manifypods = (); # we collect the keys first, i.e. the files
+ # we have to convert to pod
+
+ foreach my $name (keys %{$self->{PM}}) {
+ if ($name =~ /\.pod\z/ ) {
+ $manifypods{$name} = $self->{PM}{$name};
+ } elsif ($name =~ /\.p[ml]\z/ ) {
+ if( $self->_has_pod($name) ) {
+ $manifypods{$name} = $self->{PM}{$name};
+ }
+ }
+ }
+
+ my $parentlibs_re = join '|', @{$self->{PMLIBPARENTDIRS}};
+
+ # Remove "Configure.pm" and similar, if it's not the only pod listed
+ # To force inclusion, just name it "Configure.pod", or override
+ # MAN3PODS
+ foreach my $name (keys %manifypods) {
+ if ($self->{PERL_CORE} and $name =~ /(config|setup).*\.pm/is) {
+ delete $manifypods{$name};
+ next;
+ }
+ my($manpagename) = $name;
+ $manpagename =~ s/\.p(od|m|l)\z//;
+ # everything below lib is ok
+ unless($manpagename =~ s!^\W*($parentlibs_re)\W+!!s) {
+ $manpagename = $self->catfile(
+ split(/::/,$self->{PARENT_NAME}),$manpagename
+ );
+ }
+ $manpagename = $self->replace_manpage_separator($manpagename);
+ $self->{MAN3PODS}->{$name} =
+ $self->catfile("\$(INST_MAN3DIR)", "$manpagename.\$(MAN3EXT)");
+ }
+}
+
+
+=item init_PM
+
+Initializes PMLIBDIRS and PM from PMLIBDIRS.
+
+=cut
+
+sub init_PM {
+ my $self = shift;
+
+ my $pm = $self->{PM};
+
# Some larger extensions often wish to install a number of *.pm/pl
# files into the library in various locations.
# Avoid $_ wherever possible:
# @{$self->{PMLIBDIRS}} = grep -d && !$dir{$_}, @{$self->{PMLIBDIRS}};
my (@pmlibdirs) = @{$self->{PMLIBDIRS}};
- my ($pmlibdir);
@{$self->{PMLIBDIRS}} = ();
- foreach $pmlibdir (@pmlibdirs) {
+ my %dir = map { ($_ => $_) } @{$self->{DIR}};
+ foreach my $pmlibdir (@pmlibdirs) {
-d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
}
+ unless( $self->{PMLIBPARENTDIRS} ) {
+ @{$self->{PMLIBPARENTDIRS}} = ('lib');
+ }
+
if (@{$self->{PMLIBDIRS}}){
print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
if ($Verbose >= 2);
my $prefix = $self->{INST_LIBDIR};
my $striplibpath;
+ my $parentlibs_re = join '|', @{$self->{PMLIBPARENTDIRS}};
$prefix = $self->{INST_LIB}
- if ($striplibpath = $path) =~ s:^(\W*)lib\W:$1:i;
+ if ($striplibpath = $path) =~ s{^(\W*)($parentlibs_re)\W}
+ {$1}i;
my($inst) = $self->catfile($prefix,$striplibpath);
local($_) = $inst; # for backwards compatibility
$inst = $self->libscan($inst);
print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
return unless $inst;
- $pm{$path} = $inst;
+ $pm->{$path} = $inst;
}, @{$self->{PMLIBDIRS}});
}
-
- $self->{PM} ||= \%pm;
- $self->{PL_FILES} ||= \%pl_files;
-
- $self->{DIR} ||= [sort keys %dir];
-
- $self->{XS} ||= \%xs;
- $self->{C} ||= [sort keys %c];
- my @o_files = @{$self->{C}};
- $self->{O_FILES} = [grep s/\.c(pp|xx|c)?\z/$self->{OBJ_EXT}/i, @o_files];
-
- $self->{H} ||= [sort keys %h];
-
- # Set up names of manual pages to generate from pods
- my %pods;
- foreach my $man (qw(MAN1 MAN3)) {
- unless ($self->{"${man}PODS"}) {
- $self->{"${man}PODS"} = {};
- $pods{$man} = 1 unless
- $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/;
- }
- }
-
- if ($pods{MAN1}) {
- if ( exists $self->{EXE_FILES} ) {
- foreach $name (@{$self->{EXE_FILES}}) {
- local *FH;
- my($ispod)=0;
- if (open(FH,"<$name")) {
- while (<FH>) {
- if (/^=(?:head\d+|item|pod)\b/) {
- $ispod=1;
- last;
- }
- }
- close FH;
- } else {
- # If it doesn't exist yet, we assume, it has pods in it
- $ispod = 1;
- }
- next unless $ispod;
- if ($pods{MAN1}) {
- $self->{MAN1PODS}->{$name} =
- $self->catfile("\$(INST_MAN1DIR)", basename($name).".\$(MAN1EXT)");
- }
- }
- }
- }
- if ($pods{MAN3}) {
- my %manifypods = (); # we collect the keys first, i.e. the files
- # we have to convert to pod
- foreach $name (keys %{$self->{PM}}) {
- if ($name =~ /\.pod\z/ ) {
- $manifypods{$name} = $self->{PM}{$name};
- } elsif ($name =~ /\.p[ml]\z/ ) {
- local *FH;
- my($ispod)=0;
- if (open(FH,"<$name")) {
- while (<FH>) {
- if (/^=head1\s+\w+/) {
- $ispod=1;
- last;
- }
- }
- close FH;
- } else {
- $ispod = 1;
- }
- if( $ispod ) {
- $manifypods{$name} = $self->{PM}{$name};
- }
- }
- }
-
- # Remove "Configure.pm" and similar, if it's not the only pod listed
- # To force inclusion, just name it "Configure.pod", or override
- # MAN3PODS
- foreach $name (keys %manifypods) {
- if ($self->{PERL_CORE} and $name =~ /(config|setup).*\.pm/is) {
- delete $manifypods{$name};
- next;
- }
- my($manpagename) = $name;
- $manpagename =~ s/\.p(od|m|l)\z//;
- # everything below lib is ok
- unless($manpagename =~ s!^\W*lib\W+!!s) {
- $manpagename = $self->catfile(
- split(/::/,$self->{PARENT_NAME}),$manpagename
- );
- }
- if ($pods{MAN3}) {
- $manpagename = $self->replace_manpage_separator($manpagename);
- $self->{MAN3PODS}->{$name} =
- $self->catfile("\$(INST_MAN3DIR)", "$manpagename.\$(MAN3EXT)");
- }
- }
- }
}
+
=item init_DIRFILESEP
Using / for Unix. Called by init_main.
and not $old){
# Maybe somebody tries to build an extension with an
# uninstalled Perl outside of Perl build tree
- my $found;
+ my $lib;
for my $dir (@INC) {
- $found = $dir, last if -e $self->catdir($dir, "Config.pm");
+ $lib = $dir, last if -e $self->catdir($dir, "Config.pm");
}
- if ($found) {
- my $inc = dirname $found;
+ if ($lib) {
+ # Win32 puts its header files in /perl/src/lib/CORE.
+ # Unix leaves them in /perl/src.
+ my $inc = $Is_Win32 ? $self->catdir($lib, "CORE" )
+ : dirname $lib;
if (-e $self->catdir($inc, "perl.h")) {
- $self->{PERL_LIB} = $found;
- $self->{PERL_ARCHLIB} = $found;
+ $self->{PERL_LIB} = $lib;
+ $self->{PERL_ARCHLIB} = $lib;
$self->{PERL_INC} = $inc;
$self->{UNINSTALLED_PERL} = 1;
print STDOUT <<EOP;
$sep .= "\\\n\t";
foreach $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
- PREFIX INSTALLBASE)
+ PREFIX INSTALL_BASE)
)
{
next unless defined $self->{$key};
sub ppd {
my($self) = @_;
- if ($self->{ABSTRACT_FROM}){
- $self->{ABSTRACT} = $self->parse_abstract($self->{ABSTRACT_FROM}) or
- carp "WARNING: Setting ABSTRACT via file ".
- "'$self->{ABSTRACT_FROM}' failed\n";
- }
-
my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3];
my $abstract = $self->{ABSTRACT} || '';
$switches = join ' ', @$switches;
- return qq{\$(ABSPERLRUN) $switches -e $cmd};
+ return qq{\$(ABSPERLRUN) $switches -e $cmd --};
}
# $Revision can't be on the same line or SVN/K gets confused
use vars qw($Revision
$VERSION @ISA);
-$VERSION = '5.73';
+$VERSION = '5.73_02';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
# Switches must be quoted else they will be lowercased.
$switches = join ' ', map { qq{"$_"} } @$switches;
- return qq{\$(ABSPERLRUN) $switches -e $cmd};
+ return qq{\$(ABSPERLRUN) $switches -e $cmd --};
}
use File::Spec;
use ExtUtils::MakeMaker qw( neatvalue );
-use vars qw(@ISA $VERSION $BORLAND $GCC $DMAKE $NMAKE);
+use vars qw(@ISA $VERSION);
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = '1.12';
+$VERSION = '1.12_01';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
-$BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
-$GCC = 1 if $Config{'cc'} =~ /^gcc/i;
-$DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
-$NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
+my $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
+my $GCC = 1 if $Config{'cc'} =~ /^gcc/i;
=head2 Overridden methods
sub init_DIRFILESEP {
my($self) = shift;
+ my $make = $self->make;
+
# The ^ makes sure its not interpreted as an escape in nmake
- $self->{DIRFILESEP} = $NMAKE ? '^\\' :
- $DMAKE ? '\\\\'
- : '\\';
+ $self->{DIRFILESEP} = $make eq 'nmake' ? '^\\' :
+ $make eq 'dmake' ? '\\\\'
+ : '\\';
}
=item B<init_others>
my $make_frag = $self->SUPER::special_targets;
- $make_frag .= <<'MAKE_FRAG' if $DMAKE;
+ $make_frag .= <<'MAKE_FRAG' if $self->make eq 'dmake';
.USESHELL :
MAKE_FRAG
} elsif ($BORLAND) {
push(@m,
q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
- .($DMAKE ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
+ .($self->make eq 'dmake'
+ ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
.q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
: q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
.q{$(subst /,\,$(MYEXTLIB)),$(subst /,\,$(EXPORT_LIST))})
sub pasthru {
my($self) = shift;
- return "PASTHRU = " . ($NMAKE ? "-nologo" : "");
+ return "PASTHRU = " . ($self->make eq 'nmake' ? "-nologo" : "");
}
$switches = join ' ', @$switches;
- return qq{\$(ABSPERLRUN) $switches -e $cmd};
+ return qq{\$(ABSPERLRUN) $switches -e $cmd --};
}
# quotes; however it transforms {{ into { either inside and outside double
# quotes. It also translates }} into }. The escaping below is not
# 100% correct.
- if( $DMAKE ) {
+ if( $self->make eq 'dmake' ) {
$text =~ s/{/{{/g;
$text =~ s/}}/}}}/g;
}
sub cd {
my($self, $dir, @cmds) = @_;
- return $self->SUPER::cd($dir, @cmds) unless $NMAKE;
+ return $self->SUPER::cd($dir, @cmds) unless $self->make eq 'nmake';
my $cmd = join "\n\t", map "$_", @cmds;
package ExtUtils::MM_Win95;
use vars qw($VERSION @ISA);
-$VERSION = '0.04';
+$VERSION = '0.04_01';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
-# $Id: /local/schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 4535 2005-05-20T23:08:34.937906Z schwern $
+# $Id: /local/svn.schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 2539 2005-08-17T06:53:55.009300Z schwern $
package ExtUtils::MakeMaker;
BEGIN {require 5.005_03;}
use vars qw($Revision);
use strict;
-$VERSION = '6.30_01';
-($Revision = q$Revision: 4535 $) =~ /Revision:\s+(\S+)/;
+$VERSION = '6.30_02';
+$Revision = (q$Revision: 2539 $) =~ /Revision:\s+(\S+)/;
@ISA = qw(Exporter);
@EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
PL_FILES => 'hash',
PM => 'hash',
PMLIBDIRS => 'array',
+ PMLIBPARENTDIRS => 'array',
PREREQ_PM => 'hash',
SKIP => 'array',
TYPEMAPS => 'array',
AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS
- EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
+ EXCLUDE_EXT EXE_FILES EXTRA_META FIRST_MAKEFILE
FULLPERL FULLPERLRUN FULLPERLRUNINST
FUNCLIST H IMPORTS
INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR
INSTALLDIRS
- DESTDIR PREFIX INSTALLBASE
+ DESTDIR PREFIX INSTALL_BASE
PERLPREFIX SITEPREFIX VENDORPREFIX
INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
PERL_LIB PERL_ARCHLIB
SITELIBEXP SITEARCHEXP
- INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS
- LINKTYPE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
+ INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE
+ LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE
PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE
PERL_SRC PERM_RW PERM_RWX
- PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC
+ PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC
PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
XS_VERSION clean depend dist dynamic_lib linkext macro realclean
push @Overridable, qw[
libscan makeaperl needs_linking perm_rw perm_rwx
- subdir_x test_via_harness test_via_script init_PERL
+ subdir_x test_via_harness test_via_script
+
+ init_VERSION init_dist init_INST init_INSTALL init_DEST init_dirscan
+ init_PM init_MANPODS init_xs init_PERL init_DIRFILESEP init_linker
];
push @MM_Sections, qw[
# we will use all these variables in the Makefile
@Get_from_Config =
qw(
- ar cc cccdlflags ccdlflags dlext dlsrc ld lddlflags ldflags libc
- lib_ext obj_ext osname osvers ranlib sitelibexp sitearchexp so
- exe_ext full_ar
+ ar cc cccdlflags ccdlflags dlext dlsrc exe_ext full_ar ld
+ lddlflags ldflags libc lib_ext obj_ext osname osvers ranlib
+ sitelibexp sitearchexp so
);
# 5.5.3 doesn't have any concept of vendor libs
($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g;
+ $self->init_MAKE;
$self->init_main;
$self->init_VERSION;
$self->init_dist;
$self->init_INSTALL;
$self->init_DEST;
$self->init_dirscan;
+ $self->init_PM;
+ $self->init_MANPODS;
$self->init_xs;
$self->init_PERL;
$self->init_DIRFILESEP;
$self->init_linker;
+ $self->init_ABSTRACT;
if (! $self->{PERL_SRC} ) {
require VMS::Filespec if $Is_VMS;
'Makefile.PL' was invoked with so the programs will be sure to run
properly even if perl is not in /usr/bin/perl.
+=item EXTRA_META
+
+Extra text to be appended to the generated META.yml.
+
=item FIRST_MAKEFILE
The name of the Makefile to be produced. This is used for the second
MakeMaker will turn it into an array with one element.
+=item LICENSE
+
+The licensing terms of your distribution. Generally its "perl" for the
+same license as Perl itself.
+
+See L<Module::Build::Authoring> for the list of options.
+
+Defaults to "unknown".
+
=item LINKTYPE
'static' or 'dynamic' (default unless usedl=undef in
config.sh). Should only be used to force static linking (also see
linkext below).
+=item MAKE
+
+Variant of make you intend to run the generated Makefile with. This
+parameter lets Makefile.PL know what make quirks to account for when
+generating the Makefile.
+
+MakeMaker also honors the MAKE environment variable. This parameter
+takes precedent.
+
+Currently the only significant values are 'dmake' and 'nmake' for Windows
+users.
+
+Defaults to $Config{make}.
+
=item MAKEAPERL
Boolean which tells MakeMaker, that it should include the rules to
$VERSION = '1.00';
*VERSION = \'1.01';
- $VERSION = sprintf "%d.%03d", q$Revision: 4535 $ =~ /(\d+)/g;
+ $VERSION = (q$Revision: 2539 $) =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
package ExtUtils::MakeMaker::FAQ;
use vars qw($VERSION);
-$VERSION = '1.11';
+$VERSION = '1.11_01';
1;
__END__
system's revision number (you are using version control, right?).
In CVS, RCS and SVN you use $Revision$ (see the documentation of your
-version control system for details) writing it like so:
+version control system for details). Every time the file is checked
+in the $Revision$ will be updated, updating your $VERSION.
- $VERSION = sprintf "%d.%03d", q$Revision$ =~ /(\d+)/g;
+SVN uses a simple integer for $Revision$ so you can adapt it for your
+$VERSION like so:
-Every time the file is checked in the $Revision$ will be updated,
-updating your $VERSION.
+ $VERSION = (q$Revision$) =~ /(\d+)/g;
-In CVS version 1.9 is followed by 1.10. Since CPAN compares version
-numbers numerically we use a sprintf() to convert 1.9 to 1.009 and
-1.10 to 1.010 which compare properly.
+In CVS and RCS version 1.9 is followed by 1.10. Since CPAN compares
+version numbers numerically we use a sprintf() to convert 1.9 to 1.009
+and 1.10 to 1.010 which compare properly.
+
+ $VERSION = sprintf "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/g;
If branches are involved (ie. $Revision: 1.5.3.4$) its a little more
complicated.
# must be all on one line or MakeMaker will get confused.
$VERSION = do { my @r = (q$Revision$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
+In SVN, $Revision$ should be the same for every file in the project so
+they would all have the same $VERSION. CVS and RCS have a different
+$Revision$ per file so each file will have a differnt $VERSION.
+Distributed version control systems, such as SVK, may have a different
+$Revision$ based on who checks out the file leading to a different $VERSION
+on each machine! Finally, some distributed version control systems, such
+as darcs, have no concept of revision number at all.
+
+
=item What's this F<META.yml> thing and how did it get in my F<MANIFEST>?!
F<META.yml> is a module meta-data file pioneered by Module::Build and
+"The easy way is always mined.
+ The important things are always simple.
+ The simple things are always hard."
+ -- Some of Murphy's Laws of Combat
+
This is a short set of guidelines for those patching
ExtUtils::MakeMaker. Its not an iron-clad set of rules, but just
things which make life easier when reading and integrating a patch.
- Use $(NOECHO) instead of @.
+- Use - to tell make to ignore the exit code of a command. (Unfortunately,
+ some make variants don't honor an $(IGNORE) macro).
+
- Always put a space between $(NOECHO) and the command.
- Always put a space between - (ignore) and the command.
- Always put $(NOECHO) and - together, no space between them.
+ # Right
+ -$(NOECHO) command
+ $(NOECHO) command
+ - command
+
- Often when you patch ExtUtils::MM_Unix, similar patches must be done
to the other MM_* modules. If you can, please do this extra work
otherwise I have to. If you can't, that's ok. We can help.
ok( test_f(), 'testing non-existent file' );
@ARGV = ( $Testfile );
- cmp_ok( ! test_f(), '==', defined (-f $Testfile), 'testing non-existent file' );
+ cmp_ok( ! test_f(), '==', (-f $Testfile), 'testing non-existent file' );
# these are destructive, have to keep setting @ARGV
@ARGV = ( $Testfile );
ok( -e 'jakefile', 'FIRST_MAKEFILE honored' );
-ok( grep(/^Writing jakefile(?:\.)? for Big::Dummy/, @mpl_out) == 1,
+ok( grep(/^Writing jakefile for Big::Dummy/, @mpl_out) == 1,
'Makefile.PL output looks right' );
#!/usr/bin/perl -w
-# Tests INSTALLBASE
+# Tests INSTALL_BASE
BEGIN {
if( $ENV{PERL_CORE} ) {
ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy") || diag("chdir failed; $!");
-my @mpl_out = run(qq{$perl Makefile.PL "INSTALLBASE=../dummy-install"});
+my @mpl_out = run(qq{$perl Makefile.PL "INSTALL_BASE=../dummy-install"});
END { rmtree '../dummy-install'; }
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
BEGIN {
if ($^O =~ /NetWare/i) {
- plan tests => 40;
+ plan tests => 39;
} else {
plan skip_all => 'This is not NW5';
}
'tool_autosplit()' );
}
-# tools_other()
-{
- ( my $mm_w32 = bless { }, 'MM' )->init_others();
-
- my $bin_sh = ( $Config{make} =~ /^dmake/i
- ? "" : ($Config{sh} || 'cmd /c') . "\n" );
- $bin_sh = "SHELL = $bin_sh" if $bin_sh;
-
- my $tools = join "\n", map "$_ = $mm_w32->{ $_ }"
- => qw(CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL);
-
- like( $mm_w32->tools_other(),
- qr/^\Q$bin_sh$tools/m,
- 'tools_other()' );
-};
# xs_o() should look into that
# top_targets() should look into that
}
# path()
+my $had_path = exists $ENV{PATH};
{
- ok( eq_array( [ $MM->path() ], [ File::Spec->path ] ),
+ my @path_eg = ( qw( . .. ), 'C:\\Program Files' );
+ local $ENV{PATH} = join ';', @path_eg;
+ ok( eq_array( [ $MM->path() ], [ @path_eg ] ),
'path() [preset]' );
}
+# Bug in Perl. local $ENV{FOO} will not delete key afterwards.
+delete $ENV{PATH} unless $had_path;
# static_lib() should look into that
# dynamic_bs() should look into that
($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1;
catch_warning( \&skipcheck )
};
-ok( ! defined $warn, 'disabled warnings' );
+cmp_ok( $warn, 'eq', '', 'disabled warnings' );
# add a skip file with a rule to skip itself (and the nonexistent glob '*baz*')
add_file( 'MANIFEST.SKIP', "baz\n.SKIP" );
foreach my $orig (@copies) {
my $copy = "copy/$orig";
ok( -r $copy, "$copy: must be readable" );
-
- SKIP: {
- skip " original was not writable", 1 unless -w $orig;
- ok(-w $copy, " writable if original was" );
- }
-
- SKIP: {
- skip " original was not executable", 1 unless -x $orig;
- ok(-x $copy, " executable if original was" );
- }
+ is( -w $copy, -w $orig, " writable if original was" );
+ is( -x $copy, -x $orig, " executable if original was" );
}
rmtree('copy');
# 'make disttest' sets a bunch of environment variables which interfere
# with our testing.
-delete @ENV{qw(PREFIX LIB MAKEFLAGS MAKE_JOBS_FIFO)};
+delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
my $perl = which_perl();
my $Is_VMS = $^O eq 'VMS';
-# GNV logical interferes with testing
-$ENV{'bin'} = '[.bin]' if $Is_VMS;
-
chdir 't';
perl_lib;
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't';
+ @INC = ('../lib', 'lib/');
+ }
+ else {
+ unshift @INC, 't/lib/';
+ }
+}
+
+use Test::More tests => 3;
+
+use ExtUtils::MakeMaker;
+
+my $MM = bless { MAKE => "nmake6" }, "MM";
+is $MM->make, 'nmake';
+
+$MM->{MAKE} = 'GNUmake';
+is $MM->make, 'gmake';
+
+$MM->{MAKE} = 'MMS';
+is $MM->make, 'mms';
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use Test::More tests => 4;
+
+BEGIN {
+ use_ok 'ExtUtils::MakeMaker';
+ use_ok 'ExtUtils::MM_VMS';
+}
+
+like $ExtUtils::MakeMaker::Revision, qr/^(\d)+$/;
+like $ExtUtils::MM_VMS::Revision, qr/^(\d)+$/;