summaryrefslogtreecommitdiffstats
path: root/meta/classes/cpan.bbclass
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openedhand.com>2007-05-30 09:32:36 +0000
committerMarcin Juszkiewicz <hrw@openedhand.com>2007-05-30 09:32:36 +0000
commit6c47cd48aff1dbc3b2550ea71307c48debca9298 (patch)
tree96e18b82c2f72e76c3c1ddbc148c7ef2fbf56ad7 /meta/classes/cpan.bbclass
parent4ed25e747d7a5a636d9e517b59601ff66f1d6c15 (diff)
downloadopenembedded-core-6c47cd48aff1dbc3b2550ea71307c48debca9298.tar.gz
openembedded-core-6c47cd48aff1dbc3b2550ea71307c48debca9298.tar.bz2
openembedded-core-6c47cd48aff1dbc3b2550ea71307c48debca9298.zip
cpan classes: sync Perl with OE
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1815 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/cpan.bbclass')
-rw-r--r--meta/classes/cpan.bbclass52
1 files changed, 36 insertions, 16 deletions
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
index 159633d17a..4fff5974c1 100644
--- a/meta/classes/cpan.bbclass
+++ b/meta/classes/cpan.bbclass
@@ -1,32 +1,52 @@
#
# This is for perl modules that use the old Makefile.PL build system
#
-FILES_${PN} += '${libdir}/perl5'
-EXTRA_CPANFLAGS = ""
+inherit cpan-base
-DEPENDS += "perl-native perl"
-RDEPENDS += "perl"
+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_DIR}/${BUILD_SYS}/lib/perl/${@get_perl_version(d)}/CORE"
cpan_do_configure () {
- perl Makefile.PL ${EXTRA_CPANFLAGS}
+ yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
. ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
- sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
- -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
- -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
- -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
- -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
- Makefile
+ if [ "${IS_NEW_PERL}" = "yes" ]; then
+ sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
+ -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
+ -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \
+ -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \
+ -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
+ Makefile
+ else
+ sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
+ -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
+ -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
+ -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
+ -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
+ Makefile
+ fi
fi
}
cpan_do_compile () {
- # You must use gcc to link on sh
- OPTIONS=""
- if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then
- OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
+ if [ "${IS_NEW_PERL}" = "yes" ]; then
+ oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
+ else
+ # You must use gcc to link on sh
+ OPTIONS=""
+ if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then
+ OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
+ fi
+ if test ${TARGET_ARCH} = "powerpc" ; then
+ OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
+ fi
+ oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS
fi
- oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS
}
cpan_do_install () {