merge of '178eac00dc5aa8338d42e8e203633bec7817bbf6'
[vuplus_openembedded] / packages / glibc / glibc_2.3.3.bb
1 require glibc.inc
2
3 PR = "r9"
4
5 DEFAULT_PREFERENCE_sh3 = "-99"
6
7 DEFAULT_PREFERENCE = "-1"
8 DEFAULT_PREFERENCE_mipsel = "0"
9
10 GLIBC_ADDONS ?= "linuxthreads"
11
12 #
13 # For now, we will skip building of a gcc package if it is a uclibc one
14 # and our build is not a uclibc one, and we skip a glibc one if our build
15 # is a uclibc build.
16 #
17 # See the note in gcc/gcc_3.4.0.oe
18 #
19
20 python __anonymous () {
21     import bb, re
22     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
23     if uc_os:
24         raise bb.parse.SkipPackage("incompatible with target %s" %
25                                    bb.data.getVar('TARGET_OS', d, 1))
26 }
27
28 libc_baselibs = "/lib/libc* /lib/libm* /lib/ld* /lib/libpthread* /lib/libresolv* /lib/librt* /lib/libutil* /lib/libnsl* /lib/libnss_files* /lib/libnss_compat* /lib/libnss_dns* /lib/libdl* /lib/libanl* /lib/libBrokenLocale*"
29
30 FILES_${PN} = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir} ${datadir}/zoneinfo"
31 FILES_ldd = "${bindir}/ldd"
32 FILES_libsegfault = "/lib/libSegFault*"
33 FILES_glibc-extra-nss = "/lib/libnss*"
34 FILES_sln = "/sbin/sln"
35 FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen"
36 FILES_nscd = "${sbindir}/nscd*"
37 FILES_glibc-utils = "${bindir} ${sbindir}"
38 FILES_glibc-gconv = "${libdir}/gconv"
39 FILES_catchsegv = "${bindir}/catchsegv"
40 DEPENDS_catchsegv = "libsegfault"
41 FILES_glibc-pcprofile = "/lib/libpcprofile.so"
42 FILES_glibc-thread-db = "/lib/libthread_db*"
43 FILES_localedef = "${bindir}/localedef"
44 RPROVIDES_glibc-dev += "libc-dev"
45
46 SRC_URI = "ftp://ftp.gnu.org/gnu/glibc/glibc-${PV}.tar.gz \
47            ftp://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-${PV}.tar.gz \
48            file://etc/ld.so.conf \
49            file://generate-supported.mk"
50
51 S = "${WORKDIR}/glibc-${PV}"
52 B = "${WORKDIR}/build-${TARGET_SYS}"
53
54 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
55                 --without-cvs --disable-profile --disable-debug --without-gd \
56                 --enable-clocale=gnu \
57                 --enable-add-ons=${GLIBC_ADDONS} \
58                 --with-headers=${STAGING_INCDIR} \
59                 ${GLIBC_EXTRA_OECONF}"
60
61 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
62
63 glibc_do_unpack () {
64         mv "${WORKDIR}/linuxthreads" "${WORKDIR}/linuxthreads_db" "${S}/"
65 }
66
67 python do_unpack () {
68         bb.build.exec_func('base_do_unpack', d)
69         bb.build.exec_func('glibc_do_unpack', d)
70 }
71
72 do_configure () {
73 # override this function to avoid the autoconf/automake/aclocal/autoheader
74 # calls for now
75 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
76 # version check and doesn't really help with anything
77         if [ -z "`which rpcgen`" ]; then
78                 echo "rpcgen not found.  Install glibc-devel."
79                 exit 1
80         fi
81         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
82         CPPFLAGS="" oe_runconf
83 }
84
85 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
86           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
87           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
88
89 do_compile () {
90         # this really is arm specific
91         touch ${S}/sysdeps/arm/framestate.c
92         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
93         unset LDFLAGS
94         base_do_compile
95         (
96                 cd ${S}/sunrpc/rpcsvc
97                 for r in ${rpcsvc}; do
98                         h=`echo $r|sed -e's,\.x$,.h,'`
99                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
100                 done
101         )
102 }
103
104 require glibc-stage.inc
105
106 require glibc-package.bbclass