Multimachine builds race staging Config_heavy-target.pl to native directory.
Solve that by changing PERLCONFIGTARGET variable semantics, now it will
contain $TARGET_SYS. Change perl patch and stage functions accordingly.
Also, move PERLCONFIGTARGET and other target-specific variable settings from
cpan to cpan-base as I think they're also useful for cpan_build and anywhere
else cpan-base is needed.
Signed-off-by: Roman I Khimov <khimov@altell.ru>
Acked-by: Khem Raj <raj.khem@gmail.com>
def is_target(d):
if not bb.data.inherits_class('native', d):
- return "yes"
- return "no"
+ return bb.data.expand('${TARGET_SYS}', d)
+ return ""
PERLLIBDIRS = "${@perl_get_libdirs(d)}"
FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
${PERLLIBDIRS}/auto/*/*/.debug \
${PERLLIBDIRS}/auto/*/*/*/.debug"
+
+# Env var which tells perl if it should use host ('') or target ('$TARGET_SYS') settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+
+EXTRA_CPANFLAGS ?= ""
+
+# Env var which tells perl where the perl include files are
+export PERL_INC = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_DATADIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
\ No newline at end of file
#
inherit cpan-base
-EXTRA_CPANFLAGS ?= ""
-
-# Env var which tells perl if it should use host (no) or target (yes) settings
-export PERLCONFIGTARGET = "${@is_target(d)}"
-
-# Env var which tells perl where the perl include files are
-export PERL_INC = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}/CORE"
-export PERL_LIB = "${STAGING_DATADIR}/perl/${@get_perl_version(d)}"
-export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
-
NATIVE_INSTALL_WORKS = "1"
cpan_do_configure () {
DEPENDS_prepend = "${@cpan_build_deps(d)}"
cpan_build_do_configure () {
- if [ ${@is_target(d)} = "yes" ]; then
+ if [ ${@is_target(d)} != "" ]; then
# build for target
. ${STAGING_LIBDIR}/perl/config.sh
perl Build.PL --installdirs vendor \
}
cpan_build_do_install () {
- if [ ${@is_target(d)} = "yes" ]; then
+ if [ ${@is_target(d)} != "" ]; then
perl Build install
else
perl Build install destdir="${WORKDIR}/image"
This patch is used for perl-native only. It enables the switching of
configuration files between Config_heavy.pl and
-Config_heavy-target.pl by setting the environment variables
+Config_heavy-$TARGET_SYS.pl by setting the environment variables
PERLCONFIGTARGET - the later containing settings for the target while
the former contains those for the host. This will allow cpan.bbclass
to use the settings appropriate for the native and/or target builds
sub AUTOLOAD {
- require 'Config_heavy.pl';
+ my $cfgfile = 'Config_heavy.pl';
-+ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
++ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} ne "")
+ {
-+ $cfgfile = 'Config_heavy-target.pl';
++ $cfgfile = "Config_heavy-$ENV{PERLCONFIGTARGET}.pl";
+ }
+ require $cfgfile;
goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
This patch is used for perl-native only. It enables the switching of
configuration files between Config_heavy.pl and
-Config_heavy-target.pl by setting the environment variables
+Config_heavy-$TARGET_SYS.pl by setting the environment variables
PERLCONFIGTARGET - the later containing settings for the target while
the former contains those for the host. This will allow cpan.bbclass
to use the settings appropriate for the native and/or target builds
sub AUTOLOAD {
- require 'Config_heavy.pl';
+ my $cfgfile = 'Config_heavy.pl';
-+ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
++ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} ne "")
+ {
-+ $cfgfile = 'Config_heavy-target.pl';
++ $cfgfile = "Config_heavy-$ENV{PERLCONFIGTARGET}.pl";
+ }
+ require $cfgfile;
goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
SECTION = "libs"
LICENSE = "Artistic|GPLv1+"
DEPENDS = "virtual/db-native gdbm-native"
-PR = "r6"
+PR = "r7"
NATIVE_INSTALL_WORKS = "1"
# Not tested enough
SECTION = "libs"
LICENSE = "Artistic|GPLv1+"
DEPENDS = "virtual/db-native gdbm-native"
-PR = "r21"
+PR = "r22"
NATIVE_INSTALL_WORKS = "1"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/perl-${PV}"
PRIORITY = "optional"
# We need gnugrep (for -I)
DEPENDS = "virtual/db perl-native grep-native"
-PR = "r14"
+PR = "r15"
# 5.10.1 has Module::Build built-in
PROVIDES += "libmodule-build-perl"
# target config, used by cpan.bbclass to extract version information
install config.sh ${STAGING_LIBDIR}/perl/
# target configuration, used by native perl when cross-compiling
- install lib/Config_heavy.pl ${STAGING_LIBDIR_NATIVE}/perl/${PV}/Config_heavy-target.pl
+ install lib/Config_heavy.pl ${STAGING_LIBDIR_NATIVE}/perl/${PV}/Config_heavy-${TARGET_SYS}.pl
# target configuration
install lib/Config.pm ${STAGING_LIBDIR}/perl/${PV}/
install lib/ExtUtils/typemap ${STAGING_DATADIR}/perl/${PV}/ExtUtils/
PRIORITY = "optional"
# We need gnugrep (for -I)
DEPENDS = "virtual/db perl-native grep-native"
-PR = "r36"
+PR = "r37"
# Major part of version
PVM = "5.8"