cacao-native: add mercurial recipe
[openembedded.git] / classes / cpan.bbclass
blobdfc092601ec604fcafa51be541a3012f9f72f1da
2 # This is for perl modules that use the old Makefile.PL build system
4 inherit cpan-base
6 EXTRA_CPANFLAGS ?= ""
8 # Env var which tells perl if it should use host (no) or target (yes) settings
9 export PERLCONFIGTARGET = "${@is_target(d)}"
11 # Env var which tells perl where the perl include files are
12 export PERL_INC = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}/CORE"
13 export PERL_LIB = "${STAGING_DATADIR}/perl/${@get_perl_version(d)}"
14 export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
16 cpan_do_configure () {
17         yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
18         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
19                 . ${STAGING_LIBDIR}/perl/config.sh
20                 sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
21                         -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
22                         -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \
23                         -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \
24                         -e "s:\(LDDLFLAGS.*\)${STAGING_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \
25                         Makefile
26         fi
29 cpan_do_compile () {
30         oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
33 cpan_do_install () {
34         if [ ${@is_target(d)} = "yes" ]; then
35                 oe_runmake install_vendor
36         fi
39 cpan_do_stage () {
40         if [ ${@is_target(d)} = "no" ]; then
41                 oe_runmake install_vendor
42         fi
44                                                                 
46 EXPORT_FUNCTIONS do_configure do_compile do_install do_stage