surpport seeking the recorded video
[vuplus_openembedded] / recipes / glibc / glibc_2.9.bb
1 require glibc.inc
2
3 ARM_INSTRUCTION_SET = "arm"
4
5 PACKAGES_DYNAMIC = "libc6*"
6 RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
7
8 PR = "${INC_PR}.3"
9
10 # the -isystem in bitbake.conf screws up glibc do_stage
11 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
12 TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
13
14
15 FILESPATHPKG =. "glibc-2.4:"
16
17 GLIBC_ADDONS ?= "ports,nptl,libidn"
18
19 GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
20
21 #
22 # For now, we will skip building of a gcc package if it is a uclibc one
23 # and our build is not a uclibc one, and we skip a glibc one if our build
24 # is a uclibc build.
25 #
26 # See the note in gcc/gcc_3.4.0.oe
27 #
28
29 python __anonymous () {
30     import bb, re
31     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
32     if uc_os:
33         raise bb.parse.SkipPackage("incompatible with target %s" %
34                                    bb.data.getVar('TARGET_OS', d, 1))
35 }
36
37 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
38
39 #          file://noinfo.patch;patch=1
40 #          file://ldconfig.patch;patch=1;pnum=0
41 #          file://arm-machine-gmon.patch;patch=1;pnum=0 \
42 #          \
43 #          file://arm-ioperm.patch;patch=1;pnum=0 \
44 #          file://ldd.patch;patch=1;pnum=0 \
45 SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
46            ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2 \
47            ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2 \
48            file://nscd-init.patch;patch=1;pnum=0 \
49            file://arm-memcpy.patch;patch=1 \
50            file://arm-longlong.patch;patch=1 \
51            file://fhs-linux-paths.patch;patch=1 \
52            file://dl-cache-libcmp.patch;patch=1 \
53            file://ldsocache-varrun.patch;patch=1 \
54            file://nptl-crosscompile.patch;patch=1 \
55            file://glibc-check_pf.patch;patch=1;pnum=0 \
56            file://ldd-unbash.patch;patch=1 \
57            file://glibc-arm-IO-acquire-lock-fix.diff;patch=1 \
58            file://generic-bits_select.h \
59            file://generic-bits_types.h \
60            file://generic-bits_typesizes.h \
61            file://generic-bits_time.h \
62            file://etc/ld.so.conf \
63            file://generate-supported.mk \
64            file://march-i686.patch;patch=1;pnum=0 \
65            file://tls_i486.patch;patch=1 \
66            file://glibc-2.9-use-_begin.patch;patch=1 \
67            file://arm-lowlevellock-include-tls.patch;patch=1 \
68            file://glibc-2.9-enable-binutils-2.2.patch;patch=1 \
69            "
70
71 # patches to fix libmemusage.so
72 SRC_URI_append = " file://0001-malloc-memusage.c-update_data-Fix-handling-of-wrappi.patch;patch=1 \
73                    file://0002-malloc-memusage.c-DEFAULT_BUFFER_SIZE-Change-to-3276.patch;patch=1 \
74                    file://0003-Fix-wrap-around-in-memusage.patch;patch=1 "
75
76
77 # Build fails on sh3 and sh4 without additional patches
78 SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1 \
79                 file://glibc-2.9-sh-fix.patch;patch=1"
80 SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1 \
81                 file://glibc-2.9-sh-fix.patch;patch=1"
82
83 #powerpc patches to add support for soft-float
84 SRC_URI_append_powerpc= " file://powerpc-sqrt-hack.diff;patch=1"
85
86 S = "${WORKDIR}/glibc-${PV}"
87 B = "${WORKDIR}/build-${TARGET_SYS}"
88
89 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
90                 --without-cvs --disable-profile --disable-debug --without-gd \
91                 --enable-clocale=gnu \
92                 --enable-add-ons=${GLIBC_ADDONS} \
93                 --with-headers=${STAGING_INCDIR} \
94                 --without-selinux \
95                 ${GLIBC_EXTRA_OECONF}"
96
97 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
98
99 do_munge() {
100         # Integrate ports and libidn into tree
101         mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
102         mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
103
104         # Ports isn't really working... Fix it
105         # Some of this is rather dirty, but it seems to be the only
106         # quick way to get this cruft to compile
107         rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
108         ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
109         cp ${S}/nptl/sysdeps/pthread/bits/sigthread.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
110         cp ${S}/sysdeps/unix/sysv/linux/i386/bits/wchar.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
111         cp ${S}/sysdeps/wordsize-32/bits/wordsize.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
112         cp ${WORKDIR}/generic-bits_select.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/select.h
113         cp ${WORKDIR}/generic-bits_types.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/types.h
114         cp ${WORKDIR}/generic-bits_typesizes.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/typesizes.h
115         cp ${WORKDIR}/generic-bits_time.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/time.h
116         # Copy in generic stuff for not yet implemented headers
117         for i in ${S}/bits/*.h; do
118                 F=`basename $i`
119                 [ "$F" = "local_lim.h" ] && continue
120                 [ "$F" = "errno.h" ] && continue
121                 test -e ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/$F || test -e ${S}/ports/sysdeps/arm/bits/$F || test -e ${S}/sysdeps/unix/sysv/linux/bits/$F || test -e ${S}/sysdeps/ieee754/bits/$F || cp $i ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
122         done
123         # This is harmful; we need to get the one from nptl/sysdeps/pthreads
124         rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/libc-lock.h
125         # Obsoleted by sysdeps/arm/{fpu,eabi}/bits/fenv.h
126         rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/fenv.h
127         # Obsoleted by sysdeps/gnu/bits/utmp.h
128         rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/utmp.h
129 }
130
131 addtask munge before do_patch after do_unpack
132
133
134 do_configure () {
135 # /var/db was not included to FHS
136         sed -i s:/var/db/nscd:/var/run/nscd: ${S}/nscd/nscd.h
137 # override this function to avoid the autoconf/automake/aclocal/autoheader
138 # calls for now
139 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
140 # version check and doesn't really help with anything
141         if [ -z "`which rpcgen`" ]; then
142                 echo "rpcgen not found.  Install glibc-devel."
143                 exit 1
144         fi
145         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
146         CPPFLAGS="" oe_runconf
147 }
148
149 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
150           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
151           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
152
153 do_compile () {
154         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
155         unset LDFLAGS
156         base_do_compile
157         (
158                 cd ${S}/sunrpc/rpcsvc
159                 for r in ${rpcsvc}; do
160                         h=`echo $r|sed -e's,\.x$,.h,'`
161                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
162                 done
163         )
164 }
165
166 require glibc-stage.inc
167
168 require glibc-package.inc