Upgrade to ExtUtils::MakeMaker 6.42
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / Liblist / Kid.pm
index 5d05680..bef182b 100644 (file)
@@ -8,8 +8,9 @@ package ExtUtils::Liblist::Kid;
 use 5.00503;
 # Broken out of MakeMaker from version 4.11
 
+use strict;
 use vars qw($VERSION);
-$VERSION = 1.30;
+$VERSION = 6.42;
 
 use Config;
 use Cwd 'cwd';
@@ -131,6 +132,7 @@ sub _unix_os2_ext {
                 && ($thislib .= "_s") ){ # we must explicitly use _s version
            } elsif (-f ($fullname="$thispth/lib$thislib$Config_libext")){
            } elsif (-f ($fullname="$thispth/$thislib$Config_libext")){
+            } elsif (-f ($fullname="$thispth/lib$thislib.dll$Config_libext")){
            } elsif (-f ($fullname="$thispth/Slib$thislib$Config_libext")){
            } elsif ($^O eq 'dgux'
                 && -l ($fullname="$thispth/lib$thislib$Config_libext")
@@ -225,9 +227,9 @@ sub _win32_ext {
     return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs;
 
     my $cc             = $Config{cc};
-    my $VC             = 1 if $cc =~ /^cl/i;
-    my $BC             = 1 if $cc =~ /^bcc/i;
-    my $GC             = 1 if $cc =~ /^gcc/i;
+    my $VC             = $cc =~ /^cl/i;
+    my $BC             = $cc =~ /^bcc/i;
+    my $GC             = $cc =~ /^gcc/i;
     my $so             = $Config{'so'};
     my $libs           = $Config{'perllibs'};
     my $libpth         = $Config{'libpth'};
@@ -374,9 +376,7 @@ sub _vms_ext {
   $verbose ||= 0;
 
   my(@crtls,$crtlstr);
-  my($dbgqual) = $self->{OPTIMIZE} || $Config{'optimize'} ||
-                 $self->{CCFLAGS}   || $Config{'ccflags'};
-  @crtls = ( ($dbgqual =~ m-/Debug-i ? $Config{'dbgprefix'} : '')
+  @crtls = ( ($Config{'ldflags'} =~ m-/Debug-i ? $Config{'dbgprefix'} : '')
               . 'PerlShr/Share' );
   push(@crtls, grep { not /\(/ } split /\s+/, $Config{'perllibs'});
   push(@crtls, grep { not /\(/ } split /\s+/, $Config{'libc'});
@@ -388,7 +388,7 @@ sub _vms_ext {
   if ($self->{PERL_SRC}) {
     my($lib,$locspec,$type);
     foreach $lib (@crtls) { 
-      if (($locspec,$type) = $lib =~ m-^([\w$\-]+)(/\w+)?- and $locspec =~ /perl/i) {
+      if (($locspec,$type) = $lib =~ m{^([\w\$-]+)(/\w+)?} and $locspec =~ /perl/i) {
         if    (lc $type eq '/share')   { $locspec .= $Config{'exe_ext'}; }
         elsif (lc $type eq '/library') { $locspec .= $Config{'lib_ext'}; }
         else                           { $locspec .= $Config{'obj_ext'}; }
@@ -456,7 +456,7 @@ sub _vms_ext {
       $lib = $libmap{$lib};
     }
 
-    my(@variants,$variant,$name,$test,$cand);
+    my(@variants,$variant,$cand);
     my($ctype) = '';
 
     # If we don't have a file type, consider it a possibly abbreviated name and
@@ -470,44 +470,49 @@ sub _vms_ext {
     push(@variants,$lib);
     warn "Looking for $lib\n" if $verbose;
     foreach $variant (@variants) {
+      my($fullname, $name);
+
       foreach $dir (@dirs) {
         my($type);
 
         $name = "$dir$variant";
         warn "\tChecking $name\n" if $verbose > 2;
-        if (-f ($test = VMS::Filespec::rmsexpand($name))) {
+        $fullname = VMS::Filespec::rmsexpand($name);
+        if (defined $fullname and -f $fullname) {
           # It's got its own suffix, so we'll have to figure out the type
-          if    ($test =~ /(?:$so|exe)$/i)      { $type = 'SHR'; }
-          elsif ($test =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; }
-          elsif ($test =~ /(?:$obj_ext|obj)$/i) {
+          if    ($fullname =~ /(?:$so|exe)$/i)      { $type = 'SHR'; }
+          elsif ($fullname =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; }
+          elsif ($fullname =~ /(?:$obj_ext|obj)$/i) {
             warn "Note (probably harmless): "
-                        ."Plain object file $test found in library list\n";
+                ."Plain object file $fullname found in library list\n";
             $type = 'OBJ';
           }
           else {
             warn "Note (probably harmless): "
-                        ."Unknown library type for $test; assuming shared\n";
+                ."Unknown library type for $fullname; assuming shared\n";
             $type = 'SHR';
           }
         }
-        elsif (-f ($test = VMS::Filespec::rmsexpand($name,$so))      or
-               -f ($test = VMS::Filespec::rmsexpand($name,'.exe')))     {
+        elsif (-f ($fullname = VMS::Filespec::rmsexpand($name,$so))      or
+               -f ($fullname = VMS::Filespec::rmsexpand($name,'.exe')))     {
           $type = 'SHR';
-          $name = $test unless $test =~ /exe;?\d*$/i;
+          $name = $fullname unless $fullname =~ /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'))))  {
+        elsif (not length($ctype) and  # If we've got a lib already, 
+                                       # don't bother
+               ( -f ($fullname = VMS::Filespec::rmsexpand($name,$lib_ext)) or
+                 -f ($fullname = VMS::Filespec::rmsexpand($name,'.olb'))))  {
           $type = 'OLB';
-          $name = $test unless $test =~ /olb;?\d*$/i;
+          $name = $fullname unless $fullname =~ /olb;?\d*$/i;
         }
-        elsif (not length($ctype) and  # If we've got a lib already, don't bother
-               ( -f ($test = VMS::Filespec::rmsexpand($name,$obj_ext)) or
-                 -f ($test = VMS::Filespec::rmsexpand($name,'.obj'))))  {
+        elsif (not length($ctype) and  # If we've got a lib already, 
+                                       # don't bother
+               ( -f ($fullname = VMS::Filespec::rmsexpand($name,$obj_ext)) or
+                 -f ($fullname = VMS::Filespec::rmsexpand($name,'.obj'))))  {
           warn "Note (probably harmless): "
-                      ."Plain object file $test found in library list\n";
+                      ."Plain object file $fullname found in library list\n";
           $type = 'OBJ';
-          $name = $test unless $test =~ /obj;?\d*$/i;
+          $name = $fullname unless $fullname =~ /obj;?\d*$/i;
         }
         if (defined $type) {
           $ctype = $type; $cand = $name;
@@ -518,7 +523,8 @@ sub _vms_ext {
         # 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;
+        warn "\tFound as $cand (really $fullname), type $ctype\n" 
+          if $verbose > 1;
        push @flibs, $name unless $libs_seen{$fullname}++;
         next LIB;
       }