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

Diff of /eclass/multilib.eclass

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

Revision 1.54 Revision 1.63
1# Copyright 1999-2004 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/multilib.eclass,v 1.54 2006/07/12 07:40:49 kevquinn Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.63 2007/07/01 23:14:58 peper Exp $
4# 4#
5# Author: Jeremy Huddleston <eradicator@gentoo.org> 5# Maintainer: amd64@gentoo.org / toolchain@gentoo.org
6# 6#
7# This eclass is for all functions pertaining to handling multilib. 7# This eclass is for all functions pertaining to handling multilib.
8# configurations. 8# configurations.
9 9
10DESCRIPTION="Based on the ${ECLASS} eclass" 10___ECLASS_RECUR_MULTILIB="yes"
11[[ -z ${___ECLASS_RECUR_TOOLCHAIN_FUNCS} ]] && inherit toolchain-funcs
11 12
12# has_multilib_profile: 13# has_multilib_profile:
13# Return true if the current profile is a multilib profile and lists more than 14# Return true if the current profile is a multilib profile and lists more than
14# one abi in ${MULTILIB_ABIS}. You might want to use this like 15# one abi in ${MULTILIB_ABIS}. When has_multilib_profile returns true, that
15# 'use multilib || has_multilib_profile' until all profiles utilizing the 16# profile should enable the 'multilib' use flag. This is so you can DEPEND on
16# 'multilib' use flag are removed from portage 17# a package only for multilib or not multilib.
17 18
18# is_final_abi: 19# is_final_abi:
19# Return true if ${ABI} is the final abi to be installed (and thus we are 20# Return true if ${ABI} is the final abi to be installed (and thus we are
20# on our last run through a src_* function. 21# on our last run through a src_* function.
21 22
209 if [[ -z ${MULTILIB_ABIS} ]] ; then 210 if [[ -z ${MULTILIB_ABIS} ]] ; then
210 echo "default" 211 echo "default"
211 return 0 212 return 0
212 fi 213 fi
213 214
214 if hasq multilib-pkg-force ${RESTRICT} || 215 if [[ ${EMULTILIB_PKG} == "true" ]] ; then
215 { hasq multilib-pkg ${FEATURES} && hasq multilib-pkg ${RESTRICT}; }; then
216 for x in ${MULTILIB_ABIS} ; do 216 for x in ${MULTILIB_ABIS} ; do
217 if [[ ${x} != "${DEFAULT_ABI}" ]] ; then 217 if [[ ${x} != "${DEFAULT_ABI}" ]] ; then
218 hasq ${x} ${ABI_DENY} || ordera="${ordera} ${x}" 218 hasq ${x} ${ABI_DENY} || ordera="${ordera} ${x}"
219 fi 219 fi
220 done 220 done
268get_all_libdirs() { 268get_all_libdirs() {
269 local libdirs="lib" 269 local libdirs="lib"
270 local abi 270 local abi
271 local dir 271 local dir
272 272
273 # Remove when amd64's 2004.3 is purged.
274 if [[ -n "${CONF_LIBDIR}" ]]; then
275 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:-lib32}; do
276 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}"
277 done
278 else
279 for abi in ${MULTILIB_ABIS}; do 273 for abi in ${MULTILIB_ABIS}; do
280 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})" 274 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})"
281 done 275 done
282 fi
283 276
284 echo "${libdirs}" 277 echo "${libdirs}"
285} 278}
286 279
287# Return true if ${ABI} is the last ABI on our list (or if we're not 280# Return true if ${ABI} is the last ABI on our list (or if we're not
571 export CDEFINE_x86="__i386__" 564 export CDEFINE_x86="__i386__"
572 export LIBDIR_x86="lib" 565 export LIBDIR_x86="lib"
573 566
574 export CFLAGS_amd64=${CFLAGS_amd64--m64} 567 export CFLAGS_amd64=${CFLAGS_amd64--m64}
575 export CHOST_amd64=${CTARGET} 568 export CHOST_amd64=${CTARGET}
576 export CTARGET_amd64=${CTARGET_amd64} 569 export CTARGET_amd64=${CHOST_amd64}
577 export CDEFINE_amd64="__x86_64__" 570 export CDEFINE_amd64="__x86_64__"
578 export LIBDIR_amd64="lib64" 571 export LIBDIR_amd64="lib64"
579 572
580 export MULTILIB_ABIS="amd64 x86" 573 export MULTILIB_ABIS="amd64 x86"
581 export DEFAULT_ABI="amd64" 574 export DEFAULT_ABI="amd64"
658} 651}
659 652
660# Hide multilib details here for packages which are forced to be compiled for a 653# Hide multilib details here for packages which are forced to be compiled for a
661# specific ABI when run on another ABI (like x86-specific packages on amd64) 654# specific ABI when run on another ABI (like x86-specific packages on amd64)
662multilib_toolchain_setup() { 655multilib_toolchain_setup() {
656 export ABI=$1
657
663 if has_version app-admin/eselect-compiler ; then 658 if has_version app-admin/eselect-compiler ; then
664 # Binutils doesn't have wrappers for ld and as (yet). Eventually it 659 # Binutils doesn't have wrappers for ld and as (yet). Eventually it
665 # will, and all this can just be handled with CHOST. 660 # will, and all this can just be handled with CHOST.
666 export LD="ld $(get_abi_LDFLAGS $1)" 661 export LD="ld $(get_abi_LDFLAGS $1)"
667 export AS="as $(get_abi_ASFLAGS $1)" 662 export AS="as $(get_abi_ASFLAGS $1)"
668 663
669 export CHOST=$(get_abi_CHOST $1) 664 export CHOST=$(get_abi_CHOST $1)
670 export CBUILD=$(get_abi_CHOST $1) 665 export CBUILD=$(get_abi_CHOST $1)
671 else 666 else
672 tc-export CC 667 tc-export CC
673 export ABI=$1
674 fi 668 fi
675} 669}

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.20