merge of '178eac00dc5aa8338d42e8e203633bec7817bbf6'
[vuplus_openembedded] / packages / glibc / glibc_2.2.5.bb
1 require glibc.inc
2
3 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
4 PR = "r13"
5
6 DEFAULT_PREFERENCE_sh3 = "-99"
7
8 GLIBC_ADDONS ?= "linuxthreads"
9
10 #
11 # For now, we will skip building of a gcc package if it is a uclibc one
12 # and our build is not a uclibc one, and we skip a glibc one if our build
13 # is a uclibc build.
14 #
15 # See the note in gcc/gcc_3.4.0.oe
16 #
17
18 python __anonymous () {
19     import bb, re
20     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
21     if uc_os:
22         raise bb.parse.SkipPackage("incompatible with target %s" %
23                                    bb.data.getVar('TARGET_OS', d, 1))
24 }
25
26 PROVIDES_unslung = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc libc6-unslung"
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 ${libdir}/locale"
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 #          file://noinfo.patch;patch=1 \
47 #          file://ldconfig.patch;patch=1;pnum=0 \
48
49 SRC_URI = "${GNU_MIRROR}/glibc/glibc-${PV}.tar.gz \
50            ${GNU_MIRROR}/glibc/glibc-linuxthreads-${PV}.tar.gz \
51            file://alpha-build-failure.patch;patch=1 \
52            file://arm-asm-clobber.patch;patch=1 \
53            file://arm-ctl_bus_isa.patch;patch=1 \
54            file://cris-libc-symbols.patch;patch=1 \
55            file://cris-stack-direction.patch;patch=1 \
56            file://dl-machine-alpha.patch;patch=1 \
57            file://dl-machine-arm.patch;patch=1 \
58            file://dl-machine-m68k.patch;patch=1 \
59            file://dl-machine-mips.patch;patch=1 \
60            file://dl-machine-sh.patch;patch=1 \
61            file://dl-machine-sparc.patch;patch=1 \
62            file://errlist-1.9.patch;patch=1 \
63            file://errlist-arm.patch;patch=1 \
64            file://glibc-2.2.5-allow-gcc-3.4-fixup.patch;patch=1 \
65            file://glibc-2.2.5-allow-gcc-3.4-grp.patch;patch=1 \
66            file://glibc-2.2.5-allow-gcc-4.x-configure.patch;patch=1 \
67            file://glibc-2.2.5-alpha-pwrite64.patch;patch=1 \
68            file://glibc-2.2.5-arm-pwrite64.patch;patch=1 \
69            file://glibc-2.2.5-crosstest.patch;patch=1 \
70            file://glibc-2.2.5-crossyes.patch;patch=1 \
71            file://glibc-2.2.5-cygwin.patch;patch=1 \
72            file://glibc-2.2.5-hhl-powerpc-fpu.patch;patch=1 \
73            file://glibc-2.2.5-mips-build-gmon.patch;patch=1 \
74            file://glibc-2.2.5-mips-clone-local-label.patch;patch=1 \
75            file://glibc-2.2.5-ppc405erratum77.patch;patch=1 \
76            file://glibc-drow-sh.patch;patch=1 \
77            file://glibc-test-lowram.patch;patch=1 \
78            file://initfini-alpha.patch;patch=1 \
79            file://initfini-sh.patch;patch=1 \
80            file://longjmp-sparc.patch;patch=1 \
81            file://sh-setjmp-fix.patch;patch=1 \
82            file://sprintf-prototype.patch;patch=1 \
83            file://sscanf.patch;patch=1 \
84            file://unwind-arm.patch;patch=1 \
85            file://ldd.patch;patch=1;pnum=0 \
86            file://fhs-linux-paths.patch;patch=1;pnum=1 \
87            file://arm-no-hwcap.patch;patch=1;pnum=0 \
88            file://arm-memcpy.patch;patch=1;pnum=0 \
89            file://arm-longlong.patch;patch=1;pnum=0 \
90            file://arm-machine-gmon.patch;patch=1;pnum=0 \
91            file://glibc-2.2.5-allow-gcc-3.4-td.patch;patch=1 \
92            file://glibc-2.2.5-alpha-self-clobber.patch;patch=1 \
93            file://pt-initfini-alpha.patch;patch=1 \
94            file://pt-initfini-sh.patch;patch=1 \
95            file://linuxthreads-2.2.5-ppc405erratum77.patch;patch=1 \
96            file://threadparam.patch;patch=1 \
97            file://initfini-flags.patch;patch=1 \
98            file://pt-initfini-flags.patch;patch=1 \
99            file://glibc-2.3.2-allow-solaris.patch;patch=1 \
100            \
101            file://etc/ld.so.conf \
102            file://generate-supported.mk"
103 #          file://makeconfig.patch;patch=1;pnum=0
104
105
106 # seems to break on TLS platforms
107 # SRC_URI_append_arm = " file://dyn-ldconfig.patch;patch=1;pnum=0"
108
109 S = "${WORKDIR}/glibc-${PV}"
110 B = "${WORKDIR}/build-${TARGET_SYS}"
111
112 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
113                 --without-cvs --disable-profile --disable-debug --without-gd \
114                 --enable-clocale=gnu \
115                 --enable-add-ons=${GLIBC_ADDONS} \
116                 --with-headers=${STAGING_INCDIR} \
117                 ${GLIBC_EXTRA_OECONF}"
118
119 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
120
121 glibc_do_unpack () {
122         mv ${WORKDIR}/linuxthreads ${WORKDIR}/linuxthreads_db ${S}/
123 }
124
125 python do_unpack () {
126         bb.build.exec_func('base_do_unpack', d)
127         bb.build.exec_func('glibc_do_unpack', d)
128 }
129
130 do_configure () {
131 # override this function to avoid the autoconf/automake/aclocal/autoheader
132 # calls for now
133 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
134 # version check and doesn't really help with anything
135         if [ -z "`which rpcgen`" ]; then
136                 echo "rpcgen not found.  Install glibc-devel."
137                 exit 1
138         fi
139         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
140         CPPFLAGS="" oe_runconf
141 }
142
143 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
144           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
145           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
146
147 do_compile () {
148         # this really is arm specific
149         touch ${S}/sysdeps/arm/framestate.c
150         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
151         unset LDFLAGS
152         base_do_compile
153         (
154                 cd ${S}/sunrpc/rpcsvc
155                 for r in ${rpcsvc}; do
156                         h=`echo $r|sed -e's,\.x$,.h,'`
157                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
158                 done
159         )
160 }
161
162 do_stage() {
163         rm -f ${STAGING_DIR_HOST}${layout_base_libdir}/libc.so.6
164         oe_runmake 'install_root=${STAGING_DIR_HOST}' \
165                    'includedir=${layout_includedir}' 'libdir=${layout_libdir}' 'slibdir=${layout_base_libdir}' \
166                    '${STAGING_DIR_HOST}${layout_base_libdir}/libc.so.6' \
167                    '${STAGING_INCDIR}/bits/errno.h' \
168                    '${STAGING_INCDIR}/bits/libc-lock.h' \
169                    '${STAGING_INCDIR}/gnu/stubs.h' \
170                    install-headers install-lib
171
172         install -d ${STAGING_INCDIR}/gnu \
173                    ${STAGING_INCDIR}/bits \
174                    ${STAGING_INCDIR}/sys \
175                    ${STAGING_INCDIR}/rpcsvc
176         install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
177         install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
178         install -m 0644 ${S}/include/bits/xopen_lim.h ${STAGING_INCDIR}/bits/
179         install -m 0644 ${B}/gnu/lib-names.h ${STAGING_INCDIR}/gnu/
180         install -m 0644 ${S}/include/limits.h ${STAGING_INCDIR}/
181         install -m 0644 ${S}/include/gnu/libc-version.h ${STAGING_INCDIR}/gnu/
182         install -m 0644 ${S}/include/gnu-versions.h ${STAGING_INCDIR}/
183         install -m 0644 ${S}/include/values.h ${STAGING_INCDIR}/
184         install -m 0644 ${S}/include/errno.h ${STAGING_INCDIR}/
185         install -m 0644 ${S}/include/sys/errno.h ${STAGING_INCDIR}/sys/
186         install -m 0644 ${S}/include/features.h ${STAGING_INCDIR}/
187         for r in ${rpcsvc}; do
188                 h=`echo $r|sed -e's,\.x$,.h,'`
189                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
190         done
191         for i in libc.a libc_pic.a libc_nonshared.a; do
192                 install -m 0644 ${B}/$i ${STAGING_DIR_HOST}/${layout_base_libdir}/ || die "failed to install $i"
193         done
194         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_DIR_HOST}/${layout_base_libdir}/libc.so
195 }
196
197 require glibc-package.bbclass
198
199
200 # Unslung distribution specific packages follow ...
201
202 PACKAGES_unslung = "libc6-unslung"
203 PACKAGE_ARCH_unslung = "nslu2"
204 PACKAGE_NO_GCONV_unslung = "1"
205 RDEPENDS_libc6-unslung = "nslu2-linksys-libs"
206 RPROVIDES_libc6-unslung = "libc6"
207
208 FILES_libc6-unslung = "/lib/librt*"
209
210 # For some reason, ldconfig segfaults on nslu2.
211 # FILES_libc6-unslung += " /sbin/ldconfig"
212
213 # For some reason, libnss_compat causes segmentation faults on nslu2.
214 # FILES_libc6-unslung += " /lib/libnss_compat*"
215