netboot-launcher-efl: Bump version to 0.2.2 and fix download link.
[openembedded.git] / recipes / glibc / glibc_2.5.bb
1 require glibc.inc
2 PR = "${INC_PR}.1"
3
4 ARM_INSTRUCTION_SET = "arm"
5
6 PACKAGES_DYNAMIC = "libc6*"
7 RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
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 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-2.4"
14
15 GLIBC_ADDONS ?= "ports,nptl,libidn"
16
17 GLIBC_BROKEN_LOCALES = "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 = "\
38   ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
39   ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2 \
40   ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2 \
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-2.5-local-dynamic-resolvconf.patch;patch=1;pnum=0 \
48   file://glibc-check_pf.patch;patch=1;pnum=0 \
49   file://zecke-sane-readelf.patch;patch=1 \
50   file://ldd-unbash.patch;patch=1 \
51   file://glibc-2.6.1-use-short-for-fnstsw.patch;patch=1 \
52   file://glibc-arm-no-asm-page.patch;patch=1 \
53   file://generic-bits_select.h \
54   file://generic-bits_types.h \
55   file://generic-bits_typesizes.h \
56   file://generic-bits_time.h \
57   file://etc/ld.so.conf \
58   file://generate-supported.mk \
59 "
60
61 # Build fails on sh3 and sh4 without additional patches
62 SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
63 SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
64
65 # Powerpc patches to add support for soft-float
66 SRC_URI_append_powerpc = " file://ppc-sfp-machine.patch;patch=1 \
67                            file://ppc-soft-fp-20070115.patch;patch=1 \
68                            file://ppc-ld-nofpu-20070104.patch;patch=1 \
69                            file://ppc-ports-ld-nofpu-20070114.patch;patch=1 \
70                            file://powerpc-sqrt-hack.diff;patch=1 \
71                            file://glibc-2.5-soft-fp-separate-strong-alias.patch;patch=1"
72
73 S = "${WORKDIR}/glibc-${PV}"
74 B = "${WORKDIR}/build-${TARGET_SYS}"
75
76 EXTRA_OECONF = "\
77   --enable-kernel=${OLDEST_KERNEL} \
78   --without-cvs --disable-profile --disable-debug --without-gd \
79   --enable-clocale=gnu \
80   --enable-add-ons=${GLIBC_ADDONS} \
81   --with-headers=${STAGING_INCDIR} \
82   --without-selinux \
83   ${GLIBC_EXTRA_OECONF} \
84 "
85
86 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
87
88 do_munge() {
89         # Integrate ports and libidn into tree
90         mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
91         mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
92
93         # Ports isn't really working... Fix it
94         # Some of this is rather dirty, but it seems to be the only
95         # quick way to get this cruft to compile
96         rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
97         ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
98         cp ${S}/nptl/sysdeps/pthread/bits/sigthread.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
99         cp ${S}/sysdeps/unix/sysv/linux/i386/bits/wchar.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
100         cp ${S}/sysdeps/wordsize-32/bits/wordsize.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
101         cp ${WORKDIR}/generic-bits_select.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/select.h
102         cp ${WORKDIR}/generic-bits_types.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/types.h
103         cp ${WORKDIR}/generic-bits_typesizes.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/typesizes.h
104         cp ${WORKDIR}/generic-bits_time.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/time.h
105         # Copy in generic stuff for not yet implemented headers
106         for i in ${S}/bits/*.h; do
107                 F=`basename $i`
108                 [ "$F" = "local_lim.h" ] && continue
109                 [ "$F" = "errno.h" ] && continue
110                 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/
111         done
112         # This is harmful; we need to get the one from nptl/sysdeps/pthreads
113         rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/libc-lock.h
114         # Obsoleted by sysdeps/arm/{fpu,eabi}/bits/fenv.h
115         rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/fenv.h
116         # Obsoleted by sysdeps/gnu/bits/utmp.h
117         rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/utmp.h
118 }
119
120 addtask munge before do_patch after do_unpack
121
122
123 do_configure () {
124 # override this function to avoid the autoconf/automake/aclocal/autoheader
125 # calls for now
126 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
127 # version check and doesn't really help with anything
128         if [ -z "`which rpcgen`" ]; then
129                 echo "rpcgen not found.  Install glibc-devel."
130                 exit 1
131         fi
132         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
133         CPPFLAGS="" oe_runconf
134 }
135
136 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
137           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
138           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
139
140 do_compile () {
141         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
142         unset LDFLAGS
143         base_do_compile
144         (
145                 cd ${S}/sunrpc/rpcsvc
146                 for r in ${rpcsvc}; do
147                         h=`echo $r|sed -e's,\.x$,.h,'`
148                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
149                 done
150         )
151 }
152
153 require glibc-stage.inc
154
155 require glibc-package.inc