1 DESCRIPTION = "GNU C Library"
2 HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
7 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5"
12 DEFAULT_PREFERENCE_sh3="-1"
14 GLIBC_ADDONS ?= "ports,linuxthreads"
15 GLIBC_EXTRA_OECONF ?= ""
17 GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN"
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
24 # See the note in gcc/gcc_3.4.0.oe
27 python __anonymous () {
29 uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
31 raise bb.parse.SkipPackage("incompatible with target %s" %
32 bb.data.getVar('TARGET_OS', d, 1))
35 # nptl needs unwind support in gcc, which can't be built without glibc.
36 PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
37 PROVIDES += "virtual/libintl virtual/libiconv"
38 DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
39 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
40 INHIBIT_DEFAULT_DEPS = "1"
42 # file://noinfo.patch;patch=1
43 # file://ldconfig.patch;patch=1;pnum=0
44 # file://arm-machine-gmon.patch;patch=1;pnum=0 \
46 # file://arm-ioperm.patch;patch=1;pnum=0 \
47 # file://ldd.patch;patch=1;pnum=0 \
48 SRC_URI = "http://familiar.handhelds.org/source/v0.8.3/stash_libc_sources.redhat.com__20050627.tar.gz \
49 http://familiar.handhelds.org/source/v0.8.3/stash_ports_sources.redhat.com__20050627.tar.gz \
50 file://arm-audit.patch;patch=1 \
51 file://arm-audit2.patch;patch=1 \
52 file://arm-no-hwcap.patch;patch=1 \
53 file://arm-memcpy.patch;patch=1 \
54 file://arm-longlong.patch;patch=1;pnum=0 \
55 file://fhs-linux-paths.patch;patch=1 \
56 file://dl-cache-libcmp.patch;patch=1 \
57 file://ldsocache-varrun.patch;patch=1 \
58 file://5090_all_stubs-rule-fix.patch;patch=1 \
59 file://raise.patch;patch=1 \
60 file://zecke-sane-readelf.patch;patch=1 \
61 file://glibc-2.3.5-fix-weak-alias-arm.patch;patch=1 \
62 file://glibc-2.3.5-fix-weak-alias-arm-2.patch;patch=1 \
63 file://etc/ld.so.conf \
64 file://generate-supported.mk"
66 # seems to fail on tls platforms
67 SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
69 # Build fails on sh3 and sh4 without additional patches
70 SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1 \
71 file://superh-fcntl.patch;patch=1;pnum=0"
72 SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1 \
73 file://superh-fcntl.patch;patch=1;pnum=0"
76 B = "${WORKDIR}/build-${TARGET_SYS}"
80 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
81 --without-cvs --disable-profile --disable-debug --without-gd \
82 --enable-clocale=gnu \
83 --enable-add-ons=${GLIBC_ADDONS} \
84 --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
86 ${GLIBC_EXTRA_OECONF}"
88 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
90 #avoid too much optimization on ppc
91 CFLAGS_dht-walnut += " -O1 -g0 -fPIC -fno-inline-functions -fno-unit-at-a-time "
94 # Integrate ports into tree
95 mv ${WORKDIR}/ports ${S}
97 # http://www.handhelds.org/hypermail/oe/51/5135.html
98 # Some files were moved around between directories on
99 # 2005-12-21, which means that any attempt to check out
100 # from CVS using a datestamp older than that will be doomed.
102 # This is a workaround for that problem.
106 addtask munge before do_patch after do_unpack
108 export default_mmap_threshold_familiar = "32*1024"
111 if [ "x$default_mmap_threshold" != "x" ]; then
112 echo "malloc-CPPFLAGS=-DDEFAULT_MMAP_THRESHOLD=\"(${default_mmap_threshold})\"" >configparms
114 # override this function to avoid the autoconf/automake/aclocal/autoheader
116 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
117 # version check and doesn't really help with anything
118 if [ -z "`which rpcgen`" ]; then
119 echo "rpcgen not found. Install glibc-devel."
122 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
123 CPPFLAGS="" oe_runconf
126 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
127 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
128 rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
131 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
135 cd ${S}/sunrpc/rpcsvc
136 for r in ${rpcsvc}; do
137 h=`echo $r|sed -e's,\.x$,.h,'`
138 rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
144 rm -f ${STAGING_LIBDIR}/libc.so.6
145 oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
146 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
147 '${STAGING_LIBDIR}/libc.so.6' \
148 install-headers install-lib
150 install -d ${STAGING_INCDIR}/gnu \
151 ${STAGING_INCDIR}/bits \
152 ${STAGING_INCDIR}/rpcsvc
153 install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
154 install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
155 install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
156 for r in ${rpcsvc}; do
157 h=`echo $r|sed -e's,\.x$,.h,'`
158 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
160 for i in libc.a libc_pic.a libc_nonshared.a; do
161 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
163 echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
164 echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
166 rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
167 oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
168 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
169 '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
170 install-headers install-lib
172 install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
173 ${CROSS_DIR}/${TARGET_SYS}/include/bits \
174 ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
175 install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
176 install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
177 install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
178 for r in ${rpcsvc}; do
179 h=`echo $r|sed -e's,\.x$,.h,'`
180 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
183 for i in libc.a libc_pic.a libc_nonshared.a; do
184 install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
186 echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
187 echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
190 require glibc-package.bbclass