openmoko-session2: add RDEPENDS openmoko-panel-memory and oe-stylize
[vuplus_openembedded] / packages / glibc / eglibc_svn.bb
1 require glibc.inc
2
3 DEFAULT_PREFERENCE = "-1"
4 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/eglibc-svn"
5 PV = "2.7+svnr${SRCREV}"
6 PR = "r2"
7 SRC_URI = "svn://svn.eglibc.org;module=trunk \
8            file://etc/ld.so.conf \
9            file://generate-supported.mk"
10 S = "${WORKDIR}/trunk/libc"
11 B = "${WORKDIR}/build-${TARGET_SYS}"
12
13 PACKAGES_DYNAMIC = "libc6*"
14 RPROVIDES_${PN}-dev = "libc6-dev"
15
16 # the -isystem in bitbake.conf screws up glibc do_stage
17 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
18 TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
19
20 GLIBC_ADDONS ?= "ports,nptl,libidn"
21
22 GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
23
24 #
25 # For now, we will skip building of a gcc package if it is a uclibc one
26 # and our build is not a uclibc one, and we skip a glibc one if our build
27 # is a uclibc build.
28 #
29 # See the note in gcc/gcc_3.4.0.oe
30 #
31
32 python __anonymous () {
33     import bb, re
34     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
35     if uc_os:
36         raise bb.parse.SkipPackage("incompatible with target %s" %
37                                    bb.data.getVar('TARGET_OS', d, 1))
38 }
39
40            
41 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
42                 --without-cvs --disable-profile --disable-debug --without-gd \
43                 --enable-clocale=gnu \
44                 --enable-add-ons=${GLIBC_ADDONS} \
45                 --with-headers=${STAGING_INCDIR} \
46                 --without-selinux \
47                 ${GLIBC_EXTRA_OECONF}"
48
49 EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
50
51 do_configure_prepend() {
52         if test -d ${WORKDIR}/trunk/ports ; then
53             mv ${WORKDIR}/trunk/ports ${S}/
54         fi    
55 }
56
57 do_configure () {
58 # override this function to avoid the autoconf/automake/aclocal/autoheader
59 # calls for now
60 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
61 # version check and doesn't really help with anything
62         if [ -z "`which rpcgen`" ]; then
63                 echo "rpcgen not found.  Install glibc-devel."
64                 exit 1
65         fi
66         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
67         find ${S} -name "configure" | xargs touch
68         CPPFLAGS="" oe_runconf
69 }
70
71 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
72           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
73           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
74
75 do_compile () { 
76         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
77         unset LDFLAGS
78         base_do_compile
79         (
80                 cd ${S}/sunrpc/rpcsvc
81                 for r in ${rpcsvc}; do
82                         h=`echo $r|sed -e's,\.x$,.h,'`
83                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
84                 done
85         ) 
86 }       
87
88 do_stage() {
89         # FIXME: this removes files from staging
90         # make sure there isn't a conflicting libc in staging
91         # this should be solved differently
92         rm -f ${STAGING_LIBDIR}/libc.so.6
93         oe_runmake 'install_root=${STAGING_DIR_HOST}' \
94                    'includedir=${layout_includedir}' 'libdir=${layout_libdir}' 'slibdir=${layout_base_libdir}' \
95                    '${STAGING_LIBDIR}/libc.so.6' \
96                    install-headers install-lib
97
98         install -d ${STAGING_INCDIR}/gnu \
99                    ${STAGING_INCDIR}/bits \
100                    ${STAGING_INCDIR}/rpcsvc
101         install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
102         install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
103         install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
104         for r in ${rpcsvc}; do
105                 h=`echo $r|sed -e's,\.x$,.h,'`
106                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
107         done
108         for i in libc.a libc_pic.a libc_nonshared.a; do
109                 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
110         done
111         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
112         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
113 }
114
115 require eglibc-package.bbclass