summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-18 20:05:55 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-18 20:05:55 +0000
commitca5f36ee6ad756e1e540288a56a504c1d8ecc7a3 (patch)
tree9ad90f44e75c449f54f30bb702aa797ee8083a78 /meta/classes
parent06685d7558891dc50b439cf82c394cfadc3ee1d4 (diff)
downloadopenembedded-core-contrib-ca5f36ee6ad756e1e540288a56a504c1d8ecc7a3.tar.gz
perl: Update from OE.dev and convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cpan-base.bbclass13
-rw-r--r--meta/classes/cpan.bbclass48
-rw-r--r--meta/classes/cpan_build.bbclass25
3 files changed, 15 insertions, 71 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
index 82fd5b459ab..c90a8fbc27e 100644
--- a/meta/classes/cpan-base.bbclass
+++ b/meta/classes/cpan-base.bbclass
@@ -24,20 +24,10 @@ def get_perl_version(d):
return m.group(1)
return None
-# Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout
-def is_new_perl(d):
- ver = get_perl_version(d)
- if ver == "5.8.4" or ver == "5.8.7":
- return "no"
- return "yes"
-
# Determine where the library directories are
def perl_get_libdirs(d):
libdir = bb.data.getVar('libdir', d, 1)
- if is_new_perl(d) == "yes":
- libdirs = libdir + '/perl5'
- else:
- libdirs = libdir + '/*/*/perl5'
+ libdirs = libdir + '/*/*/perl5'
return libdirs
def is_target(d):
@@ -45,7 +35,6 @@ def is_target(d):
return "yes"
return "no"
-IS_NEW_PERL = "${@is_new_perl(d)}"
PERLLIBDIRS = "${@perl_get_libdirs(d)}"
FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
index 66054bc755d..3b1280c07b3 100644
--- a/meta/classes/cpan.bbclass
+++ b/meta/classes/cpan.bbclass
@@ -14,54 +14,26 @@ export PERL_LIB = "${STAGING_DATADIR}/perl/${@get_perl_version(d)}"
export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
cpan_do_configure () {
+ export PERL5LIB="${PERL_ARCHLIB}"
yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
. ${STAGING_LIBDIR}/perl/config.sh
- 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_LIBDIR_NATIVE}:\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_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \
- Makefile
- fi
+ # Use find since there can be a Makefile generated for each Makefile.PL
+ for f in `find -name Makefile.PL`; do
+ f2=`echo $f | sed -e 's/.PL//'`
+ sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \
+ $f2
+ done
fi
}
cpan_do_compile () {
- 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}" LD="${CCLD}"
}
+NATIVE_INSTALL_WORKS = "1"
cpan_do_install () {
- if [ ${@is_target(d)} = "yes" ]; then
- oe_runmake install_vendor
- fi
-}
-
-cpan_do_stage () {
- if [ ${@is_target(d)} = "no" ]; then
- oe_runmake install_vendor
- fi
+ oe_runmake DESTDIR="${D}" install_vendor
}
-
EXPORT_FUNCTIONS do_configure do_compile do_install do_stage
diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass
index 6cac85c5fe0..944e8d4ac06 100644
--- a/meta/classes/cpan_build.bbclass
+++ b/meta/classes/cpan_build.bbclass
@@ -23,7 +23,7 @@ cpan_build_do_configure () {
if [ ${@is_target(d)} == "yes" ]; then
# build for target
. ${STAGING_LIBDIR}/perl/config.sh
- if [ "${IS_NEW_PERL}" = "yes" ]; then
+
perl Build.PL --installdirs vendor \
--destdir ${D} \
--install_path lib="${datadir}/perl5" \
@@ -32,19 +32,9 @@ cpan_build_do_configure () {
--install_path bin=${bindir} \
--install_path bindoc=${mandir}/man1 \
--install_path libdoc=${mandir}/man3
- else
- perl Build.PL --installdirs vendor \
- --destdir ${D} \
- --install_path lib="${libdir}/perl5/site_perl/${version}" \
- --install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
- --install_path script=${bindir} \
- --install_path bin=${bindir} \
- --install_path bindoc=${mandir}/man1 \
- --install_path libdoc=${mandir}/man3
- fi
else
# build for host
- perl Build.PL --installdirs site
+ perl Build.PL --installdirs site --destdir ${D}
fi
}
@@ -52,16 +42,9 @@ cpan_build_do_compile () {
perl Build
}
+NATIVE_INSTALL_WORKS = "1"
cpan_build_do_install () {
- if [ ${@is_target(d)} == "yes" ]; then
- perl Build install
- fi
-}
-
-do_stage () {
- if [ ${@is_target(d)} == "no" ]; then
- perl Build install
- fi
+ perl Build install
}
EXPORT_FUNCTIONS do_configure do_compile do_install