perl-native: fix compile on ubuntu 11.04
[vuplus_openembedded] / recipes / perl / perl-native_5.8.8.bb
1 DESCRIPTION = "Perl is a popular scripting language."
2 HOMEPAGE = "http://www.perl.org/"
3 SECTION = "libs"
4 LICENSE = "Artistic|GPL"
5 DEPENDS = "virtual/db-native gdbm-native"
6 PR = "r16"
7
8 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/perl-${PV}"
9
10 SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \
11            file://perl-5.8.8-gcc-4.2.patch;patch=1 \
12            file://Configure-multilib.patch;patch=1 \
13            file://perl-configpm-switch.patch;patch=1 \
14            file://native-nopacklist.patch;patch=1 \
15            file://native-no-gdbminc.patch;patch=1 \
16            file://native-perlinc.patch;patch=1 \
17            file://makedepend-dash.patch;patch=1 \
18            file://ubuntu-11.04-multiarch.patch;patch=1 \
19            file://asm-pageh-fix.patch;patch=1"
20
21 S = "${WORKDIR}/perl-${PV}"
22
23 inherit native
24
25 export LD="${CC}"
26
27 do_configure () {
28     ./Configure \
29         -Dcc="${CC}" \
30         -Dcflags="${CFLAGS}" \
31         -Dldflags="${LDFLAGS}" \
32         -Dcf_by="Open Embedded" \
33         -Dprefix=${prefix} \
34         -Dvendorprefix=${prefix} \
35         -Dvendorprefix=${prefix} \
36         -Dsiteprefix=${prefix} \
37         \
38         -Dprivlib=${STAGING_LIBDIR}/perl/${PV} \
39         -Darchlib=${STAGING_LIBDIR}/perl/${PV} \
40         -Dvendorlib=${STAGING_LIBDIR}/perl/${PV} \
41         -Dvendorarch=${STAGING_LIBDIR}/perl/${PV} \
42         -Dsitelib=${STAGING_LIBDIR}/perl/${PV} \
43         -Dsitearch=${STAGING_LIBDIR}/perl/${PV} \
44         \
45         -Duseshrplib \
46         -Dusethreads \
47         -Duseithreads \
48         -Duselargefiles \
49         -Dnoextensions=ODBM_File \
50         -Ud_dosuid \
51         -Ui_db \
52         -Ui_ndbm \
53         -Ui_gdbm \
54         -Di_shadow \
55         -Di_syslog \
56         -Duseperlio \
57         -Dman3ext=3pm \
58         -Uafs \
59         -Ud_csh \
60         -Uusesfio \
61         -Uusenm -des
62     sed "s!${STAGING_DIR}/bin!${STAGING_BINDIR}!;
63          s!${STAGING_DIR}/lib!${STAGING_LIBDIR}!;
64          s!^installbin=.*!installbin=\'${STAGING_BINDIR}\'!;
65          s!^installsitebin=.*!installsitebin=\'${STAGING_BINDIR}\'!" < config.sh > config.sh.new
66     mv config.sh.new config.sh
67 }
68 do_stage_append() {
69         # We need a hostperl link for building perl
70         ln -sf ${STAGING_BINDIR_NATIVE}/perl${PV} ${STAGING_BINDIR_NATIVE}/hostperl
71         # Store native config in non-versioned directory
72         install -d ${STAGING_LIBDIR_NATIVE}/perl/${PV}/CORE \
73                    ${STAGING_DATADIR_NATIVE}/perl/${PV}/ExtUtils
74         install config.sh ${STAGING_LIBDIR}/perl
75         # target configuration
76         install lib/Config.pm       ${STAGING_LIBDIR_NATIVE}/perl/${PV}/
77         install lib/ExtUtils/typemap ${STAGING_DATADIR_NATIVE}/perl/${PV}/ExtUtils/
78         # perl shared library headers
79         for i in av.h embed.h gv.h keywords.h op.h perlio.h pp.h regexp.h \
80                  uconfig.h XSUB.h cc_runtime.h embedvar.h handy.h opnames.h \
81                  perliol.h pp_proto.h regnodes.h unixish.h config.h EXTERN.h \
82                  hv.h malloc_ctl.h pad.h perlsdio.h proto.h scope.h utf8.h \
83                  cop.h fakesdio.h INTERN.h mg.h patchlevel.h perlsfio.h \
84                  reentr.h sv.h utfebcdic.h cv.h fakethr.h intrpvar.h \
85                  nostdio.h perlapi.h perlvars.h reentr.inc thrdvar.h util.h \
86                  dosish.h form.h iperlsys.h opcode.h perl.h perly.h regcomp.h \
87                  thread.h warnings.h; do
88             install $i ${STAGING_LIBDIR_NATIVE}/perl/${PV}/CORE
89         done
90 }
91 do_stage_append_nylon() {
92         # get rid of definitions not supported by the gcc version we use for nylon...
93         for i in ${STAGING_LIBDIR_NATIVE}/perl/${PV}/Config_heavy.pl ${STAGING_LIBDIR}/perl/config.sh; do
94                 perl -pi -e 's/-Wdeclaration-after-statement //g' ${i}
95         done
96 }
97
98 PARALLEL_MAKE = ""