]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - pkgs/perl/patches/perl-USE_MM_LD_RUN_PATH.patch
Change file layout of the makefiles.
[people/stevee/ipfire-3.x.git] / pkgs / perl / patches / perl-USE_MM_LD_RUN_PATH.patch
1 diff -up perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm.runpath perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm
2 --- perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm.runpath 2010-01-18 19:52:49.000000000 +0100
3 +++ perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm 2010-04-13 15:56:55.859789425 +0200
4 @@ -88,6 +88,11 @@ libraries. LD_RUN_PATH is a colon separ
5 in LDLOADLIBS. It is passed as an environment variable to the process
6 that links the shared library.
7
8 +Fedora extension: This generation of LD_RUN_PATH is disabled by default.
9 +To use the generated LD_RUN_PATH for all links, set the USE_MM_LD_RUN_PATH
10 +MakeMaker object attribute / argument, (or set the $USE_MM_LD_RUN_PATH
11 +environment variable).
12 +
13 =head2 BSLOADLIBS
14
15 List of those libraries that are needed but can be linked in
16 diff -up perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm.runpath perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
17 --- perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm.runpath 2010-01-18 19:52:49.000000000 +0100
18 +++ perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 2010-04-13 16:00:32.941778159 +0200
19 @@ -262,7 +262,7 @@ sub full_setup {
20 PERL_SRC PERM_DIR PERM_RW PERM_RWX
21 PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC
22 PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
23 - SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
24 + SIGN SKIP TYPEMAPS USE_MM_LD_RUN_PATH VERSION VERSION_FROM XS XSOPT XSPROTOARG
25 XS_VERSION clean depend dist dynamic_lib linkext macro realclean
26 tool_autosplit
27
28 @@ -406,7 +406,27 @@ sub new {
29 # PRINT_PREREQ is RedHatism.
30 if ("@ARGV" =~ /\bPRINT_PREREQ\b/) {
31 $self->_PRINT_PREREQ;
32 - }
33 + }
34 +
35 + # USE_MM_LD_RUN_PATH - another RedHatism to disable automatic RPATH generation
36 + if ( ( ! $self->{USE_MM_LD_RUN_PATH} )
37 + &&( ("@ARGV" =~ /\bUSE_MM_LD_RUN_PATH(=([01]))?\b/)
38 + ||( exists( $ENV{USE_MM_LD_RUN_PATH} )
39 + &&( $ENV{USE_MM_LD_RUN_PATH} =~ /([01])?$/ )
40 + )
41 + )
42 + )
43 + {
44 + my $v = $1;
45 + if( $v )
46 + {
47 + $v = ($v=~/=([01])$/)[0];
48 + }else
49 + {
50 + $v = 1;
51 + };
52 + $self->{USE_MM_LD_RUN_PATH}=$v;
53 + };
54
55 print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose;
56 if (-f "MANIFEST" && ! -f "Makefile"){
57 @@ -2320,6 +2340,40 @@ precedence. A typemap in the current di
58 precedence, even if it isn't listed in TYPEMAPS. The default system
59 typemap has lowest precedence.
60
61 +=item USE_MM_LD_RUN_PATH
62 +
63 +boolean
64 +The Fedora perl MakeMaker distribution differs from the standard
65 +upstream release in that it disables use of the MakeMaker generated
66 +LD_RUN_PATH by default, UNLESS this attribute is specified , or the
67 +USE_MM_LD_RUN_PATH environment variable is set during the MakeMaker run.
68 +
69 +The upstream MakeMaker will set the ld(1) environment variable LD_RUN_PATH
70 +to the concatenation of every -L ld(1) option directory in which a -l ld(1)
71 +option library is found, which is used as the ld(1) -rpath option if none
72 +is specified. This means that, if your application builds shared libraries
73 +and your MakeMaker application links to them, that the absolute paths of the
74 +libraries in the build tree will be inserted into the RPATH header of all
75 +MakeMaker generated binaries, and that such binaries will be unable to link
76 +to these libraries if they do not still reside in the build tree directories
77 +(unlikely) or in the system library directories (/lib or /usr/lib), regardless
78 +of any LD_LIBRARY_PATH setting. So if you specified -L../mylib -lmylib , and
79 + your 'libmylib.so' gets installed into /some_directory_other_than_usr_lib,
80 + your MakeMaker application will be unable to link to it, even if LD_LIBRARY_PATH
81 +is set to include /some_directory_other_than_usr_lib, because RPATH overrides
82 +LD_LIBRARY_PATH.
83 +
84 +So for Fedora MakeMaker builds LD_RUN_PATH is NOT generated by default for
85 +every link. You can still use explicit -rpath ld options or the LD_RUN_PATH
86 +environment variable during the build to generate an RPATH for the binaries.
87 +
88 +You can set the USE_MM_LD_RUN_PATH attribute to 1 on the MakeMaker command
89 +line or in the WriteMakefile arguments to enable generation of LD_RUN_PATH
90 +for every link command.
91 +
92 +USE_MM_LD_RUN_PATH will default to 1 (LD_RUN_PATH will be used) IF the
93 +$USE_MM_LD_RUN_PATH environment variable is set during a MakeMaker run.
94 +
95 =item VENDORPREFIX
96
97 Like PERLPREFIX, but only for the vendor install locations.
98 diff -up perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.runpath perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
99 --- perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.runpath 2010-01-18 19:52:49.000000000 +0100
100 +++ perl-5.12.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2010-04-13 15:56:10.656775285 +0200
101 @@ -944,7 +944,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $
102 }
103
104 my $ld_run_path_shell = "";
105 - if ($self->{LD_RUN_PATH} ne "") {
106 + if (($self->{LD_RUN_PATH} ne "") && ($self->{USE_MM_LD_RUN_PATH})) {
107 $ld_run_path_shell = 'LD_RUN_PATH="$(LD_RUN_PATH)" ';
108 }
109