summaryrefslogtreecommitdiffstats
path: root/meta/classes/cpan.bbclass
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/cpan.bbclass
parent06685d7558891dc50b439cf82c394cfadc3ee1d4 (diff)
downloadpoky-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/cpan.bbclass')
-rw-r--r--meta/classes/cpan.bbclass48
1 files changed, 10 insertions, 38 deletions
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
index 66054bc755..3b1280c07b 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)}"
14export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}" 14export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
15 15
16cpan_do_configure () { 16cpan_do_configure () {
17 export PERL5LIB="${PERL_ARCHLIB}"
17 yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS} 18 yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
18 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then 19 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
19 . ${STAGING_LIBDIR}/perl/config.sh 20 . ${STAGING_LIBDIR}/perl/config.sh
20 if [ "${IS_NEW_PERL}" = "yes" ]; then 21 # Use find since there can be a Makefile generated for each Makefile.PL
21 sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \ 22 for f in `find -name Makefile.PL`; do
22 -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \ 23 f2=`echo $f | sed -e 's/.PL//'`
23 -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \ 24 sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \
24 -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \ 25 $f2
25 -e "s:\(LDDLFLAGS.*\)${STAGING_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \ 26 done
26 Makefile
27 else
28 sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
29 -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
30 -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
31 -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
32 -e "s:\(LDDLFLAGS.*\)${STAGING_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \
33 Makefile
34 fi
35 fi 27 fi
36} 28}
37 29
38cpan_do_compile () { 30cpan_do_compile () {
39 if [ "${IS_NEW_PERL}" = "yes" ]; then 31 oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
40 oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
41 else
42 # You must use gcc to link on sh
43 OPTIONS=""
44 if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then
45 OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
46 fi
47 if test ${TARGET_ARCH} = "powerpc" ; then
48 OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
49 fi
50 oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS
51 fi
52} 32}
53 33
34NATIVE_INSTALL_WORKS = "1"
54cpan_do_install () { 35cpan_do_install () {
55 if [ ${@is_target(d)} = "yes" ]; then 36 oe_runmake DESTDIR="${D}" install_vendor
56 oe_runmake install_vendor
57 fi
58}
59
60cpan_do_stage () {
61 if [ ${@is_target(d)} = "no" ]; then
62 oe_runmake install_vendor
63 fi
64} 37}
65
66 38
67EXPORT_FUNCTIONS do_configure do_compile do_install do_stage 39EXPORT_FUNCTIONS do_configure do_compile do_install do_stage