perl 5.003_01: lib/ExtUtils/MakeMaker.pm
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / Liblist.pm
index 1064cb1..097203e 100644 (file)
@@ -2,6 +2,8 @@ package ExtUtils::Liblist;
 
 # Broken out of MakeMaker from version 4.11
 
+$ExtUtils::Liblist::VERSION = substr q$Revision: 1.20 $, 10;
+
 use Config;
 use Cwd 'cwd';
 use File::Basename;
@@ -10,7 +12,7 @@ my $Config_libext = $Config{lib_ext} || ".a";
 
 sub ext {
     my($self,$potential_libs, $Verbose) = @_;
-    if ($^O eq 'os2' and $Config{libs}) { 
+    if ($^O =~ 'os2' and $Config{libs}) { 
        # Dynamic libraries are not transitive, so we may need including
        # the libraries linked against perl.dll again.
 
@@ -45,9 +47,9 @@ sub ext {
                        if $Verbose;
                next;
            }
-           if ($thislib !~ m|^/|) {
+           unless ($self->file_name_is_absolute($thislib)) {
              print STDOUT "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
-             $thislib = "$pwd/$thislib";
+             $thislib = $self->catdir($pwd,$thislib);
            }
            push(@searchpath, $thislib);
            push(@extralibs,  "$ptype$thislib");
@@ -133,15 +135,18 @@ sub ext {
 
            # Do not add it into the list if it is already linked in
            # with the main perl executable.
-           # We have to special-case the NeXT, because all the math 
-           # is also in libsys_s
+           # We have to special-case the NeXT, because math and ndbm 
+           # are both in libsys_s
            unless ($in_perl || 
-                   ($^O eq 'next' && $thislib eq 'm') ){
+               ($Config{'osname'} eq 'next' &&
+                   ($thislib eq 'm' || $thislib eq 'ndbm')) ){
                push(@extralibs, "-l$thislib");
            }
 
            # We might be able to load this archive file dynamically
-           if ( $Config{'dlsrc'} =~ /dl_next|dl_dld/){
+           if ( ($Config{'dlsrc'} =~ /dl_next/ && $Config{'osvers'} lt '4_0')
+           ||   ($Config{'dlsrc'} =~ /dl_dld/) )
+           {
                # We push -l$thislib instead of $fullname because
                # it avoids hardwiring a fixed path into the .bs file.
                # Mkbootstrap will automatically add dl_findfile() to