1 DESCRIPTION = "GNU C Library"
2 HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
6 MAINTAINER = "Phil Blundell <pb@handhelds.org>"
8 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5"
12 GLIBC_ADDONS ?= "ports,linuxthreads"
13 GLIBC_EXTRA_OECONF ?= ""
15 GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN"
18 # For now, we will skip building of a gcc package if it is a uclibc one
19 # and our build is not a uclibc one, and we skip a glibc one if our build
22 # See the note in gcc/gcc_3.4.0.oe
25 python __anonymous () {
27 uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
29 raise bb.parse.SkipPackage("incompatible with target %s" %
30 bb.data.getVar('TARGET_OS', d, 1))
33 # nptl needs unwind support in gcc, which can't be built without glibc.
34 PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
35 PROVIDES += "virtual/libintl virtual/libiconv"
36 DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
37 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
38 INHIBIT_DEFAULT_DEPS = "1"
40 # file://noinfo.patch;patch=1
41 # file://ldconfig.patch;patch=1;pnum=0
42 # file://arm-memcpy.patch;patch=1;pnum=0 \
43 # file://arm-machine-gmon.patch;patch=1;pnum=0 \
45 # file://arm-ioperm.patch;patch=1;pnum=0 \
46 # file://ldd.patch;patch=1;pnum=0 \
47 SRC_URI = "http://familiar.handhelds.org/source/v0.8.3/stash_libc_sources.redhat.com__20050627.tar.gz \
48 http://familiar.handhelds.org/source/v0.8.3/stash_ports_sources.redhat.com__20050627.tar.gz \
49 file://arm-audit.patch;patch=1 \
50 file://arm-audit2.patch;patch=1 \
51 file://arm-no-hwcap.patch;patch=1 \
52 file://arm-memcpy.patch;patch=1 \
53 file://arm-longlong.patch;patch=1;pnum=0 \
54 file://fhs-linux-paths.patch;patch=1 \
55 file://dl-cache-libcmp.patch;patch=1 \
56 file://ldsocache-varrun.patch;patch=1 \
57 file://etc/ld.so.conf \
58 file://generate-supported.mk"
60 # seems to fail on tls platforms
61 SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
64 B = "${WORKDIR}/build-${TARGET_SYS}"
68 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
69 --without-cvs --disable-profile --disable-debug --without-gd \
70 --enable-clocale=gnu \
71 --enable-add-ons=${GLIBC_ADDONS} \
72 --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
74 ${GLIBC_EXTRA_OECONF}"
76 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
78 def get_glibc_fpu_setting(bb, d):
79 if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
84 # Integrate ports into tree
85 mv ${WORKDIR}/ports ${S}
87 # http://www.handhelds.org/hypermail/oe/51/5135.html
88 # Some files were moved around between directories on
89 # 2005-12-21, which means that any attempt to check out
90 # from CVS using a datestamp older than that will be doomed.
92 # This is a workaround for that problem.
96 addtask munge before do_patch after do_unpack
98 export default_mmap_threshold_familiar = "32*1024"
101 if [ "x$default_mmap_threshold" != "x" ]; then
102 echo "malloc-CPPFLAGS=-DDEFAULT_MMAP_THRESHOLD=\"(${default_mmap_threshold})\"" >configparms
104 # override this function to avoid the autoconf/automake/aclocal/autoheader
106 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
107 # version check and doesn't really help with anything
108 if [ -z "`which rpcgen`" ]; then
109 echo "rpcgen not found. Install glibc-devel."
112 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
113 CPPFLAGS="" oe_runconf
116 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
117 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
118 rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
121 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
125 cd ${S}/sunrpc/rpcsvc
126 for r in ${rpcsvc}; do
127 h=`echo $r|sed -e's,\.x$,.h,'`
128 rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
134 rm -f ${STAGING_LIBDIR}/libc.so.6
135 oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
136 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
137 '${STAGING_LIBDIR}/libc.so.6' \
138 install-headers install-lib
140 install -d ${STAGING_INCDIR}/gnu \
141 ${STAGING_INCDIR}/bits \
142 ${STAGING_INCDIR}/rpcsvc
143 install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
144 install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
145 install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
146 for r in ${rpcsvc}; do
147 h=`echo $r|sed -e's,\.x$,.h,'`
148 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
150 for i in libc.a libc_pic.a libc_nonshared.a; do
151 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
153 echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
154 echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
156 rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
157 oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
158 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
159 '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
160 install-headers install-lib
162 install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
163 ${CROSS_DIR}/${TARGET_SYS}/include/bits \
164 ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
165 install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
166 install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
167 install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
168 for r in ${rpcsvc}; do
169 h=`echo $r|sed -e's,\.x$,.h,'`
170 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
173 for i in libc.a libc_pic.a libc_nonshared.a; do
174 install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
176 echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
177 echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
180 include glibc-package.bbclass