/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.279 Revision 1.282
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.279 2007/04/25 09:14:35 carlo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.282 2007/06/16 07:11:43 vapier Exp $
4# 4#
5# This eclass is for general purpose functions that most ebuilds 5# This eclass is for general purpose functions that most ebuilds
6# have to implement themselves. 6# have to implement themselves.
7# 7#
8# NB: If you add anything, please comment it! 8# NB: If you add anything, please comment it!
35 echo -ne "\a" 35 echo -ne "\a"
36 sleep 1 36 sleep 1
37 done 37 done
38 fi 38 fi
39} 39}
40
41# This function generate linker scripts in /usr/lib for dynamic
42# libs in /lib. This is to fix linking problems when you have
43# the .so in /lib, and the .a in /usr/lib. What happens is that
44# in some cases when linking dynamic, the .a in /usr/lib is used
45# instead of the .so in /lib due to gcc/libtool tweaking ld's
46# library search path. This cause many builds to fail.
47# See bug #4411 for more info.
48#
49# To use, simply call:
50#
51# gen_usr_ldscript libfoo.so
52#
53# Note that you should in general use the unversioned name of
54# the library, as ldconfig should usually update it correctly
55# to point to the latest version of the library present.
56#
57# <azarah@gentoo.org> (26 Oct 2002)
58#
59gen_usr_ldscript() {
60 if [[ $(type -t _tc_gen_usr_ldscript) == "function" ]] ; then
61 _tc_gen_usr_ldscript "$@"
62 return $?
63 fi
64
65 ewarn "QA Notice: Please upgrade your ebuild to use toolchain-funcs"
66 ewarn "QA Notice: rather than gen_usr_ldscript() from eutils"
67
68 local lib libdir=$(get_libdir)
69 # Just make sure it exists
70 dodir /usr/${libdir}
71
72 for lib in "${@}" ; do
73 cat > "${D}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
74 /* GNU ld script
75 Since Gentoo has critical dynamic libraries
76 in /lib, and the static versions in /usr/lib,
77 we need to have a "fake" dynamic lib in /usr/lib,
78 otherwise we run into linking problems.
79
80 See bug http://bugs.gentoo.org/4411 for more info.
81 */
82 GROUP ( /${libdir}/${lib} )
83 END_LDSCRIPT
84 fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms on ${lib}"
85 done
86}
87
88 40
89# Default directory where patches are located 41# Default directory where patches are located
90EPATCH_SOURCE="${WORKDIR}/patch" 42EPATCH_SOURCE="${WORKDIR}/patch"
91# Default extension for patches 43# Default extension for patches
92EPATCH_SUFFIX="patch.bz2" 44EPATCH_SUFFIX="patch.bz2"
366 [[ -z ${T} ]] \ 318 [[ -z ${T} ]] \
367 && topdir="/tmp" \ 319 && topdir="/tmp" \
368 || topdir=${T} 320 || topdir=${T}
369 fi 321 fi
370 322
371 if [[ -z $(type -p mktemp) ]] ; then 323 if ! type -P mktemp > /dev/null ; then
324 # system lacks `mktemp` so we have to fake it
372 local tmp=/ 325 local tmp=/
373 while [[ -e ${tmp} ]] ; do 326 while [[ -e ${tmp} ]] ; do
374 tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM} 327 tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}
375 done 328 done
376 ${exe} "${tmp}" || ${exe} -p "${tmp}" 329 ${exe} "${tmp}" || ${exe} -p "${tmp}"
377 echo "${tmp}" 330 echo "${tmp}"
378 else 331 else
332 # the args here will give slightly wierd names on BSD,
333 # but should produce a usable file on all userlands
379 if [[ ${exe} == "touch" ]] ; then 334 if [[ ${exe} == "touch" ]] ; then
380 [[ ${USERLAND} == "GNU" ]] \
381 && mktemp -p "${topdir}" \
382 || TMPDIR="${topdir}" mktemp -t tmp 335 TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX
383 else 336 else
384 [[ ${USERLAND} == "GNU" ]] \
385 && mktemp -d "${topdir}" \
386 || TMPDIR="${topdir}" mktemp -dt tmp 337 TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX
387 fi 338 fi
388 fi 339 fi
389} 340}
390 341
391# Small wrapper for getent (Linux), nidump (Mac OS X), 342# Small wrapper for getent (Linux), nidump (Mac OS X),
1459 local dir=$(dirname ${cdset[${i}]}) 1410 local dir=$(dirname ${cdset[${i}]})
1460 local file=$(basename ${cdset[${i}]}) 1411 local file=$(basename ${cdset[${i}]})
1461 1412
1462 local point= node= fs= foo= 1413 local point= node= fs= foo=
1463 while read point node fs foo ; do 1414 while read point node fs foo ; do
1464 [[ " cd9660 iso9660 " != *" ${fs} "* ]] && \ 1415 [[ " cd9660 iso9660 udf " != *" ${fs} "* ]] && \
1465 ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \ 1416 ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \
1466 && continue 1417 && continue
1467 point=${point//\040/ } 1418 point=${point//\040/ }
1468 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue 1419 [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue
1469 export CDROM_ROOT=${point} 1420 export CDROM_ROOT=${point}

Legend:
Removed from v.1.279  
changed lines
  Added in v.1.282

  ViewVC Help
Powered by ViewVC 1.1.20