Contents of /smage/trunk/core/eglibc/eglibc-2.10.0_20091229-r4.smage2
Parent Directory | Revision Log
Revision 497 -
(show annotations)
(download)
Fri May 7 20:36:34 2010 UTC (14 years, 4 months ago) by niro
File size: 14454 byte(s)
Fri May 7 20:36:34 2010 UTC (14 years, 4 months ago) by niro
File size: 14454 byte(s)
auto added: ver bump to 2.10.0_20091229-r4
1 | # $Id$ |
2 | |
3 | PNAME="eglibc" |
4 | PVER="2.10.0_20091229" |
5 | PBUILD="r4" |
6 | |
7 | PCATEGORIE="sys-libs" |
8 | STATE="unstable" |
9 | |
10 | #DESCRIPTION="Embedded GNU libc6 (also called glibc2) C library with NPTL Threads." |
11 | HOMEPAGE="http://www.eglibc.org/" |
12 | |
13 | #DEPEND="${SDEPEND} |
14 | # >= sys-libs/libstdc++-4.3 |
15 | # >= virtual/base-files" |
16 | |
17 | # we force headers to one specific version |
18 | # (for x86_64 2.6.12.0-r2 bi-arch headers are needed!) |
19 | SDEPEND="== sys-kernel/linux-libc-headers-2.6.31 |
20 | >= sys-libs/libstdc++-4.3 |
21 | >= virtual/base-files" |
22 | |
23 | #PROVIDE="virtual/glibc" |
24 | |
25 | # functions to include in the mage file |
26 | SPECIAL_FUNCTIONS="fix_db_files" |
27 | |
28 | SRCFILE="${PNAME}-${PVER/.0/}.tar.bz2" |
29 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER/.0/}/libc" |
30 | |
31 | sminclude mtools cleanutils |
32 | |
33 | SRC_URI=( |
34 | gnu://${PNAME}/${SRCFILE} |
35 | mirror://${PNAME}/${SRCFILE} |
36 | mirror://${PNAME}/nsswitch.conf |
37 | mirror://${PNAME}/nscd.conf |
38 | mirror://${PNAME}/eglibc.envd |
39 | mirror://${PNAME}/locale-gen |
40 | mirror://${PNAME}/locale.gen |
41 | ) |
42 | |
43 | # glibc don't like strong CFLAGS |
44 | export CFLAGS="${CFLAGS//-O?} -O2" |
45 | # glibc -> nptl thread don't like striping |
46 | NOSTRIP=true |
47 | # gcc 3.0 - 3.3 needs this: |
48 | export CFLAGS="${CFLAGS} -finline-limit=2000" |
49 | export CXXFLAGS="${CFLAGS}" |
50 | export LDFLAGS="${LDFLAGS//-Wl,--relax}" |
51 | |
52 | # hack to fix NPTL issues with xen, only required on 32bit arches |
53 | if [[ ${ARCH} = i*86 ]] |
54 | then |
55 | export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" |
56 | fi |
57 | |
58 | # glibc-2.6.1 and above needs march CFLAGS: -march=${ARCH} -mtune=generic |
59 | # first filter -mtune and -march from flags |
60 | for flag in ${CFLAGS} |
61 | do |
62 | case ${flag} in |
63 | -mtune=*) continue ;; |
64 | -march=*) continue ;; |
65 | esac |
66 | newflags="${newflags} ${flag}" |
67 | done |
68 | # than add our defaults for glibc |
69 | export CFLAGS="${CFLAGS} -march=${ARCH} -mtune=generic" |
70 | export CXXFLAGS="${CFLAGS}" |
71 | |
72 | # use other linux-headers |
73 | [[ -z ${ALT_HEADERS} ]] && export ALT_HEADERS="/usr/include" |
74 | |
75 | # kernel support |
76 | export ENABLE_KERNEL=2.6.18 |
77 | |
78 | SPLIT_PACKAGES="eglibc eglibc-dev" |
79 | |
80 | split_info_eglibc() |
81 | { |
82 | DESCRIPTION="Embedded GNU libc6 (also called glibc2) C library with NPTL Threads." |
83 | |
84 | SDEPEND=">= sys-libs/libstdc++-4.3 |
85 | >= virtual/base-files" |
86 | |
87 | PROVIDE="virtual/glibc" |
88 | |
89 | preinstall() |
90 | { |
91 | # remove libmemusage and libpcprofile as these libs now |
92 | # resides in /usr/lib and are symlinked to /lib |
93 | if [[ -f ${MROOT}/$(mlibdir)/libmemusage.so ]] |
94 | then |
95 | rm ${MROOT}/$(mlibdir)/libmemusage.so |
96 | fi |
97 | |
98 | if [[ -f ${MROOT}/$(mlibdir)/libpcprofile.so ]] |
99 | then |
100 | rm ${MROOT}/$(mlibdir)/libpcprofile.so |
101 | fi |
102 | } |
103 | |
104 | postinstall() |
105 | { |
106 | # first save the old libpthread.so.0; |
107 | # it will later used to determinate that there are no stale |
108 | # libpthreads that breaks ldconfig |
109 | local OLD_PTHREAD |
110 | OLD_PTHREAD="$(readlink ${MROOT}/$(mlibdir)/libpthread.so.0)" |
111 | |
112 | # slackware install method |
113 | |
114 | # we cannot easily install the glibc libs, |
115 | # because our tools for cp etc needs them to run |
116 | |
117 | local file |
118 | |
119 | echo " Switching to new glibc ..." |
120 | # swap libraries on the fly: |
121 | if [ -x /sbin/ldconfig -a -d /$(mlibdir)/incoming ] && [[ -z ${MROOT} ]] |
122 | then |
123 | # first create copies of the incoming libraries: |
124 | cd /$(mlibdir)/incoming |
125 | for file in $(find /$(mlibdir)/incoming -type f) |
126 | do |
127 | if [ ! -r "../$(basename ${file}).incoming" ] |
128 | then |
129 | cp -a ${file} ../$(basename ${file}).incoming |
130 | fi |
131 | done |
132 | |
133 | # then switch to them all at once: |
134 | /sbin/ldconfig -l /$(mlibdir)/*.incoming 2> /dev/null |
135 | |
136 | # finally, rename them and clean up: |
137 | cd /$(mlibdir) |
138 | for file in *.incoming |
139 | do |
140 | rm -f $(basename ${file} .incoming) |
141 | cp -a ${file} $(basename ${file} .incoming) |
142 | /sbin/ldconfig -l $(basename ${file} .incoming) |
143 | rm -f ${file} |
144 | done |
145 | |
146 | # no ldconfig? |
147 | # good, it's safe to just jam it on home (and make links below): |
148 | else |
149 | ( |
150 | cd ${MROOT}/$(mlibdir)/incoming |
151 | for file in * |
152 | do |
153 | cp -a ${file} .. |
154 | done |
155 | |
156 | local my_sym |
157 | local my_dest |
158 | |
159 | # rebuild symlinks |
160 | echo " Recreating Symlinks:" |
161 | for i in $(find ${MROOT}/$(mlibdir)/incoming -type l) |
162 | do |
163 | my_sym="$(readlink ${i})" |
164 | my_dest="$(basename ${i})" |
165 | |
166 | echo " ${my_dest} -> ${my_dest}" |
167 | |
168 | # assure to remove the old ones; |
169 | [ -L ${MROOT}/$(mlibdir)/"${my_dest}" ] && \ |
170 | rm ${MROOT}/$(mlibdir)/"${my_dest}" |
171 | |
172 | ln -snf "${my_sym}" ${MROOT}/$(mlibdir)/"${my_dest}" |
173 | done |
174 | ) |
175 | fi |
176 | |
177 | # now, get rid of the temporary directory: |
178 | rm -rf ${MROOT}/$(mlibdir)/incoming |
179 | |
180 | # remove stale nptl libpthread-2.?.?.so, |
181 | # fix only needed for glibc with linuxthreads; |
182 | # prevent reloc errors such as: |
183 | # ls: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory |
184 | |
185 | # get our new libpthread.so.0 |
186 | local NEW_PTHREAD |
187 | NEW_PTHREAD="$(readlink ${MROOT}/$(mlibdir)/libpthread.so.0)" |
188 | |
189 | if [ "${NEW_PTHREAD}" != "${OLD_PTHREAD}" ] |
190 | then |
191 | echo " Removing stale libpthread libraries ..." |
192 | for file in ${MROOT}/$(mlibdir)/libpthread-* |
193 | do |
194 | if [ "$(basename ${file})" != "${NEW_PTHREAD}" ] |
195 | then |
196 | rm -f ${file} |
197 | fi |
198 | done |
199 | |
200 | #rm -f /lib/${OLD_PTHREAD} |
201 | |
202 | ln -snf ${NEW_PTHREAD} ${MROOT}/$(mlibdir)/libpthread.so.0 |
203 | fi |
204 | |
205 | if [ -x /usr/sbin/iconvconfig ] |
206 | then |
207 | # generate fastloading iconv module configuration file. |
208 | echo " Generate iconv module config ..." |
209 | /usr/sbin/iconvconfig --prefix=${MROOT}/ |
210 | fi |
211 | |
212 | # not working with busybox |
213 | if [[ $(basename $(readlink /sbin/init)) != busybox ]] |
214 | then |
215 | # reloading init |
216 | echo " Reloading init ..." |
217 | [[ -z ${MROOT} ]] && /sbin/init U &> /dev/null |
218 | fi |
219 | |
220 | if [[ -x /usr/sbin/locale-gen ]] && [[ -z ${MROOT} ]] |
221 | then |
222 | # generating user def locales |
223 | echo " Generating user defined locales ..." |
224 | /usr/sbin/locale-gen |
225 | fi |
226 | |
227 | # now we must fix the mage db files |
228 | # to stop the annoying errors messages |
229 | fix_db_files |
230 | } |
231 | |
232 | } |
233 | |
234 | split_info_eglibc-dev() |
235 | { |
236 | DESCRIPTION="Development files for ${PCATEGORE}/${PNAME}-${PVER}-${PBUILD}." |
237 | SDEPEND=">= ${PCATEGORIE}/${PNAME}-${PVER}" |
238 | |
239 | postinstall() |
240 | { |
241 | |
242 | if [ -x /usr/sbin/iconvconfig ] |
243 | then |
244 | # generate fastloading iconv module configuration file. |
245 | echo " Generate iconv module config ..." |
246 | /usr/sbin/iconvconfig --prefix=${MROOT}/ |
247 | fi |
248 | |
249 | # not working with busybox |
250 | if [[ $(basename $(readlink /sbin/init)) != busybox ]] |
251 | then |
252 | # reloading init |
253 | echo " Reloading init ..." |
254 | [[ -z ${MROOT} ]] && /sbin/init U &> /dev/null |
255 | fi |
256 | |
257 | if [[ -x /usr/sbin/locale-gen ]] && [[ -z ${MROOT} ]] |
258 | then |
259 | # generating user def locales |
260 | echo " Generating user defined locales ..." |
261 | /usr/sbin/locale-gen |
262 | fi |
263 | } |
264 | } |
265 | |
266 | src_prepare() |
267 | { |
268 | munpack ${SRCFILE} || die |
269 | cd ${SRCDIR} |
270 | |
271 | # disable binutils -as-needed |
272 | sed -i 's/^have-as-needed.*/have-as-needed = no/' ${SRCDIR}/config.make.in || die |
273 | |
274 | # fix permissions on some of the scripts |
275 | chmod u+x ${SRCDIR}/scripts/*.sh || die |
276 | |
277 | install -d ${SRCDIR}/build || die |
278 | cd ${SRCDIR}/build |
279 | |
280 | if [ ! -f /etc/ld.so.conf ] |
281 | then |
282 | touch /etc/ld.so.conf || die |
283 | fi |
284 | |
285 | # disable some eglibc defaults: |
286 | # no ipv6 support |
287 | # sed -i "s:^\(OPTION_EGLIBC_ADVANCED_INET6 =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
288 | # only some default charsets |
289 | # sed -i "s:^\(OPTION_EGLIBC_CHARSETS =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
290 | # disable support for locales |
291 | # sed -i "s:^\(OPTION_EGLIBC_CATGETS =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
292 | # sed -i "s:^\(OPTION_EGLIBC_LOCALES =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
293 | # sed -i "s:^\(OPTION_EGLIBC_LOCALE_CODE =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
294 | # disable mail aliases support |
295 | # sed -i "s:^\(OPTION_EGLIBC_DB_ALIASES =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
296 | # # disable nis support |
297 | # sed -i "s:^\(OPTION_EGLIBC_NIS =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
298 | # no remote services via rsh |
299 | # sed -i "s:^\(OPTION_EGLIBC_RCMD =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
300 | # no sunrpc |
301 | # sed -i "s:^\(OPTION_EGLIBC_SUNRPC =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
302 | # no support for old access of utmp |
303 | # sed -i "s:^\(OPTION_EGLIBC_UTMP =\).*:\1 n:" ${SRCDIR}/option-groups.defaults || die |
304 | } |
305 | |
306 | src_compile() |
307 | { |
308 | |
309 | # fixes some build issues; |
310 | # -> configure: error: no acceptable grep could be found |
311 | export ac_cv_path_GREP=/bin/grep |
312 | |
313 | # support multilib lib64 dir (x86_64 only) |
314 | if [[ ${ARCH} = x86_64 ]] |
315 | then |
316 | # first build a -m32 version |
317 | install -d ${SRCDIR}/build-m32 |
318 | cd ${SRCDIR}/build-m32 |
319 | |
320 | CC="gcc -m32" CXX="g++ -m32" \ |
321 | ../configure \ |
322 | --build=${CHOST} \ |
323 | --host=i686-pc-linux-gnu \ |
324 | --prefix=/usr \ |
325 | --mandir=/usr/share/man \ |
326 | --infodir=/usr/share/info \ |
327 | --disable-profile \ |
328 | --enable-add-ons=nptl \ |
329 | --with-tls \ |
330 | --with-__thread \ |
331 | --enable-kernel=${ENABLE_KERNEL} \ |
332 | --without-cvs \ |
333 | --without-gd \ |
334 | --libdir=/usr/lib \ |
335 | --libexecdir=/usr/lib/eglibc \ |
336 | --with-headers=${ALT_HEADERS} \ |
337 | --disable-nls \ |
338 | || die |
339 | |
340 | make PARALLELMFLAGS="${MAKEOPTS}" || die |
341 | fi |
342 | |
343 | cd ${SRCDIR}/build |
344 | |
345 | if [[ ${ARCH} = x86_64 ]]; then |
346 | # make sure the -m64 libs goes really to /lib64 |
347 | echo "slibdir=/$(mlibdir)" >> ${SRCDIR}/build/configparms || die |
348 | fi |
349 | |
350 | # kernel-2.6 with nptl needs this |
351 | ../configure \ |
352 | --build=${CHOST} \ |
353 | --host=${CHOST} \ |
354 | --prefix=/usr \ |
355 | --mandir=/usr/share/man \ |
356 | --infodir=/usr/share/info \ |
357 | --disable-profile \ |
358 | --enable-add-ons=nptl \ |
359 | --with-tls \ |
360 | --with-__thread \ |
361 | --enable-kernel=2.6.0 \ |
362 | --without-cvs \ |
363 | --without-gd \ |
364 | --libdir=/usr/$(mlibdir) \ |
365 | --libexecdir=/usr/$(mlibdir)/eglibc \ |
366 | --with-headers=${ALT_HEADERS} \ |
367 | || die |
368 | |
369 | make PARALLELMFLAGS="${MAKEOPTS}" || die |
370 | } |
371 | |
372 | src_install_eglibc() |
373 | { |
374 | if [[ ${ARCH} = x86_64 ]] |
375 | then |
376 | # install -m32 libs |
377 | cd ${SRCDIR}/build-m32 |
378 | make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die |
379 | fi |
380 | |
381 | cd ${SRCDIR}/build |
382 | make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die |
383 | |
384 | # cleanup |
385 | zapmost ${BINDIR} $(mlibdir) \ |
386 | usr/$(mlibdir)/*.so \ |
387 | $([[ ${ARCH} = x86_64 ]] && echo 'lib usr/lib/*.so') \ |
388 | sbin/ldconfig \ |
389 | usr/bin/iconv \ |
390 | usr/bin/locale \ |
391 | usr/$(mlibdir)/gconv/ISO8859-1.so \ |
392 | usr/$(mlibdir)/gconv/UNICODE.so \ |
393 | usr/$(mlibdir)/gconv/gconv-modules \ |
394 | $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/ISO8859-1.so') \ |
395 | $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/UNICODE.so') \ |
396 | $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/gconv-modules') \ |
397 | || die |
398 | |
399 | # base environment |
400 | minstallenv eglibc.envd 00eglibc || die |
401 | if [[ ${ARCH} = x86_64 ]] |
402 | then |
403 | echo "LDPATH=\"/usr/local/$(mlibdir)\"" >> ${BINDIR}/etc/env.d/00eglibc || die |
404 | echo "LDPATH=\"/opt/$(mlibdir)\"" >> ${BINDIR}/etc/env.d/00eglibc || die |
405 | fi |
406 | |
407 | # move some libs and tools to proper locations |
408 | # will suppress some ldconfig errors too |
409 | mv ${BINDIR}/$(mlibdir)/libmemusage.so ${BINDIR}/usr/$(mlibdir) || die |
410 | mv ${BINDIR}/$(mlibdir)/libpcprofile.so ${BINDIR}/usr/$(mlibdir) || die |
411 | mlink ../usr/$(mlibdir)/libmemusage.so /$(mlibdir)/libmemusage.so || die |
412 | mlink ../usr/$(mlibdir)/libpcprofile.so /$(mlibdir)/libpcprofile.so || die |
413 | |
414 | # strip all binaries |
415 | find ${BINDIR} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || die |
416 | |
417 | # strip all libraries |
418 | # want to be safe here; --strip-unneeded seems to cause pthread problems |
419 | # strip all but libpthread |
420 | install -d ${BUILDDIR}/thread-backup || die |
421 | mv ${BINDIR}/$(mlibdir)/lib{pthread,thread_db}* ${BUILDDIR}/thread-backup/ || die |
422 | # now strip |
423 | find ${BINDIR} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || die |
424 | mv -f ${BUILDDIR}/thread-backup/* ${BINDIR}/$(mlibdir)/ || die |
425 | # remove stale directory |
426 | rm -rf ${BUILDDIR}/thread-backup || die |
427 | |
428 | # prepare glibc for installation; slackware method |
429 | minstalldir /incoming || die |
430 | mv ${BINDIR}/$(mlibdir)/* ${BINDIR}/incoming || die |
431 | mv ${BINDIR}/incoming ${BINDIR}/$(mlibdir)/incoming || die |
432 | mv ${BINDIR}/$(mlibdir)/incoming/libSegFault.so ${BINDIR}/$(mlibdir) || die |
433 | } |
434 | |
435 | src_install_eglibc-dev() |
436 | { |
437 | if [[ ${ARCH} = x86_64 ]] |
438 | then |
439 | # install -m32 libs |
440 | cd ${SRCDIR}/build-m32 |
441 | make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die |
442 | fi |
443 | |
444 | cd ${SRCDIR}/build |
445 | make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die |
446 | |
447 | # cleanup -> in eglibc |
448 | rm -r ${BINDIR}/$(mlibdir) || die |
449 | rm ${BINDIR}/usr/$(mlibdir)/*.so || die |
450 | rm ${BINDIR}/usr/$(mlibdir)/gconv/ISO8859-1.so || die |
451 | rm ${BINDIR}/usr/$(mlibdir)/gconv/UNICODE.so || die |
452 | rm ${BINDIR}/usr/$(mlibdir)/gconv/gconv-modules || die |
453 | if [[ ${ARCH} = x86_64 ]] |
454 | then |
455 | rm -r ${BINDIR}/lib || die |
456 | rm ${BINDIR}/usr/lib/*.so || die |
457 | rm ${BINDIR}/usr/lib/gconv/ISO8859-1.so || die |
458 | rm ${BINDIR}/usr/lib/gconv/UNICODE.so || die |
459 | rm ${BINDIR}/usr/lib/gconv/gconv-modules || die |
460 | fi |
461 | rm ${BINDIR}/sbin/ldconfig || die |
462 | rm ${BINDIR}/usr/bin/iconv || die |
463 | rm ${BINDIR}/usr/bin/locale || die |
464 | |
465 | # do not generate the locales here, let it the user do with the locale-gen tool |
466 | # make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} localedata/install-locales || die |
467 | |
468 | # install locales list and generate tools |
469 | # to generate this listing see the glibc-2.5/localedata/SUPPORTED file |
470 | minstalletc locale.gen || die |
471 | minstalldir /usr/sbin || die |
472 | minstallexec -s locale-gen /usr/sbin || die |
473 | |
474 | # nsswitch configuration file |
475 | minstalletc nsswitch.conf || die |
476 | |
477 | # nscd configuration file |
478 | minstalletc nscd.conf || die |
479 | |
480 | # we use Berlin as default |
481 | cp --remove-destination ${BINDIR}/usr/share/zoneinfo/Europe/Berlin ${BINDIR}/etc/localtime || die |
482 | [ -f ${BINDIR}/etc/ld.so.conf ] && { rm -f ${BINDIR}/etc/ld.so.conf || die; } |
483 | [ -e ${BINDIR}/etc/ld.so.cache ] && { rm -rf ${BINDIR}/etc/ld.so.cache || die; } |
484 | |
485 | # strip all binaries |
486 | find ${BINDIR} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || die |
487 | |
488 | # strip all libraries |
489 | find ${BINDIR} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || die |
490 | } |
491 | |
492 | fix_db_files() |
493 | { |
494 | local i |
495 | local DB_ENTRY="${BUILDDIR}/${PKGNAME}" |
496 | |
497 | for i in .files .symlinks .dirs |
498 | do |
499 | [ ! -f ${DB_ENTRY}/${i} ] && continue |
500 | [[ -z $(< ${DB_ENTRY}/${i}) ]] && continue |
501 | |
502 | echo " fixing /$(mlibdir)/incoming from db-entry '${i}' ..." |
503 | |
504 | # /lib/incoming -> empty line; sed2 removes all empty lines |
505 | #sed -i -e "s:/$(mlibdir)/incoming.*::g" -e '/^$/d' ${DB_ENTRY}/${i} |
506 | # do not simply emtpy the line, but change it the the correct path, |
507 | # so no stale libs are around if the package gets updated! |
508 | sed -i -e "s:/$(mlibdir)/incoming:/$(mlibdir):g" \ |
509 | -e "s:/$(mlibdir)/incoming.*::g" -e '/^$/d' ${DB_ENTRY}/${i} |
510 | done |
511 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |