diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 03dd6f688..36a9c615d 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -6,7 +6,7 @@ our $VERSION = '7.05_07'; use File::Spec; require ExtUtils::Liblist::Kid; -our @ISA = qw(ExtUtils::Liblist::Kid File::Spec); +our @ISA = qw(ExtUtils::Liblist::Kid); # Backwards compatibility with old interface. sub ext { diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm index c982f67ae..5858337f2 100644 --- a/lib/ExtUtils/Liblist/Kid.pm +++ b/lib/ExtUtils/Liblist/Kid.pm @@ -78,7 +78,7 @@ sub _unix_os2_ext { } unless ( File::Spec->file_name_is_absolute( $thislib ) ) { warn "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n"; - $thislib = $self->catdir( $pwd, $thislib ); + $thislib = File::Spec->catdir( $pwd, $thislib ); } push( @searchpath, $thislib ); push( @extralibs, "$ptype$thislib" ); @@ -318,7 +318,7 @@ sub _win32_ext { elsif ( -d ) { unless ( File::Spec->file_name_is_absolute( $_ ) ) { warn "Warning: '$thislib' changed to '-L$pwd/$_'\n"; - $_ = $self->catdir( $pwd, $_ ); + $_ = File::Spec->catdir( $pwd, $_ ); } push( @searchpath, $_ ); next; @@ -475,7 +475,7 @@ sub _vms_ext { if ( lc $type eq '/share' ) { $locspec .= $Config{'exe_ext'}; } elsif ( lc $type eq '/library' ) { $locspec .= $Config{'lib_ext'}; } else { $locspec .= $Config{'obj_ext'}; } - $locspec = $self->catfile( $self->{PERL_SRC}, $locspec ); + $locspec = File::Spec->catfile( $self->{PERL_SRC}, $locspec ); $lib = "$locspec$type" if -e $locspec; } } @@ -539,7 +539,7 @@ sub _vms_ext { $dir = VMS::Filespec::vmspath( $dir ); } else { - $dir = $self->catdir( $cwd, $dir ); + $dir = File::Spec->catdir( $cwd, $dir ); } } @dirs = grep { length( $_ ) } @dirs; diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index 9ad48d8fd..b4129da73 100644 --- a/lib/ExtUtils/MM_Any.pm +++ b/lib/ExtUtils/MM_Any.pm @@ -13,12 +13,11 @@ use ExtUtils::MakeMaker qw($Verbose write_file_via_tmp neatvalue); use ExtUtils::MakeMaker::Config; - # So we don't have to keep calling the methods over and over again, # we have these globals to cache the values. Faster and shrtr. -my $Curdir = __PACKAGE__->curdir; -my $Rootdir = __PACKAGE__->rootdir; -my $Updir = __PACKAGE__->updir; +my $Curdir = File::Spec->curdir; +my $Rootdir = File::Spec->rootdir; +my $Updir = File::Spec->updir; my $METASPEC_URL = 'https://metacpan.org/pod/CPAN::Meta::Spec'; my $METASPEC_V = 2; @@ -212,7 +211,7 @@ sub _clear_maketype_cache { %maketype2true = () } sub is_make_type { my($self, $type) = @_; return $maketype2true{$type} if defined $maketype2true{$type}; - (undef, undef, my $make_basename) = $self->splitpath($self->make); + (undef, undef, my $make_basename) = File::Spec->splitpath($self->make); return $maketype2true{$type} = 1 if $make_basename =~ /\b$type\b/i; # executable's filename return $maketype2true{$type} = 0 @@ -678,7 +677,7 @@ sub blibdirs_target { my ($v, $d, $f) = File::Spec->splitpath($ext); my @d = File::Spec->splitdir($d); shift @d if $d[0] eq 'lib'; - push @dirs, $self->catdir('$(INST_ARCHLIB)', 'auto', @d, $f); + push @dirs, File::Spec->catdir('$(INST_ARCHLIB)', 'auto', @d, $f); } } @@ -755,8 +754,8 @@ clean :: clean_subdirs $(BASEEXT).exp $(BASEEXT).x ]); - push(@files, $self->catfile('$(INST_ARCHAUTODIR)','extralibs.all')); - push(@files, $self->catfile('$(INST_ARCHAUTODIR)','extralibs.ld')); + push(@files, File::Spec->catfile('$(INST_ARCHAUTODIR)','extralibs.all')); + push(@files, File::Spec->catfile('$(INST_ARCHAUTODIR)','extralibs.ld')); # core files if ($^O eq 'vos') { @@ -1922,8 +1921,8 @@ to XS code. Those are handled in init_xs. sub init_INST { my($self) = shift; - $self->{INST_ARCHLIB} ||= $self->catdir($Curdir,"blib","arch"); - $self->{INST_BIN} ||= $self->catdir($Curdir,'blib','bin'); + $self->{INST_ARCHLIB} ||= File::Spec->catdir($Curdir,"blib","arch"); + $self->{INST_BIN} ||= File::Spec->catdir($Curdir,'blib','bin'); # INST_LIB typically pre-set if building an extension after # perl has been built and installed. Setting INST_LIB allows @@ -1932,22 +1931,22 @@ sub init_INST { if ($self->{PERL_CORE}) { $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB}; } else { - $self->{INST_LIB} = $self->catdir($Curdir,"blib","lib"); + $self->{INST_LIB} = File::Spec->catdir($Curdir,"blib","lib"); } } my @parentdir = split(/::/, $self->{PARENT_NAME}); - $self->{INST_LIBDIR} = $self->catdir('$(INST_LIB)', @parentdir); - $self->{INST_ARCHLIBDIR} = $self->catdir('$(INST_ARCHLIB)', @parentdir); - $self->{INST_AUTODIR} = $self->catdir('$(INST_LIB)', 'auto', + $self->{INST_LIBDIR} = File::Spec->catdir('$(INST_LIB)', @parentdir); + $self->{INST_ARCHLIBDIR} = File::Spec->catdir('$(INST_ARCHLIB)', @parentdir); + $self->{INST_AUTODIR} = File::Spec->catdir('$(INST_LIB)', 'auto', '$(FULLEXT)'); - $self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto', + $self->{INST_ARCHAUTODIR} = File::Spec->catdir('$(INST_ARCHLIB)', 'auto', '$(FULLEXT)'); - $self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script'); + $self->{INST_SCRIPT} ||= File::Spec->catdir($Curdir,'blib','script'); - $self->{INST_MAN1DIR} ||= $self->catdir($Curdir,'blib','man1'); - $self->{INST_MAN3DIR} ||= $self->catdir($Curdir,'blib','man3'); + $self->{INST_MAN1DIR} ||= File::Spec->catdir($Curdir,'blib','man1'); + $self->{INST_MAN3DIR} ||= File::Spec->catdir($Curdir,'blib','man3'); return 1; } @@ -2157,7 +2156,7 @@ sub init_INSTALL_from_PREFIX { if( $var =~ /arch/ ) { $self->{$Installvar} ||= - $self->catdir($self->{LIB}, $Config{archname}); + File::Spec->catdir($self->{LIB}, $Config{archname}); } else { $self->{$Installvar} ||= $self->{LIB}; @@ -2224,7 +2223,7 @@ sub init_INSTALL_from_INSTALL_BASE { my $key = "INSTALL".$dir.$uc_thing; $install{$key} ||= - $self->catdir('$(INSTALL_BASE)', @{$map{$thing}}); + File::Spec->catdir('$(INSTALL_BASE)', @{$map{$thing}}); } } @@ -2745,11 +2744,11 @@ sub arch_check { return 1 if $self->{PERL_SRC}; - my($pvol, $pthinks) = $self->splitpath($pconfig); - my($cvol, $cthinks) = $self->splitpath($cconfig); + my($pvol, $pthinks) = File::Spec->splitpath($pconfig); + my($cvol, $cthinks) = File::Spec->splitpath($cconfig); - $pthinks = $self->canonpath($pthinks); - $cthinks = $self->canonpath($cthinks); + $pthinks = File::Spec->canonpath($pthinks); + $cthinks = File::Spec->canonpath($cthinks); my $ret = 1; if ($pthinks ne $cthinks) { @@ -2758,7 +2757,7 @@ sub arch_check { $ret = 0; - my $arch = (grep length, $self->splitdir($pthinks))[-1]; + my $arch = (grep length, File::Spec->splitdir($pthinks))[-1]; print <{UNINSTALLED_PERL}; Your perl and your Config.pm seem to have different ideas about the @@ -2904,9 +2903,9 @@ installation. sub libscan { my($self,$path) = @_; - my($dirs,$file) = ($self->splitpath($path))[1,2]; + my($dirs,$file) = (File::Spec->splitpath($path))[1,2]; return '' if grep /^(?:RCS|CVS|SCCS|\.svn|_darcs)$/, - $self->splitdir($dirs), $file; + File::Spec->splitdir($dirs), $file; return $path; } @@ -3034,7 +3033,7 @@ Used by perldepend() in MM_Unix and MM_VMS via _perl_header_files_fragment() sub _perl_header_files { my $self = shift; - my $header_dir = $self->{PERL_SRC} || $ENV{PERL_SRC} || $self->catdir($Config{archlibexp}, 'CORE'); + my $header_dir = $self->{PERL_SRC} || $ENV{PERL_SRC} || File::Spec->catdir($Config{archlibexp}, 'CORE'); opendir my $dh, $header_dir or die "Failed to opendir '$header_dir' to find header files: $!"; diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index ecd5356e2..2fbb62a0c 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -8,6 +8,7 @@ use Carp; use ExtUtils::MakeMaker::Config; use File::Basename qw(basename dirname); use DirHandle; +use File::Spec (); our %Config_Override; @@ -97,9 +98,9 @@ something that used to be in here, look in MM_Any. # So we don't have to keep calling the methods over and over again, # we have these globals to cache the values. Faster and shrtr. -my $Curdir = __PACKAGE__->curdir; -my $Rootdir = __PACKAGE__->rootdir; -my $Updir = __PACKAGE__->updir; +my $Curdir = File::Spec->curdir; +my $Rootdir = File::Spec->rootdir; +my $Updir = File::Spec->updir; =head2 Methods @@ -1106,10 +1107,10 @@ WARNING foreach my $dir (@$dirs){ next unless defined $dir; # $self->{PERL_SRC} may be undefined my ($abs, $val); - if ($self->file_name_is_absolute($name)) { # /foo/bar + if (File::Spec->file_name_is_absolute($name)) { # /foo/bar $abs = $name; - } elsif ($self->canonpath($name) eq - $self->canonpath(basename($name))) { # foo + } elsif (File::Spec->canonpath($name) eq + File::Spec->canonpath(basename($name))) { # foo $abs = File::Spec->catfile($dir, $name); } else { # foo/bar $abs = File::Spec->catfile($Curdir, $name); @@ -1241,7 +1242,7 @@ sub _fixin_replace_shebang { } else { my (@absdirs) - = reverse grep { $self->file_name_is_absolute($_) } $self->path; + = reverse grep { File::Spec->file_name_is_absolute($_) } File::Spec->path; $interpreter = ''; foreach my $dir (@absdirs) { @@ -1962,21 +1963,21 @@ sub init_PERL { my($self) = shift; my @defpath = (); - foreach my $component ($self->{PERL_SRC}, $self->path(), + foreach my $component ($self->{PERL_SRC}, File::Spec->path(), $Config{binexp}) { push @defpath, $component if defined $component; } # Build up a set of file names (not command names). - my $thisperl = $self->canonpath($^X); + my $thisperl = File::Spec->canonpath($^X); $thisperl .= $Config{exe_ext} unless # VMS might have a file version # at the end $Is{VMS} ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i : $thisperl =~ m/$Config{exe_ext}$/i; # We need a relative path to perl when in the core. - $thisperl = $self->abs2rel($thisperl) if $self->{PERL_CORE}; + $thisperl = File::Spec->abs2rel($thisperl) if $self->{PERL_CORE}; my @perls = ($thisperl); push @perls, map { "$_$Config{exe_ext}" } @@ -2029,11 +2030,11 @@ sub init_PERL { # sometimes. $self->{ABSPERL} = $self->{PERL}; $has_mcr = $self->{ABSPERL} =~ s/^MCR\s*//; - if( $self->file_name_is_absolute($self->{ABSPERL}) ) { + if( File::Spec->file_name_is_absolute($self->{ABSPERL}) ) { $self->{ABSPERL} = '$(PERL)'; } else { - $self->{ABSPERL} = $self->rel2abs($self->{ABSPERL}); + $self->{ABSPERL} = File::Spec->rel2abs($self->{ABSPERL}); # Quote the perl command if it contains whitespace $self->{ABSPERL} = $self->quote_literal($self->{ABSPERL}) @@ -3429,8 +3430,8 @@ sub static_lib { my ($v, $d, $f) = File::Spec->splitpath($ext); my @d = File::Spec->splitdir($d); shift @d if $d[0] eq 'lib'; - my $instdir = $self->catdir('$(INST_ARCHLIB)', 'auto', @d, $f); - my $instfile = $self->catfile($instdir, "$f\$(LIB_EXT)"); + my $instdir = File::Spec->catdir('$(INST_ARCHLIB)', 'auto', @d, $f); + my $instfile = File::Spec->catfile($instdir, "$f\$(LIB_EXT)"); my $objfile = "$ext\$(OBJ_EXT)"; push @libs, [ $objfile, $instfile, $instdir ]; } diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index b4b0587d2..03385a5b8 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -3,6 +3,7 @@ package ExtUtils::MM_VMS; use strict; use ExtUtils::MakeMaker::Config; +use File::Spec; require Exporter; BEGIN { @@ -164,8 +165,8 @@ sub find_perl { if( $self->{PERL_CORE} ) { # Check in relative directories first, so we pick up the current # version of Perl if we're running MakeMaker as part of the main build. - @sdirs = sort { my($absa) = $self->file_name_is_absolute($a); - my($absb) = $self->file_name_is_absolute($b); + @sdirs = sort { my($absa) = File::Spec->file_name_is_absolute($a); + my($absb) = File::Spec->file_name_is_absolute($b); if ($absa && $absb) { return $a cmp $b } else { return $absa ? 1 : ($absb ? -1 : ($a cmp $b)); } } @$dirs; @@ -197,7 +198,7 @@ sub find_perl { } foreach my $dir (@sdirs){ next unless defined $dir; # $self->{PERL_SRC} may be undefined - $inabs++ if $self->file_name_is_absolute($dir); + $inabs++ if File::Spec->file_name_is_absolute($dir); if ($inabs == 1) { # We've covered relative dirs; everything else is an absolute # dir (probably an installed location). First, we'll try @@ -209,7 +210,7 @@ sub find_perl { $inabs++; # Should happen above in next $dir, but just in case... } foreach my $name (@snames){ - push @cand, ($name !~ m![/:>\]]!) ? $self->catfile($dir,$name) + push @cand, ($name !~ m![/:>\]]!) ? File::Spec->catfile($dir,$name) : $self->fixpath($name,0); } } @@ -521,7 +522,7 @@ sub init_platform { $self->{MM_VMS_REVISION} = $Revision; $self->{MM_VMS_VERSION} = $VERSION; - $self->{PERL_VMS} = $self->catdir($self->{PERL_SRC}, 'VMS') + $self->{PERL_VMS} = File::Spec->catdir($self->{PERL_SRC}, 'VMS') if $self->{PERL_SRC}; } @@ -973,7 +974,7 @@ sub xs_make_dlsyms { my ($v, $d, $f) = File::Spec->splitpath($target); my @d = File::Spec->splitdir($d); shift @d if $d[0] eq 'lib'; - my $instloc = $self->catfile('$(INST_ARCHLIB)', 'auto', @d, $f); + my $instloc = File::Spec->catfile('$(INST_ARCHLIB)', 'auto', @d, $f); push @m,"\ndynamic :: $instloc\n\t\$(NOECHO) \$(NOOP)\n" unless $self->{SKIPHASH}{'dynamic'}; push @m,"\nstatic :: $instloc\n\t\$(NOECHO) \$(NOOP)\n" @@ -1251,7 +1252,7 @@ q[ $(NOECHO) $(ECHO_N) "$(INST_LIB)|$(DESTINSTALLPRIVLIB)|" >>.MM_tmp $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)|$(DESTINSTALLMAN3DIR)" >>.MM_tmp $(NOECHO) $(MOD_INSTALL) <.MM_tmp $(NOECHO) $(RM_F) .MM_tmp - $(NOECHO) $(WARN_IF_OLD_PACKLIST) "].$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[" + $(NOECHO) $(WARN_IF_OLD_PACKLIST) "].File::Spec->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[" # Likewise pure_site_install :: @@ -1270,7 +1271,7 @@ q[ $(NOECHO) $(ECHO_N) "$(INST_LIB)|$(DESTINSTALLSITELIB)|" >>.MM_tmp $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)|$(DESTINSTALLSITEMAN3DIR)" >>.MM_tmp $(NOECHO) $(MOD_INSTALL) <.MM_tmp $(NOECHO) $(RM_F) .MM_tmp - $(NOECHO) $(WARN_IF_OLD_PACKLIST) "].$self->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q[" + $(NOECHO) $(WARN_IF_OLD_PACKLIST) "].File::Spec->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q[" pure_vendor_install :: ]; @@ -1308,28 +1309,28 @@ doc_vendor_install :: push @m, q[ # Ditto doc_perl_install :: - $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" + $(NOECHO) $(ECHO) "Appending installation info to ].File::Spec->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO_N) "installed into|$(INSTALLPRIVLIB)|" >.MM_tmp $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp - $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ + $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].File::Spec->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp # And again doc_site_install :: - $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" + $(NOECHO) $(ECHO) "Appending installation info to ].File::Spec->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO_N) "installed into|$(INSTALLSITELIB)|" >.MM_tmp $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp - $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ + $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].File::Spec->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp doc_vendor_install :: - $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" + $(NOECHO) $(ECHO) "Appending installation info to ].File::Spec->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO_N) "installed into|$(INSTALLVENDORLIB)|" >.MM_tmp $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp - $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ + $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].File::Spec->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp ] unless $self->{NO_PERLLOCAL}; @@ -1339,13 +1340,13 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs $(NOECHO) $(NOOP) uninstall_from_perldirs :: - $(NOECHO) $(UNINSTALL) ].$self->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q[ + $(NOECHO) $(UNINSTALL) ].File::Spec->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q[ uninstall_from_sitedirs :: - $(NOECHO) $(UNINSTALL) ].$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[ + $(NOECHO) $(UNINSTALL) ].File::Spec->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[ uninstall_from_vendordirs :: - $(NOECHO) $(UNINSTALL) ].$self->catfile($self->{VENDORARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[ + $(NOECHO) $(UNINSTALL) ].File::Spec->catfile($self->{VENDORARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[ ]; join('',@m); @@ -1566,15 +1567,15 @@ $(MAP_TARGET) :: $(MAKE_APERL_FILE) # that's what we're building here). push @optlibs, grep { !/PerlShr/i } split ' ', +($self->ext())[2]; if ($libperl) { - unless (-f $libperl || -f ($libperl = $self->catfile($Config{'installarchlib'},'CORE',$libperl))) { + unless (-f $libperl || -f ($libperl = File::Spec->catfile($Config{'installarchlib'},'CORE',$libperl))) { print "Warning: $libperl not found\n"; undef $libperl; } } unless ($libperl) { if (defined $self->{PERL_SRC}) { - $libperl = $self->catfile($self->{PERL_SRC},"libperl$self->{LIB_EXT}"); - } elsif (-f ($libperl = $self->catfile($Config{'installarchlib'},'CORE',"libperl$self->{LIB_EXT}")) ) { + $libperl = File::Spec->catfile($self->{PERL_SRC},"libperl$self->{LIB_EXT}"); + } elsif (-f ($libperl = File::Spec->catfile($Config{'installarchlib'},'CORE',"libperl$self->{LIB_EXT}")) ) { } else { print "Warning: $libperl not found If you're going to build a static perl binary, make sure perl is installed @@ -1628,9 +1629,9 @@ doc_inst_perl : $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO) "Perl binary $(MAP_TARGET)|" >.MM_tmp $(NOECHO) $(ECHO) "MAP_STATIC|$(MAP_STATIC)|" >>.MM_tmp - $(NOECHO) $(PERL) -pl040 -e " " ].$self->catfile('$(INST_ARCHAUTODIR)','extralibs.all'),q[ >>.MM_tmp + $(NOECHO) $(PERL) -pl040 -e " " ].File::Spec->catfile('$(INST_ARCHAUTODIR)','extralibs.all'),q[ >>.MM_tmp $(NOECHO) $(ECHO) -e "MAP_LIBPERL|$(MAP_LIBPERL)|" >>.MM_tmp - $(NOECHO) $(DOC_INSTALL) <.MM_tmp >>].$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q[ + $(NOECHO) $(DOC_INSTALL) <.MM_tmp >>].File::Spec->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp ]; @@ -1708,7 +1709,7 @@ sub prefixify { warn " no Config found for $var.\n" if $Verbose >= 2; $path = $self->_prefixify_default($rprefix, $default); } - elsif( !$self->{ARGS}{PREFIX} || !$self->file_name_is_absolute($path) ) { + elsif( !$self->{ARGS}{PREFIX} || !File::Spec->file_name_is_absolute($path) ) { # do nothing if there's no prefix or if its relative } elsif( $sprefix eq $rprefix ) { @@ -1719,7 +1720,7 @@ sub prefixify { warn " prefixify $var => $path\n" if $Verbose >= 2; warn " from $sprefix to $rprefix\n" if $Verbose >= 2; - my($path_vol, $path_dirs) = $self->splitpath( $path ); + my($path_vol, $path_dirs) = File::Spec->splitpath( $path ); if( $path_vol eq $Config{vms_prefix}.':' ) { warn " $Config{vms_prefix}: seen\n" if $Verbose >= 2; @@ -1756,15 +1757,15 @@ sub _prefixify_default { sub _catprefix { my($self, $rprefix, $default) = @_; - my($rvol, $rdirs) = $self->splitpath($rprefix); + my($rvol, $rdirs) = File::Spec->splitpath($rprefix); if( $rvol ) { - return $self->catpath($rvol, - $self->catdir($rdirs, $default), + return File::Spec->catpath($rvol, + File::Spec->catdir($rdirs, $default), '' ) } else { - return $self->catdir($rdirs, $default); + return File::Spec->catdir($rdirs, $default); } } @@ -1929,7 +1930,7 @@ sub init_linker { my $shr = $Config{dbgprefix} . 'PERLSHR'; if ($self->{PERL_SRC}) { $self->{PERL_ARCHIVE} ||= - $self->catfile($self->{PERL_SRC}, "$shr.$Config{'dlext'}"); + File::Spec->catfile($self->{PERL_SRC}, "$shr.$Config{'dlext'}"); } else { $self->{PERL_ARCHIVE} ||= @@ -1957,7 +1958,7 @@ sub catdir { # Process the macros on VMS MMS/MMK my @args = map { m{\$\(} ? $self->eliminate_macros($_) : $_ } @_; - my $dir = $self->SUPER::catdir(@args); + my $dir = File::Spec->catdir(@args); # Fix up the directory and force it to VMS format. $dir = $self->fixpath($dir, 1); @@ -1971,7 +1972,7 @@ sub catfile { # Process the macros on VMS MMS/MMK my @args = map { m{\$\(} ? $self->eliminate_macros($_) : $_ } @_; - my $file = $self->SUPER::catfile(@args); + my $file = File::Spec->catfile(@args); $file = vmsify($file); diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index f973cb112..44f605821 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -557,7 +557,7 @@ sub cd { my $cmd = join "\n\t", map "$_", @cmds; - my $updirs = $self->catdir(map { $self->updir } $self->splitdir($dir)); + my $updirs = File::Spec->catdir(map { File::Spec->updir } File::Spec->splitdir($dir)); # No leading tab and no trailing newline makes for easier embedding. my $make_frag = sprintf <<'MAKE_FRAG', $dir, $cmd, $updirs; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index f42cdbcfc..1e7a1ffd6 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -235,7 +235,7 @@ sub eval_in_subdirs { push @INC, '.'; # '.' has to always be at the end of @INC foreach my $dir (@{$self->{DIR}}){ - my($abs) = $self->catdir($pwd,$dir); + my($abs) = File::Spec->catdir($pwd,$dir); eval { $self->eval_in_x($abs); }; last if $@; } @@ -657,15 +657,15 @@ END # into a filespec, but do add a level to the path of # the argument if not already absolute. my @cmd = split /\s+/, $self->{$key}; - $cmd[1] = $self->catfile('[-]',$cmd[1]) - unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]); + $cmd[1] = File::Spec->catfile('[-]',$cmd[1]) + unless (@cmd < 2) || File::Spec->file_name_is_absolute($cmd[1]); $self->{$key} = join(' ', @cmd); } else { my $value = $self->{$key}; # not going to test in FS so only stripping start $value =~ s/^"// if $key =~ /PERL$/; - $value = $self->catdir("..", $value) - unless $self->file_name_is_absolute($value); + $value = File::Spec->catdir("..", $value) + unless File::Spec->file_name_is_absolute($value); $value = qq{"$value} if $key =~ /PERL$/; $self->{$key} = $value; } @@ -725,7 +725,7 @@ END $self->arch_check( $INC{'Config.pm'}, - $self->catfile($Config{'archlibexp'}, "Config.pm") + File::Spec->catfile($Config{'archlibexp'}, "Config.pm") ); $self->init_tools(); diff --git a/t/arch_check.t b/t/arch_check.t index 076415bdb..b1e3a53d9 100644 --- a/t/arch_check.t +++ b/t/arch_check.t @@ -8,6 +8,7 @@ use Test::More 'no_plan'; use Config; use ExtUtils::MakeMaker; +use File::Spec; ok( my $stdout = tie *STDOUT, 'TieOut' ); @@ -16,7 +17,7 @@ my $mm = bless {}, "MM"; $mm->{PERL_SRC} = 0; $mm->{UNINSTALLED_PERL} = 0; -my $rel2abs = sub { $mm->rel2abs($mm->catfile(@_)) }; +my $rel2abs = sub { File::Spec->rel2abs(File::Spec->catfile(@_)) }; ok $mm->arch_check( $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),