MM_Unix patch for use under CVS
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MM_Unix.pm
index f4ee44f..6f85c8c 100644 (file)
@@ -662,11 +662,17 @@ sub dir_target {
 # too often :)
 
     my($self,@dirs) = @_;
-    my(@m,$dir);
+    my(@m,$dir,$targdir);
     foreach $dir (@dirs) {
        my($src) = $self->catfile($self->{PERL_INC},'perl.h');
        my($targ) = $self->catfile($dir,'.exists');
-       my($targdir) = dirname($targ); # Necessary because catfile may have adapted syntax of $dir to target OS
+       # catfile may have adapted syntax of $dir to target OS, so...
+       if ($Is_VMS) { # Just remove file name; dirspec is often in macro
+           ($targdir = $targ) =~ s:/?\.exists$::;
+       }
+       else { # while elsewhere we expect to see the dir separator in $targ
+           $targdir = dirname($targ);
+       }
        next if $self->{DIR_TARGET}{$self}{$targdir}++;
        push @m, qq{
 $targ :: $src
@@ -1161,6 +1167,7 @@ sub init_dirscan {        # --- File and Directory Lists (.xs .pm .pod etc)
     $ignore{'test.pl'} = 1;
     $ignore{'makefile.pl'} = 1 if $Is_VMS;
     foreach $name ($self->lsdir($self->curdir)){
+       next if $name =~ /\#/;
        next if $name eq $self->curdir or $name eq $self->updir or $ignore{$name};
        next unless $self->libscan($name);
        if (-d $name){
@@ -1236,6 +1243,7 @@ sub init_dirscan {        # --- File and Directory Lists (.xs .pm .pod etc)
                }
                return;
            }
+           return if /\#/;
            my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
            my($striplibpath,$striplibname);
            $prefix =  '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:i);
@@ -1350,7 +1358,7 @@ sub init_dirscan {        # --- File and Directory Lists (.xs .pm .pod etc)
 
 Initializes NAME, FULLEXT, BASEEXT, PARENT_NAME, DLBASE, PERL_SRC,
 PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*,
-PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET,
+PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, EXE_EXT, MAP_TARGET,
 LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM.
 
 =cut
@@ -1539,7 +1547,7 @@ usually solves this kind of problem.
     # all the installation path variables to literally $(PREFIX), so
     # the user can still say make PREFIX=foo
     my($configure_prefix) = $Config{'prefix'};
-    $prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
+    $configure_prefix = VMS::Filespec::unixify($configure_prefix) if $Is_VMS;
     $self->{PREFIX} ||= $configure_prefix;