xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/perl/files/perl-configpm-switch.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom 1f7cc5db2ca549c37c6a7923368e1a0104f31b99 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Alexander Kanavin <alex.kanavin@gmail.com>
3*4882a593SmuzhiyunDate: Sun, 27 May 2007 21:04:11 +0000
4*4882a593SmuzhiyunSubject: [PATCH] perl: 5.8.7 -> 5.8.8 (from OE)
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunThis patch is used for perl-native only. It enables the switching of
7*4882a593Smuzhiyunconfiguration files between Config_heavy.pl and
8*4882a593SmuzhiyunConfig_heavy-target.pl by setting the environment variables
9*4882a593SmuzhiyunPERLCONFIGTARGET - the later containing settings for the target while
10*4882a593Smuzhiyunthe former contains those for the host. This will allow cpan.bbclass
11*4882a593Smuzhiyunto use the settings appropriate for the native and/or target builds
12*4882a593Smuzhiyunas required. This also disables the use of the cache since the cached
13*4882a593Smuzhiyunvalues would be valid for the host only.
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunUpstream-Status: Inappropriate [native]
16*4882a593SmuzhiyunSigned-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun---
19*4882a593Smuzhiyun configpm | 18 ++++++++++++++++--
20*4882a593Smuzhiyun 1 file changed, 16 insertions(+), 2 deletions(-)
21*4882a593Smuzhiyun
22*4882a593Smuzhiyundiff --git a/configpm b/configpm
23*4882a593Smuzhiyunindex 94a4778..99b20c9 100755
24*4882a593Smuzhiyun--- a/configpm
25*4882a593Smuzhiyun+++ b/configpm
26*4882a593Smuzhiyun@@ -687,7 +687,7 @@ sub FETCH {
27*4882a593Smuzhiyun     my($self, $key) = @_;
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun     # check for cached value (which may be undef so we use exists not defined)
30*4882a593Smuzhiyun-    return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key);
31*4882a593Smuzhiyun+    return $self->fetch_string($key);
32*4882a593Smuzhiyun }
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun ENDOFEND
35*4882a593Smuzhiyun@@ -845,7 +845,21 @@ $config_txt .= sprintf <<'ENDOFTIE', $fast_config;
36*4882a593Smuzhiyun sub DESTROY { }
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun sub AUTOLOAD {
39*4882a593Smuzhiyun-    require 'Config_heavy.pl';
40*4882a593Smuzhiyun+    my $cfgfile = 'Config_heavy.pl';
41*4882a593Smuzhiyun+    if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
42*4882a593Smuzhiyun+    {
43*4882a593Smuzhiyun+        $cfgfile = 'Config_heavy-target.pl';
44*4882a593Smuzhiyun+    }
45*4882a593Smuzhiyun+    if (defined $ENV{PERL_ARCHLIB})
46*4882a593Smuzhiyun+    {
47*4882a593Smuzhiyun+        push @INC, $ENV{PERL_ARCHLIB};
48*4882a593Smuzhiyun+        require $cfgfile;
49*4882a593Smuzhiyun+        pop @INC;
50*4882a593Smuzhiyun+    }
51*4882a593Smuzhiyun+    else
52*4882a593Smuzhiyun+    {
53*4882a593Smuzhiyun+        require $cfgfile;
54*4882a593Smuzhiyun+    }
55*4882a593Smuzhiyun     goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
56*4882a593Smuzhiyun     die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
57*4882a593Smuzhiyun }
58