]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glibc/glibc_2.3.2.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.2.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 PR = "r6"
7
8 GLIBC_ADDONS ?= "linuxthreads"
9 GLIBC_EXTRA_OECONF ?= ""
10
11 #
12 # For now, we will skip building of a gcc package if it is a uclibc one
13 # and our build is not a uclibc one, and we skip a glibc one if our build
14 # is a uclibc build.
15 #
16 # See the note in gcc/gcc_3.4.0.oe
17 #
18
19 python __anonymous () {
20     import bb, re
21     uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
22     if uc_os:
23         raise bb.parse.SkipPackage("incompatible with target %s" %
24                                    bb.data.getVar('TARGET_OS', d, 1))
25 }
26
27 PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"
28 PROVIDES += "virtual/libintl virtual/libiconv"
29
30 # nptl needs unwind support in gcc, which can't be built without glibc.
31 PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
32 DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
33 INHIBIT_DEFAULT_DEPS = "1"
34
35 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*"
36
37 FILES_${PN} = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir} ${datadir}/zoneinfo"
38 FILES_ldd = "${bindir}/ldd"
39 FILES_libsegfault = "/lib/libSegFault*"
40 FILES_glibc-extra-nss = "/lib/libnss*"
41 FILES_sln = "/sbin/sln"
42 FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen"
43 FILES_nscd = "${sbindir}/nscd*"
44 FILES_glibc-utils = "${bindir} ${sbindir}"
45 FILES_glibc-gconv = "${libdir}/gconv"
46 FILES_catchsegv = "${bindir}/catchsegv"
47 DEPENDS_catchsegv = "libsegfault"
48 FILES_glibc-pcprofile = "/lib/libpcprofile.so"
49 FILES_glibc-thread-db = "/lib/libthread_db*"
50 FILES_localedef = "${bindir}/localedef"
51 RPROVIDES_glibc-dev += "libc-dev"
52
53 SRC_URI = "ftp://ftp.gnu.org/gnu/glibc/glibc-${PV}.tar.gz \
54            ftp://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-2.3.2.tar.gz \
55            file://noinfo.patch;patch=1 \
56            file://10_cvs.patch;patch=1 \
57            file://arm-ioperm.patch;patch=1;pnum=0 \
58            file://glibc-i686-timing.patch;patch=1;pnum=1 \
59            file://makeconfig.patch;patch=1;pnum=0 \
60            file://locale-es_AR.patch;patch=1;pnum=0 \
61            file://ldconfig.patch;patch=1;pnum=0 \
62            file://ldd.patch;patch=1;pnum=0 \
63            file://fhs-linux-paths.patch;patch=1;pnum=1 \
64            file://glibc22-nss-upgrade.patch;patch=1;pnum=1 \
65            file://glibc22-eo_EO.patch;patch=1;pnum=1 \
66            file://glibc22-m68k-compat.patch;patch=1;pnum=1 \
67            file://glibc22-m68k-fpic.patch;patch=1;pnum=1 \
68            file://glibc22-locales.patch;patch=1;pnum=0 \
69            file://sparc64-fixups.patch;patch=1;pnum=1 \
70            file://glibc22-ttyname-devfs.patch;patch=1;pnum=0 \
71            file://powerpc-sysconf.patch;patch=1;pnum=1 \
72            file://arm-no-hwcap.patch;patch=1;pnum=0 \
73            file://locales-stuff.patch;patch=1;pnum=1 \
74            file://librt-mips.patch;patch=1;pnum=0 \
75            file://glibc23-ctype-compat.patch;patch=1;pnum=1 \
76            file://glibc23-hppa-Rminkernel.patch;patch=1;pnum=0 \
77            file://glibc23-function-compat.patch;patch=1;pnum=1 \
78            file://glibc23-errno.patch;patch=1;pnum=1 \
79            file://glibc23-asserth-decls.patch;patch=1;pnum=0 \
80            file://alpha-pic.patch;patch=1;pnum=0 \
81            file://glibc23-cmov.patch;patch=1;pnum=1 \
82            file://libgcc-compat-all.patch;patch=1;pnum=0 \
83            file://locales-supported.patch;patch=1;pnum=0 \
84            file://libgcc-compat-other.patch;patch=1;pnum=1 \
85            file://s390-tls.patch;patch=1;pnum=0 \
86            file://hurd-enable-ldconfig.patch;patch=1;pnum=1 \
87            file://30_glibc232-base.patch;patch=1;pnum=0 \
88            file://sparcv8-target.patch;patch=1;pnum=0 \
89            file://50_glibc232-arm-dwarf2-buildfix.patch;patch=1;pnum=0 \
90            file://50_glibc232-m68k-dwarf2-buildfix.patch;patch=1;pnum=1 \
91            file://arm-output-format.patch;patch=1;pnum=0 \
92            file://pthread-cleanup.patch;patch=1;pnum=0 \
93            file://glibc-${PV}-ldconfig-tls.patch;patch=1;pnum=1 \
94            file://glibc23-mips-msq.patch;patch=1;pnum=0 \
95            file://glibc23-libio-compat.patch;patch=1;pnum=1 \
96            file://80_glibc232-locales-nb_NO-fix.patch;patch=1;pnum=0 \
97            file://ldso-disable-hwcap.patch;patch=1;pnum=1 \
98            file://11_shlib-lds.patch;patch=1;pnum=1 \
99            file://glibc23-version-sanity.patch;patch=1;pnum=1 \
100            file://glibc23-sse-oldkernel.patch;patch=1;pnum=1 \
101            file://glibc23-sparc-pread64.patch;patch=1;pnum=1 \
102            file://glibc23-powerpc-sigcontext.patch;patch=1;pnum=1 \
103            file://hppa-syscall.patch;patch=1;pnum=0 \
104            file://glibc23-errno-hack.patch;patch=1;pnum=1 \
105            file://90_glibc232-statvfs.patch;patch=1;pnum=0 \
106            file://90_glibc232-timezones.patch;patch=1;pnum=0 \
107            file://arm-memcpy.patch;patch=1;pnum=0 \
108            file://arm-longlong.patch;patch=1;pnum=0 \
109            file://arm-machine-gmon.patch;patch=1;pnum=0 \
110            file://dyn-ldconfig.diff;patch=1;pnum=0 \
111            file://glibc232-gcc34-i386-fixup-attribute.patch;patch=1;pnum=1 \
112            file://glibc232-gcc34-no-unit-at-a-time.patch;patch=1;pnum=1 \
113            file://etc/ld.so.conf \
114            file://generate-supported.mk"
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(bb, d)}"
129
130 def get_glibc_fpu_setting(bb, d):
131         if bb.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         bb.build.exec_func('base_do_unpack', d)
141         bb.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                    install-headers install-lib
182
183         install -d ${STAGING_INCDIR}/gnu \
184                    ${STAGING_INCDIR}/bits \
185                    ${STAGING_INCDIR}/rpcsvc
186         install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
187         install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
188         install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
189         for r in ${rpcsvc}; do
190                 h=`echo $r|sed -e's,\.x$,.h,'`
191                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
192         done
193         for i in libc.a libc_pic.a libc_nonshared.a; do
194                 install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
195         done
196         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
197         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
198
199         rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
200         oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
201                    'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
202                    '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
203                    install-headers install-lib
204
205         install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
206                    ${CROSS_DIR}/${TARGET_SYS}/include/bits \
207                    ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
208         install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
209         install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
210         install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
211         for r in ${rpcsvc}; do
212                 h=`echo $r|sed -e's,\.x$,.h,'`
213                 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
214         done
215
216         for i in libc.a libc_pic.a libc_nonshared.a; do
217                 install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
218         done
219         echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
220         echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
221 }
222
223 include glibc-package.bbclass