Apply NetBSD patch-af: handle both -[LR] and -Wl,-R linker paths.
Jarkko Hietaniemi [Sun, 9 Dec 2001 21:09:10 +0000 (21:09 +0000)]
p4raw-id: //depot/perl@13567

lib/ExtUtils/Liblist.pm

index 09421e3..c7c6f77 100644 (file)
@@ -68,20 +68,28 @@ sub _unix_os2_ext {
     foreach $thislib (split ' ', $potential_libs){
 
        # Handle possible linker path arguments.
-       if ($thislib =~ s/^(-[LR])//){  # save path flag type
+       if ($thislib =~ s/^(-[LR]|-Wl,-R)//){   # save path flag type
            my($ptype) = $1;
            unless (-d $thislib){
                warn "$ptype$thislib ignored, directory does not exist\n"
                        if $verbose;
                next;
            }
+           my($rtype) = $ptype;
+           if (($ptype eq '-R') or ($ptype eq '-Wl,-R')) {
+               if ($Config{'lddlflags'} =~ /-Wl,-R/) {
+                   $rtype = '-Wl,-R';
+               } elsif ($Config{'lddlflags'} =~ /-R/) {
+                   $rtype = '-R';
+               }
+           }
            unless ($self->file_name_is_absolute($thislib)) {
              warn "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
              $thislib = $self->catdir($pwd,$thislib);
            }
            push(@searchpath, $thislib);
            push(@extralibs,  "$ptype$thislib");
-           push(@ldloadlibs, "$ptype$thislib");
+           push(@ldloadlibs, "$rtype$thislib");
            next;
        }