lib/ExtUtils/MM_Win95.pm MakeMaker methods for Win95
lib/ExtUtils/MY.pm MakeMaker user override class
lib/ExtUtils/Packlist.pm Manipulates .packlist files
+lib/ExtUtils/t/00setup_dummy.t Setup MakeMaker test module
+lib/ExtUtils/t/backwards.t Check MakeMaker's backwards compatibility
lib/ExtUtils/t/basic.t See if MakeMaker can build a module
-lib/ExtUtils/t/Big-Fat-Dummy/Liar/lib/Big/Fat/Liar.pm MakeMaker dummy module
-lib/ExtUtils/t/Big-Fat-Dummy/Liar/Makefile.PL MakeMaker dummy module
-lib/ExtUtils/t/Big-Fat-Dummy/lib/Big/Fat/Dummy.pm MakeMaker dummy module
-lib/ExtUtils/t/Big-Fat-Dummy/Makefile.PL MakeMaker dummy module
lib/ExtUtils/t/Command.t See if ExtUtils::Command works (Win32 only)
lib/ExtUtils/t/Constant.t See if ExtUtils::Constant works
lib/ExtUtils/t/Embed.t See if ExtUtils::Embed and embedding works
lib/ExtUtils/t/MM_Win32.t See if ExtUtils::MM_Win32 works
lib/ExtUtils/t/Packlist.t See if Packlist works
lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX
-lib/ExtUtils/t/Problem-Module/Makefile.PL MakeMaker dummy module
-lib/ExtUtils/t/Problem-Module/subdir/Makefile.PL MakeMaker dummy module
lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems
lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works
+lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works
+lib/ExtUtils/t/zz_cleanup_dummy.t Cleanup MakeMaker test module
lib/ExtUtils/testlib.pm Fixes up @INC to use just-built extension
lib/ExtUtils/typemap Extension interface types
lib/ExtUtils/xsubpp External subroutine preprocessor
+5.91_02 Wed Apr 24 01:29:56 EDT 2002
+ - Adjustments to tests for inclusion in the core.
+
+5.91_01 Wed Apr 24 00:11:06 EDT 2002
+ [[ API Changes ]]
+ * A failing Makefile.PL in a subdir will now kill the whole
+ makefile making process.
+ * "make install PREFIX=something" will no longer work. Sorry.
+ - Now supporting the usevendorprefix %Config setting
+ - Tests now guaranteed to run in alphabetical order.
+ - Allowing $VERSION = 0.
+
+ [[ Bug Fixes ]]
+ - Missing prerequisite warning malformatted.
+ - INSTALL*MAN*DIR and INST_MAN*DIR weren't allowed on the command
+ line.
+ * For years now skipcheck() has been returning a different
+ value than what was documented.
+ - Partially reversing Ken's "speed up ExtUtils::Manifest" patch
+ from 5.51_01 so MANIFEST overrides MANIFEST.SKIP.
+ * Fixed PREFIXification so it works on Win32.
+ * Fixed PREFIXification so it works on VMS.
+ - Fixed INSTALLMAN*DIR=none on VMS.
+ * NetWare fixes (bleadperl@16076)
+ - Craig Berry fixed some macro corruption on VMS.
+ - Systems configured to not have man pages now honored thanks to
+ Paul Green
+ - Hack to allow 5.6.X versions of ExtUtils::Embed use MY implicitly.
+ - Moved use of glob out of MM_Unix so MacPerl could build
+
+ [[ Test Changes ]]
+ - Shortening directory levels to accomodate old VMS's
+ - was using a slightly wrong prefix for the prefix tests
+
+ [[ Doc Fixes ]]
+ - Documenting VERBINST
+
5.90_01 Thu Apr 11 01:11:54 EDT 2002
[[ API Changes ]]
* Implementation of the new PREFIX logic.
Runs the tests on @ARGV via Test::Harness passing through the $verbose
flag. Any @test_libs will be unshifted onto the test's @INC.
+@test_libs are run in alphabetical order.
+
=cut
sub test_harness {
local @INC = @INC;
unshift @INC, map { File::Spec->rel2abs($_) } @_;
- Test::Harness::runtests(@ARGV);
+ Test::Harness::runtests(sort { lc $a cmp lc $b } @ARGV);
}
=back
}
$Is{UWIN} = 1 if $^O eq 'uwin';
$Is{Cygwin} = 1 if $^O eq 'cygwin';
-$Is{NW5} = 1 if $Config{'osname'} eq 'NetWare'; # intentional
+$Is{NW5} = 1 if $Config{osname} eq 'NetWare'; # intentional
$Is{BeOS} = 1 if $^O =~ /beos/i; # XXX should this be that loose?
$Is{DOS} = 1 if $^O eq 'dos';
my $base = $self->SUPER::cflags($libperl);
foreach (split /\n/, $base) {
- / *= */ and $self->{$`} = $';
+ /^(\S*)\s*=\s*(\S*)$/ and $self->{$1} = $2;
};
$self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true');
use Config;
use File::Basename;
-#require Exporter;
-
-#use ExtUtils::MakeMaker;
-#Exporter::import('ExtUtils::MakeMaker',
-# qw( $Verbose &neatvalue));
-
use vars qw(@ISA $VERSION);
$VERSION = '2.01_01';
use ExtUtils::MakeMaker qw( &neatvalue );
$ENV{EMXSHELL} = 'sh'; # to run `commands`
-#unshift @MM::ISA, 'ExtUtils::MM_NW5';
-$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;
+$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;
$PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i;
-
sub init_others
{
my ($self) = @_;
Initializes lots of constants and .SUFFIXES and .PHONY
=cut
-# NetWare override
+
sub const_cccmd {
my($self,$libperl)=@_;
return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
return '' unless $self->needs_linking();
- return $self->{CONST_CCCMD} =
+ return $self->{CONST_CCCMD} =
q{CCCMD = $(CC) $(CCFLAGS) $(INC) $(OPTIMIZE) \\
$(PERLTYPE) $(MPOLLUTE) -o $@ \\
- -DVERSION=\"$(VERSION)\" -DXS_VERSION=\"$(XS_VERSION)\"};
+ -DVERSION="$(VERSION)" -DXS_VERSION="$(XS_VERSION)"};
}
sub constants {
PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
PERL_INC PERL FULLPERL LIBPTH BASE_IMPORT PERLRUN
- FULLPERLRUN PERLRUNINST FULL_AR PERL_CORE FULLPERLRUNINST
- NLM_VERSION MPKTOOL TOOLPATH
-
+ FULLPERLRUN PERLRUNINST FULLPERLRUNINST
+ FULL_AR PERL_CORE NLM_VERSION MPKTOOL TOOLPATH
+
/ ) {
next unless defined $self->{$tmp};
push @m, "$tmp = $self->{$tmp}\n";
}
- (my $boot = $self->{'NAME'}) =~ s/:/_/g;
- $self->{'BOOT_SYMBOL'}=$boot;
- push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n";
-
- # If the final binary name is greater than 8 chars,
- # truncate it here and rename it after creation
- # otherwise, Watcom Linker fails
-
- if(length($self->{'BASEEXT'}) > 8) {
- $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8);
- push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n";
- }
-
+ (my $boot = $self->{'NAME'}) =~ s/:/_/g;
+ $self->{'BOOT_SYMBOL'}=$boot;
+ push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n";
+
+ # If the final binary name is greater than 8 chars,
+ # truncate it here and rename it after creation
+ # otherwise, Watcom Linker fails
+ if(length($self->{'BASEEXT'}) > 8) {
+ $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8);
+ push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n";
+ }
+
push @m, qq{
VERSION_MACRO = VERSION
DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
};
- # Get the include path and replace the spaces with ;
- # Copy this to makefile as INCLUDE = d:\...;d:\;
- (my $inc = $Config{'incpath'}) =~ s/([ ]*)-I/;/g;
-
-=head
- # Commented by Ananth since the below code was not adding the DBI path
- # and compilation was failing due to non-availability of the correct path. 3 Jan 2002
-
- # Get the additional include path and append to INCLUDE, keep it in
- # INC will give problems during compilation, hence reset it after getting
- # the value
-## (my $add_inc = $self->{'INC'}) =~ s/ -I/;/g;
- $self->{'INC'} = '';
- push @m, qq{
-INCLUDE = $inc;$add_inc;
-};
-=cut
+ # Get the include path and replace the spaces with ;
+ # Copy this to makefile as INCLUDE = d:\...;d:\;
+ (my $inc = $Config{'incpath'}) =~ s/([ ]*)-I/;/g;
-push @m, qq{
+ push @m, qq{
INCLUDE = $inc;
};
- # Set the path to CodeWarrior binaries which might not have been set in
- # any other place
- push @m, qq{
+
+ # Set the path to CodeWarrior binaries which might not have been set in
+ # any other place
+ push @m, qq{
PATH = \$(PATH);\$(TOOLPATH)
};
join('',@m);
}
+
=item dynamic_lib (o)
Defines how to produce the *.so (or equivalent) files.
=cut
sub dynamic_lib {
- my($self, %attribs) = @_;
+ my($self, %attribs) = @_;
return '' unless $self->needs_linking(); #might be because of a subdir
return '' unless $self->has_link_code;
my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
my($ldfrom) = '$(LDFROM)';
my(@m);
- (my $boot = $self->{NAME}) =~ s/:/_/g;
- my ($mpk);
+ (my $boot = $self->{NAME}) =~ s/:/_/g;
+
push(@m,'
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP)
');
-# push(@m,
-# q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
-# .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
-
- # Create xdc data for an MT safe NLM in case of mpk build
-# if ( scalar(keys %XS) == 0 ) { return; }
- push(@m,
- q{ @echo Export boot_$(BOOT_SYMBOL) > $(BASEEXT).def
-});
- push(@m,
- q{ @echo $(BASE_IMPORT) >> $(BASEEXT).def
-});
- push(@m,
- q{ @echo Import @$(PERL_INC)\perl.imp >> $(BASEEXT).def
-});
-
- if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) {
- $mpk=1;
- push @m, ' $(MPKTOOL) $(XDCFLAGS) $(BASEEXT).xdc
-';
- push @m, ' @echo xdcdata $(BASEEXT).xdc >> $(BASEEXT).def
-';
- } else {
- $mpk=0;
- }
-
- push(@m,
- q{ $(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) }
- );
-
- push(@m,
- q{ -desc "Perl 5.7.3 Extension ($(BASEEXT)) XS_VERSION: $(XS_VERSION)" -nlmversion $(NLM_VERSION) }
- );
-
- # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc
- if($self->{NLM_SHORT_NAME}) {
- # In case of nlms with names exceeding 8 chars, build nlm in the
- # current dir, rename and move to auto\lib. If we create in auto\lib
- # in the first place, we can't rename afterwards.
- push(@m,
- q{ -o $(NLM_SHORT_NAME).$(DLEXT)}
- );
- } else {
- push(@m,
- q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)}
- );
- }
-
-
-# if ($mpk) {
-# push (@m,
-# q{ Option XDCDATA=$(BASEEXT).xdc }
-# );
-# }
-
- # Add additional lib files if any (SDBM_File)
- if($self->{MYEXTLIB}) {
- push(@m,
- q{ $(MYEXTLIB) }
- );
- }
-
-#For now lets comment all the Watcom lib calls
-#q{ LibPath $(LIBPTH) Library plib3s.lib Library math3s.lib Library clib3s.lib Library emu387.lib Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib}
-
-
- push(@m,
- q{ $(PERL_INC)\Main.lib}
- .q{ -commandfile $(BASEEXT).def }
- );
-
- # If it is having a short name, rename it
- if($self->{NLM_SHORT_NAME}) {
- push @m, '
+
+ my ($mpk);
+ # Create xdc data for an MT safe NLM in case of mpk build
+ push(@m,
+ q{@echo Export boot_$(BOOT_SYMBOL) > $(BASEEXT).def
+ });
+ push(@m,
+ q{@echo $(BASE_IMPORT) >> $(BASEEXT).def
+ });
+ push(@m,
+ q{@echo Import @$(PERL_INC)\perl.imp >> $(BASEEXT).def
+ });
+
+
+ if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) {
+ $mpk=1;
+ push @m, qq{\t\$(MPKTOOL) \$(XDCFLAGS) \$(BASEEXT).xdc\n},
+ qq{\t\@echo xdcdata $(BASEEXT).xdc >> $(BASEEXT).def\n};
+ } else {
+ $mpk=0;
+ }
+
+ push(@m,
+ q{$(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) }
+ );
+
+ push(@m,
+ qq{\t-desc "Perl 5.7.3 Extension (\$(BASEEXT)) XS_VERSION: \$(XS_VERSION)" -nlmversion \$(NLM_VERSION) }
+ );
+
+ # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc
+ if($self->{NLM_SHORT_NAME}) {
+ # In case of nlms with names exceeding 8 chars, build nlm in the
+ # current dir, rename and move to auto\lib. If we create in auto\lib
+ # in the first place, we can't rename afterwards.
+ push(@m,
+ q{ -o $(NLM_SHORT_NAME).$(DLEXT)}
+ );
+ } else {
+ push(@m,
+ q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)}
+ );
+ }
+
+ # Add additional lib files if any (SDBM_File)
+ if($self->{MYEXTLIB}) {
+ push(@m,
+ q{ $(MYEXTLIB) }
+ );
+ }
+
+ push(@m,
+ q{ $(PERL_INC)\Main.lib}.
+ q{ -commandfile $(BASEEXT).def }
+ );
+
+ # If it is having a short name, rename it
+ if($self->{NLM_SHORT_NAME}) {
+ push @m, '
if exist $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)';
- push @m, '
+ push @m, '
rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT)';
- push @m, '
+ push @m, '
move $(BASEEXT).$(DLEXT) $(INST_AUTODIR)';
- }
+ }
push @m, '
$(CHMOD) 755 $@
';
push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
-# } else {
-# push @m, '
-# @$(NOOP)
-#';
-# }
join('',@m);
}
=cut
+
use strict;
use Exporter ();
-use Carp ();
+use Carp;
use Config;
use File::Basename qw(basename dirname fileparse);
use File::Spec;
use DirHandle;
use strict;
use vars qw($VERSION @ISA
- $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS $Is_NetWare
+ $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS
$Verbose %pm %static $Xsubpp_Version
%Config_Override
);
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.30_01';
+$VERSION = '1.31_01';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
$Is_OS2 = $^O eq 'os2';
$Is_Mac = $^O eq 'MacOS';
-$Is_Win32 = $^O eq 'MSWin32';
+$Is_Win32 = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare';
$Is_Dos = $^O eq 'dos';
$Is_VOS = $^O eq 'vos';
-+$Is_NetWare = $Config{'osname'} eq 'NetWare'; # Config{'osname'} intentional
-if ($Is_NetWare) {
- $^O = 'NetWare';
- $Is_Win32 = 0;
-}
-
-if ($Is_VMS = $^O eq 'VMS') {
- require VMS::Filespec;
- import VMS::Filespec qw( &vmsify );
-}
+$Is_VMS = $^O eq 'VMS';
=head1 NAME
0; # false and not empty
}
+=item find_tests
+
+ my $test = $mm->find_tests;
+
+Returns a string suitable for feeding to the shell to return all
+tests in t/*.t.
+
+=cut
+
+sub find_tests {
+ my($self) = shift;
+ return 't/*.t';
+}
+
=back
=head2 Methods to actually produce chunks of text for the Makefile
for my $file (@files) {
local(*FIXIN);
local(*FIXOUT);
- open(FIXIN, $file) or Carp::croak "Can't process '$file': $!";
+ open(FIXIN, $file) or croak "Can't process '$file': $!";
local $/ = "\n";
chomp(my $line = <FIXIN>);
next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
if ($self->{PERL_SRC}){
$self->{PERL_LIB} ||= File::Spec->catdir("$self->{PERL_SRC}","lib");
$self->{PERL_ARCHLIB} = $self->{PERL_LIB};
- $self->{PERL_INC} = ($Is_Win32 || $Is_NetWare) ? File::Spec->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC};
+ $self->{PERL_INC} = ($Is_Win32) ? File::Spec->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC};
# catch a situation that has occurred a few times in the past:
unless (
$Is_Mac
or
$Is_Win32
- or
- $Is_NetWare
){
warn qq{
You cannot build extensions below the perl source tree after executing
# Determine VERSION and VERSION_FROM
($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
if ($self->{VERSION_FROM}){
- $self->{VERSION} = $self->parse_version($self->{VERSION_FROM}) or
- Carp::carp "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n"
+ $self->{VERSION} = $self->parse_version($self->{VERSION_FROM});
+ if( $self->{VERSION} eq 'undef' ) {
+ carp "WARNING: Setting VERSION via file ".
+ "'$self->{VERSION_FROM}' failed\n";
+ }
}
# strip blanks
$self->{VERSION} =~ s/^\s+//;
$self->{VERSION} =~ s/\s+$//;
}
-
- $self->{VERSION} ||= "0.10";
($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
$self->{DISTVNAME} = "$self->{DISTNAME}-$self->{VERSION}";
sub init_INSTALL {
my($self) = shift;
- # The user who requests an installation directory explicitly
- # should not have to tell us an architecture installation directory
- # as well. We look if a directory exists that is named after the
- # architecture. If not we take it as a sign that it should be the
- # same as the requested installation directory. Otherwise we take
- # the found one.
- # We do the same thing twice: for privlib/archlib and for sitelib/sitearch
- for my $libpair ({l=>"privlib", a=>"archlib"},
- {l=>"sitelib", a=>"sitearch"})
- {
- my $lib = "install$libpair->{l}";
- my $Lib = uc $lib;
- my $Arch = uc "install$libpair->{a}";
- if( $self->{$Lib} && ! $self->{$Arch} ){
- my($ilib) = $Config{$lib};
- $ilib = VMS::Filespec::unixify($ilib) if $Is_VMS;
-
- $self->prefixify($Arch,$ilib,$self->{$Lib});
-
- unless (-d $self->{$Arch}) {
- print STDOUT "Directory $self->{$Arch} not found\n"
- if $Verbose;
- $self->{$Arch} = $self->{$Lib};
- }
- print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose;
- }
- }
+ $self->init_lib2arch;
# There are no Config.pm defaults for these.
$Config_Override{installsiteman1dir} =
- "$Config{siteprefixexp}/man/man\$(MAN1EXT)";
+ File::Spec->catdir($Config{siteprefixexp}, 'man', 'man$(MAN1EXT)');
$Config_Override{installsiteman3dir} =
- "$Config{siteprefixexp}/man/man\$(MAN3EXT)";
- $Config_Override{installvendorman1dir} =
- "$Config{vendorprefixexp}/man/man\$(MAN1EXT)";
- $Config_Override{installvendorman3dir} =
- "$Config{vendorprefixexp}/man/man\$(MAN3EXT)";
-
- my $iprefix = $Config{installprefixexp} || '';
- my $vprefix = $Config{vendorprefixexp} || $iprefix;
+ File::Spec->catdir($Config{siteprefixexp}, 'man', 'man$(MAN3EXT)');
+
+ if( $Config{usevendorprefix} ) {
+ $Config_Override{installvendorman1dir} =
+ File::Spec->catdir($Config{vendorprefixexp}, 'man', 'man$(MAN1EXT)');
+ $Config_Override{installvendorman3dir} =
+ File::Spec->catdir($Config{vendorprefixexp}, 'man', 'man$(MAN3EXT)');
+ }
+ else {
+ $Config_Override{installvendorman1dir} = '';
+ $Config_Override{installvendorman3dir} = '';
+ }
+
+ my $iprefix = $Config{installprefixexp} || $Config{installprefix} ||
+ $Config{prefixexp} || $Config{prefix} || '';
+ my $vprefix = $Config{usevendorprefix} ? $Config{vendorprefixexp} : '';
my $sprefix = $Config{siteprefixexp} || '';
my $u_prefix = $self->{PREFIX} || '';
$manstyle = $self->{LIBSTYLE} eq 'lib/perl5' ? 'lib/perl5' : '';
}
+ # Some systems, like VOS, set installman*dir to '' if they can't
+ # read man pages.
+ for my $num (1, 3) {
+ $self->{'INSTALLMAN'.$num.'DIR'} ||= 'none'
+ unless $Config{'installman'.$num.'dir'};
+ }
+
my %bin_layouts =
(
bin => { s => $iprefix,
- r => '$(PREFIX)',
+ r => $u_prefix,
d => 'bin' },
vendorbin => { s => $vprefix,
- r => '$(VENDORPREFIX)',
+ r => $u_vprefix,
d => 'bin' },
sitebin => { s => $sprefix,
- r => '$(SITEPREFIX)',
+ r => $u_sprefix,
d => 'bin' },
script => { s => $iprefix,
- r => '$(PREFIX)',
+ r => $u_prefix,
d => 'bin' },
);
my %man_layouts =
(
man1dir => { s => $iprefix,
- r => '$(PREFIX)',
+ r => $u_prefix,
d => 'man/man$(MAN1EXT)',
style => $manstyle, },
siteman1dir => { s => $sprefix,
- r => '$(SITEPREFIX)',
+ r => $u_sprefix,
d => 'man/man$(MAN1EXT)',
style => $manstyle, },
vendorman1dir => { s => $vprefix,
- r => '$(VENDORPREFIX)',
+ r => $u_vprefix,
d => 'man/man$(MAN1EXT)',
style => $manstyle, },
man3dir => { s => $iprefix,
- r => '$(PREFIX)',
+ r => $u_prefix,
d => 'man/man$(MAN3EXT)',
style => $manstyle, },
siteman3dir => { s => $sprefix,
- r => '$(SITEPREFIX)',
+ r => $u_sprefix,
d => 'man/man$(MAN3EXT)',
style => $manstyle, },
vendorman3dir => { s => $vprefix,
- r => '$(VENDORPREFIX)',
+ r => $u_vprefix,
d => 'man/man$(MAN3EXT)',
style => $manstyle, },
);
my %lib_layouts =
(
privlib => { s => $iprefix,
- r => '$(PREFIX)',
+ r => $u_prefix,
d => '',
style => $libstyle, },
vendorlib => { s => $vprefix,
- r => '$(VENDORPREFIX)',
+ r => $u_vprefix,
d => '',
style => $libstyle, },
sitelib => { s => $sprefix,
- r => '$(SITEPREFIX)',
+ r => $u_sprefix,
d => 'site_perl',
style => $libstyle, },
archlib => { s => $iprefix,
- r => '$(PREFIX)',
+ r => $u_prefix,
d => "$version/$arch",
style => $libstyle },
vendorarch => { s => $vprefix,
- r => '$(VENDORPREFIX)',
+ r => $u_vprefix,
d => "$version/$arch",
style => $libstyle },
sitearch => { s => $sprefix,
- r => '$(SITEPREFIX)',
+ r => $u_sprefix,
d => "site_perl/$version/$arch",
style => $libstyle },
);
if $Verbose >= 2;
}
- $self->{PREFIX} ||= $iprefix;
-
return 1;
}
+=begin _protected
+
+=item init_lib2arch
+
+ $mm->init_lib2arch
+
+=end _protected
+
+=cut
+
+sub init_lib2arch {
+ my($self) = shift;
+
+ # The user who requests an installation directory explicitly
+ # should not have to tell us an architecture installation directory
+ # as well. We look if a directory exists that is named after the
+ # architecture. If not we take it as a sign that it should be the
+ # same as the requested installation directory. Otherwise we take
+ # the found one.
+ for my $libpair ({l=>"privlib", a=>"archlib"},
+ {l=>"sitelib", a=>"sitearch"},
+ {l=>"vendorlib", a=>"vendorarch"},
+ )
+ {
+ my $lib = "install$libpair->{l}";
+ my $Lib = uc $lib;
+ my $Arch = uc "install$libpair->{a}";
+ if( $self->{$Lib} && ! $self->{$Arch} ){
+ my($ilib) = $Config{$lib};
+
+ $self->prefixify($Arch,$ilib,$self->{$Lib});
+
+ unless (-d $self->{$Arch}) {
+ print STDOUT "Directory $self->{$Arch} not found\n"
+ if $Verbose;
+ $self->{$Arch} = $self->{$Lib};
+ }
+ print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose;
+ }
+ }
+}
+
=item init_PERL
push(@m, qq{
EXE_FILES = @{$self->{EXE_FILES}}
-} . (($Is_Win32 || $Is_NetWare)
+} . ($Is_Win32
? q{FIXIN = pl2bat.bat
} : q{FIXIN = $(PERLRUN) "-MExtUtils::MY" \
-e "MY->fixin(shift)"
my($self) = shift;
my($child,$caller);
$caller = (caller(0))[3];
- Carp::confess("Needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/;
+ confess("Needs_linking called too early") if
+ $caller =~ /^ExtUtils::MakeMaker::/;
return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
if ($self->has_link_code or $self->{MAKEAPERL}){
$self->{NEEDS_LINKING} = 1;
no warnings;
$result = eval($eval);
warn "Could not eval '$eval' in $parsefile: $@" if $@;
- $result = "undef" unless defined $result;
last;
}
close FH;
+
+ $result = "undef" unless defined $result;
return $result;
}
if ($self->{ABSTRACT_FROM}){
$self->{ABSTRACT} = $self->parse_abstract($self->{ABSTRACT_FROM}) or
- Carp::carp "WARNING: Setting ABSTRACT via file ".
- "'$self->{ABSTRACT_FROM}' failed\n";
+ carp "WARNING: Setting ABSTRACT via file ".
+ "'$self->{ABSTRACT_FROM}' failed\n";
}
my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3];
my($self,$var,$sprefix,$rprefix,$default) = @_;
my $path = $self->{uc $var} ||
- $Config_Override{lc $var} || $Config{lc $var};
-
- print STDERR " prefixify $var=$path\n" if $Verbose >= 2;
- print STDERR " from $sprefix to $rprefix\n"
- if $Verbose >= 2;
+ $Config_Override{lc $var} || $Config{lc $var} || '';
- $path = VMS::Filespec::unixpath($path) if $Is_VMS;
+ print STDERR " prefixify $var => $path\n" if $Verbose >= 2;
+ print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2;
- unless( $path =~ s,^\Q$sprefix\E(?=/|\z),$rprefix,s ) {
+ unless( $path =~ s{^\Q$sprefix\E\b}{$rprefix}s ) {
print STDERR " cannot prefix, using default.\n" if $Verbose >= 2;
print STDERR " no default!\n" if !$default && $Verbose >= 2;
my($self, %attribs) = @_;
my $tests = $attribs{TESTS} || '';
if (!$tests && -d 't') {
- $tests = $Is_Win32 ? join(' ', <t\\*.t>) : 't/*.t';
+ $tests = $self->find_tests;
}
# note: 'test.pl' name is also hardcoded in init_dirscan()
my(@m);
PERL_LIB PERL_ARCHLIB
PERL_INC PERL_SRC FULLEXT ] ) {
next unless defined $self->{$macro};
+ next if $macro =~ /MAN/ && $self->{$macro} eq 'none';
$self->{$macro} = $self->fixpath($self->{$macro},1);
}
$self->{PERL_VMS} = File::Spec->catdir($self->{PERL_SRC},q(VMS))
pm_to_blib : pm_to_blib.ts
$(NOECHO) $(NOOP)
+};
+
+ push @m, <<'MAKE_FRAG',
# As always, keep under DCL's 255-char limit
pm_to_blib.ts : $(TO_INST_PM)
- $(NOECHO) $(PERL) -e "print '},shift(@files),q{ },shift(@files),q{'" >.MM_tmp
-};
+ $(NOECHO) $(RM_F) .MM_tmp
+MAKE_FRAG
$line = ''; # avoid uninitialized var warning
while ($from = shift(@files),$to = shift(@files)) {
join('',@m);
}
+=item find_tests (override)
+
+=cut
+
+sub find_tests {
+ my $self = shift;
+ return -d 't' ? 't/*.t' : '';
+}
+
=item test (override)
Use VMS commands for handling subdirectories.
sub test {
my($self, %attribs) = @_;
- my($tests) = $attribs{TESTS} || ( -d 't' ? 't/*.t' : '');
+ my($tests) = $attribs{TESTS} || $self->find_tests;
my(@m);
push @m,"
TEST_VERBOSE = 0
=cut
sub nicetext {
-
my($self,$text) = @_;
+ return $text if $text =~ m/^\w+\s*=/; # leave macro defs alone
$text =~ s/([^\s:])(:+\s)/$1 $2/gs;
$text;
}
-1;
+=item prefixify (override)
+
+prefixifying on VMS is simple. Each should simply be:
+
+ perl_root:[some.dir]
+
+which can just be converted to:
+
+ volume:[your.prefix.some.dir]
+
+otherwise you get the default layout.
+
+In effect, your search prefix is ignored and $Config{vms_prefix} is
+used instead.
+
+=cut
+
+sub prefixify {
+ my($self, $var, $sprefix, $rprefix, $default) = @_;
+ $default = VMS::Filespec::vmsify($default)
+ unless $default =~ /\[.*\]/;
+
+ (my $var_no_install = $var) =~ s/^install//;
+ my $path = $self->{uc $var} || $Config{lc $var} ||
+ $Config{lc $var_no_install};
+
+ if( !$path ) {
+ print STDERR " no Config found for $var.\n" if $Verbose >= 2;
+ $path = $self->_prefixify_default($rprefix, $default);
+ }
+ elsif( $sprefix eq $rprefix ) {
+ print STDERR " no new prefix.\n" if $Verbose >= 2;
+ }
+ else {
+
+ print STDERR " prefixify $var => $path\n" if $Verbose >= 2;
+ print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2;
+
+ my($path_vol, $path_dirs) = File::Spec->splitpath( $path );
+ if( $path_vol eq $Config{vms_prefix}.':' ) {
+ print STDERR " $Config{vms_prefix}: seen\n" if $Verbose >= 2;
+
+ $path_dirs =~ s{^\[}{\[.} unless $path_dirs =~ m{^\[\.};
+ $path = $self->_catprefix($rprefix, $path_dirs);
+ }
+ else {
+ $path = $self->_prefixify_default($rprefix, $default);
+ }
+ }
+
+ print " now $path\n" if $Verbose >= 2;
+ return $self->{uc $var} = $path;
+}
+
+
+sub _prefixify_default {
+ my($self, $rprefix, $default) = @_;
+
+ print STDERR " cannot prefix, using default.\n" if $Verbose >= 2;
+
+ if( !$default ) {
+ print STDERR "No default!\n" if $Verbose >= 1;
+ return;
+ }
+ if( !$rprefix ) {
+ print STDERR "No replacement prefix!\n" if $Verbose >= 1;
+ return '';
+ }
+
+ return $self->_catprefix($rprefix, $default);
+}
+
+sub _catprefix {
+ my($self, $rprefix, $default) = @_;
+
+ my($rvol, $rdirs) = File::Spec->splitpath($rprefix);
+ if( $rvol ) {
+ return File::Spec->catpath($rvol,
+ File::Spec->catdir($rdirs, $default),
+ ''
+ )
+ }
+ else {
+ return File::Spec->catdir($rdirs, $default);
+ }
+}
+
=back
=cut
-__END__
+1;
0; # false and not empty
}
+
+# This code was taken out of MM_Unix to avoid loading File::Glob
+# unless necessary.
+sub find_tests {
+ return join(' ', <t\\*.t>);
+}
+
+
sub init_others
{
my ($self) = @_;
return "$self->{BASEEXT}.def";
}
+
=item perl_script
Takes one argument, a file name, and returns the file name, if the
package ExtUtils::MakeMaker;
-$VERSION = "5.90_01";
+$VERSION = "5.91_02";
$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.37 $, 10)) =~ s/\s+$//;
+($Revision = substr(q$Revision: 1.44 $, 10)) =~ s/\s+$//;
require Exporter;
use Config;
require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker
# will give them MM.
+require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect
+ # loading ExtUtils::MakeMaker will give them MY.
+ # This will go when Embed is it's own CPAN module.
+
sub WriteMakefile {
Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
# } else {
# warn "WARNING from evaluation of $dir/Makefile.PL: $@";
# }
- warn "WARNING from evaluation of $dir/Makefile.PL: $@";
+ die "ERROR from evaluation of $dir/Makefile.PL: $@";
}
}
EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
FULLPERL FULLPERLRUN FULLPERLRUNINST
FUNCLIST H IMPORTS
- INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB
+ INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR
INSTALLDIRS
PREFIX SITEPREFIX VENDORPREFIX
INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
- INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN INSTALLSCRIPT
+ INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN
+ INSTALLMAN1DIR INSTALLMAN3DIR
+ INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR
+ INSTALLVENDORMAN1DIR INSTALLVENDORMAN3DIR
+ INSTALLSCRIPT
PERL_LIB PERL_ARCHLIB
SITELIBEXP SITEARCHEXP
INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS
unless $self->{PREREQ_FATAL};
$unsatisfied{$prereq} = 'not installed';
} elsif ($pr_version < $self->{PREREQ_PM}->{$prereq} ){
- warn "Warning: prerequisite %s %s not found. We have %s.\n",
+ warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n",
$prereq, $self->{PREREQ_PM}{$prereq},
($pr_version || 'unknown version')
unless $self->{PREREQ_FATAL};
sub flush {
my $self = shift;
my($chunk);
-# use FileHandle ();
-# my $fh = new FileHandle;
local *FH;
print STDOUT "Writing $self->{MAKEFILE} for $self->{NAME}\n";
unlink($self->{MAKEFILE}, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : '');
-# $fh->open(">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!";
open(FH,">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!";
for $chunk (@{$self->{RESULT}}) {
-# print $fh "$chunk\n";
print FH "$chunk\n";
}
-# $fh->close;
close FH;
my($finalname) = $self->{MAKEFILE};
rename("MakeMaker.tmp", $finalname);
MakeMaker also checks for any files matching glob("t/*.t"). It will
add commands to the test target of the generated Makefile that execute
-all matching files via the L<Test::Harness> module with the C<-I>
-switches set correctly.
+all matching files in alphabetical order via the L<Test::Harness>
+module with the C<-I> switches set correctly.
=head2 make testdb
Defaults to PREFIX (if set) or $Config{vendorprefixexp}
+=item VERBINST
+
+If true, make install will be verbose
+
=item VERSION
Your version number for distributing the package. This defaults to
$VERSION = '1.00';
*VERSION = \'1.01';
- ( $VERSION ) = '$Revision: 1.37 $ ' =~ /\$Revision:\s+([^\s]+)/;
+ ( $VERSION ) = '$Revision: 1.43 $ ' =~ /\$Revision:\s+([^\s]+)/;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
sub manifind {
my $p = shift || {};
- my $skip = _maniskip(warn => $p->{warn_on_skip});
my $found = {};
my $wanted = sub {
my $name = clean_up_filename($File::Find::name);
warn "Debug: diskfile $name\n" if $Debug;
- return if $skip->($name) or -d $name;
+ return if -d $name;
if( $Is_VMS ) {
$name =~ s#(.*)\.$#\L$1#;
# Also, it's okay to use / here, because MANIFEST files use Unix-style
# paths.
find({wanted => $wanted,
- preprocess =>
- sub {grep {!$skip->( clean_up_filename("$File::Find::dir/$_") )} @_},
no_chdir => 1,
},
$Is_MacOS ? ":" : ".");
}
sub fullcheck {
- _manicheck({check_files => 1, check_MANIFEST => 1});
+ return [_check_files()], [_check_manifest()];
}
sub manicheck {
- return @{(_manicheck({check_files => 1}))[0]};
+ return _check_files();
}
sub filecheck {
- return @{(_manicheck({check_MANIFEST => 1}))[1]};
+ return _check_manifest();
}
sub skipcheck {
- _manicheck({check_MANIFEST => 1, warn_on_skip => 1});
+ my($p) = @_;
+ my $found = manifind();
+ my $matches = _maniskip();
+
+ my @skipped = ();
+ foreach my $file (sort keys %$found){
+ if (&$matches($file)){
+ warn "Skipping $file\n";
+ push @skipped, $file;
+ next;
+ }
+ }
+
+ return @skipped;
}
-sub _manicheck {
- my($p) = @_;
- my $read = maniread();
- my $found = manifind($p);
- my $file;
+sub _check_files {
+ my $p = shift;
my $dosnames=(defined(&Dos::UseLFN) && Dos::UseLFN()==0);
- my(@missfile,@missentry);
- if ($p->{check_files}){
- foreach $file (sort keys %$read){
- warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug;
- if ($dosnames){
- $file = lc $file;
- $file =~ s=(\.(\w|-)+)=substr ($1,0,4)=ge;
- $file =~ s=((\w|-)+)=substr ($1,0,8)=ge;
- }
- unless ( exists $found->{$file} ) {
- warn "No such file: $file\n" unless $Quiet;
- push @missfile, $file;
- }
- }
+ my $read = maniread() || {};
+ my $found = manifind($p);
+
+ my(@missfile) = ();
+ foreach my $file (sort keys %$read){
+ warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug;
+ if ($dosnames){
+ $file = lc $file;
+ $file =~ s=(\.(\w|-)+)=substr ($1,0,4)=ge;
+ $file =~ s=((\w|-)+)=substr ($1,0,8)=ge;
+ }
+ unless ( exists $found->{$file} ) {
+ warn "No such file: $file\n" unless $Quiet;
+ push @missfile, $file;
+ }
}
- if ($p->{check_MANIFEST}){
- $read ||= {};
- my $matches = _maniskip();
- foreach $file (sort keys %$found){
- if (&$matches($file)){
- warn "Skipping $file\n" if $p->{warn_on_skip};
- next;
- }
- warn "Debug: manicheck checking from disk $file\n" if $Debug;
- unless ( exists $read->{$file} ) {
- my $canon = $Is_MacOS ? "\t" . _unmacify($file) : '';
- warn "Not in $MANIFEST: $file$canon\n" unless $Quiet;
- push @missentry, $file;
- }
- }
+
+ return @missfile;
+}
+
+
+sub _check_manifest {
+ my($p) = @_;
+ my $read = maniread() || {};
+ my $found = manifind($p);
+ my $skip = _maniskip();
+
+ my @missentry = ();
+ 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 $canon = $Is_MacOS ? "\t" . _unmacify($file) : '';
+ warn "Not in $MANIFEST: $file$canon\n" unless $Quiet;
+ push @missentry, $file;
+ }
}
- (\@missfile,\@missentry);
+
+ return @missentry;
}
+
sub maniread {
my ($mfile) = @_;
$mfile ||= $MANIFEST;
# returns an anonymous sub that decides if an argument matches
sub _maniskip {
- my (%args) = @_;
-
my @skip ;
- my $mfile ||= "$MANIFEST.SKIP";
+ my $mfile = "$MANIFEST.SKIP";
local *M;
open M, $mfile or open M, $DEFAULT_MSKIP or return sub {0};
while (<M>){
# any of them contain alternations
my $regex = join '|', map "(?:$_)", @skip;
- return ($args{warn}
- ? sub { $_[0] =~ qr{$opts$regex} && warn "Skipping $_[0]\n" }
- : sub { $_[0] =~ qr{$opts$regex} }
- );
+ return sub { $_[0] =~ qr{$opts$regex} };
}
sub manicopy {
copy($srcFile,$dstFile);
utime $access, $mod + ($Is_VMS ? 1 : 0), $dstFile;
# chmod a+rX-w,go-w
- chmod( 0444 | ( $perm & 0111 ? 0111 : 0 ), $dstFile ) unless ($^O eq 'MacOS');
+ chmod( 0444 | ( $perm & 0111 ? 0111 : 0 ), $dstFile )
+ unless ($^O eq 'MacOS');
}
sub ln {
=item C<Not in MANIFEST:> I<file>
-is reported if a file is found, that is missing in the C<MANIFEST>
-file which is excluded by a regular expression in the file
-C<MANIFEST.SKIP>.
+is reported if a file is found which is not in C<MANIFEST>.
+
+=item C<Skipping> I<file>
+
+is reported if a file is skipped due to an entry in C<MANIFEST.SKIP>.
=item C<No such file:> I<file>
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+chdir 't';
+
+use strict;
+use Test::More tests => 7;
+use File::Path;
+use File::Basename;
+
+my %Files = (
+ 'Big-Dummy/lib/Big/Dummy.pm' => <<'END',
+package Big::Dummy;
+
+$VERSION = 0.01;
+
+1;
+END
+
+ 'Big-Dummy/Makefile.PL' => <<'END',
+use ExtUtils::MakeMaker;
+
+printf "Current package is: %s\n", __PACKAGE__;
+
+WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ PREREQ_PM => {},
+);
+END
+
+ 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END',
+package Big::Liar;
+
+$VERSION = 0.01;
+
+1;
+END
+
+ 'Big-Dummy/Liar/Makefile.PL' => <<'END',
+use ExtUtils::MakeMaker;
+
+my $mm = WriteMakefile(
+ NAME => 'Big::Liar',
+ VERSION_FROM => 'lib/Big/Liar.pm',
+ _KEEP_AFTER_FLUSH => 1
+ );
+
+print "Big::Liar's vars\n";
+foreach my $key (qw(INST_LIB INST_ARCHLIB)) {
+ print "$key = $mm->{$key}\n";
+}
+END
+
+ 'Problem-Module/Makefile.PL' => <<'END',
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'Problem::Module',
+);
+END
+
+ 'Problem-Module/subdir/Makefile.PL' => <<'END',
+printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
+
+warn "I think I'm going to be sick\n";
+die "YYYAaaaakkk\n";
+END
+
+ );
+
+while(my($file, $text) = each %Files) {
+ my $dir = dirname($file);
+ mkpath $dir;
+ open(FILE, ">$file");
+ print FILE $text;
+ close FILE;
+
+ ok( -e $file, "$file created" );
+}
+
+
+pass("Setup done");
+++ /dev/null
-use ExtUtils::MakeMaker;
-
-my $mm = WriteMakefile(
- NAME => 'Big::Fat::Liar',
- VERSION_FROM => 'lib/Big/Fat/Liar.pm',
- _KEEP_AFTER_FLUSH => 1
- );
-
-print "Big::Fat::Liar's vars\n";
-foreach my $key (qw(INST_LIB INST_ARCHLIB)) {
- print "$key = $mm->{$key}\n";
-}
+++ /dev/null
-package Big::Fat::Liar;
-
-$VERSION = 0.01;
-
-1;
+++ /dev/null
-use ExtUtils::MakeMaker;
-
-printf "Current package is: %s\n", __PACKAGE__;
-
-WriteMakefile(
- NAME => 'Big::Fat::Dummy',
- VERSION_FROM => 'lib/Big/Fat/Dummy.pm',
- PREREQ_PM => {},
-);
+++ /dev/null
-package Big::Fat::Dummy;
-
-$VERSION = 0.01;
-
-1;
}
use strict;
-use Test::More tests => 17;
+use Test::More tests => 23;
use MakeMaker::Test::Utils;
use ExtUtils::MakeMaker;
use File::Spec;
use TieOut;
use Config;
-$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
+chdir 't';
perl_lib;
my $Curdir = File::Spec->curdir;
my $Updir = File::Spec->updir;
-ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) ||
+ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
my $stdout = tie *STDOUT, 'TieOut' or die;
my $mm = WriteMakefile(
- NAME => 'Big::Fat::Dummy',
- VERSION_FROM => 'lib/Big/Fat/Dummy.pm',
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
PREREQ_PM => {},
PERL_CORE => $ENV{PERL_CORE},
);
like( $stdout->read, qr{
- Writing\ $Makefile\ for\ Big::Fat::Liar\n
- Big::Fat::Liar's\ vars\n
+ Writing\ $Makefile\ for\ Big::Liar\n
+ Big::Liar's\ vars\n
INST_LIB\ =\ \S+\n
INST_ARCHLIB\ =\ \S+\n
- Writing\ $Makefile\ for\ Big::Fat::Dummy\n
+ Writing\ $Makefile\ for\ Big::Dummy\n
}x );
undef $stdout;
untie *STDOUT;
isa_ok( $mm, 'ExtUtils::MakeMaker' );
-is( $mm->{NAME}, 'Big::Fat::Dummy', 'NAME' );
+is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
is( $mm->{VERSION}, 0.01, 'VERSION' );
my $config_prefix = $^O eq 'VMS'
- ? VMS::Filespec::unixify($Config{installprefixexp})
+ ? $Config{installprefixexp} || $Config{prefix}
: $Config{installprefixexp};
is( $mm->{PREFIX}, $config_prefix, 'PREFIX' );
my($perl_src, $mm_perl_src);
if( $ENV{PERL_CORE} ) {
- $perl_src = File::Spec->catdir($Updir, $Updir, $Updir, $Updir);
+ $perl_src = File::Spec->catdir($Updir, $Updir);
$perl_src = File::Spec->canonpath($perl_src);
$mm_perl_src = File::Spec->canonpath($mm->{PERL_SRC});
}
# INSTALL*
is( $mm->{INSTALLDIRS}, 'site', 'INSTALLDIRS' );
+
+
+
+# Make sure the INSTALL*MAN*DIR variables work. We forgot them
+# at one point.
+$stdout = tie *STDOUT, 'TieOut' or die;
+$mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ PERL_CORE => $ENV{PERL_CORE},
+ INSTALLMAN1DIR => 'none',
+ INSTALLSITEMAN3DIR => 'none',
+ INSTALLVENDORMAN1DIR => 'none',
+ INST_MAN1DIR => 'none',
+);
+like( $stdout->read, qr{
+ Writing\ $Makefile\ for\ Big::Liar\n
+ Big::Liar's\ vars\n
+ INST_LIB\ =\ \S+\n
+ INST_ARCHLIB\ =\ \S+\n
+ Writing\ $Makefile\ for\ Big::Dummy\n
+}x );
+undef $stdout;
+untie *STDOUT;
+
+isa_ok( $mm, 'ExtUtils::MakeMaker' );
+
+is ( $mm->{INSTALLMAN1DIR}, 'none' );
+is ( $mm->{INSTALLSITEMAN3DIR}, 'none' );
+is ( $mm->{INSTALLVENDORMAN1DIR}, 'none' );
+is ( $mm->{INST_MAN1DIR}, 'none' );
}
use strict;
-use Test::More tests => 24;
+use Test::More tests => 26;
use MakeMaker::Test::Utils;
use ExtUtils::MakeMaker;
use File::Spec;
use TieOut;
use Config;
-$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
+my $Is_VMS = $^O eq 'VMS';
+
+chdir 't';
perl_lib;
my $Curdir = File::Spec->curdir;
my $Updir = File::Spec->updir;
-ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) ||
+ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
+my $PREFIX = File::Spec->catdir('foo', 'bar');
my $stdout = tie *STDOUT, 'TieOut' or die;
my $mm = WriteMakefile(
- NAME => 'Big::Fat::Dummy',
- VERSION_FROM => 'lib/Big/Fat/Dummy.pm',
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
PREREQ_PM => {},
PERL_CORE => $ENV{PERL_CORE},
- PREFIX => 'foo/bar',
+ PREFIX => $PREFIX,
);
like( $stdout->read, qr{
- Writing\ $Makefile\ for\ Big::Fat::Liar\n
- Big::Fat::Liar's\ vars\n
+ Writing\ $Makefile\ for\ Big::Liar\n
+ Big::Liar's\ vars\n
INST_LIB\ =\ \S+\n
INST_ARCHLIB\ =\ \S+\n
- Writing\ $Makefile\ for\ Big::Fat::Dummy\n
+ Writing\ $Makefile\ for\ Big::Dummy\n
}x );
undef $stdout;
untie *STDOUT;
isa_ok( $mm, 'ExtUtils::MakeMaker' );
-is( $mm->{NAME}, 'Big::Fat::Dummy', 'NAME' );
+is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
is( $mm->{VERSION}, 0.01, 'VERSION' );
-is( $mm->{PREFIX}, 'foo/bar', 'PREFIX' );
+is( $mm->{PREFIX}, $PREFIX, 'PREFIX' );
is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
my($perl_src, $mm_perl_src);
if( $ENV{PERL_CORE} ) {
- $perl_src = File::Spec->catdir($Updir, $Updir, $Updir, $Updir);
+ $perl_src = File::Spec->catdir($Updir, $Updir);
$perl_src = File::Spec->canonpath($perl_src);
$mm_perl_src = File::Spec->canonpath($mm->{PERL_SRC});
}
vendorman1dir vendorman3dir);
foreach my $var (@Perl_Install) {
- like( $mm->{uc "install$var"}, qr/^\$\(PREFIX\)/, "PREFIX + $var" );
+ my $prefix = $Is_VMS ? '[.foo.bar' : File::Spec->catdir(qw(foo bar));
+
+ # support for man page skipping
+ $prefix = 'none' if $var =~ /man/ && !$Config{"install$var"};
+ like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/, "PREFIX + $var" );
}
foreach my $var (@Site_Install) {
- like( $mm->{uc "install$var"}, qr/^\$\(SITEPREFIX\)/,
+ my $prefix = $Is_VMS ? '[.foo.bar' : File::Spec->catdir(qw(foo bar));
+
+ like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/,
"SITEPREFIX + $var" );
}
foreach my $var (@Vend_Install) {
- like( $mm->{uc "install$var"}, qr/^\$\(VENDORPREFIX\)/,
+ my $prefix = $Is_VMS ? '[.foo.bar' : File::Spec->catdir(qw(foo bar));
+
+ like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/,
"VENDORPREFIX + $var" );
}
+
+
+# Check that when installman*dir isn't set in Config no man pages
+# are generated.
+{
+ undef *ExtUtils::MM_Unix::Config;
+ %ExtUtils::MM_Unix::Config = %Config;
+ $ExtUtils::MM_Unix::Config{installman1dir} = '';
+ $ExtUtils::MM_Unix::Config{installman3dir} = '';
+
+ my $wibble = File::Spec->catdir(qw(wibble and such));
+ my $stdout = tie *STDOUT, 'TieOut' or die;
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ PREREQ_PM => {},
+ PERL_CORE => $ENV{PERL_CORE},
+ PREFIX => $PREFIX,
+ INSTALLMAN1DIR=> $wibble,
+ );
+
+ is( $mm->{INSTALLMAN1DIR}, $wibble );
+ is( $mm->{INSTALLMAN3DIR}, 'none' );
+}
plan skip_all => 'Non-Unix platform';
}
else {
- plan tests => 108;
+ plan tests => 112;
}
}
my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t'
: 'MM_Unix.t';
-is ($t->parse_version($self_name),'0.02',
- 'parse_version on ourself');
+is( $t->parse_version($self_name), '0.02', 'parse_version on ourself');
+
+my %versions = (
+ '$VERSION = 0.0' => 0.0,
+ '$VERSION = -1.0' => -1.0,
+ '$VERSION = undef' => 'undef',
+ '$wibble = 1.0' => 'undef',
+ );
+
+while( my($code, $expect) = each %versions ) {
+ open(FILE, ">VERSION.tmp") || die $!;
+ print FILE "$code\n";
+ close FILE;
+
+ is( $t->parse_version('VERSION.tmp'), $expect, $code );
+
+ unlink "VERSION.tmp";
+}
+
###############################################################################
# perl_script (on unix any ordinary, readable file)
use strict;
# these files help the test run
-use Test::More tests => 32;
+use Test::More tests => 33;
use Cwd;
# these files are needed for the module itself
($res, $warn) = catch_warning( \&skipcheck );
like( $warn, qr/^Skipping MANIFEST\.SKIP/i, 'got skipping warning' );
-# I'm not sure why this should be... shouldn't $missing be the only one?
-my ($found, $missing );
+my @skipped;
catch_warning( sub {
- ( $found, $missing ) = skipcheck()
+ @skipped = skipcheck()
});
-# nothing new should be found, bar should be skipped
-is( @$found, 0, 'no output here' );
-is( join( ' ', @$missing ), 'bar', 'listed skipped files' );
+is( join( ' ', @skipped ), 'MANIFEST.SKIP', 'listed skipped files' );
{
local $ExtUtils::Manifest::Quiet = 1;
# This'll skip moretest/quux
($res, $warn) = catch_warning( \&skipcheck );
-like( $warn, qr{^Skipping moretest/quux}i, 'got skipping warning again' );
+like( $warn, qr{^Skipping moretest/quux$}i, 'got skipping warning again' );
+
+
+# There was a bug where entries in MANIFEST would be blotted out
+# by MANIFEST.SKIP rules.
+add_file( 'MANIFEST.SKIP' => 'foo' );
+add_file( 'MANIFEST' => 'foobar' );
+add_file( 'foobar' => '123' );
+($res, $warn) = catch_warning( \&manicheck );
+is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
+is( $warn, undef, 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
END {
+++ /dev/null
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
- NAME => 'Problem::Module',
-);
+++ /dev/null
-printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
-
-warn "I think I'm going to be sick\n";
-die "YYYAaaaakkk\n";
--- /dev/null
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+chdir 't';
+
+use strict;
+use Test::More tests => 1;
+use MakeMaker::Test::Utils;
+use ExtUtils::MakeMaker;
+use TieOut;
+use File::Path;
+
+perl_lib();
+
+mkdir 'Odd-Version';
+END { chdir File::Spec->updir; rmtree 'Odd-Version' }
+chdir 'Odd-Version';
+
+open(MPL, ">Version") || die $!;
+print MPL "\$VERSION = 0\n";
+close MPL;
+END { unlink 'Version' }
+
+my $stdout = tie *STDOUT, 'TieOut' or die;
+my $mm = WriteMakefile(
+ NAME => 'Version',
+ VERSION_FROM => 'Version'
+);
+
+is( $mm->{VERSION}, 0, 'VERSION_FROM when $VERSION = 0' );
--- /dev/null
+#!/usr/bin/perl -w
+
+# This is a test for all the odd little backwards compatible things
+# MakeMaker has to support. And we do mean backwards.
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+use Test::More tests => 2;
+
+require ExtUtils::MakeMaker;
+
+# CPAN.pm wants MM.
+can_ok('MM', 'new');
+
+# Pre 5.8 ExtUtils::Embed wants MY.
+can_ok('MY', 'catdir');
my $perl = which_perl();
-$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
+chdir 't';
perl_lib;
$| = 1;
-ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) ||
+ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
print TEST <<'COMPILE_T';
print "1..2\n";
-print eval "use Big::Fat::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
+print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
print "ok 2 - TEST_VERBOSE\n";
COMPILE_T
close TEST;
print TEST <<'SANITY_T';
print "1..3\n";
-print eval "use Big::Fat::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
-print eval "use Big::Fat::Liar; 1;" ? "ok 2\n" : "not ok 2\n";
+print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
+print eval "use Big::Liar; 1;" ? "ok 2\n" : "not ok 2\n";
print "ok 3 - TEST_VERBOSE\n";
SANITY_T
close TEST;
diag(@mpl_out);
my $makefile = makefile_name();
-ok( grep(/^Writing $makefile for Big::Fat::Dummy/,
+ok( grep(/^Writing $makefile for Big::Dummy/,
@mpl_out) == 1,
'Makefile.PL output looks right');
like( $test_out, qr/All tests successful/, ' successful' );
is( $?, 0 );
-my $kill_err = $^O eq 'MSWin32' ? '2>&1' : ''; # avoid nmake spew
-my $dist_test_out = `$make disttest $kill_err`;
+my $dist_test_out = `$make disttest`;
is( $?, 0, 'disttest' ) || diag($dist_test_out);
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
diag(@mpl_out);
-ok( grep(/^Writing $makefile for Big::Fat::Dummy/,
+ok( grep(/^Writing $makefile for Big::Dummy/,
@mpl_out) == 1,
'init_dirscan skipped distdir') ||
diag(@mpl_out);
unshift @INC, 't/lib/';
}
}
-$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
+chdir 't';
use Test::More tests => 3;
}
use strict;
-use Test::More tests => 1;
+use Test::More;
+
+if( $^O eq 'VMS' ) {
+ plan skip_all => 'prefixify works differently on VMS';
+}
+else {
+ plan tests => 2;
+}
use File::Spec;
use ExtUtils::MM;
is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
'prefixify w/defaults');
+
+{
+ undef *ExtUtils::MM_Unix::Config;
+ $ExtUtils::MM_Unix::Config{wibble} = 'C:\opt\perl\wibble';
+ $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
+
+ is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' );
+ { package ExtUtils::MM_Unix; Config->import }
+}
unshift @INC, 't/lib';
}
}
-$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
+chdir 't';
use strict;
use Test::More tests => 3;
# Make sure when Makefile.PL's break, they issue a warning.
# Also make sure Makefile.PL's in subdirs still have '.' in @INC.
-my $stdout;
-$stdout = tie *STDOUT, 'TieOut' or die;
{
+ my $stdout = tie *STDOUT, 'TieOut' or die;
+
my $warning = '';
local $SIG{__WARN__} = sub { $warning = join '', @_ };
- $MM->eval_in_subdirs;
+ eval { $MM->eval_in_subdirs; };
is( $stdout->read, qq{\@INC has .\n}, 'cwd in @INC' );
- like( $warning,
- qr{^WARNING from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk},
+ like( $@,
+ qr{^ERROR from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk},
'Makefile.PL death in subdir warns' );
untie *STDOUT;
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+chdir 't';
+
+
+use strict;
+use Test::More tests => 2;
+use File::Path;
+
+rmtree('Big-Dummy');
+ok(!-d 'Big-Dummy', 'Big-Dummy cleaned up');
+rmtree('Problem-Module');
+ok(!-d 'Problem-Module', 'Problem-Module cleaned up');