Ticket #476: rpath-lib-patch.txt

File rpath-lib-patch.txt, 1.2 KB (added by doughera, 6 years ago)

Patch to skip unnecessary rpath_lib setting

Line 
1--- parrot-svn/config/inter/libparrot.pm        2009-03-21 21:02:56.000000000 -0400
2+++ parrot-andy/config/inter/libparrot.pm       2009-03-23 23:49:57.118939305 -0400
3@@ -107,13 +107,21 @@
4     );
5 
6     # Set -rpath (or equivalent) for the installed executables to find the
7-    # installed shared libparrot.
8-    $conf->data->set(
9-        rpath_lib => ( $parrot_is_shared && $conf->data->get('rpath') )
10-        ? $conf->data->get('rpath')
11-            . $conf->data->get('libdir')
12-        : ''
13-    );
14+    # installed shared libparrot.  Don't set rpath if the library
15+    # directory is going to be searched by ld.so anyway.  For now,
16+    # hard-code those directories as qw(/lib /usr/lib /usr/lib64).
17+    if ($parrot_is_shared && $
18+         conf->data->get('rpath') &&
19+         $conf->data->get('libdir') ne '/lib' &&
20+         $conf->data->get('libdir') ne '/usr/lib' &&
21+         $conf->data->get('libdir') ne '/usr/lib64') {
22+        $conf->data->set( rpath_lib =>
23+            $conf->data->get('rpath') . $conf->data->get('libdir')
24+        );
25+    }
26+    else {
27+        $conf->data->set( rpath_lib => "");
28+    }
29 
30     unless ( defined( $conf->data->get('libparrot_ldflags') ) ) {
31         $conf->data->set(libparrot_ldflags =>