diff options
author | Charles Bailey <bailey@newman.upenn.edu> | 1999-03-17 20:10:44 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-03-24 10:38:05 +0000 |
commit | 562a7b0c67b6218259506760bd4728f2f0c6093b (patch) | |
tree | 8cdc1fa81166184bfb07594e19cb9e39afbdf4ff /lib | |
parent | 918c0b2d7bc71242c4810571f6971cac26c1327c (diff) | |
download | perl-562a7b0c67b6218259506760bd4728f2f0c6093b.tar.gz |
applied suggested patch, modulo superseded parts
Message-id: <01J8YFGIHW2W001E7S@mail.newman.upenn.edu>
Subject: [PATCH 5.005_56] Miscellaneous VMS-specific fixes
p4raw-id: //depot/perl@3153
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExtUtils/Liblist.pm | 36 | ||||
-rw-r--r-- | lib/ExtUtils/MM_VMS.pm | 6 |
2 files changed, 19 insertions, 23 deletions
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index dae3125d90..13e4e29e88 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -362,7 +362,7 @@ sub _vms_ext { return ('', '', $crtlstr, ''); } - my(@dirs,@libs,$dir,$lib,%sh,%olb,%obj,$ldlib); + my(@dirs,@libs,$dir,$lib,%found,@fndlibs,$ldlib); my $cwd = cwd(); my($so,$lib_ext,$obj_ext) = @Config{'so','lib_ext','obj_ext'}; # List of common Unix library names and there VMS equivalents @@ -430,28 +430,28 @@ sub _vms_ext { warn "\tChecking $name\n" if $verbose > 2; if (-f ($test = VMS::Filespec::rmsexpand($name))) { # It's got its own suffix, so we'll have to figure out the type - if ($test =~ /(?:$so|exe)$/i) { $type = 'sh'; } - elsif ($test =~ /(?:$lib_ext|olb)$/i) { $type = 'olb'; } + if ($test =~ /(?:$so|exe)$/i) { $type = 'SHR'; } + elsif ($test =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; } elsif ($test =~ /(?:$obj_ext|obj)$/i) { warn "Note (probably harmless): " ."Plain object file $test found in library list\n"; - $type = 'obj'; + $type = 'OBJ'; } else { warn "Note (probably harmless): " ."Unknown library type for $test; assuming shared\n"; - $type = 'sh'; + $type = 'SHR'; } } elsif (-f ($test = VMS::Filespec::rmsexpand($name,$so)) or -f ($test = VMS::Filespec::rmsexpand($name,'.exe'))) { - $type = 'sh'; + $type = 'SHR'; $name = $test unless $test =~ /exe;?\d*$/i; } elsif (not length($ctype) and # If we've got a lib already, don't bother ( -f ($test = VMS::Filespec::rmsexpand($name,$lib_ext)) or -f ($test = VMS::Filespec::rmsexpand($name,'.olb')))) { - $type = 'olb'; + $type = 'OLB'; $name = $test unless $test =~ /olb;?\d*$/i; } elsif (not length($ctype) and # If we've got a lib already, don't bother @@ -459,17 +459,18 @@ sub _vms_ext { -f ($test = VMS::Filespec::rmsexpand($name,'.obj')))) { warn "Note (probably harmless): " ."Plain object file $test found in library list\n"; - $type = 'obj'; + $type = 'OBJ'; $name = $test unless $test =~ /obj;?\d*$/i; } if (defined $type) { $ctype = $type; $cand = $name; - last if $ctype eq 'sh'; + last if $ctype eq 'SHR'; } } if ($ctype) { - eval '$' . $ctype . "{'$cand'}++"; - die "Error recording library: $@" if $@; + # This has to precede any other CRTLs, so just make it first + if ($cand eq 'VAXCCURSE') { unshift @{$found{$ctype}}, $cand; } + else { push @{$found{$ctype}}, $cand; } warn "\tFound as $cand (really $test), type $ctype\n" if $verbose > 1; next LIB; } @@ -478,15 +479,10 @@ sub _vms_ext { ."No library found for $lib\n"; } - @libs = sort keys %obj; - # This has to precede any other CRTLs, so just make it first - if ($olb{VAXCCURSE}) { - push(@libs,"$olb{VAXCCURSE}/Library"); - delete $olb{VAXCCURSE}; - } - push(@libs, map { "$_/Library" } sort keys %olb); - push(@libs, map { "$_/Share" } sort keys %sh); - $lib = join(' ',@libs); + push @fndlibs, @{$found{OBJ}} if exists $found{OBJ}; + push @fndlibs, map { "$_/Library" } @{$found{OLB}} if exists $found{OLB}; + push @fndlibs, map { "$_/Share" } @{$found{SHR}} if exists $found{SHR}; + $lib = join(' ',@fndlibs); $ldlib = $crtlstr ? "$lib $crtlstr" : $lib; warn "Result:\n\tEXTRALIBS: $lib\n\tLDLOADLIBS: $ldlib\n" if $verbose; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index 8f8ac1787c..3b8352823f 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -1465,8 +1465,8 @@ $(INST_STATIC) : $(OBJECT) $(MYEXTLIB) push(@m,"\t",'Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST)',"\n"); } - foreach $lib (split $self->{EXTRALIBS}) { - $lib = '""' if $lib eq '"'; + push @m, "\t\$(NOECHO) \$(PERL) -e 1 >\$(INST_ARCHAUTODIR)extralibs.ld\n"; + foreach $lib (split ' ', $self->{EXTRALIBS}) { push(@m,"\t",'$(NOECHO) $(PERL) -e "print qq{',$lib,'\n}" >>$(INST_ARCHAUTODIR)extralibs.ld',"\n"); } push @m, $self->dir_target('$(INST_ARCHAUTODIR)'); @@ -2312,7 +2312,7 @@ $(MAP_TARGET) :: $(MAKE_APERL_FILE) $tmp = $self->fixpath($tmp,1); if (@optlibs) { $extralist = join(' ',@optlibs); } else { $extralist = ''; } - # Let ExtUtils::Liblist find the necessary for us (but skip PerlShr; + # Let ExtUtils::Liblist find the necessary libs for us (but skip PerlShr) # that's what we're building here). push @optlibs, grep { !/PerlShr/i } split +($self->ext())[2]; if ($libperl) { |