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

Diff of /eclass/multilib.eclass

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

Revision 1.49 Revision 1.64
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.49 2006/05/28 19:31:33 blubb Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.64 2008/05/02 04:07:38 vapier 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
191 local var="${flag}_${abi}" 192 local var="${flag}_${abi}"
192 echo ${!var} 193 echo ${!var}
193} 194}
194 195
195get_abi_CFLAGS() { get_abi_var CFLAGS "$@"; } 196get_abi_CFLAGS() { get_abi_var CFLAGS "$@"; }
197get_abi_ASFLAGS() { get_abi_var ASFLAGS "$@"; }
196get_abi_LDFLAGS() { get_abi_var LDFLAGS "$@"; } 198get_abi_LDFLAGS() { get_abi_var LDFLAGS "$@"; }
197get_abi_CHOST() { get_abi_var CHOST "$@"; } 199get_abi_CHOST() { get_abi_var CHOST "$@"; }
198get_abi_CTARGET() { get_abi_var CTARGET "$@"; } 200get_abi_CTARGET() { get_abi_var CTARGET "$@"; }
199get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; } 201get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; }
200get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; } 202get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; }
208 if [[ -z ${MULTILIB_ABIS} ]] ; then 210 if [[ -z ${MULTILIB_ABIS} ]] ; then
209 echo "default" 211 echo "default"
210 return 0 212 return 0
211 fi 213 fi
212 214
213 if hasq multilib-pkg-force ${RESTRICT} || 215 if [[ ${EMULTILIB_PKG} == "true" ]] ; then
214 { hasq multilib-pkg ${FEATURES} && hasq multilib-pkg ${RESTRICT}; }; then
215 for x in ${MULTILIB_ABIS} ; do 216 for x in ${MULTILIB_ABIS} ; do
216 if [[ ${x} != "${DEFAULT_ABI}" ]] ; then 217 if [[ ${x} != "${DEFAULT_ABI}" ]] ; then
217 hasq ${x} ${ABI_DENY} || ordera="${ordera} ${x}" 218 hasq ${x} ${ABI_DENY} || ordera="${ordera} ${x}"
218 fi 219 fi
219 done 220 done
267get_all_libdirs() { 268get_all_libdirs() {
268 local libdirs="lib" 269 local libdirs="lib"
269 local abi 270 local abi
270 local dir 271 local dir
271 272
272 # Remove when amd64's 2004.3 is purged.
273 if [[ -n "${CONF_LIBDIR}" ]]; then
274 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:-lib32}; do
275 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}"
276 done
277 else
278 for abi in ${MULTILIB_ABIS}; do 273 for abi in ${MULTILIB_ABIS}; do
279 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})" 274 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})"
280 done 275 done
281 fi
282 276
283 echo "${libdirs}" 277 echo "${libdirs}"
284} 278}
285 279
286# 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
539 533
540get_libname() { 534get_libname() {
541 local libname 535 local libname
542 local ver=$1 536 local ver=$1
543 case ${CHOST} in 537 case ${CHOST} in
538 mingw*|*-mingw*) libname="dll";;
544 *-darwin*) libname="dylib";; 539 *-darwin*) libname="dylib";;
545 *) libname="so";; 540 *) libname="so";;
546 esac 541 esac
547 542
548 if [[ -z $@ ]] ; then 543 if [[ -z $* ]] ; then
549 echo ".${libname}" 544 echo ".${libname}"
550 else 545 else
551 for ver in "$@" ; do 546 for ver in "$@" ; do
552 case ${CHOST} in 547 case ${CHOST} in
553 *-darwin*) echo ".${ver}.${libname}";; 548 *-darwin*) echo ".${ver}.${libname}";;
570 export CDEFINE_x86="__i386__" 565 export CDEFINE_x86="__i386__"
571 export LIBDIR_x86="lib" 566 export LIBDIR_x86="lib"
572 567
573 export CFLAGS_amd64=${CFLAGS_amd64--m64} 568 export CFLAGS_amd64=${CFLAGS_amd64--m64}
574 export CHOST_amd64=${CTARGET} 569 export CHOST_amd64=${CTARGET}
575 export CTARGET_amd64=${CTARGET_amd64} 570 export CTARGET_amd64=${CHOST_amd64}
576 export CDEFINE_amd64="__x86_64__" 571 export CDEFINE_amd64="__x86_64__"
577 export LIBDIR_amd64="lib64" 572 export LIBDIR_amd64="lib64"
578 573
579 export MULTILIB_ABIS="amd64 x86" 574 export MULTILIB_ABIS="amd64 x86"
580 export DEFAULT_ABI="amd64" 575 export DEFAULT_ABI="amd64"
653 export MULTILIB_ABIS="default" 648 export MULTILIB_ABIS="default"
654 export DEFAULT_ABI="default" 649 export DEFAULT_ABI="default"
655 ;; 650 ;;
656 esac 651 esac
657} 652}
653
654# Hide multilib details here for packages which are forced to be compiled for a
655# specific ABI when run on another ABI (like x86-specific packages on amd64)
656multilib_toolchain_setup() {
657 export ABI=$1
658
659 if has_version app-admin/eselect-compiler ; then
660 # Binutils doesn't have wrappers for ld and as (yet). Eventually it
661 # will, and all this can just be handled with CHOST.
662 export LD="ld $(get_abi_LDFLAGS $1)"
663 export AS="as $(get_abi_ASFLAGS $1)"
664
665 export CHOST=$(get_abi_CHOST $1)
666 export CBUILD=$(get_abi_CHOST $1)
667 else
668 tc-export CC
669 fi
670}

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.20