lib/ExtUtils/t/Liblist.t See if ExtUtils::Liblist 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/MM_BeOS.t See if ExtUtils::MM_BeOS works
lib/ExtUtils/t/MM_Cygwin.t See if ExtUtils::MM_Cygwin works
lib/ExtUtils/t/MM_NW5.t See if ExtUtils::MM_NW5 works
use vars qw(@ISA @EXPORT $VERSION);
@ISA = qw(Exporter);
@EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f);
-$VERSION = '1.04';
+$VERSION = '1.05';
my $Is_VMS = $^O eq 'VMS';
@EXPORT = qw(test_harness pod2man perllocal_install uninstall
warn_if_old_packlist);
-$VERSION = '0.02';
+$VERSION = '0.03';
my $Is_VMS = $^O eq 'VMS';
use 5.00503;
use vars qw(@ISA @EXPORT $VERSION);
-$VERSION = 1.31;
+$VERSION = 1.32;
use Exporter;
use Carp ();
mkpath($autodir,0,0755);
while(my($from, $to) = each %$fromto) {
- next if -f $to && -M $to < -M $from;
+ if( -f $to && -s $from == -s $to && -M $to < -M $from ) {
+ print "Skip $to (unchanged)\n";
+ next;
+ }
# When a pm_filter is defined, we need to pre-process the source first
# to determine whether it has changed or not. Therefore, only perform
use File::Find;
use File::Basename;
use File::Spec;
-require VMS::Filespec if $^O eq 'VMS';
-
-use vars qw($VERSION);
-$VERSION = '0.06';
+my $Is_VMS = $^O eq 'VMS';
my $DOSISH = ($^O =~ /^(MSWin\d\d|os2|dos|mint)$/);
+require VMS::Filespec if $Is_VMS;
+
+use vars qw($VERSION);
+$VERSION = '0.07';
+
sub _is_prefix {
my ($self, $path, $prefix) = @_;
return unless defined $prefix && defined $path;
- if( $^O eq 'VMS' ) {
+ if( $Is_VMS ) {
$prefix = VMS::Filespec::unixify($prefix);
$path = VMS::Filespec::unixify($path);
}
my $sitearch = $Config{sitearchexp};
# File::Find does not know how to deal with VMS filepaths.
- if( $^O eq 'VMS' ) {
+ if( $Is_VMS ) {
$archlib = VMS::Filespec::unixify($archlib);
$sitearch = VMS::Filespec::unixify($sitearch);
}
# Read the module packlists
my $sub = sub {
# Only process module .packlists
- return if ($_) ne ".packlist" || $File::Find::dir eq $archlib;
+ return if $_ ne ".packlist" || $File::Find::dir eq $archlib;
# Hack of the leading bits of the paths & convert to a module name
my $module = $File::Find::name;
$self->{$module}{version} = '';
foreach my $dir (@INC) {
my $p = File::Spec->catfile($dir, $modfile);
- if (-f $p) {
+ if (-r $p) {
+ $module = _module_name($p, $module) if $Is_VMS;
+
require ExtUtils::MM;
$self->{$module}{version} = MM->parse_version($p);
last;
return(bless($self, $class));
}
+# VMS's non-case preserving file-system means the package name can't
+# be reconstructed from the filename.
+sub _module_name {
+ my($file, $orig_module) = @_;
+
+ my $module = '';
+ if (open PACKFH, $file) {
+ while (<PACKFH>) {
+ if (/package\s+(\S+)\s*;/) {
+ my $pack = $1;
+ # Make a sanity check, that lower case $module
+ # is identical to lowercase $pack before
+ # accepting it
+ if (lc($pack) eq lc($orig_module)) {
+ $module = $pack;
+ last;
+ }
+ }
+ }
+ close PACKFH;
+ }
+
+ print STDERR "Couldn't figure out the package name for $file\n"
+ unless $module;
+
+ return $module;
+}
+
+
+
sub modules {
my ($self) = @_;
package ExtUtils::Liblist;
use vars qw($VERSION);
-$VERSION = '1.00';
+$VERSION = '1.01';
use File::Spec;
require ExtUtils::Liblist::Kid;
# Broken out of MakeMaker from version 4.11
use vars qw($VERSION);
-$VERSION = 1.29;
+$VERSION = 1.30;
use Config;
use Cwd 'cwd';
use strict;
use vars qw($VERSION @ISA);
-$VERSION = 0.04;
+$VERSION = 0.05;
@ISA = qw(File::Spec);
use Config;
These are methods which are by their nature cross-platform and should
always be cross-platform.
+=over 4
+
+=item os_flavor_is
+
+ $mm->os_flavor_is($this_flavor);
+ $mm->os_flavor_is(@one_of_these_flavors);
+
+Checks to see if the current operating system is one of the given flavors.
+
+This is useful for code like:
+
+ if( $mm->os_flavor_is('Unix') ) {
+ $out = `foo 2>&1`;
+ }
+ else {
+ $out = `foo`;
+ }
+
+=cut
+
+sub os_flavor_is {
+ my $self = shift;
+ my %flavors = map { ($_ => 1) } $self->os_flavor;
+ return (grep { $flavors{$_} } @_) ? 1 : 0;
+}
+
+=back
+
=head2 File::Spec wrappers
ExtUtils::MM_Any is a subclass of File::Spec. The methods noted here
sub init_VERSION {
my($self) = shift;
- $self->{MAKEMAKER} = $INC{'ExtUtils/MakeMaker.pm'};
+ $self->{MAKEMAKER} = $ExtUtils::MakeMaker::Filename;
$self->{MM_VERSION} = $ExtUtils::MakeMaker::VERSION;
$self->{MM_REVISION}= $ExtUtils::MakeMaker::Revision;
$self->{VERSION_FROM} ||= '';
CMD
}
+ $manify .= "\t\$(NOECHO) \$(NOOP)\n" unless @man_cmds;
$manify .= join '', map { "$_\n" } @man_cmds;
return $manify;
Macro Description
- NOOP
- NOECHO
+ NOOP Do nothing
+ NOECHO Tell make not to display the command itself
MAKEFILE
FIRST_MAKEFILE
SHELL Program used to run
shell commands
+ ECHO Print text adding a newline on the end
RM_F Remove a file
RM_RF Remove a directory
TOUCH Update a file's timestamp
return '';
}
+=item os_flavor
+
+ my @os_flavor = $mm->os_flavor;
+
+@os_flavor is the style of operating system this is, usually
+corresponding to the MM_*.pm file we're using.
+
+The first element of @os_flavor is the major family (ie. Unix,
+Windows, VMS, OS/2, MacOS, etc...) and the rest are sub families.
+
+Some examples:
+
+ Cygwin98 ('Unix', 'Cygwin', 'Cygwin9x')
+ Windows NT ('Win32', 'WinNT')
+ Win98 ('Win32', 'Win9x')
+ Linux ('Unix', 'Linux')
+ MacOS Classic ('MacOS', 'MacOS Classic')
+ MacOS X ('Unix', 'Darwin', 'MacOS', 'MacOS X')
+ OS/2 ('OS/2')
+
+This is used to write code for styles of operating system.
+See os_flavor_is() for use.
+
=back
use vars qw(@ISA $VERSION);
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = 1.03;
+$VERSION = 1.04;
+=item os_flavor (o)
+
+BeOS is BeOS.
+
+=cut
+
+sub os_flavor {
+ return('BeOS');
+}
+
=item init_linker
libperl.a equivalent to be linked to dynamic extensions.
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = 1.05;
+$VERSION = 1.06;
=head1 NAME
=over 4
+=item os_flavor (o)
+
+We're Unix and Cygwin.
+
+=cut
+
+sub os_flavor {
+ return('Unix', 'Cygwin');
+}
+
=item cflags (o)
if configured for dynamic loading, triggers #define EXT in EXTERN.h
use strict;
use vars qw($VERSION @ISA);
-$VERSION = 0.01;
+$VERSION = 0.02;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
=over 4
+=item os_flavor
+
+=cut
+
+sub os_flavor {
+ return('DOS');
+}
+
=item B<replace_manpage_separator>
Generates Foo__Bar.3 style man page names
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
use vars qw($VERSION);
-$VERSION = '1.04';
+$VERSION = '1.05';
use Config;
use Cwd 'cwd';
}
}
+=item os_flavor
+
+MacOS Classic is MacOS and MacOS Classic.
+
+=cut
+
+sub os_flavor {
+ return('MacOS', 'MacOS Classic');
+}
+
=back
=cut
use File::Basename;
use vars qw(@ISA $VERSION);
-$VERSION = '2.05';
+$VERSION = '2.06';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
+=item os_flavor
+
+We're Netware in addition to being Windows.
+
+=cut
+
+sub os_flavor {
+ my $self = shift;
+ return ($self->SUPER::os_flavor, 'Netware');
+}
+
=item init_platform (o)
Add Netware macros.
use ExtUtils::MakeMaker qw(neatvalue);
use File::Spec;
-$VERSION = '1.03';
+$VERSION = '1.04';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
my($self) = @_;
$self->{TO_UNIX} ||= <<'MAKE_TEXT';
-$(NOECHO) $(TEST_F) tmp.zip && $(RM) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM) tmp.zip
+$(NOECHO) $(TEST_F) tmp.zip && $(RM_F) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM_F) tmp.zip
MAKE_TEXT
$self->SUPER::init_dist;
$self->{EXPORT_LIST} = '$(BASEEXT).def';
}
+=item os_flavor
+
+OS/2 is OS/2
+
+=cut
+
+sub os_flavor {
+ return('OS/2');
+}
+
=back
=cut
use strict;
use vars qw($VERSION @ISA);
-$VERSION = 0.01;
+$VERSION = 0.02;
require ExtUtils::MM_Unix;
@ISA = qw(ExtUtils::MM_Unix);
=over 4
+=item os_flavor
+
+In addition to being Unix, we're U/WIN.
+
+=cut
+
+sub os_flavor {
+ return('Unix', 'U/WIN');
+}
+
+
=item B<replace_manpage_separator>
=cut
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.35';
+$VERSION = '1.36';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
=over 4
+=item os_flavor (o)
+
+Simply says that we're Unix.
+
+=cut
+
+sub os_flavor {
+ return('Unix');
+}
+
+
=item c_o (o)
Defines the suffix rules to compile different flavors of C files to
$armaybe = 'ar' if ($Is_OSF and $armaybe eq ':');
my(@m);
my $ld_opt = $Is_OS2 ? '$(OPTIMIZE) ' : ''; # Useful on other systems too?
+ my $ld_fix = $Is_OS2 ? '|| ( $(RM_F) $@ && sh -c false )' : '';
push(@m,'
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
ARMAYBE = '.$armaybe.'
OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
+INST_DYNAMIC_FIX = '.$ld_fix.'
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
');
push(@m,
' LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) '.$ldrun.' $(LDDLFLAGS) '.$ldfrom.
-' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) '.$libs.' $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST)');
+' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) '.$libs.' $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) $(INST_DYNAMIC_FIX)');
push @m, '
$(CHMOD) $(PERM_RWX) $@
';
my($does_shbang) = $Config{'sharpbang'} =~ /^\s*\#\!/;
for my $file (@files) {
+ my $file_new = "$file.new";
+ my $file_bak = "$file.bak";
+
local(*FIXIN);
local(*FIXOUT);
open(FIXIN, $file) or croak "Can't process '$file': $!";
next;
}
- unless ( open(FIXOUT,">$file.new") ) {
+ unless ( open(FIXOUT,">$file_new") ) {
warn "Can't create new $file: $!\n";
next;
}
close FIXIN;
close FIXOUT;
- unless ( rename($file, "$file.bak") ) {
- warn "Can't rename $file to $file.bak: $!";
+ chmod 0666, $file_bak;
+ unlink $file_bak;
+ unless ( rename($file, $file_bak) ) {
+ warn "Can't rename $file to $file_bak: $!";
next;
}
- unless ( rename("$file.new", $file) ) {
- warn "Can't rename $file.new to $file: $!";
- unless ( rename("$file.bak", $file) ) {
- warn "Can't rename $file.bak back to $file either: $!";
- warn "Leaving $file renamed as $file.bak\n";
+ unless ( rename($file_new, $file) ) {
+ warn "Can't rename $file_new to $file: $!";
+ unless ( rename($file_bak, $file) ) {
+ warn "Can't rename $file_bak back to $file either: $!";
+ warn "Leaving $file renamed as $file_bak\n";
}
next;
}
- unlink "$file.bak";
+ unlink $file_bak;
} continue {
close(FIXIN) if fileno(FIXIN);
system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';;
push @m, q{
# We take a very conservative approach here, but it\'s worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
-$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(VERSION_FROM)
+$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
}
}
- my(@tmdeps) = $self->catdir('$(XSUBPPDIR)','typemap');
+ my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
+ my(@tmdeps) = $self->catfile($tmdir,'typemap');
if( $self->{TYPEMAPS} ){
my $typemap;
foreach $typemap (@{$self->{TYPEMAPS}}){
}
}
- my $xsubpp = "xsubpp";
-
return qq{
XSUBPPDIR = $xsdir
-XSUBPP = \$(XSUBPPDIR)/$xsubpp
+XSUBPP = \$(XSUBPPDIR)/xsubpp
XSPROTOARG = $self->{XSPROTOARG}
XSUBPPDEPS = @tmdeps \$(XSUBPP)
XSUBPPARGS = @tmargs
use File::Basename;
use vars qw($Revision @ISA $VERSION);
-($VERSION) = '5.66';
-($Revision = substr(q$Revision: 1.82 $, 10)) =~ s/\s+$//;
+($VERSION) = '5.67';
+($Revision = substr(q$Revision: 1.89 $, 10)) =~ s/\s+$//;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
sub tool_xsubpp {
my($self) = @_;
return '' unless $self->needs_linking;
- my($xsdir) = $self->catdir($self->{PERL_LIB},'ExtUtils');
- # drop back to old location if xsubpp is not in new location yet
- $xsdir = $self->catdir($self->{PERL_SRC},'ext')
- unless (-f $self->catfile($xsdir,'xsubpp'));
- my(@tmdeps) = '$(XSUBPPDIR)typemap';
+
+ my $xsdir;
+ foreach my $dir (@INC) {
+ $xsdir = $self->catdir($dir, 'ExtUtils');
+ if( -r $self->catfile($xsdir, "xsubpp") ) {
+ last;
+ }
+ }
+
+ my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
+ my(@tmdeps) = $self->catfile($tmdir,'typemap');
if( $self->{TYPEMAPS} ){
my $typemap;
foreach $typemap (@{$self->{TYPEMAPS}}){
# than just typing the literal string.
my $extra_tools = <<'EXTRA_TOOLS';
-# Assumes \$(MMS) invokes MMS or MMK
+# Assumes $(MMS) invokes MMS or MMK
# (It is assumed in some cases later that the default makefile name
# (Descrip.MMS for MM[SK]) is used.)
USEMAKEFILE = /Descrip=
MACROEND = )
# Just in case anyone is using the old macro.
-SAY = $ECHO
+SAY = $(ECHO)
EXTRA_TOOLS
=item B<echo> (o)
-perl trips up on "<foo>" thinking its an input redirect. So we use the
-native Write sys$output instead.
+perl trips up on "<foo>" thinking it's an input redirect. So we use the
+native Write command instead. Besides, its faster.
=cut
my($self, $text, $file, $appending) = @_;
$appending ||= 0;
- die "The VMS version of echo() cannot currently append" if $appending;
+ my $opencmd = $appending ? 'Open/Append' : 'Open/Write';
- my @cmds = ("\$(NOECHO) Assign $file Sys\$Output");
- push @cmds, map { '$(NOECHO) Write Sys$Output '.$self->quote_literal($_) }
+ my @cmds = ("\$(NOECHO) $opencmd MMECHOFILE $file ");
+ push @cmds, map { '$(NOECHO) Write MMECHOFILE '.$self->quote_literal($_) }
split /\n/, $text;
- push @cmds, '$(NOECHO) Deassign Sys$Output';
+ push @cmds, '$(NOECHO) Close MMECHOFILE';
return @cmds;
}
$self->{EXPORT_LIST} ||= '$(BASEEXT).opt';
my $shr = $Config{dbgprefix} . 'PERLSHR';
- $self->{PERL_ARCHIVE} ||= $self->catfile($self->{PERL_SRC},"$shr.$Config{'dlext'}");
+ $self->{PERL_ARCHIVE} ||= $self->catfile($self->{PERL_SRC}, "$shr.$Config{'dlext'}");
$self->{PERL_ARCHIVE_AFTER} ||= '';
}
identically named elements of C<%$self>, and returns the result
as a file specification in Unix syntax.
-NOTE: This is the cannonical version of the method. The version in
+NOTE: This is the canonical version of the method. The version in
File::Spec::VMS is deprecated.
=cut
checks to see whether it matches the name of a directory in the current
default directory, and returns a directory or file specification accordingly.
-NOTE: This is the cannonical version of the method. The version in
+NOTE: This is the canonical version of the method. The version in
File::Spec::VMS is deprecated.
=cut
}
+=item os_flavor
+
+VMS is VMS.
+
+=cut
+
+sub os_flavor {
+ return('VMS');
+}
+
=back
=cut
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = '1.06';
+$VERSION = '1.07';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
sub init_DIRFILESEP {
my($self) = shift;
- # gotta be careful this isn't interpreted as an escape.
- $self->{DIRFILESEP} = '^\\';
+ # The ^ makes sure its not interpreted as an escape in nmake
+ $self->{DIRFILESEP} = $NMAKE ? '^\\' :
+ $DMAKE ? '\\\\'
+ : '\\';
}
=item B<init_others>
my ($self) = @_;
# Used in favor of echo because echo won't strip quotes. :(
- $self->{ECHO} ||= '$(PERLRUN) -le "print qq{@ARGV}"';
+ $self->{ECHO} ||= $self->oneliner('print qq{@ARGV}', ['-l']);
+
$self->{TOUCH} ||= '$(PERLRUN) -MExtUtils::Command -e touch';
$self->{CHMOD} ||= '$(PERLRUN) -MExtUtils::Command -e chmod';
$self->{CP} ||= '$(PERLRUN) -MExtUtils::Command -e cp';
$self->SUPER::init_others;
+ # Setting SHELL from $Config{sh} can break dmake. Its ok without it.
+ delete $self->{SHELL};
+
$self->{LDLOADLIBS} ||= $Config{libs};
# -Lfoo must come first for Borland, so we put it in LDDLFLAGS
if ($BORLAND) {
# Win98's command.com
$text =~ s{"}{\\"}g;
+ # dmake eats '{' inside double quotes and leaves alone { outside double
+ # quotes; however it transforms {{ into { either inside and outside double
+ # quotes. It also translates }} into }. The escaping below is not
+ # 100% correct.
+ if( $DMAKE ) {
+ $text =~ s/{/{{/g;
+ $text =~ s/}}/}}}/g;
+ }
+
return qq{"$text"};
}
}
+=item os_flavor
+
+Windows is Win32.
+
+=cut
+
+sub os_flavor {
+ return('Win32');
+}
+
+
1;
__END__
package ExtUtils::MM_Win95;
use vars qw($VERSION @ISA);
-$VERSION = 0.02;
+$VERSION = 0.03;
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
return $self->{_MAX_EXEC_LEN} ||= 2500;
}
+
+=item os_flavor
+
+Win95 and Win98 and WinME are collectively Win9x and Win32
+
+=cut
+
+sub os_flavor {
+ my $self = shift;
+ return ($self->SUPER::os_flavor, 'Win9x');
+}
+
+
=back
BEGIN {require 5.005_03;}
-$VERSION = "6.03";
-$Version_OK = "5.49"; # Makefiles older than $Version_OK will die
- # (Will be checked from MakeMaker version 4.13 onwards)
-($Revision = substr(q$Revision: 1.63 $, 10)) =~ s/\s+$//;
+$VERSION = '6.10_02';
+($Revision = substr(q$Revision: 1.108 $, 10)) =~ s/\s+$//;
require Exporter;
use Config;
use Carp ();
+use File::Path;
use vars qw(
@ISA @EXPORT @EXPORT_OK
- $ISA_TTY $Revision $VERSION $Verbose $Version_OK %Config
- %Keep_after_flush %MM_Sections @Prepend_parent
+ $Revision $VERSION $Verbose %Config
+ @Prepend_parent @Parent
%Recognized_Att_Keys @Get_from_Config @MM_Sections @Overridable
- @Parent $PACKNAME
+ $Filename
);
use strict;
my $Is_VMS = $^O eq 'VMS';
my $Is_Win32 = $^O eq 'MSWin32';
+# Our filename for diagnostic and debugging purposes. More reliable
+# than %INC (think caseless filesystems)
+$Filename = __FILE__;
+
full_setup();
require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker
my %att = @_;
my $self = MM->new(\%att);
if (-f $self->{MAKEFILE_OLD}) {
- chmod 0666, $self->{MAKEFILE_OLD};
- unlink $self->{MAKEFILE_OLD} or warn "unlink $self->{MAKEFILE_OLD}: $!";
+ _unlink($self->{MAKEFILE_OLD}) or
+ warn "unlink $self->{MAKEFILE_OLD}: $!";
}
if ( -f $self->{MAKEFILE} ) {
- _rename($self->{MAKEFILE}, $self->{MAKEFILE_OLD})
- or warn "rename $self->{MAKEFILE} => $self->{MAKEFILE_OLD}: $!"
+ _rename($self->{MAKEFILE}, $self->{MAKEFILE_OLD}) or
+ warn "rename $self->{MAKEFILE} => $self->{MAKEFILE_OLD}: $!"
}
open MF, '>'.$self->{MAKEFILE} or die "open $self->{MAKEFILE} for write: $!";
print MF <<'EOP';
return rename $src, $dest;
}
+# This is an unlink for OS's where the target must be writable first.
+sub _unlink {
+ my @files = @_;
+ chmod 0666, @files;
+ return unlink @files;
+}
+
# The following mkbootstrap() is only for installations that are calling
# the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker
$VERSION = '1.00';
*VERSION = \'1.01';
- ( $VERSION ) = '$Revision: 1.63 $ ' =~ /\$Revision:\s+([^\s]+)/;
+ ( $VERSION ) = '$Revision: 1.108 $ ' =~ /\$Revision:\s+([^\s]+)/;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
=over 4
+=item How to I prevent "object version X.XX does not match bootstrap parameter Y.YY" errors?
+
+XS code is very sensitive to the module version number and will
+complain if the version number in your Perl module doesn't match. If
+you change your module's version # without reruning Makefile.PL the old
+version number will remain in the Makefile causing the XS code to be built
+with the wrong number.
+
+To avoid this, you can force the Makefile to be rebuilt whenever you
+change the module containing the version number by adding this to your
+WriteMakefile() arguments.
+
+ depend => { '$(FIRST_MAKEFILE)' => '$(VERSION_FROM)' }
+
+
=item How do I make two or more XS files coexist in the same directory?
Sometimes you need to have two and more XS files in the same package.
$Is_MacOS $Is_VMS
$Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP);
-$VERSION = 1.38;
+$VERSION = 1.39;
@ISA=('Exporter');
@EXPORT_OK = qw(mkmanifest
manicheck filecheck fullcheck skipcheck
$Quiet = 0;
$MANIFEST = 'MANIFEST';
-my $manifest_mod = $INC{"ExtUtils/Manifest.pm"} ||
- ($Is_VMS ? $INC{'extutils/manifest.pm'} : '');
-$DEFAULT_MSKIP = (File::Spec->splitpath($manifest_mod))[1].
+my $Filename = __FILE__;
+$DEFAULT_MSKIP = (File::Spec->splitpath($Filename))[1].
"$MANIFEST.SKIP";
=cut
+sub _sort {
+ return sort { lc $a cmp lc $b } @_;
+}
+
sub mkmanifest {
my $manimiss = 0;
my $read = (-r 'MANIFEST' && maniread()) or $manimiss++;
%all = (%$found, %$read);
$all{$MANIFEST} = ($Is_VMS ? "$MANIFEST\t\t" : '') . 'This list of files'
if $manimiss; # add new MANIFEST to known file list
- foreach $file (sort keys %all) {
+ foreach $file (_sort keys %all) {
if ($skip->($file)) {
# Policy: only remove files if they're listed in MANIFEST.SKIP.
# Don't remove files just because they don't exist.
my $matches = _maniskip();
my @skipped = ();
- foreach my $file (sort keys %$found){
+ foreach my $file (_sort keys %$found){
if (&$matches($file)){
warn "Skipping $file\n";
push @skipped, $file;
my $found = manifind($p);
my(@missfile) = ();
- foreach my $file (sort keys %$read){
+ foreach my $file (_sort keys %$read){
warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug;
if ($dosnames){
$file = lc $file;
my $skip = _maniskip();
my @missentry = ();
- foreach my $file (sort keys %$found){
+ foreach my $file (_sort keys %$found){
next if $skip->($file);
warn "Debug: manicheck checking from disk $file\n" if $Debug;
unless ( exists $read->{$file} ) {
my $manifest = maniread();
open(MANIFEST, ">>$MANIFEST") or die "Could not open $MANIFEST: $!";
- while( my($file, $comment) = each %$additions ) {
- $comment ||= '';
+ foreach my $file (_sort keys %$additions) {
+ my $comment = $additions->{$file} || '';
printf MANIFEST "%-40s%s\n", $file, $comment unless
exists $manifest->{$file};
}
consider instead working on Module::Build, MakeMaker's heir apparent.
+Reporting bugs
+
+- Often the only information we have for fixing a bug is contained in your
+ report. So...
+
+- Please report your bugs via http://rt.cpan.org or by mailing to
+ makemaker@perl.org. RT is preferred.
+
+- Please report your bug immediately upon encountering it. Do not wait
+ until you have a patch to fix the bug. Patches are good, but not at
+ the expense of timely bug reports.
+
+- Please be as verbose as possible. Include the complete output of
+ your 'make test' or even 'make test TEST_VERBOSE=1' and a copy of the
+ generated Makefile. Err on the side of verbosity. The more data we
+ have to work with, the faster we can diagnose the problem.
+
+- If you find an undocumented feature, or if a feature has changed/been
+ added which causes a problem, report it. Do not assume it was done
+ deliberately. Even if it was done deliberately, we still want to hear
+ if it caused problems.
+
+
Patching details
- Please use unified diffs. (diff -u)
creating one. Its ok to have an MM_* module with only one method.
- Some shells have very small buffers. This means command lines must
- be as small as possible. 20K is the upper limit for Unixen, and 256
- for VMS. Not sure what Windows and DOS are limited to, probably 1K.
- This limit *includes* any files passed into it. Some modules (such as
- bioperl) generate enourmous commands because of their large number of
- files. If your command is just too long, consider making it an
- ExtUtils::Command::MM function.
+ be as small as possible. If your command is just too long, consider
+ making it an ExtUtils::Command::MM function. If your command might
+ receive many arguments (such as pod2man or pm_to_blib) consider
+ using split_command() to split it into several, shorter calls.
- Most shells quote differently. If you need to put a perl one-liner
in the Makefile, please use oneliner() to generate it.
ActivePerl likely broken if installed in C:\Program Files or other
prefix with a space in the name.
-manifypods target produces command lines too long for some systems
-
Using the MMS utility on VMS causes lots of extra newlines. Unknown
why this is so, might be a bug in MMS. Problem not seen with MMK.
-ActivePerl/Win95 disttest produces "File creation error" from somewhere
-in running Makefile.PL after check_manifest() is run. Don't know why.
+MacOS Classic is likely broken.
See TODO for details.
Consider if VMS->find_perl needs to have pieces put into maybe_command()
-Consider if shell escaping all macro data is a good idea.
-
-Move Win32->init_others() ExtUtils::Command overrides into MM_Any.
+Add a MM_Any->init_others() using ExtUtils::Command.
Figure out and document the 4th arg to ExtUtils::Install::install()
Consider if adding a nativize() routine to replace macify() and
fixpath() is useful.
-Eliminate the above from inside FS::VMS->catfile and catdir. Make into
-MM_VMS wrappers.
+Eliminate eliminate_macros() from inside FS::VMS->catfile and catdir.
+Make into MM_VMS wrappers.
Add "NO_META" to stop autogeneration (and auto overwrite) of META.yml.
Test ExtUtils::Command::MM
-Finish ExtUtils::MakeMaker::Tutorial
\ No newline at end of file
+Finish ExtUtils::MakeMaker::Tutorial
+
+Add 'how to install additional files' to ExtUtils::MakeMaker::FAQ.
+
+Fix NORECUSE bug continuing to set DIR
+
+Give typemap location its own macro.
+
+Merge MM_VMS->tool_xsubpp
$Has_Test_Pod = eval 'use Test::Pod 0.95; 1';
}
-my(@modules);
-
-chdir File::Spec->catdir(File::Spec->updir, 'lib');
-find( sub {
- return if /~$/;
- if( $File::Find::dir =~ /^blib|t$/ ) {
- $File::Find::prune = 1;
- return;
- }
- push @modules, $File::Find::name if /\.pm$/;
- }, 'ExtUtils'
-);
-
+chdir File::Spec->updir;
+my $manifest = File::Spec->catfile('MANIFEST');
+open(MANIFEST, $manifest) or die "Can't open $manifest: $!";
+my @modules = map { m{^lib/(\S+)}; $1 }
+ grep { m{^lib/ExtUtils/\S*\.pm} } <MANIFEST>;
+chomp @modules;
+close MANIFEST;
+
+chdir 'lib';
plan tests => scalar @modules * 2;
foreach my $file (@modules) {
- local @INC = @INC;
- unshift @INC, File::Spec->curdir;
-
- # This piece of insanity brought to you by non-case preserving
- # file systems! We have extutils/command.pm, %INC has
- # ExtUtils/Command.pm
- # Furthermore, 5.8.0 has a bug about require alone in an eval. Thus
- # the extra statement.
- eval q{ require($file); 1 } unless grep { lc $file =~ lc $_ } keys %INC;
+ # 5.8.0 has a bug about require alone in an eval. Thus the extra
+ # statement.
+ eval q{ require($file); 1 };
is( $@, '', "require $file" );
SKIP: {
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+chdir 't';
+
+use Test::More tests => 7;
+BEGIN { use_ok('ExtUtils::MM') }
+
+
+### OS Flavor methods
+
+can_ok( 'MM', 'os_flavor', 'os_flavor_is' );
+
+# Can't really know what the flavors are going to be, so we just
+# make sure it returns something.
+my @flavors = MM->os_flavor;
+ok( @flavors, 'os_flavor() returned something' );
+
+ok( MM->os_flavor_is($flavors[rand @flavors]),
+ 'os_flavor_is() one flavor' );
+ok( MM->os_flavor_is($flavors[rand @flavors], 'BogusOS'),
+ ' many flavors' );
+ok( !MM->os_flavor_is('BogusOS'), ' wrong flavor' );
+ok( !MM->os_flavor_is(), ' no flavor' );
+
BEGIN {
if ($^O =~ /cygwin/i) {
- plan tests => 13;
+ plan tests => 11;
} else {
plan skip_all => "This is not cygwin";
}
like( $res, qr/pure_all.*foo.*foo.1/s, '... should add MAN3PODS targets' );
-SKIP: {
- skip "Only relevent in the core", 2 unless $ENV{PERL_CORE};
- $MM->{PERL_SRC} = File::Spec->updir;
- $MM->{MAN1PODS} = { bar => 1 };
- my $out = tie *STDOUT, 'FakeOut';
- $res = $MM->manifypods();
- is( $$out, '', '... should not warn if PERL_SRC provided' );
- like( $res, qr/bar \\\n\t1 \\\n\tfoo/,
- '... should join MAN1PODS and MAN3PODS');
-}
-
-
# init_linker
{
my $libperl = $Config{libperl} || 'libperl.a';
use File::Find;
use File::Spec;
+# 'make disttest' sets a bunch of environment variables which interfere
+# with our testing.
+delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
+
my $perl = which_perl();
my $Is_VMS = $^O eq 'VMS';
ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
-my @mpl_out = `$perl Makefile.PL PREFIX=dummy-install`;
+my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=dummy-install"});
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
diag(@mpl_out);
{
# Supress 'make manifest' noise
local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0;
- my $manifest_out = `$make manifest`;
+ my $manifest_out = run("$make manifest");
ok( -e 'MANIFEST', 'make manifest created a MANIFEST' );
ok( -s 'MANIFEST', ' its not empty' );
}
END { unlink 'MANIFEST'; }
-`$make ppd`;
-is( $?, 0, ' exited normally' );
+my $ppd_out = run("$make ppd");
+is( $?, 0, ' exited normally' ) || diag $ppd_out;
ok( open(PPD, 'Big-Dummy.ppd'), ' .ppd file generated' );
my $ppd_html;
{ local $/; $ppd_html = <PPD> }
END { unlink 'Big-Dummy.ppd' }
-my $test_out = `$make test`;
+my $test_out = run("$make test");
like( $test_out, qr/All tests successful/, 'make test' );
is( $?, 0, ' exited normally' );
# Test 'make test TEST_VERBOSE=1'
my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1);
-$test_out = `$make_test_verbose`;
+$test_out = run("$make_test_verbose");
like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' );
like( $test_out, qr/All tests successful/, ' successful' );
is( $?, 0, ' exited normally' );
-my $install_out = `$make install`;
+my $install_out = run("$make install");
is( $?, 0, 'install' ) || diag $install_out;
like( $install_out, qr/^Installing /m );
like( $install_out, qr/^Writing /m );
SKIP: {
skip "VMS install targets do not preserve PREFIX", 8 if $Is_VMS;
- $install_out = `$make install PREFIX=elsewhere`;
+ $install_out = run("$make install PREFIX=elsewhere");
is( $?, 0, 'install with PREFIX override' ) || diag $install_out;
like( $install_out, qr/^Installing /m );
like( $install_out, qr/^Writing /m );
}
-my $dist_test_out = `$make disttest`;
+my $dist_test_out = run("$make disttest");
is( $?, 0, 'disttest' ) || diag($dist_test_out);
# Test META.yml generation
# Make sure init_dirscan doesn't go into the distdir
-@mpl_out = `$perl Makefile.PL "PREFIX=dummy-install"`;
+@mpl_out = run(qq{$perl Makefile.PL "PREFIX=dummy-install"});
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
diag(@mpl_out);
open(SAVERR, ">&STDERR") or die $!;
open(STDERR, ">".File::Spec->devnull) or die $!;
-my $realclean_out = `$make realclean`;
+my $realclean_out = run("$make realclean");
is( $?, 0, 'realclean' ) || diag($realclean_out);
open(STDERR, ">&SAVERR") or die $!;
$VERSION = 0.02;
@EXPORT = qw(which_perl perl_lib makefile_name makefile_backup
- make make_run make_macro calibrate_mtime
+ make make_run run make_macro calibrate_mtime
);
my $Is_VMS = $^O eq 'VMS';
my $mtime = calibrate_mtime;
+ my $out = run($cmd);
+
=head1 DESCRIPTION
A consolidation of little utility functions used through out the
return $mtime;
}
+=item B<run>
+
+ my $out = run($command);
+ my @out = run($command);
+
+Runs the given $command as an external program returning at least STDOUT
+as $out. If possible it will return STDOUT and STDERR combined as you
+would expect to see on a screen.
+
+=cut
+
+sub run {
+ my $cmd = shift;
+
+ require ExtUtils::MM;
+
+ # Unix can handle 2>&1 and OS/2 from 5.005_54 up.
+ # This makes our failure diagnostics nicer to read.
+ if( MM->os_flavor_is('Unix') or
+ ($] > 5.00554 and MM->os_flavor_is('OS/2'))
+ ) {
+ return `$cmd 2>&1`;
+ }
+ else {
+ return `$cmd`;
+ }
+}
+
=back
=head1 AUTHOR