perl: Another sh3/sh4 shared library fix. Modules build built with
[vuplus_openembedded] / classes / cpan.bbclass
1 #
2 # This is for perl modules that use the old Makefile.PL build system
3 #
4 FILES_${PN} += '${libdir}/perl5'
5 EXTRA_CPANFLAGS = ""
6
7 DEPENDS  += "perl-native"
8 RDEPENDS += "perl"
9
10 cpan_do_configure () {
11         perl Makefile.PL ${EXTRA_CPANFLAGS}
12         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
13                 . ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
14                 sed -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:; s:\(SITEARCHEXP = \).*:\1${sitearchexp}:; s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:; s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" < Makefile > Makefile.new
15                 mv Makefile.new Makefile
16         fi
17 }
18
19 cpan_do_compile () {
20         # You must use gcc to link on sh
21         OPTIONS=""
22         if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then
23                 OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
24         fi
25         oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS
26 }
27
28 cpan_do_install () {
29         oe_runmake install_vendor
30 }
31
32 EXPORT_FUNCTIONS do_configure do_compile do_install