I have not tested this or anything on 5.8.7, I am in the process of
moving my changes over to 5.8.7.
I have seen no changes in 5.8.7 from the files I started with on my
5.8.6 basis.
These changes should be at most harmless until the rest of the VMS Perl
catches up with them, or at worse, Perl really does not function well if
you put the CRTL in the UNIX modes now.
lib/extutils/command/mm.pm
When VMS CRTL is in UNIX mode, some names need to be returned in UNIX
format.
lib/extutils/liblist/kid.pm
When the CRTL is in UNIX mode, the VMS specific code in this facility
expects these filenames in VMS format.
lib/extutils/command.pm
When the VMS CRTL is in UNIX mode, Perl needs to use '?' for a wild
card. A '%' character can occur in a filename in on ODS-5 volumes in
that mode. The UNIX 'foo%bar' is translated to the VMS 'foo^%bar.'.
Of course this will cause problems because with out any path specifiers,
a translation routine like UNIXIFY or VMSIFY does not know which way to
interpret the file.
Note, if all my patches get in, '^' in a filename will make Perl on VMS
assume that it is VMS a VMS file specification. Not the best check as
vms 'foo^^bar.' translates to a UNIX 'foo^bar', and a VMS 'foo^bar.'
translates to a UNIX filename of 'foo' . 0xba . 'r'. Also in my
examples, the trailing dot on the VMS style names is intentional and not
a typo. So perfection at guessing what operating system a file name is
for is not possible.
Even with my changes to the VMS specific part of Perl, there are still
bugs in the handling of EFS filenames. I was mainly concerned with
getting the most common cases working. I did not investigate if any
changes are needed to get UNICODE filenames translated from UNIX to VMS.
lib/extutils/manifest.pm
When the VMS CRTL is in EFS character set (ODS-5 file system), the extra
dot characters are legal if UNIX path specifications, and should not be
mangled into '_'. The DECC$EFS_CHARSET feature controls this.
When the VMS CRTL is in a case preserved mode, you should not lower case
filenames.
lib/extutils/mm_unix.pm
lib/extutils/mm_vms.pm
Starting to get into the *FUN* part. When using MMK/MMS, while they
will take UNIX file specifications as long as everything in a dependency
rule is in UNIX, some of the actions may require traditional VMS
filenames as parameters.
Not here with this patch, but when the environment variable for the
shell is "BASH" and GNU MAKE is the make program, all file
specifications will probably need to be in UNIX for the same reason,
even on VMS. It might even be safe to assume that any make program
other than MMK/MMS on VMS will want all output files names in UNIX
format. I did not work on anything other than the MMK/MMS on VMS case.
Normally what is expected is that if you put in UNIX name to a CRTL or
Perl routines, you get output in UNIX. And putting in VMS got you a VMS
name in response.
And with no options set, routines that just return filenames returned
them in VMS format.
When the CRTL is in the UNIX mode, or the coming POSIX mode, by default
it returns filenames in UNIX format, not VMS.
Before my changes, Perl was not consistent about this, and was sometimes
returning VMS specifications or UNIX specifications when under the
normal rules the other would be expected.
But when the CRTL is in UNIX or POSIX mode, things have to work
consistently. That is because it is not possible to always translate a
VMS file specification to it's equivalent UNIX pathname and then get
back the original VMS file specification.
Several VMS file specifications for different files will syntactically
translate to the same UNIX specification because of differences in the
naming conventions between the two platforms, and for the reasons that I
wrote about above.
And the cases this shows up in are a lot. So generally you can only get
away with translating the file one way, and leaving it that way. Even
though my changes make things better on translations, I know that I do
not have it as good as it could be.
So the basic rules are:
I can always come up with a valid and unique VMS file specification for
an UNIX path name to an existing file.
I can not always come up with a unique UNIX file specification for an
existing VMS file, but I can usually come up with a good enough one.
And if the file from the UNIX pathname does not actually exist, I can
not accurately predict what VMS file specification it will end up with.
And I can only guess if I have a VMS or UNIX file specifications unless
I artificially restrict what is valid in each of them.
[Some of this note should get into the VMS specific Perl programming help]
The result of this is that any code that assumes that it will see a VMS
file specification returned when it did not specifically ask for a VMS
file specification, or it started out with a UNIX file specification
will not work.
Normally what is expected is that if you put in UNIX name to a CRTL or
Perl routines, you get output in UNIX. And putting in VMS got you a VMS
name in response.
So in order to get the tests to work with MMK, I had to make sure that
all filenames were output as VMS.
I also had to make sure that MCR only gets a VMS pathname, however it is
probable that the MCR prefix can just be removed in most cases, and the
existing VMS Perl code will do the right thing.
Now of course some of the tests needed to be fixed to work in the UNIX
mode and the new POSIX mode on VMS.
[EMAIL PROTECTED]
Personal Opinion Only
--- lib/ExtUtils/Command.pm_5_8_6 Tue May 3 15:43:21 2005
+++ lib/ExtUtils/Command.pm Tue May 3 15:43:30 2005
@@ -50,8 +50,28 @@
=cut
+my $wild_regex = '*?';
# VMS uses % instead of ? to mean "one character"
-my $wild_regex = $Is_VMS ? '*%' : '*?';
+if ($Is_VMS) {
+ my $unix_report;
+ my $unix_only;
+
+ $unix_report = $ENV{'DECC$FILENAME_UNIX_REPORT'};
+ if (defined $unix_report) {
+ if (($unix_report lt '1') && ($unix_report ne 'ENABLE')) {
+ $unix_report = undef;
+ }
+ }
+ $unix_only = $ENV{'DECC$FILENAME_UNIX_ONLY'};
+ if (defined $unix_only) {
+ if (($unix_only lt '1') && ($unix_only ne 'ENABLE')) {
+ $unix_only = undef;
+ }
+ }
+ $unix_report = 1 if (defined $unix_only);
+
+ $wild_regex = '*%' if !(defined $unix_report);
+}
sub expand_wildcards
{
@ARGV = map(/[$wild_regex]/o ? glob($_) : $_,@ARGV);
--- lib/ExtUtils/Manifest.pm_5_8_6 Thu Apr 21 18:44:32 2005
+++ lib/ExtUtils/Manifest.pm Thu Apr 21 18:44:45 2005
@@ -152,9 +152,18 @@
return if -d $_;
if( $Is_VMS ) {
+ my $case_preserved;
+ $case_preserved = $ENV{'DECC$EFS_CASE_PRESERVE'};
+ if (defined $case_preserved) {
+ if (($case_preserved lt '1') && ($case_preserved ne 'ENABLE')) {
+ $case_preserved = undef;
+ }
+ }
$name =~ s#(.*)\.$#\L$1#;
+ if (!defined $case_preserved) {
$name = uc($name) if $name =~ /^MANIFEST(\.SKIP)?$/i;
}
+ }
$found->{$name} = "";
};
@@ -325,17 +334,35 @@
$file =~ s/\\([0-3][0-7][0-7])/sprintf("%c", oct($1))/ge;
}
elsif ($Is_VMS) {
+ my $efs_charset;
+ my $case_preserved;
+ $efs_charset = $ENV{'DECC$EFS_CHARSET'};
+ if (defined $efs_charset) {
+ if (($efs_charset lt '1') && ($efs_charset ne 'ENABLE')) {
+ $case_preserved = undef;
+ }
+ }
+ $case_preserved = $ENV{'DECC$EFS_CASE_PRESERVE'};
+ if (defined $case_preserved) {
+ if (($case_preserved lt '1') && ($case_preserved ne 'ENABLE')) {
+ $case_preserved = undef;
+ }
+ }
require File::Basename;
my($base,$dir) = File::Basename::fileparse($file);
# Resolve illegal file specifications in the same way as tar
+ if (!defined $efs_charset) {
$dir =~ tr/./_/;
my(@pieces) = split(/\./,$base);
if (@pieces > 2) { $base = shift(@pieces) . '.' .
join('_',@pieces); }
my $okfile = "$dir$base";
warn "Debug: Illegal name $file changed to $okfile\n" if $Debug;
$file = $okfile;
+ }
+ if (!defined $case_preserved) {
$file = lc($file) unless $file =~ /^MANIFEST(\.SKIP)?$/;
}
+ }
$read->{$file} = $comment;
}
--- lib/ExtUtils/MM_UNIX.PM_5_8_6 Mon Apr 4 20:02:53 2005
+++ lib/ExtUtils/MM_UNIX.PM Thu Jun 2 09:34:04 2005
@@ -42,6 +42,28 @@
$Is_SunOS = $Is_SunOS4 || $Is_Solaris;
$Is_BSD = $^O =~ /^(?:free|net|open)bsd|bsdos$/;
+my $unix_report;
+my $unix_only;
+if ($Is_VMS) {
+ $unix_only = $ENV{'DECC$FILENAME_UNIX_ONLY'};
+ if (defined $unix_only) {
+ if (($unix_only ne '1') && ($unix_only ne 'ENABLE')) {
+ $unix_only = undef;
+ }
+ }
+
+ if (defined $unix_only) {
+ $unix_report = 1;
+ }
+ else {
+ $unix_report = $ENV{'DECC$FILENAME_UNIX_REPORT'};
+ if (defined $unix_report) {
+ if (($unix_report ne '1') && ($unix_report ne 'ENABLE')) {
+ $unix_report = undef;
+ }
+ }
+ }
+}
=head1 NAME
@@ -1437,7 +1459,7 @@
@ignore{qw(Makefile.PL test.pl t)} = (1,1,1);
# ignore the distdir
- $Is_VMS ? $ignore{"$self->{DISTVNAME}.dir"} = 1
+ $Is_VMS && !defined($unix_report) ? $ignore{"$self->{DISTVNAME}.dir"} = 1
: $ignore{$self->{DISTVNAME}} = 1;
@ignore{map lc, keys %ignore} = values %ignore if $Is_VMS;
@@ -2018,16 +2040,37 @@
my @parentdir = split(/::/, $self->{PARENT_NAME});
$self->{INST_LIBDIR} = $self->catdir('$(INST_LIB)', @parentdir);
+
+ # TO DO:
+ # should be if mmk/mms instead of if VMS below, or just make sure that all
+ # filespecs are output in UNIX format when on VMS. MMS/MMK should
+ # be able to handle UNIX specifications just fine.
+ # But because some of the filespecifications are still coming out in
+ # VMS format when VMS is in UNIX emulation mode, I have to make
+ # sure that all of them are in VMS format.
+
+ $self->{INST_LIBDIR} = VMS::Filespec::vmspath($self->{INST_LIBDIR})
+ if $Is_VMS && ($self->{INST_LIBDIR} =~ m|/|);
$self->{INST_ARCHLIBDIR} = $self->catdir('$(INST_ARCHLIB)', @parentdir);
+ $self->{INST_ARCHLIBDIR} = VMS::Filespec::vmspath($self->{INST_ARCHLIBDIR})
+ if $Is_VMS && ($self->{INST_ARCHLIBDIR} =~ m|/|);
$self->{INST_AUTODIR} = $self->catdir('$(INST_LIB)', 'auto',
'$(FULLEXT)');
+ $self->{INST_AUTODIR} = VMS::Filespec::vmspath($self->{INST_AUTODIR})
+ if $Is_VMS && ($self->{INST_AUTODIR} =~ m|/|);
$self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto',
'$(FULLEXT)');
+ $self->{INST_ARCHAUTODIR} =
VMS::Filespec::vmspath($self->{INST_ARCHAUTODIR})
+ if $Is_VMS && ($self->{INST_ARCHAUTODIR} =~ m|/|);
$self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script');
$self->{INST_MAN1DIR} ||= $self->catdir($Curdir,'blib','man1');
+ $self->{INST_MAN1DIR} = VMS::Filespec::vmspath($self->{INST_MAN1DIR})
+ if $Is_VMS && ($self->{INST_MAN1DIR} =~ m|/|);
$self->{INST_MAN3DIR} ||= $self->catdir($Curdir,'blib','man3');
+ $self->{INST_MAN3DIR} = VMS::Filespec::vmspath($self->{INST_MAN3DIR})
+ if $Is_VMS && ($self->{INST_MAN3DIR} =~ m|/|);
return 1;
}
@@ -2362,14 +2405,18 @@
# Little hack to get around VMS's find_perl putting "MCR" in front
# sometimes.
+#print STDERR "#MM_UNIX self->{PERL} = $self->{PERL} \n";
$self->{ABSPERL} = $self->{PERL};
+#print STDERR "#MM_UNIX self->{ABSPERL} = $self->{ABSPERL} \n";
my $has_mcr = $self->{ABSPERL} =~ s/^MCR\s*//;
if( $self->file_name_is_absolute($self->{ABSPERL}) ) {
$self->{ABSPERL} = '$(PERL)';
+#print STDERR "#MM_UNIX file is absolute self->{ABSPERL} = $self->{ABSPERL}
\n";
}
else {
$self->{ABSPERL} = $self->rel2abs($self->{ABSPERL});
- $self->{ABSPERL} = 'MCR '.$self->{ABSPERL} if $has_mcr;
+#print STDERR "#MM_UNIX self-rel2abs(self->{ABSPERL}) = $self->{ABSPERL} \n";
+ $self->{ABSPERL} = 'MCR '.VMS::Filespec::vmsify($self->{ABSPERL}) if
$has_mcr;
}
# Are we building the core?
--- lib/ExtUtils/MM_VMS.pm_5_8_6 Fri Apr 29 11:29:17 2005
+++ lib/ExtUtils/MM_VMS.pm Mon Jun 20 15:27:43 2005
@@ -105,6 +105,12 @@
to find a C<package> statement from which to obtain the Mixed::Case
package name.
+VMS can be set to case preserved and case insensitive modes.
+In case preserved mode, .DIR suffixes will be in upper case.
+This quick update makes that work for logical name set case preserved mode.
+If someone has set case insensitive with out setting case preserved,
+that is not going to work very well.
+
=cut
sub guess_name {
@@ -112,8 +118,21 @@
my($defname,$defpm,@pm,%xs,$pm);
local *PM;
+ my $case_preserved = 1;
+ $case_preserved = $ENV{'DECC$EFS_CASE_PRESERVE'};
+ if (defined $case_preserved) {
+ if (($case_preserved lt '1') && ($case_preserved ne 'ENABLE')) {
+ $case_preserved = undef;
+ }
+ }
+
$defname = basename(fileify($ENV{'DEFAULT'}));
+ if (defined $case_preserved) {
$defname =~ s![\d\-_]*\.dir.*$!!; # Clip off .dir;1 suffix, and package
version
+ }
+ else {
+ $defname =~ s![\d\-_]*\.DIR.*$!!; # Clip off .dir;1 suffix, and package
version
+ }
$defpm = $defname;
# Fallback in case for some reason a user has copied the files for an
# extension into a working directory whose name doesn't reflect the
@@ -165,6 +184,14 @@
my($inabs) = 0;
local *TCF;
+ my $efs_charset;
+ $efs_charset = $ENV{'DECC$EFS_CHARSET'};
+ if (defined $efs_charset) {
+ if (($efs_charset lt '1') && ($efs_charset ne 'ENABLE')) {
+ $efs_charset = undef;
+ }
+ }
+
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.
@@ -192,7 +219,10 @@
}
# Image names containing Perl version use '_' instead of '.' under VMS
- foreach $name (@snames) { $name =~ s/\.(\d+)$/_$1/; }
+ # This is not correct for ODS-5 volumes.
+ foreach $name (@snames) {
+ $name =~ s/\.(\d+)$/_$1/ unless (defined $efs_charset);
+ }
if ($trace >= 2){
print "Looking for perl $ver by these names:\n";
print "[EMAIL PROTECTED],\n";
@@ -210,8 +240,8 @@
$inabs++; # Should happen above in next $dir, but just in case . . .
}
foreach $name (@snames){
- if ($name !~ m![/:>\]]!) { push(@cand,$self->catfile($dir,$name)); }
- else { push(@cand,$self->fixpath($name,0)); }
+ if ($name !~ m![/:>\]]!)
{push(@cand,vmsify($self->catfile($dir,$name))); }
+ else
{push(@cand,vmsify($self->fixpath($name,0))); }
}
}
foreach $name (@cand) {
@@ -262,7 +292,7 @@
my($self,$file) = @_;
return $file if -x $file && ! -d _;
my(@dirs) = ('');
- my(@exts) = ('',$Config{'exe_ext'},'.exe','.com');
+ my(@exts) = ('',$Config{'exe_ext'},'.exe','.com','.EXE','.COM');
my($dir,$ext);
if ($file !~ m![/:>\]]!) {
for (my $i = 0; defined $ENV{"DCL\$PATH;$i"}; $i++) {
@@ -325,7 +355,9 @@
# Expand DEST variables.
foreach my $var ($self->installvars) {
my $destvar = 'DESTINSTALL'.$var;
- $self->{$destvar} = File::Spec->eliminate_macros($self->{$destvar});
+#print STDERR "# var = $var, destvar = $destvar self-{destvar} =
$self->{$destvar}\n";
+ $self->{$destvar} = $self->eliminate_macros($self->{$destvar});
+#print STDERR "# var = $var, self-{destvar} = $self->{$destvar}\n";
}
}
@@ -433,12 +465,12 @@
if ($self->{OBJECT} =~ /\s/) {
$self->{OBJECT} =~ s/(\\)?\n+\s+/ /g;
$self->{OBJECT} = $self->wraplist(
- map $self->fixpath($_,0), split /,?\s+/, $self->{OBJECT}
+ map vmsify($self->fixpath($_,0)), split /,?\s+/, $self->{OBJECT}
);
}
$self->{LDFROM} = $self->wraplist(
- map $self->fixpath($_,0), split /,?\s+/, $self->{LDFROM}
+ map vmsify($self->fixpath($_,0)), split /,?\s+/, $self->{LDFROM}
);
}
@@ -457,7 +489,7 @@
$self->{MM_VMS_REVISION} = $Revision;
$self->{MM_VMS_VERSION} = $VERSION;
- $self->{PERL_VMS} = $self->catdir($self->{PERL_SRC}, 'VMS')
+ $self->{PERL_VMS} = vmspath($self->catdir($self->{PERL_SRC}, 'VMS'))
if $self->{PERL_SRC};
}
@@ -522,7 +554,7 @@
{
next unless defined $self->{$macro};
next if $macro =~ /MAN/ && $self->{$macro} eq 'none';
- $self->{$macro} = $self->fixpath($self->{$macro},1);
+ $self->{$macro} = vmspath($self->fixpath($self->{$macro},1));
}
# Cleanup paths for files in MMS macros.
@@ -530,7 +562,7 @@
MAKE_APERL_FILE MYEXTLIB] )
{
next unless defined $self->{$macro};
- $self->{$macro} = $self->fixpath($self->{$macro},0);
+ $self->{$macro} = vmsify($self->fixpath($self->{$macro},0));
}
# Fixup files for MMS macros
@@ -548,8 +580,8 @@
next unless $self ne " " && defined $self->{$macro};
my %tmp = ();
for my $key (keys %{$self->{$macro}}) {
- $tmp{$self->fixpath($key,0)} =
- $self->fixpath($self->{$macro}{$key},0);
+ $tmp{vmsify($self->fixpath($key,0))} =
+
vmsify($self->fixpath($self->{$macro}{$key},0));
}
$self->{$macro} = \%tmp;
}
@@ -558,7 +590,7 @@
next unless defined $self->{$macro};
my @tmp = ();
for my $val (@{$self->{$macro}}) {
- push(@tmp,$self->fixpath($val,0));
+ push(@tmp,vmsify($self->fixpath($val,0)));
}
$self->{$macro} = [EMAIL PROTECTED];
}
@@ -618,7 +650,7 @@
$quals =~ s/ -$type$def\s*//;
$def =~ s/"/""/g;
if ($type eq 'D') { $definestr .= qq["$def",]; }
- elsif ($type eq 'I') { $incstr .= ',' . $self->fixpath($def,1); }
+ elsif ($type eq 'I') { $incstr .= ',' .
vmspath($self->fixpath($def,1)); }
else { $undefstr .= qq["$def",]; }
}
}
@@ -657,7 +689,7 @@
my(@includes) = split(/\s+/,$self->{INC});
foreach (@includes) {
s/^-I//;
- $incstr .= ','.$self->fixpath($_,1);
+ $incstr .= ','.vmspath($self->fixpath($_,1));
}
}
$quals .= "$incstr)";
@@ -736,13 +768,13 @@
my $xsdir;
foreach my $dir (@INC) {
- $xsdir = $self->catdir($dir, 'ExtUtils');
+ $xsdir = vmspath($self->catdir($dir, 'ExtUtils'));
if( -r $self->catfile($xsdir, "xsubpp") ) {
last;
}
}
- my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
+ my $tmdir = vmspath(File::Spec->catdir($self->{PERL_LIB},"ExtUtils"));
my(@tmdeps) = $self->catfile($tmdir,'typemap');
if( $self->{TYPEMAPS} ){
my $typemap;
@@ -751,7 +783,7 @@
warn "Typemap $typemap not found.\n";
}
else{
- push(@tmdeps, $self->fixpath($typemap,0));
+ push(@tmdeps, vmsify($self->fixpath($typemap,0)));
}
}
}
@@ -966,9 +998,11 @@
}
push @m, '\n$(INST_STATIC)/Library\n"";" >>$(MMS$TARGET)',"\n";
+#print STDERR "#self->{LDLOADLIBS}= $self->{LDLOADLIBS}\n";
if (length $self->{LDLOADLIBS}) {
my($lib); my($line) = '';
foreach $lib (split ' ', $self->{LDLOADLIBS}) {
+#print STDERR "#lib = $lib\n";
$lib =~ s%\$%\\\$%g; # Escape '$' in VMS filespecs
if (length($line) + length($lib) > 160) {
push @m, "\t\$(PERL) -e \"print qq{$line}\"
>>\$(MMS\$TARGET)\n";
@@ -1126,6 +1160,9 @@
splitting potentially long list of files across multiple lines
in C<realclean> target.
+FIXME: Newer versions of VMS do not have that limitation, but the main
+perl image still does.
+
=cut
sub installbin {
@@ -1170,7 +1207,7 @@
else {
($todir = $to) =~ s/[^\)]+$//;
}
- $todir = $self->fixpath($todir,1);
+ $todir = vmspath($self->fixpath($todir,1));
push @m, "
$to : $from \$(FIRST_MAKEFILE) ${todir}\$(DIRFILESEP).exists
\$(CP) $from $to
@@ -1189,7 +1226,7 @@
sub subdir_x {
my($self, $subdir) = @_;
my(@m,$key);
- $subdir = $self->fixpath($subdir,1);
+ $subdir = vmspath($self->fixpath($subdir,1));
push @m, '
subdirs ::
@@ -1247,7 +1284,7 @@
my $line = '';
foreach my $file (@otherfiles) {
- $file = $self->fixpath($file);
+ $file = vmsify($self->fixpath($file));
if (length($line) + length($file) > 80) {
push @m, "\t\$(RM_RF) $line\n";
$line = "$file";
@@ -1281,7 +1318,7 @@
my $clean = "clean_subdirs :\n";
foreach my $dir (@{$self->{DIR}}) { # clean subdirectories first
- $dir = $self->fixpath($dir,1);
+ $dir = vmspath($self->fixpath($dir,1));
$clean .= sprintf <<'MAKE_FRAG', $dir, $dir;
If F$Search("%s$(FIRST_MAKEFILE)").nes."" Then $(PERLRUN) -e "chdir
'%s'; print `$(MMS)$(MMSQUALIFIERS) clean`;"
@@ -1306,7 +1343,7 @@
realclean :: clean
');
foreach(@{$self->{DIR}}){
- my($vmsdir) = $self->fixpath($_,1);
+ my($vmsdir) = vmspath($self->fixpath($_,1));
push(@m, ' If F$Search("'."$vmsdir".'$(FIRST_MAKEFILE)").nes.""
Then \\',"\n\t",
'$(PERL) -e "chdir ',"'$vmsdir'",'; print `$(MMS)$(MMSQUALIFIERS)
realclean`;"',"\n");
}
@@ -1350,7 +1387,7 @@
# Occasionally files are repeated several times from different sources
{ my(%af) = map { ($_,1) } @allfiles; @allfiles = keys %af; }
foreach $file (@allfiles) {
- $file = $self->fixpath($file);
+ $file = vmsify($self->fixpath($file));
if (length($line) + length($file) > 80) {
push @m, "\t\$(RM_RF) $line\n";
$line = "$file";
@@ -1486,8 +1523,8 @@
$(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) " >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_BIN) $(DESTINSTALLBIN) " >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(DESTINSTALLSCRIPT) " >>.MM_tmp
- $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) " >>.MM_tmp
- $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) " >>.MM_tmp
+ $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR)
'.VMS::Filespec::vmspath('$(DESTINSTALLMAN1DIR)') " >>.MM_tmp
+ $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)
'.VMS::Filespec::vmspath('$(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[
@@ -1500,51 +1537,51 @@
$(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) " >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_BIN) $(DESTINSTALLSITEBIN) " >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(DESTINSTALLSCRIPT) " >>.MM_tmp
- $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) "
>>.MM_tmp
- $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) "
>>.MM_tmp
+ $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR)
'.VMS::Filespec::vmspath('$(DESTINSTALLSITEMAN1DIR)')' " >>.MM_tmp
+ $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)
'.VMS::Filespec::vmspath('$(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[
pure_vendor_install ::
- $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read
'.File::Spec->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').' '"
>.MM_tmp
- $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write
'.File::Spec->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').'
'" >>.MM_tmp
+ $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read
'.File::Spec->catfile(vmspath('$(VENDORARCHEXP)'),'auto','$(FULLEXT)','.packlist').'
'" >.MM_tmp
+ $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write
'.File::Spec->catfile(vmspath('$(DESTINSTALLVENDORARCH)'),'auto','$(FULLEXT)','.packlist').'
'" >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_LIB) $(DESTINSTALLVENDORLIB) " >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) "
>>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_BIN) $(DESTINSTALLVENDORBIN) " >>.MM_tmp
$(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(DESTINSTALLSCRIPT) " >>.MM_tmp
- $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) "
>>.MM_tmp
- $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) "
>>.MM_tmp
+ $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR)
'.VMS::Filespec::vmspath('$(DESTINSTALLVENDORMAN1DIR)') " >>.MM_tmp
+ $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR)
'.VMS::Filespec::vmspath('$(DESTINSTALLVENDORMAN3DIR)') " >>.MM_tmp
$(NOECHO) $(MOD_INSTALL) <.MM_tmp
$(NOECHO) $(RM_F) .MM_tmp
# Ditto
doc_perl_install ::
- $(NOECHO) $(ECHO) "Appending installation info to
].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q["
+ $(NOECHO) $(ECHO) "Appending installation info to
].$self->catfile(vmspath($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
],@exe_files,
-q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp
>>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[
+q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp
>>].$self->catfile(vmspath($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
].$self->catfile(vmspath($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
],@exe_files,
-q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp
>>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[
+q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp
>>].$self->catfile(vmspath($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
].$self->catfile(vmspath($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
],@exe_files,
-q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp
>>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[
+q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp
>>].$self->catfile(vmspath($self->{DESTINSTALLARCHLIB}),'perllocal.pod').q[
$(NOECHO) $(RM_F) .MM_tmp
];
@@ -1622,7 +1659,7 @@
Set Default $(PERL_SRC)
$(MMS)],$mmsquals,);
if ($self->{PERL_ARCHLIB} =~ m|\[-| && $self->{PERL_SRC} =~ m|(\[-+)|) {
- my($prefix,$target) =
($1,$self->fixpath('$(PERL_ARCHLIB)Config.pm',0));
+ my($prefix,$target) =
($1,vmsify($self->fixpath('$(PERL_ARCHLIB)Config.pm',0)));
$target =~ s/\Q$prefix/[/;
push(@m," $target");
}
@@ -1632,7 +1669,7 @@
]);
}
- push(@m, join(" ", map($self->fixpath($_,0),values %{$self->{XS}}))." :
\$(XSUBPPDEPS)\n")
+ push(@m, join(" ", map(vmsify($self->fixpath($_,0)),values
%{$self->{XS}}))." : \$(XSUBPPDEPS)\n")
if %{$self->{XS}};
join('',@m);
@@ -1703,7 +1740,7 @@
";
foreach(@{$self->{DIR}}){
- my($vmsdir) = $self->fixpath($_,1);
+ my($vmsdir) = vmspath($self->fixpath($_,1));
push(@m, ' If F$Search("',$vmsdir,'$(FIRST_MAKEFILE)").nes."" Then
$(PERL) -e "chdir ',"'$vmsdir'",
'; print `$(MMS)$(MMSQUALIFIERS) $(PASTHRU2) test`'."\n");
}
@@ -1851,7 +1888,7 @@
# in [.intuit]intuit.olb).
for (sort { length($a) <=> length($b) } keys %olbs) {
next unless $olbs{$_} =~ /\Q$self->{LIB_EXT}\E$/;
- my($dir) = $self->fixpath($_,1);
+ my($dir) = vmspath($self->fixpath($_,1));
my($extralibs) = $dir . "extralibs.ld";
my($extopt) = $dir . $olbs{$_};
$extopt =~ s/$self->{LIB_EXT}$/.opt/;
@@ -1897,7 +1934,7 @@
$shrtarget = $targdir . $shrtarget;
$target = "Perlshr.$Config{'dlext'}" unless $target;
$tmpdir = "[]" unless $tmpdir;
- $tmpdir = $self->fixpath($tmpdir,1);
+ $tmpdir = vmspath($self->fixpath($tmpdir,1));
if (@optlibs) { $extralist = join(' ',@optlibs); }
else { $extralist = ''; }
# Let ExtUtils::Liblist find the necessary libs for us (but skip PerlShr)
@@ -1919,16 +1956,16 @@
otherwise ignore this warning\n";
}
}
- $libperldir = $self->fixpath((fileparse($libperl))[1],1);
+ $libperldir = vmspath($self->fixpath((fileparse($libperl))[1],1));
push @m, '
# Fill in the target you want to produce if it\'s not perl
-MAP_TARGET = ',$self->fixpath($target,0),'
-MAP_SHRTARGET = ',$self->fixpath($shrtarget,0),"
+MAP_TARGET = ',vmsify($self->fixpath($target,0)),'
+MAP_SHRTARGET = ',vmsify($self->fixpath($shrtarget,0)),"
MAP_LINKCMD = $linkcmd
MAP_PERLINC = ", $perlinc ? map('"$_" ',@{$perlinc}) : '',"
MAP_EXTRA = $extralist
-MAP_LIBPERL = ",$self->fixpath($libperl,0),'
+MAP_LIBPERL = ",vmsify($self->fixpath($libperl,0)),'
';
@@ -1966,9 +2003,9 @@
$(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 " "
].$self->catfile(vmspath('$(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
>>].$self->catfile(vmspath('$(DESTINSTALLARCHLIB)'),'perllocal.pod').q[
$(NOECHO) $(RM_F) .MM_tmp
];
@@ -1977,8 +2014,8 @@
\$(NOECHO) \$(NOOP)
pure_inst_perl : \$(MAP_TARGET)
- $self->{CP} \$(MAP_SHRTARGET)
",$self->fixpath($Config{'installbin'},1),"
- $self->{CP} \$(MAP_TARGET) ",$self->fixpath($Config{'installbin'},1),"
+ $self->{CP} \$(MAP_SHRTARGET)
",vmspath($self->fixpath($Config{'installbin'},1)),"
+ $self->{CP} \$(MAP_TARGET)
",vmspath($self->fixpath($Config{'installbin'},1)),"
clean :: map_clean
\$(NOECHO) \$(NOOP)
@@ -2028,6 +2065,14 @@
sub prefixify {
my($self, $var, $sprefix, $rprefix, $default) = @_;
+ my $case_preserved = 1;
+ $case_preserved = $ENV{'DECC$EFS_CASE_PRESERVE'};
+ if (defined $case_preserved) {
+ if (($case_preserved lt '1') && ($case_preserved ne 'ENABLE')) {
+ $case_preserved = undef;
+ }
+ }
+
# Translate $(PERLPREFIX) to a real path.
$rprefix = $self->eliminate_macros($rprefix);
$rprefix = VMS::Filespec::vmspath($rprefix) if $rprefix;
@@ -2092,13 +2137,13 @@
my($rvol, $rdirs) = $self->splitpath($rprefix);
if( $rvol ) {
- return $self->catpath($rvol,
+ return vmspath($self->catpath($rvol,
$self->catdir($rdirs, $default),
''
- )
+ ))
}
else {
- return $self->catdir($rdirs, $default);
+ return vmspath($self->catdir($rdirs, $default));
}
}
@@ -2194,7 +2239,7 @@
my $shr = $Config{dbgprefix} . 'PERLSHR';
if ($self->{PERL_SRC}) {
$self->{PERL_ARCHIVE} ||=
- $self->catfile($self->{PERL_SRC}, "$shr.$Config{'dlext'}");
+ $self->catfile(vmspath($self->{PERL_SRC}), "$shr.$Config{'dlext'}");
}
else {
$self->{PERL_ARCHIVE} ||=
@@ -2217,6 +2262,7 @@
sub eliminate_macros {
my($self,$path) = @_;
+#print STDERR "MM_VMS eliminate_macros - path = $path\n";
return '' unless $path;
$self = {} unless ref $self;
@@ -2251,6 +2297,7 @@
}
}
if ($complex) { $npath =~ s#\cB(.*?)\cB#\${$1}#gs; }
+#print STDERR "MM_VMS eliminate_macros - npath = $npath\n";
$npath;
}
@@ -2268,6 +2315,8 @@
checks to see whether it matches the name of a directory in the current
default directory, and returns a directory or file specification accordingly.
+Now returns UNIX style specifications if UNIX files are entered.
+
NOTE: This is the canonical version of the method. The version in
File::Spec::VMS is deprecated.
@@ -2276,8 +2325,11 @@
sub fixpath {
my($self,$path,$force_path) = @_;
return '' unless $path;
+#print STDERR ("Entering mm_vms/fixpath path = $path, force_path = $force_path
\n") if $force_path;
+#print STDERR ("Entering mm_vms/fixpath path = $path, force_path = undef \n")
unless $force_path;
$self = bless {} unless ref $self;
my($fixedpath,$prefix,$name);
+ my $vms_mode = 1;
if ($path =~ /\s/) {
return join ' ',
@@ -2285,12 +2337,58 @@
split /\s+/, $path;
}
+ my $unix_report;
+ my $unix_only;
+ $unix_only = $ENV{'DECC$FILENAME_UNIX_ONLY'};
+ if (defined $unix_only) {
+ if (($unix_only ne '1') && ($unix_only ne 'ENABLE')) {
+ $unix_only = undef;
+ }
+ }
+
+ if (defined $unix_only) {
+ $unix_report = 1;
+ }
+ else {
+ $unix_report = $ENV{'DECC$FILENAME_UNIX_REPORT'};
+ if (defined $unix_report) {
+ if (($unix_report ne '1') && ($unix_report ne 'ENABLE')) {
+ $unix_report = undef;
+ }
+ }
+ }
+
+ if (defined $unix_report) {
+ $vms_mode = 0;
+ }
+ if (!defined ($unix_only)) {
+ $vms_mode = 1 if $path =~ m|[\]>:]|;
+ }
+
+#if ($force_path) {
+#print "mm_vms/fixpath path = $path, force_path = $force_path \n";
+#} else {
+#print "mm_vms/fixpath path = $path, force_path = undef \n";
+#}
+#my $verbose_flag = 1;
+#print "fixpath - vms_mode = $vms_mode\n" if $verbose_flag;
+
if ($path =~ m#^\$\([^\)]+\)\Z(?!\n)#s || $path =~ m#[/:>\]]#) {
if ($force_path or $path =~ /(?:DIR\)|\])\Z(?!\n)/) {
+#my $path_n2 = $self->eliminate_macros($path);
+#print "mm_vms/fixpath (1.0) path_n2 = $path_n2, path = $path \n";
+ if ($vms_mode == 1) {
$fixedpath = vmspath($self->eliminate_macros($path));
}
else {
- $fixedpath = vmsify($self->eliminate_macros($path));
+ $fixedpath = $self->eliminate_macros($path);
+ }
+#print "mm_vms/fixpath (1) fixedpath = $fixedpath\n";
+ }
+ else {
+ $fixedpath = $self->eliminate_macros($path);
+ $fixedpath = vmsify($fixedpath) if ($vms_mode == 1);
+#print "mm_vms/fixpath (2) fixedpath = $fixedpath\n";
}
}
elsif ((($prefix,$name) = ($path =~ m#^\$\(([^\)]+)\)(.+)#s)) &&
$self->{$prefix}) {
@@ -2298,15 +2396,39 @@
# is it a dir or just a name?
$vmspre = ($vmspre =~ m|/| or $prefix =~ /DIR\Z(?!\n)/) ?
vmspath($vmspre) : '';
$fixedpath = ($vmspre ? $vmspre : $self->{$prefix}) . $name;
- $fixedpath = vmspath($fixedpath) if $force_path;
+ if ($force_path) {
+ if ($vms_mode == 1) {
+ $fixedpath = vmspath($fixedpath);
+ }
+# else {
+# $fixedpath = unixpath($fixedpath);
+# }
+ }
+#print "mm_vms/fixpath (4) fixedpath = $fixedpath\n";
}
else {
$fixedpath = $path;
- $fixedpath = vmspath($fixedpath) if $force_path;
+ if ($force_path) {
+ if ($vms_mode == 1) {
+ $fixedpath = vmspath($fixedpath);
+ }
+# else {
+# $fixedpath = unixpath($fixedpath);
+# }
+ }
+#print "mm_vms/fixpath (5) fixedpath = $fixedpath\n";
}
# No hints, so we try to guess
if (!defined($force_path) and $fixedpath !~ /[:>(.\]]/) {
- $fixedpath = vmspath($fixedpath) if -d $fixedpath;
+ if (-d $fixedpath) {
+ if ($vms_mode == 1) {
+ $fixedpath = vmspath($fixedpath);
+ }
+# else {
+# $fixedpath = unixpath($fixedpath);
+# }
+ }
+#print "mm_vms/fixpath (6) fixedpath = $fixedpath\n";
}
# Trim off root dirname if it's had other dirs inserted in front of it.
@@ -2317,6 +2439,7 @@
# directory tree".
if ($path =~ /^[\[>][^.\-]/) { $fixedpath =~ s/^[^\[<]+//; }
+#print "mm_vms/fixpath (7) fixedpath = $fixedpath\n";
return $fixedpath;
}
--- lib/ExtUtils/Command/MM.pm_5_8_6 Mon Jun 20 16:26:28 2005
+++ lib/ExtUtils/Command/MM.pm Mon Jun 20 16:30:18 2005
@@ -51,6 +51,20 @@
$Test::Harness::verbose = shift;
local @INC = @INC;
+
+my $IsVMS = $^O eq 'VMS';
+my $posix_compliant;
+if ($IsVMS) {
+ $posix_compliant = $ENV{'DECC$POSIX_COMPLIANT_PATHNAMES'};
+ if (defined $posix_compliant) {
+ if (($posix_compliant lt '1') && ($posix_compliant ne 'ENABLE')) {
+ $posix_compliant = undef;
+ }
+ }
+ # VMS in POSIX mode currently needs these in UNIX format
+ @_ = map { VMS::Filespec::unixify($_) } @_ if defined $posix_compliant;
+}
+
unshift @INC, map { File::Spec->rel2abs($_) } @_;
Test::Harness::runtests(sort { lc $a cmp lc $b } @ARGV);
}
--- lib/ExtUtils/Liblist/Kid.pm_5_8_6 Mon May 23 17:13:36 2005
+++ lib/ExtUtils/Liblist/Kid.pm Mon May 23 17:13:43 2005
@@ -393,7 +393,7 @@
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 =
$self->catfile(VMS::Filespec::vmspath($self->{PERL_SRC}),$locspec);
$lib = "$locspec$type" if -e $locspec;
}
}