summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl-5.12.3/perl-configpm-switch.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.12.3/perl-configpm-switch.patch')
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.3/perl-configpm-switch.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.3/perl-configpm-switch.patch b/meta/recipes-devtools/perl/perl-5.12.3/perl-configpm-switch.patch
new file mode 100644
index 0000000000..9e9f342866
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.12.3/perl-configpm-switch.patch
@@ -0,0 +1,45 @@
1Upstream-Status:Inappropriate [native]
2
3This patch is used for perl-native only. It enables the switching of
4configuration files between Config_heavy.pl and
5Config_heavy-target.pl by setting the environment variables
6PERLCONFIGTARGET - the later containing settings for the target while
7the former contains those for the host. This will allow cpan.bbclass
8to use the settings appropriate for the native and/or target builds
9as required. This also disables the use of the cache since the cached
10values would be valid for the host only.
11
12--- perl-5.8.8/configpm 2007/04/30 03:10:43 1.1
13+++ perl-5.8.8/configpm 2007/04/30 03:11:56
14@@ -374,7 +374,7 @@
15 my($self, $key) = @_;
16
17 # check for cached value (which may be undef so we use exists not defined)
18- return $self->{$key} if exists $self->{$key};
19+ #return $self->{$key} if exists $self->{$key};
20
21 return $self->fetch_string($key);
22 }
23@@ -530,7 +530,21 @@
24 sub DESTROY { }
25
26 sub AUTOLOAD {
27- require 'Config_heavy.pl';
28+ my $cfgfile = 'Config_heavy.pl';
29+ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
30+ {
31+ $cfgfile = 'Config_heavy-target.pl';
32+ }
33+ if (defined $ENV{PERL_ARCHLIB})
34+ {
35+ push @INC, $ENV{PERL_ARCHLIB};
36+ require $cfgfile;
37+ pop @INC;
38+ }
39+ else
40+ {
41+ require $cfgfile;
42+ }
43 goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
44 die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
45 }