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