summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/cpan-base.bbclass10
-rw-r--r--meta/classes/cpan.bbclass12
2 files changed, 13 insertions, 9 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
index 6cd2aa340f..b5dbdaea81 100644
--- a/meta/classes/cpan-base.bbclass
+++ b/meta/classes/cpan-base.bbclass
@@ -7,10 +7,12 @@ FILES_${PN} += "${libdir}/perl ${datadir}/perl"
7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" 7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
8RDEPENDS += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" 8RDEPENDS += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
9 9
10PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
11
10# Determine the staged version of perl from the perl configuration file 12# Determine the staged version of perl from the perl configuration file
11def get_perl_version(d): 13def get_perl_version(d):
12 import re 14 import re
13 cfg = bb.data.expand('${STAGING_LIBDIR}/perl/config.sh', d) 15 cfg = bb.data.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh', d)
14 try: 16 try:
15 f = open(cfg, 'r') 17 f = open(cfg, 'r')
16 except IOError: 18 except IOError:
@@ -27,8 +29,10 @@ def get_perl_version(d):
27# Determine where the library directories are 29# Determine where the library directories are
28def perl_get_libdirs(d): 30def perl_get_libdirs(d):
29 libdir = bb.data.getVar('libdir', d, 1) 31 libdir = bb.data.getVar('libdir', d, 1)
30 libdirs = libdir + '/perl' 32 if is_target(d) == "no":
31 return libdirs 33 libdir += '/perl-native'
34 libdir += '/perl'
35 return libdir
32 36
33def is_target(d): 37def is_target(d):
34 if not bb.data.inherits_class('native', d): 38 if not bb.data.inherits_class('native', d):
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
index 9b8431bed0..cbf428d3a2 100644
--- a/meta/classes/cpan.bbclass
+++ b/meta/classes/cpan.bbclass
@@ -1,7 +1,7 @@
1# 1#
2# This is for perl modules that use the old Makefile.PL build system 2# This is for perl modules that use the old Makefile.PL build system
3# 3#
4inherit cpan-base 4inherit cpan-base perlnative
5 5
6EXTRA_CPANFLAGS ?= "" 6EXTRA_CPANFLAGS ?= ""
7EXTRA_PERLFLAGS ?= "" 7EXTRA_PERLFLAGS ?= ""
@@ -10,16 +10,16 @@ EXTRA_PERLFLAGS ?= ""
10export PERLCONFIGTARGET = "${@is_target(d)}" 10export PERLCONFIGTARGET = "${@is_target(d)}"
11 11
12# Env var which tells perl where the perl include files are 12# Env var which tells perl where the perl include files are
13export PERL_INC = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}/CORE" 13export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
14export PERL_LIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}" 14export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
15export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}" 15export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
16export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl/${@get_perl_version(d)}/" 16export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/"
17 17
18cpan_do_configure () { 18cpan_do_configure () {
19 export PERL5LIB="${PERL_ARCHLIB}" 19 export PERL5LIB="${PERL_ARCHLIB}"
20 yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL ${EXTRA_CPANFLAGS} 20 yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL ${EXTRA_CPANFLAGS}
21 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then 21 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
22 . ${STAGING_LIBDIR}/perl/config.sh 22 . ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh
23 # Use find since there can be a Makefile generated for each Makefile.PL 23 # Use find since there can be a Makefile generated for each Makefile.PL
24 for f in `find -name Makefile.PL`; do 24 for f in `find -name Makefile.PL`; do
25 f2=`echo $f | sed -e 's/.PL//'` 25 f2=`echo $f | sed -e 's/.PL//'`