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

Diff of /eclass/eutils.eclass

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

Revision 1.95 Revision 1.96
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.95 2004/08/15 03:25:19 lv Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.96 2004/08/24 11:51:28 lv Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
13INHERITED="$INHERITED $ECLASS" 13INHERITED="$INHERITED $ECLASS"
14 14
15DEPEND="!bootstrap? ( sys-devel/patch )" 15DEPEND="!bootstrap? ( sys-devel/patch )"
16 16
17DESCRIPTION="Based on the ${ECLASS} eclass" 17DESCRIPTION="Based on the ${ECLASS} eclass"
18
19# This function simply returns the desired lib directory. With portage
20# 2.0.51, we now have support for installing libraries to lib32/lib64
21# to accomidate the needs of multilib systems. It's no longer a good idea
22# to assume all libraries will end up in lib. Replace any (sane) instances
23# where lib is named directly with $(get_libdir) if possible.
24#
25# Travis Tilley <lv@gentoo.org> (24 Aug 2004)
26get_libdir() {
27 # CONF_LIBDIR wasnt supported until 2.0.51_pre18, so for all versions of
28 # portage prior to that lib would need to be used even if CONF_LIBDIR is
29 # set. dolib and friends will ignore CONF_LIBDIR in <2.0.51_pre20
30 portageq has_version / '<sys-apps/portage-2.0.51_pre20' && CONF_LIBDIR="lib"
31 # and of course, we need to default to lib when CONF_LIBDIR isnt set
32 echo ${CONF_LIBDIR:=lib}
33}
18 34
19# This function generate linker scripts in /usr/lib for dynamic 35# This function generate linker scripts in /usr/lib for dynamic
20# libs in /lib. This is to fix linking problems when you have 36# libs in /lib. This is to fix linking problems when you have
21# the .so in /lib, and the .a in /usr/lib. What happens is that 37# the .so in /lib, and the .a in /usr/lib. What happens is that
22# in some cases when linking dynamic, the .a in /usr/lib is used 38# in some cases when linking dynamic, the .a in /usr/lib is used
33# to point to the latest version of the library present. 49# to point to the latest version of the library present.
34# 50#
35# <azarah@gentoo.org> (26 Oct 2002) 51# <azarah@gentoo.org> (26 Oct 2002)
36# 52#
37gen_usr_ldscript() { 53gen_usr_ldscript() {
38 # this adds support for installing to lib64/lib32. since only portage
39 # 2.0.51 will have this functionality supported in dolib and friends,
40 # and since it isnt expected that many profiles will define it, we need
41 # to make this variable default to lib.
42 [ -z "${CONF_LIBDIR}" ] && CONF_LIBDIR="lib"
43
44 # Just make sure it exists 54 # Just make sure it exists
45 dodir /usr/${CONF_LIBDIR} 55 dodir /usr/$(get_libdir)
46 56
47 cat > ${D}/usr/${CONF_LIBDIR}/$1 <<"END_LDSCRIPT" 57 cat > ${D}/usr/$(get_libdir)/$1 <<"END_LDSCRIPT"
48/* GNU ld script 58/* GNU ld script
49 Because Gentoo have critical dynamic libraries 59 Because Gentoo have critical dynamic libraries
50 in /lib, and the static versions in /usr/lib, we 60 in /lib, and the static versions in /usr/lib, we
51 need to have a "fake" dynamic lib in /usr/lib, 61 need to have a "fake" dynamic lib in /usr/lib,
52 otherwise we run into linking problems. 62 otherwise we run into linking problems.
53 See bug #4411 on http://bugs.gentoo.org/ for 63 See bug #4411 on http://bugs.gentoo.org/ for
54 more info. */ 64 more info. */
55END_LDSCRIPT 65END_LDSCRIPT
56 66
57 echo "GROUP ( /${CONF_LIBDIR}/libxxx )" >> ${D}/usr/${CONF_LIBDIR}/$1 67 echo "GROUP ( /$(get_libdir)/libxxx )" >> ${D}/usr/$(get_libdir)/$1
58 dosed "s:libxxx:$1:" /usr/${CONF_LIBDIR}/$1 68 dosed "s:libxxx:$1:" /usr/$(get_libdir)/$1
59 69
60 return 0 70 return 0
61} 71}
62 72
63# Simple function to draw a line consisting of '=' the same length as $* 73# Simple function to draw a line consisting of '=' the same length as $*

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.96

  ViewVC Help
Powered by ViewVC 1.1.20