c92d3e898c2b0904726f81680ecc39984665817a
[vuplus_openembedded] / packages / glibc / glibc_2.4.bb
1 require glibc.inc
2
3 FILE_PR = "r19"
4
5 #add the hosts that are confirmed to be working to COMPATIBLE_HOSTi
6 COMPATIBLE_HOST = '(i.86.*-linux|sh.*-linux)'
7 DEFAULT_PREFERENCE_arm = "-1"
8
9 # the -isystem in bitbake.conf screws up glibc do_stage
10 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
11 TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
12
13
14 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-2.4"
15
16 GLIBC_ADDONS ?= "ports,nptl,libidn"
17
18 GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
19
20 #
21 # For now, we will skip building of a gcc package if it is a uclibc one
22 # and our build is not a uclibc one, and we skip a glibc one if our build
23 # is a uclibc build.
24 #
25 # See the note in gcc/gcc_3.4.0.oe
26 #
27
28 python __anonymous () {
29     import bb, re
30     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
31     if uc_os:
32         raise bb.parse.SkipPackage("incompatible with target %s" %
33                                    bb.data.getVar('TARGET_OS', d, 1))
34 }
35
36 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
37
38 #          file://noinfo.patch;patch=1
39 #          file://ldconfig.patch;patch=1;pnum=0
40 #          file://arm-machine-gmon.patch;patch=1;pnum=0 \
41 #          \
42 #          file://arm-ioperm.patch;patch=1;pnum=0 \
43 #          file://ldd.patch;patch=1;pnum=0 \
44 SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.4.tar.bz2 \
45            ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-2.4.tar.bz2 \
46            ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-2.4.tar.bz2 \
47            file://arm-memcpy.patch;patch=1 \
48            file://arm-longlong.patch;patch=1 \
49            file://fhs-linux-paths.patch;patch=1 \
50            file://dl-cache-libcmp.patch;patch=1 \
51            file://ldsocache-varrun.patch;patch=1 \
52            file://nptl-crosscompile.patch;patch=1 \
53            file://glibc-2.4-compile.patch;patch=1 \
54            file://glibc-2.4-openat-3.patch;patch=1 \
55            file://fixup-aeabi-syscalls.patch;patch=1 \
56            file://zecke-sane-readelf.patch;patch=1 \
57            file://arm_eabi_ipc_fix.patch;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
65
66 # Build fails on sh3 and sh4 without additional patches
67 SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
68 SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
69
70 S = "${WORKDIR}/glibc-2.4"
71 B = "${WORKDIR}/build-${TARGET_SYS}"
72
73 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
74                 --without-cvs --disable-profile --disable-debug --without-gd \
75                 --enable-clocale=gnu \
76                 --enable-add-ons=${GLIBC_ADDONS} \
77                 --with-headers=${STAGING_INCDIR} \
78                 --without-selinux \
79                 ${GLIBC_EXTRA_OECONF}"
80
81 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
82
83 do_munge() {
84         # Integrate ports and libidn into tree
85         mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
86         mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
87
88         # Ports isn't really working... Fix it
89         # Some of this is rather dirty, but it seems to be the only
90         # quick way to get this cruft to compile
91         rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
92         ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
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 do_configure () {
117 # override this function to avoid the autoconf/automake/aclocal/autoheader
118 # calls for now
119 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
120 # version check and doesn't really help with anything
121         if [ -z "`which rpcgen`" ]; then
122                 echo "rpcgen not found.  Install glibc-devel."
123                 exit 1
124         fi
125         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
126         CPPFLAGS="" oe_runconf
127 }
128
129 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
130           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
131           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
132
133 do_compile () {
134         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
135         unset LDFLAGS
136         base_do_compile
137         (
138                 cd ${S}/sunrpc/rpcsvc
139                 for r in ${rpcsvc}; do
140                         h=`echo $r|sed -e's,\.x$,.h,'`
141                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
142                 done
143         )
144 }
145
146 require glibc-stage.inc
147
148 require glibc-package.bbclass