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

Diff of /eclass/multilib.eclass

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

Revision 1.1.1.1 Revision 1.59
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.1.1.1 2005/11/30 09:59:17 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.59 2007/03/27 01:34:31 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" 10DESCRIPTION="Based on the ${ECLASS} eclass"
11
12#inherit toolchain-funcs # cant do this because it includes us
11 13
12# has_multilib_profile: 14# has_multilib_profile:
13# Return true if the current profile is a multilib profile and lists more than 15# 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 16# one abi in ${MULTILIB_ABIS}. You might want to use this like
15# 'use multilib || has_multilib_profile' until all profiles utilizing the 17# 'use multilib || has_multilib_profile' until all profiles utilizing the
100export LDFLAGS_default 102export LDFLAGS_default
101export CHOST_default=${CHOST_default:-${CHOST}} 103export CHOST_default=${CHOST_default:-${CHOST}}
102export CTARGET_default=${CTARGET_default:-${CTARGET:-${CHOST_default}}} 104export CTARGET_default=${CTARGET_default:-${CTARGET:-${CHOST_default}}}
103export LIBDIR_default=${CONF_LIBDIR:-"lib"} 105export LIBDIR_default=${CONF_LIBDIR:-"lib"}
104export CDEFINE_default="__unix__" 106export CDEFINE_default="__unix__"
107export KERNEL_ABI=${KERNEL_ABI:-${DEFAULT_ABI}}
105 108
106# has_multilib_profile() 109# has_multilib_profile()
107has_multilib_profile() { 110has_multilib_profile() {
108 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ] 111 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ]
109} 112}
190 local var="${flag}_${abi}" 193 local var="${flag}_${abi}"
191 echo ${!var} 194 echo ${!var}
192} 195}
193 196
194get_abi_CFLAGS() { get_abi_var CFLAGS "$@"; } 197get_abi_CFLAGS() { get_abi_var CFLAGS "$@"; }
198get_abi_ASFLAGS() { get_abi_var ASFLAGS "$@"; }
195get_abi_LDFLAGS() { get_abi_var LDFLAGS "$@"; } 199get_abi_LDFLAGS() { get_abi_var LDFLAGS "$@"; }
196get_abi_CHOST() { get_abi_var CHOST "$@"; } 200get_abi_CHOST() { get_abi_var CHOST "$@"; }
197get_abi_CTARGET() { get_abi_var CTARGET "$@"; } 201get_abi_CTARGET() { get_abi_var CTARGET "$@"; }
198get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; } 202get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; }
199get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; } 203get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; }
266get_all_libdirs() { 270get_all_libdirs() {
267 local libdirs="lib" 271 local libdirs="lib"
268 local abi 272 local abi
269 local dir 273 local dir
270 274
271 if has_multilib_profile; then
272 for abi in ${MULTILIB_ABIS}; do 275 for abi in ${MULTILIB_ABIS}; do
273 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})" 276 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})"
274 done 277 done
275 elif [ -n "${CONF_LIBDIR}" ]; then
276 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:-lib32}; do
277 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}"
278 done
279 fi
280 278
281 echo "${libdirs}" 279 echo "${libdirs}"
282} 280}
283 281
284# Return true if ${ABI} is the last ABI on our list (or if we're not 282# Return true if ${ABI} is the last ABI on our list (or if we're not
388# Ideas for this code came from debian's sparc-linux headers package. 386# Ideas for this code came from debian's sparc-linux headers package.
389# 387#
390# Example: 388# Example:
391# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64 389# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64
392# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64 390# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64
391#
392# Warning: Be careful with the ordering here. The default ABI has to be the
393# last, because it is always defined (by GCC)
393create_ml_includes() { 394create_ml_includes() {
394 local dest=$1 395 local dest=$1
395 shift 396 shift
396 local basedirs=$(create_ml_includes-listdirs "$@") 397 local basedirs=$(create_ml_includes-listdirs "$@")
397 398
565 export CDEFINE_x86="__i386__" 566 export CDEFINE_x86="__i386__"
566 export LIBDIR_x86="lib" 567 export LIBDIR_x86="lib"
567 568
568 export CFLAGS_amd64=${CFLAGS_amd64--m64} 569 export CFLAGS_amd64=${CFLAGS_amd64--m64}
569 export CHOST_amd64=${CTARGET} 570 export CHOST_amd64=${CTARGET}
570 export CTARGET_amd64=${CTARGET_amd64} 571 export CTARGET_amd64=${CHOST_amd64}
571 export CDEFINE_amd64="__x86_64__" 572 export CDEFINE_amd64="__x86_64__"
572 export LIBDIR_amd64="lib64" 573 export LIBDIR_amd64="lib64"
573 574
574 export MULTILIB_ABIS="amd64 x86" 575 export MULTILIB_ABIS="amd64 x86"
575 export DEFAULT_ABI="amd64" 576 export DEFAULT_ABI="amd64"
648 export MULTILIB_ABIS="default" 649 export MULTILIB_ABIS="default"
649 export DEFAULT_ABI="default" 650 export DEFAULT_ABI="default"
650 ;; 651 ;;
651 esac 652 esac
652} 653}
654
655# Hide multilib details here for packages which are forced to be compiled for a
656# specific ABI when run on another ABI (like x86-specific packages on amd64)
657multilib_toolchain_setup() {
658 export ABI=$1
659
660 if has_version app-admin/eselect-compiler ; then
661 # Binutils doesn't have wrappers for ld and as (yet). Eventually it
662 # will, and all this can just be handled with CHOST.
663 export LD="ld $(get_abi_LDFLAGS $1)"
664 export AS="as $(get_abi_ASFLAGS $1)"
665
666 export CHOST=$(get_abi_CHOST $1)
667 export CBUILD=$(get_abi_CHOST $1)
668 else
669 tc-export CC
670 fi
671}

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.59

  ViewVC Help
Powered by ViewVC 1.1.20