]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glibc/glibc_cvs.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / glibc / glibc_cvs.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 PR = "r0"
10 PV = "2.3.5+cvs${CVSDATE}"
11
12 GLIBC_ADDONS ?= "ports,linuxthreads"
13 GLIBC_EXTRA_OECONF ?= ""
14
15 DEFAULT_PREFERENCE = "-1"
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 INHIBIT_DEFAULT_DEPS = "1"
38 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
39
40 #          file://noinfo.patch;patch=1
41 #          file://ldconfig.patch;patch=1;pnum=0
42 #          file://arm-no-hwcap.patch;patch=1;pnum=0 \
43 #          file://arm-memcpy.patch;patch=1;pnum=0 \
44 #          file://arm-machine-gmon.patch;patch=1;pnum=0 \
45 #          \
46 #          file://arm-ioperm.patch;patch=1;pnum=0 \
47 #          file://ldd.patch;patch=1;pnum=0 \
48 SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc \
49            cvs://anoncvs@sources.redhat.com/cvs/glibc;module=ports \
50            file://arm-audit.patch;patch=1 \
51            file://arm-audit2.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
88 addtask munge before do_patch after do_unpack
89
90 do_configure () {
91 # override this function to avoid the autoconf/automake/aclocal/autoheader
92 # calls for now
93 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
94 # version check and doesn't really help with anything
95         if [ -z "`which rpcgen`" ]; then
96                 echo "rpcgen not found.  Install glibc-devel."
97                 exit 1
98         fi
99         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
100         CPPFLAGS="" oe_runconf
101 }
102
103 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
104           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
105           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
106
107 do_compile () {
108         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
109         unset LDFLAGS
110         base_do_compile
111         (
112                 cd ${S}/sunrpc/rpcsvc
113                 for r in ${rpcsvc}; do
114                         h=`echo $r|sed -e's,\.x$,.h,'`
115                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
116                 done
117         )
118 }
119
120 do_stage() {
121         rm -f ${STAGING_LIBDIR}/libc.so.6
122         oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
123                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
124                    '${STAGING_LIBDIR}/libc.so.6' \
125                    install-headers install-lib
126
127         install -d ${STAGING_INCDIR}/gnu \
128                    ${STAGING_INCDIR}/bits \
129                    ${STAGING_INCDIR}/rpcsvc
130         install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
131         install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
132         install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
133         for r in ${rpcsvc}; do
134                 h=`echo $r|sed -e's,\.x$,.h,'`
135                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
136         done
137         for i in libc.a libc_pic.a libc_nonshared.a; do
138                 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
139         done
140         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
141         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
142
143         rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
144         oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
145                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
146                    '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
147                    install-headers install-lib
148
149         install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
150                    ${CROSS_DIR}/${TARGET_SYS}/include/bits \
151                    ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
152         install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
153         install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
154         install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
155         for r in ${rpcsvc}; do
156                 h=`echo $r|sed -e's,\.x$,.h,'`
157                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
158         done
159
160         for i in libc.a libc_pic.a libc_nonshared.a; do
161                 install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
162         done
163         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
164         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
165 }
166
167 include glibc-package.bbclass