]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glibc/glibc_2.3.5+cvs20050627.bb
0d1d073f4789e623e4ffc50494d6134e5cc2aba0
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / glibc / glibc_2.3.5+cvs20050627.bb
1 DESCRIPTION = "GNU C Library"
2 HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
3 LICENSE = "LGPL"
4 SECTION = "libs"
5 PRIORITY = "required"
6 MAINTAINER = "Phil Blundell <pb@handhelds.org>"
7
8 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5"
9 CVSDATE = "20050627"
10 PR = "r4"
11
12 GLIBC_ADDONS ?= "ports,linuxthreads"
13 GLIBC_EXTRA_OECONF ?= ""
14
15 GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN"
16
17 #
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
20 # is a uclibc build.
21 #
22 # See the note in gcc/gcc_3.4.0.oe
23 #
24
25 python __anonymous () {
26     import bb, re
27     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
28     if uc_os:
29         raise bb.parse.SkipPackage("incompatible with target %s" %
30                                    bb.data.getVar('TARGET_OS', d, 1))
31 }
32
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"
39
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 \
44 #          \
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"
59
60 # seems to fail on tls platforms
61 SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
62
63 S = "${WORKDIR}/libc"
64 B = "${WORKDIR}/build-${TARGET_SYS}"
65
66 inherit autotools
67
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 \
73                 --without-selinux \
74                 ${GLIBC_EXTRA_OECONF}"
75
76 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
77
78 def get_glibc_fpu_setting(bb, d):
79         if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
80                 return "--without-fp"
81         return ""
82
83 do_munge() {
84         # Integrate ports into tree
85         mv ${WORKDIR}/ports ${S}
86
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.
91         #
92         # This is a workaround for that problem.
93         rm -rf ${S}/bits
94 }
95
96 addtask munge before do_patch after do_unpack
97
98 export default_mmap_threshold_familiar = "32*1024"
99
100 do_configure () {
101         if [ "x$default_mmap_threshold" != "x" ]; then
102                 echo "malloc-CPPFLAGS=-DDEFAULT_MMAP_THRESHOLD=\"(${default_mmap_threshold})\"" >configparms
103         fi
104 # override this function to avoid the autoconf/automake/aclocal/autoheader
105 # calls for now
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."
110                 exit 1
111         fi
112         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
113         CPPFLAGS="" oe_runconf
114 }
115
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"
119
120 do_compile () {
121         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
122         unset LDFLAGS
123         base_do_compile
124         (
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"
129                 done
130         )
131 }
132
133 do_stage() {
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
139
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/
149         done
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"
152         done
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
155
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
161
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/
171         done
172
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"
175         done
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
178 }
179
180 include glibc-package.bbclass