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