292b33
diff -up perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm.usem perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm
292b33
--- perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm.usem	2011-05-08 05:10:08.000000000 +0200
292b33
+++ perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm	2011-05-17 11:14:22.169115984 +0200
292b33
@@ -88,6 +88,11 @@ libraries.  LD_RUN_PATH is a colon separ
292b33
 in LDLOADLIBS. It is passed as an environment variable to the process
292b33
 that links the shared library.
292b33
 
292b33
+Fedora extension: This generation of LD_RUN_PATH is disabled by default.
292b33
+To use the generated LD_RUN_PATH for all links, set the USE_MM_LD_RUN_PATH
292b33
+MakeMaker object attribute / argument, (or set the $USE_MM_LD_RUN_PATH
292b33
+environment variable).
292b33
+
292b33
 =head2 BSLOADLIBS
292b33
 
292b33
 List of those libraries that are needed but can be linked in
292b33
diff -up perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm.usem perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
292b33
--- perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm.usem	2011-05-08 05:10:08.000000000 +0200
292b33
+++ perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm	2011-05-17 13:39:26.912586030 +0200
292b33
@@ -278,7 +278,7 @@ sub full_setup {
292b33
     PERL_SRC PERM_DIR PERM_RW PERM_RWX
292b33
     PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC
292b33
     PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
292b33
-    SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
292b33
+    SIGN SKIP TYPEMAPS USE_MM_LD_RUN_PATH VERSION VERSION_FROM XS XSOPT XSPROTOARG
292b33
     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
292b33
     tool_autosplit
292b33
 
292b33
@@ -422,7 +422,27 @@ sub new {
292b33
     # PRINT_PREREQ is RedHatism.
292b33
     if ("@ARGV" =~ /\bPRINT_PREREQ\b/) {
292b33
         $self->_PRINT_PREREQ;
292b33
-   }
292b33
+    }
292b33
+
292b33
+    # USE_MM_LD_RUN_PATH - another RedHatism to disable automatic RPATH generation
292b33
+    if ( ( ! $self->{USE_MM_LD_RUN_PATH} )
292b33
+       &&( ("@ARGV" =~ /\bUSE_MM_LD_RUN_PATH(=([01]))?\b/)
292b33
+        ||( exists( $ENV{USE_MM_LD_RUN_PATH} )
292b33
+           &&( $ENV{USE_MM_LD_RUN_PATH} =~ /([01])?$/ )
292b33
+           )
292b33
+        )
292b33
+       )
292b33
+    {
292b33
+       my $v = $1;
292b33
+       if( $v )
292b33
+       {
292b33
+           $v = ($v=~/=([01])$/)[0];
292b33
+       }else
292b33
+       {
292b33
+           $v = 1;
292b33
+       };
292b33
+       $self->{USE_MM_LD_RUN_PATH}=$v;
292b33
+    };
292b33
 
292b33
     print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose;
292b33
     if (-f "MANIFEST" && ! -f "Makefile" && ! $ENV{PERL_CORE}){
292b33
@@ -2352,6 +2372,40 @@ precedence.  A typemap in the current di
292b33
 precedence, even if it isn't listed in TYPEMAPS.  The default system
292b33
 typemap has lowest precedence.
292b33
 
292b33
+=item USE_MM_LD_RUN_PATH
292b33
+
292b33
+boolean
292b33
+The Fedora perl MakeMaker distribution differs from the standard
292b33
+upstream release in that it disables use of the MakeMaker generated
292b33
+LD_RUN_PATH by default, UNLESS this attribute is specified , or the
292b33
+USE_MM_LD_RUN_PATH environment variable is set during the MakeMaker run.
292b33
+
292b33
+The upstream MakeMaker will set the ld(1) environment variable LD_RUN_PATH
292b33
+to the concatenation of every -L ld(1) option directory in which a -l ld(1)
292b33
+option library is found, which is used as the ld(1) -rpath option if none
292b33
+is specified. This means that, if your application builds shared libraries
292b33
+and your MakeMaker application links to them, that the absolute paths of the
292b33
+libraries in the build tree will be inserted into the RPATH header of all
292b33
+MakeMaker generated binaries, and that such binaries will be unable to link
292b33
+to these libraries if they do not still reside in the build tree directories
292b33
+(unlikely) or in the system library directories (/lib or /usr/lib), regardless
292b33
+of any LD_LIBRARY_PATH setting. So if you specified -L../mylib -lmylib , and
292b33
+ your 'libmylib.so' gets installed into /some_directory_other_than_usr_lib,
292b33
+ your MakeMaker application will be unable to link to it, even if LD_LIBRARY_PATH
292b33
+is set to include /some_directory_other_than_usr_lib, because RPATH overrides
292b33
+LD_LIBRARY_PATH.
292b33
+
292b33
+So for Fedora MakeMaker builds LD_RUN_PATH is NOT generated by default for
292b33
+every link. You can still use explicit -rpath ld options or the LD_RUN_PATH
292b33
+environment variable during the build to generate an RPATH for the binaries.
292b33
+
292b33
+You can set the USE_MM_LD_RUN_PATH attribute to 1 on the MakeMaker command
292b33
+line or in the WriteMakefile arguments to enable generation of LD_RUN_PATH
292b33
+for every link command.
292b33
+
292b33
+USE_MM_LD_RUN_PATH will default to 1 (LD_RUN_PATH will be used) IF the
292b33
+$USE_MM_LD_RUN_PATH environment variable is set during a MakeMaker run.
292b33
+
292b33
 =item VENDORPREFIX
292b33
 
292b33
 Like PERLPREFIX, but only for the vendor install locations.
292b33
diff -up perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.usem perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
292b33
--- perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.usem	2011-05-08 05:10:08.000000000 +0200
292b33
+++ perl-5.14.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm	2011-05-17 11:14:22.172115972 +0200
292b33
@@ -944,7 +944,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $
292b33
     }
292b33
 
292b33
     my $ld_run_path_shell = "";
292b33
-    if ($self->{LD_RUN_PATH} ne "") {
292b33
+    if (($self->{LD_RUN_PATH} ne "") && ($self->{USE_MM_LD_RUN_PATH})) {
292b33
 	$ld_run_path_shell = 'LD_RUN_PATH="$(LD_RUN_PATH)" ';
292b33
     }
292b33