bc495758fd27ef735cbe4ca0cf615a9f466e1e86
[vuplus_openembedded] / glibc / glibc_2.2.5.oe
1 FILESDIR = "${@os.path.dirname(oe.data.getVar('FILE',d,1))}/glibc-cvs"
2 PR = "r3"
3 DESCRIPTION = "GNU C Library"
4 HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
5 LICENSE = "LGPL"
6 SECTION = "libs"
7 PRIORITY = "required"
8 MAINTAINER = "Phil Blundell <pb@handhelds.org>"
9
10 GLIBC_ADDONS ?= "linuxthreads"
11 GLIBC_EXTRA_OECONF ?= ""
12
13 #
14 # For now, we will skip building of a gcc package if it is a uclibc one
15 # and our build is not a uclibc one, and we skip a glibc one if our build
16 # is a uclibc build.
17 #
18 # See the note in gcc/gcc_3.4.0.oe
19 #
20
21 python __anonymous () {
22     import oe, re
23     uc_os = (re.match('.*uclibc$', oe.data.getVar('TARGET_OS', d, 1)) != None)
24     if uc_os:
25         raise oe.parse.SkipPackage("incompatible with target %s" %
26                                    oe.data.getVar('TARGET_OS', d, 1))
27 }
28
29 PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"
30
31 # nptl needs unwind support in gcc, which can't be built without glibc.
32 PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
33 PROVIDES += "virtual/libintl virtual/libiconv"
34 DEPENDS = "patcher-native ${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
35 INHIBIT_DEFAULT_DEPS = "1"
36
37 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*"
38
39 FILES_${PN} = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
40 FILES_ldd = "${bindir}/ldd"
41 FILES_libsegfault = "/lib/libSegFault*"
42 FILES_glibc-extra-nss = "/lib/libnss*"
43 FILES_sln = "/sbin/sln"
44 FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen"
45 FILES_nscd = "${sbindir}/nscd*"
46 FILES_glibc-utils = "${bindir} ${sbindir}"
47 FILES_glibc-gconv = "${libdir}/gconv"
48 FILES_catchsegv = "${bindir}/catchsegv"
49 DEPENDS_catchsegv = "libsegfault"
50 FILES_glibc-pcprofile = "/lib/libpcprofile.so"
51 FILES_glibc-thread-db = "/lib/libthread_db*"
52 FILES_localedef = "${bindir}/localedef"
53 RPROVIDES_glibc-dev += "libc-dev"
54
55 #          file://noinfo.patch;patch=1 \
56 #          file://ldconfig.patch;patch=1;pnum=0 \
57
58 SRC_URI = "${GNU_MIRROR}/glibc/glibc-${PV}.tar.gz \
59            ${GNU_MIRROR}/glibc/glibc-linuxthreads-${PV}.tar.gz \
60            file://alpha-build-failure.patch;patch=1 \
61            file://arm-asm-clobber.patch;patch=1 \
62            file://arm-ctl_bus_isa.patch;patch=1 \
63            file://cris-libc-symbols.patch;patch=1 \
64            file://cris-stack-direction.patch;patch=1 \
65            file://dl-machine-alpha.patch;patch=1 \
66            file://dl-machine-arm.patch;patch=1 \
67            file://dl-machine-m68k.patch;patch=1 \
68            file://dl-machine-mips.patch;patch=1 \
69            file://dl-machine-sh.patch;patch=1 \
70            file://dl-machine-sparc.patch;patch=1 \
71            file://errlist-1.9.patch;patch=1 \
72            file://errlist-arm.patch;patch=1 \
73            file://glibc-2.2.5-allow-gcc-3.4-fixup.patch;patch=1 \
74            file://glibc-2.2.5-allow-gcc-3.4-grp.patch;patch=1 \
75            file://glibc-2.2.5-alpha-pwrite64.patch;patch=1 \
76            file://glibc-2.2.5-arm-pwrite64.patch;patch=1 \
77            file://glibc-2.2.5-crosstest.patch;patch=1 \
78            file://glibc-2.2.5-crossyes.patch;patch=1 \
79            file://glibc-2.2.5-cygwin.patch;patch=1 \
80            file://glibc-2.2.5-hhl-powerpc-fpu.patch;patch=1 \
81            file://glibc-2.2.5-mips-build-gmon.patch;patch=1 \
82            file://glibc-2.2.5-mips-clone-local-label.patch;patch=1 \
83            file://glibc-2.2.5-ppc405erratum77.patch;patch=1 \
84            file://glibc-drow-sh.patch;patch=1 \
85            file://glibc-test-lowram.patch;patch=1 \
86            file://initfini-alpha.patch;patch=1 \
87            file://initfini-sh.patch;patch=1 \
88            file://longjmp-sparc.patch;patch=1 \
89            file://sh-setjmp-fix.patch;patch=1 \
90            file://sprintf-prototype.patch;patch=1 \
91            file://sscanf.patch;patch=1 \
92            file://unwind-arm.patch;patch=1 \
93            file://ldd.patch;patch=1;pnum=0 \
94            file://fhs-linux-paths.patch;patch=1;pnum=1 \
95            file://arm-no-hwcap.patch;patch=1;pnum=0 \
96            file://arm-memcpy.patch;patch=1;pnum=0 \
97            file://arm-longlong.patch;patch=1;pnum=0 \
98            file://arm-machine-gmon.patch;patch=1;pnum=0 \
99            file://glibc-2.2.5-allow-gcc-3.4-td.patch;patch=1 \
100            file://glibc-2.2.5-alpha-self-clobber.patch;patch=1 \
101            file://pt-initfini-alpha.patch;patch=1 \
102            file://pt-initfini-sh.patch;patch=1 \
103            file://linuxthreads-2.2.5-ppc405erratum77.patch;patch=1 \
104            file://threadparam.patch;patch=1 \
105            file://initfini-flags.patch;patch=1 \
106            file://pt-initfini-flags.patch;patch=1 \
107            \
108            file://etc/ld.so.conf \
109            file://generate-supported.mk"
110 #          file://makeconfig.patch;patch=1;pnum=0
111
112
113 # seems to break on TLS platforms
114 # SRC_URI_append_arm = " file://dyn-ldconfig.patch;patch=1;pnum=0"
115
116 S = "${WORKDIR}/glibc-${PV}"
117 B = "${WORKDIR}/build-${TARGET_SYS}"
118
119 inherit autotools
120
121 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
122                 --without-cvs --disable-profile --disable-debug --without-gd \
123                 --enable-clocale=gnu \
124                 --enable-add-ons=${GLIBC_ADDONS} \
125                 --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
126                 ${GLIBC_EXTRA_OECONF}"
127
128 EXTRA_OECONF += "${@get_glibc_fpu_setting(oe, d)}"
129
130 def get_glibc_fpu_setting(oe, d):
131         if oe.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
132                 return "--without-fp"
133         return ""
134
135 glibc_do_unpack () {
136         mv ${WORKDIR}/linuxthreads ${WORKDIR}/linuxthreads_db ${S}/
137 }
138
139 python do_unpack () {
140         oe.build.exec_func('base_do_unpack', d) 
141         oe.build.exec_func('glibc_do_unpack', d)        
142 }
143
144 do_configure () {
145 # override this function to avoid the autoconf/automake/aclocal/autoheader
146 # calls for now
147 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
148 # version check and doesn't really help with anything
149         if [ -z "`which rpcgen`" ]; then
150                 echo "rpcgen not found.  Install glibc-devel."
151                 exit 1
152         fi
153         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
154         CPPFLAGS="" oe_runconf
155 }
156
157 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
158           yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
159           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
160
161 do_compile () {
162         # this really is arm specific
163         touch ${S}/sysdeps/arm/framestate.c
164         # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
165         unset LDFLAGS
166         base_do_compile
167         (
168                 cd ${S}/sunrpc/rpcsvc
169                 for r in ${rpcsvc}; do
170                         h=`echo $r|sed -e's,\.x$,.h,'`
171                         rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
172                 done
173         )
174 }
175
176 do_stage() {
177         rm -f ${STAGING_LIBDIR}/libc.so.6
178         oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
179                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
180                    '${STAGING_LIBDIR}/libc.so.6' \
181                    '${STAGING_INCDIR}/bits/errno.h' \
182                    '${STAGING_INCDIR}/bits/libc-lock.h' \
183                    '${STAGING_INCDIR}/gnu/stubs.h' \
184                    install-headers install-lib
185
186         install -d ${STAGING_INCDIR}/gnu \
187                    ${STAGING_INCDIR}/bits \
188                    ${STAGING_INCDIR}/sys \
189                    ${STAGING_INCDIR}/rpcsvc
190         install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
191         install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
192         install -m 0644 ${S}/include/bits/xopen_lim.h ${STAGING_INCDIR}/bits/
193         install -m 0644 ${B}/gnu/lib-names.h ${STAGING_INCDIR}/gnu/
194         install -m 0644 ${S}/include/limits.h ${STAGING_INCDIR}/
195         install -m 0644 ${S}/include/gnu/libc-version.h ${STAGING_INCDIR}/gnu/
196         install -m 0644 ${S}/include/gnu-versions.h ${STAGING_INCDIR}/
197         install -m 0644 ${S}/include/values.h ${STAGING_INCDIR}/
198         install -m 0644 ${S}/include/errno.h ${STAGING_INCDIR}/
199         install -m 0644 ${S}/include/sys/errno.h ${STAGING_INCDIR}/sys/
200         install -m 0644 ${S}/include/features.h ${STAGING_INCDIR}/
201         for r in ${rpcsvc}; do
202                 h=`echo $r|sed -e's,\.x$,.h,'`
203                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
204         done
205         for i in libc.a libc_pic.a libc_nonshared.a; do
206                 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
207         done
208         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
209         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
210
211         rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
212         oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
213                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
214                    '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
215                    '${CROSS_DIR}/${TARGET_SYS}/include/bits/errno.h' \
216                    '${CROSS_DIR}/${TARGET_SYS}/include/bits/libc-lock.h' \
217                    '${CROSS_DIR}/${TARGET_SYS}/include/gnu/stubs.h' \
218                    install-headers install-lib
219
220         install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
221                    ${CROSS_DIR}/${TARGET_SYS}/include/bits \
222                    ${CROSS_DIR}/${TARGET_SYS}/include/sys \
223                    ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
224         install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
225         install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
226         install -m 0644 ${S}/include/bits/xopen_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
227         install -m 0644 ${B}/gnu/lib-names.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
228         install -m 0644 ${S}/include/limits.h ${CROSS_DIR}/${TARGET_SYS}/include/
229         install -m 0644 ${S}/include/gnu/libc-version.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
230         install -m 0644 ${S}/include/gnu-versions.h ${CROSS_DIR}/${TARGET_SYS}/include/
231         install -m 0644 ${S}/include/values.h ${CROSS_DIR}/${TARGET_SYS}/include/
232         install -m 0644 ${S}/include/errno.h ${CROSS_DIR}/${TARGET_SYS}/include/
233         install -m 0644 ${S}/include/sys/errno.h ${CROSS_DIR}/${TARGET_SYS}/include/sys/
234         install -m 0644 ${S}/include/features.h ${CROSS_DIR}/${TARGET_SYS}/include/
235         for r in ${rpcsvc}; do
236                 h=`echo $r|sed -e's,\.x$,.h,'`
237                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
238         done
239
240         for i in libc.a libc_pic.a libc_nonshared.a; do
241                 install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
242         done
243         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
244         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
245 }
246
247 include glibc-package.oeclass
248
249
250 # Unslung distribution specific packages follow ...
251
252 PACKAGES_unslung = libc6-unslung
253 PACKAGE_ARCH_nslu2 = "nslu2"
254 MAINTAINER_libc6-unslung = "NSLU2 Linux <www.nslu2-linux.org>"
255 RDEPENDS_libc6-unslung = "nslu2-linksys-ramdisk"
256 RPROVIDES_libc6-unslung = "libc6"
257
258 FILES_libc6-unslung = "/lib/librt*"
259
260 # For some reason, ldconfig segfaults on nslu2.
261 # FILES_libc6-unslung += " /sbin/ldconfig"
262
263 # For some reason, libnss_compat causes segmentation faults on nslu2.
264 # FILES_libc6-unslung += " /lib/libnss_compat*"
265