jvdias ae5aa7a
--- perl-5.8.7/lib/ExtUtils/MakeMaker.pm.USE_MM_LD_RUN_PATH	2005-12-08 15:10:24.000000000 -0500
jvdias ae5aa7a
+++ perl-5.8.7/lib/ExtUtils/MakeMaker.pm	2005-12-08 19:36:26.000000000 -0500
jvdias ae5aa7a
@@ -226,7 +226,7 @@
jvdias ae5aa7a
     PERL_SRC PERM_RW PERM_RWX
jvdias ae5aa7a
     PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC
jvdias ae5aa7a
     PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
jvdias ae5aa7a
-    SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
jvdias ae5aa7a
+    SKIP TYPEMAPS USE_MM_LD_RUN_PATH VERSION VERSION_FROM XS XSOPT XSPROTOARG
jvdias ae5aa7a
     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
jvdias ae5aa7a
     tool_autosplit
jvdias ae5aa7a
 
jvdias ae5aa7a
@@ -362,7 +362,27 @@
jvdias ae5aa7a
         print join(" ", map { "perl($_)>=$self->{PREREQ_PM}->{$_} " } 
jvdias ae5aa7a
                         sort keys %{$self->{PREREQ_PM}}), "\n";
jvdias ae5aa7a
         exit 0;
jvdias ae5aa7a
-   }
jvdias ae5aa7a
+    }
jvdias ae5aa7a
+   
jvdias ae5aa7a
+    # USE_MM_LD_RUN_PATH - another RedHatism to disable automatic RPATH generation
jvdias ae5aa7a
+    if ( ( ! $self->{USE_MM_LD_RUN_PATH} )
jvdias ae5aa7a
+       &&( ("@ARGV" =~ /\bUSE_MM_LD_RUN_PATH(=([01]))?\b/)
jvdias ae5aa7a
+	 ||( exists( $ENV{USE_MM_LD_RUN_PATH} ) 
jvdias ae5aa7a
+           &&( $ENV{USE_MM_LD_RUN_PATH} =~ /([01])?$/ )
jvdias ae5aa7a
+	    )
jvdias ae5aa7a
+	 )
jvdias ae5aa7a
+       )
jvdias ae5aa7a
+    {
jvdias ae5aa7a
+	my $v = $1;
jvdias ae5aa7a
+	if( $v )
jvdias ae5aa7a
+	{
jvdias ae5aa7a
+	    $v = ($v=~/=([01])$/)[0];
jvdias ae5aa7a
+	}else
jvdias ae5aa7a
+	{
jvdias ae5aa7a
+	    $v = 1;
jvdias ae5aa7a
+	};
jvdias ae5aa7a
+	$self->{USE_MM_LD_RUN_PATH}=$v;
jvdias ae5aa7a
+    }
jvdias ae5aa7a
 
jvdias ae5aa7a
     print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose;
jvdias ae5aa7a
     if (-f "MANIFEST" && ! -f "Makefile"){
jvdias ae5aa7a
@@ -2007,6 +2027,40 @@
jvdias ae5aa7a
 precedence, even if it isn't listed in TYPEMAPS.  The default system
jvdias ae5aa7a
 typemap has lowest precedence.
jvdias ae5aa7a
 
jvdias ae5aa7a
+=item USE_MM_LD_RUN_PATH
jvdias ae5aa7a
+
jvdias ae5aa7a
+boolean
jvdias ae5aa7a
+The Red Hat perl MakeMaker distribution differs from the standard 
jvdias ae5aa7a
+upstream release in that it disables use of the MakeMaker generated
jvdias ae5aa7a
+LD_RUN_PATH by default, UNLESS this attribute is specified , or the
jvdias ae5aa7a
+USE_MM_LD_RUN_PATH environment variable is set during the MakeMaker run.
jvdias ae5aa7a
+
jvdias ae5aa7a
+The upstream MakeMaker will set the ld(1) environment variable LD_RUN_PATH 
jvdias ae5aa7a
+to the concatenation of every -L ld(1) option directory in which a -l ld(1)
jvdias ae5aa7a
+option library is found, which is used as the ld(1) -rpath option if none 
jvdias ae5aa7a
+is specified. This means that, if your application builds shared libraries 
jvdias ae5aa7a
+and your MakeMaker application links to them, that the absolute paths of the
jvdias ae5aa7a
+libraries in the build tree will be inserted into the RPATH header of all 
jvdias ae5aa7a
+MakeMaker generated binaries, and that such binaries will be unable to link 
jvdias ae5aa7a
+to these libraries if they do not still reside in the build tree directories 
jvdias ae5aa7a
+(unlikely) or in the system library directories (/lib or /usr/lib), regardless 
jvdias ae5aa7a
+of any LD_LIBRARY_PATH setting. So if you specified -L../mylib -lmylib , and
jvdias ae5aa7a
+ your 'libmylib.so' gets installed into /some_directory_other_than_usr_lib,
jvdias ae5aa7a
+ your MakeMaker application will be unable to link to it, even if LD_LIBRARY_PATH 
jvdias ae5aa7a
+is set to include /some_directory_other_than_usr_lib, because RPATH overrides
jvdias ae5aa7a
+LD_LIBRARY_PATH.
jvdias ae5aa7a
+
jvdias ae5aa7a
+So for Red Hat MakeMaker builds LD_RUN_PATH is NOT generated by default for
jvdias ae5aa7a
+every link. You can still use explicit -rpath ld options or the LD_RUN_PATH
jvdias ae5aa7a
+environment variable during the build to generate an RPATH for the binaries.
jvdias ae5aa7a
+ 
jvdias ae5aa7a
+You can set the USE_MM_LD_RUN_PATH attribute to 1 on the MakeMaker command
jvdias ae5aa7a
+line or in the WriteMakefile arguments to enable generation of LD_RUN_PATH
jvdias ae5aa7a
+for every link command. 
jvdias ae5aa7a
+
jvdias ae5aa7a
+USE_MM_LD_RUN_PATH will default to 1 (LD_RUN_PATH will be used) IF the 
jvdias ae5aa7a
+$USE_MM_LD_RUN_PATH environment variable is set during a MakeMaker run. 
jvdias ae5aa7a
+
jvdias ae5aa7a
 =item VENDORPREFIX
jvdias ae5aa7a
 
jvdias ae5aa7a
 Like PERLPREFIX, but only for the vendor install locations.
jvdias ae5aa7a
--- perl-5.8.7/lib/ExtUtils/MM_Unix.pm.USE_MM_LD_RUN_PATH	2005-12-08 15:10:24.000000000 -0500
jvdias ae5aa7a
+++ perl-5.8.7/lib/ExtUtils/MM_Unix.pm	2005-12-08 18:35:13.000000000 -0500
jvdias ae5aa7a
@@ -1142,7 +1142,7 @@
jvdias ae5aa7a
     }
jvdias ae5aa7a
 
jvdias ae5aa7a
     my $ld_run_path_shell = "";
jvdias ae5aa7a
-    if ($self->{LD_RUN_PATH} ne "") {
jvdias ae5aa7a
+    if (($self->{LD_RUN_PATH} ne "") && ($self->{USE_MM_LD_RUN_PATH})) {
jvdias ae5aa7a
 	$ld_run_path_shell = 'LD_RUN_PATH="$(LD_RUN_PATH)" ';
jvdias ae5aa7a
     }
jvdias ae5aa7a
     push(@m,
jvdias ae5aa7a
--- perl-5.8.7/lib/ExtUtils/Liblist.pm.USE_MM_LD_RUN_PATH	2003-04-07 14:58:17.000000000 -0400
jvdias ae5aa7a
+++ perl-5.8.7/lib/ExtUtils/Liblist.pm	2005-12-08 19:39:28.000000000 -0500
jvdias ae5aa7a
@@ -51,6 +51,8 @@
jvdias ae5aa7a
 specifics below.  The list of the filenames is returned only if
jvdias ae5aa7a
 $need_names argument is true.
jvdias ae5aa7a
 
jvdias ae5aa7a
+NOTE: if the LD_RUN_PATH me
jvdias ae5aa7a
+
jvdias ae5aa7a
 Dependent libraries can be linked in one of three ways:
jvdias ae5aa7a
 
jvdias ae5aa7a
 =over 2
jvdias ae5aa7a
@@ -87,6 +89,11 @@
jvdias ae5aa7a
 in LDLOADLIBS. It is passed as an environment variable to the process
jvdias ae5aa7a
 that links the shared library.
jvdias ae5aa7a
 
jvdias ae5aa7a
+Red Hat extension: This generation of LD_RUN_PATH is disabled by default.
jvdias ae5aa7a
+To use the generated LD_RUN_PATH for all links, set the USE_MM_LD_RUN_PATH
jvdias ae5aa7a
+MakeMaker object attribute / argument, (or set the $USE_MM_LD_RUN_PATH
jvdias ae5aa7a
+environment variable). 
jvdias ae5aa7a
+
jvdias ae5aa7a
 =head2 BSLOADLIBS
jvdias ae5aa7a
 
jvdias ae5aa7a
 List of those libraries that are needed but can be linked in