]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glibc/glibc_2.3.3+cvs20041128.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / glibc / glibc_2.3.3+cvs20041128.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"
9 PR = "r2"
10
11 GLIBC_ADDONS ?= "linuxthreads"
12 GLIBC_EXTRA_OECONF ?= ""
13
14 DEFAULT_PREFERENCE = "-1"
15 DEFAULT_PREFERENCE_i686 = "0"
16 DEFAULT_PREFERENCE_sh3 = "0"
17 DEFAULT_PREFERENCE_sh4 = "0"
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 # 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 INHIBIT_DEFAULT_DEPS = "1"
40
41 #          file://noinfo.patch;patch=1
42 #          file://ldconfig.patch;patch=1;pnum=0
43 SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc;date=${@bb.data.getVar('PV', d, 1)[9:]} \
44            file://arm-ioperm.patch;patch=1;pnum=0 \
45            file://ldd.patch;patch=1;pnum=0 \
46            file://fhs-linux-paths.patch;patch=1 \
47            file://arm-no-hwcap.patch;patch=1;pnum=0 \
48            file://arm-memcpy.patch;patch=1;pnum=0 \
49            file://arm-longlong.patch;patch=1;pnum=0 \
50            file://arm-machine-gmon.patch;patch=1;pnum=0 \
51            \
52            file://etc/ld.so.conf \
53            file://generate-supported.mk"
54
55 # seems to fail on tls platforms
56 SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
57
58 SRC_URI_append_openmn = " file://ldsocache-varrun.patch;patch=1"
59
60 S = "${WORKDIR}/libc"
61 B = "${WORKDIR}/build-${TARGET_SYS}"
62
63 inherit autotools
64
65 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
66                 --without-cvs --disable-profile --disable-debug --without-gd \
67                 --enable-clocale=gnu \
68                 --enable-add-ons=${GLIBC_ADDONS} \
69                 --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
70                 --without-selinux \
71                 ${GLIBC_EXTRA_OECONF}"
72
73 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
74
75 def get_glibc_fpu_setting(bb, d):
76         if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
77                 return "--without-fp"
78         return ""
79
80 do_configure () {
81 # override this function to avoid the autoconf/automake/aclocal/autoheader
82 # calls for now
83 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
84 # version check and doesn't really help with anything
85         if [ -z "`which rpcgen`" ]; then
86                 echo "rpcgen not found.  Install glibc-devel."
87                 exit 1
88         fi
89         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
90         CPPFLAGS="" oe_runconf
91 }
92
93 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
94           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
95           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
96
97 do_compile () {
98         # this really is arm specific
99         touch ${S}/sysdeps/arm/framestate.c
100         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
101         unset LDFLAGS
102         base_do_compile
103         (
104                 cd ${S}/sunrpc/rpcsvc
105                 for r in ${rpcsvc}; do
106                         h=`echo $r|sed -e's,\.x$,.h,'`
107                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
108                 done
109         )
110 }
111
112 do_stage() {
113         rm -f ${STAGING_LIBDIR}/libc.so.6
114         oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
115                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
116                    '${STAGING_LIBDIR}/libc.so.6' \
117                    install-headers install-lib
118
119         install -d ${STAGING_INCDIR}/gnu \
120                    ${STAGING_INCDIR}/bits \
121                    ${STAGING_INCDIR}/rpcsvc
122         install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
123         install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
124         install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
125         for r in ${rpcsvc}; do
126                 h=`echo $r|sed -e's,\.x$,.h,'`
127                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
128         done
129         for i in libc.a libc_pic.a libc_nonshared.a; do
130                 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
131         done
132         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
133         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
134
135         rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
136         oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
137                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
138                    '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
139                    install-headers install-lib
140
141         install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
142                    ${CROSS_DIR}/${TARGET_SYS}/include/bits \
143                    ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
144         install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
145         install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
146         install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
147         for r in ${rpcsvc}; do
148                 h=`echo $r|sed -e's,\.x$,.h,'`
149                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
150         done
151
152         for i in libc.a libc_pic.a libc_nonshared.a; do
153                 install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
154         done
155         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
156         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
157 }
158
159 include glibc-package.bbclass