summaryrefslogtreecommitdiff
path: root/lang/perl5/patches/patch-af
blob: b205006e87dfb2a95fce8f5bdc050f7a95942538 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-af,v 1.11 2001/10/02 06:37:56 jlam Exp $

--- lib/ExtUtils/Liblist.pm.orig	Thu Feb 22 21:57:55 2001
+++ lib/ExtUtils/Liblist.pm
@@ -68,20 +68,28 @@
     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;
 	}