| 1 | # Copyright 1999-2008 Gentoo Foundation |
1 | # Copyright 1999-2008 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.71 2009/02/09 19:53:14 maekke Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.72 2009/02/20 23:20:22 vapier Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: multilib.eclass |
5 | # @ECLASS: multilib.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # amd64@gentoo.org |
7 | # amd64@gentoo.org |
| 8 | # toolchain@gentoo.org |
8 | # toolchain@gentoo.org |
| … | |
… | |
| 647 | # @FUNCTION: multilib_toolchain_setup |
647 | # @FUNCTION: multilib_toolchain_setup |
| 648 | # @DESCRIPTION: |
648 | # @DESCRIPTION: |
| 649 | # Hide multilib details here for packages which are forced to be compiled for a |
649 | # Hide multilib details here for packages which are forced to be compiled for a |
| 650 | # specific ABI when run on another ABI (like x86-specific packages on amd64) |
650 | # specific ABI when run on another ABI (like x86-specific packages on amd64) |
| 651 | multilib_toolchain_setup() { |
651 | multilib_toolchain_setup() { |
|
|
652 | local v vv |
|
|
653 | |
| 652 | export ABI=$1 |
654 | export ABI=$1 |
| 653 | |
655 | |
| 654 | # disable ccache for non-native builds #196243. this is because how |
656 | # We want to avoid the behind-the-back magic of gcc-config as it |
| 655 | # we cram ABI related CFLAGS behind the back of the gcc frontend with |
657 | # screws up ccache and distcc. See #196243 for more info. |
| 656 | # the gcc-config wrapper. |
|
|
| 657 | if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then |
658 | if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then |
| 658 | : ${CCACHE_DISABLE:=multilib-disable} |
659 | if [[ ${DEFAULT_ABI_SAVED} != "true" ]] ; then |
| 659 | else |
660 | for v in CHOST CBUILD AS CC CXX LD ; do |
| 660 | if [[ ${CCACHE_DISABLE} == "multilib-disable" ]] ; then |
661 | export __abi_saved_${v}="${!v}" |
| 661 | unset CCACHE_DISABLE |
662 | done |
|
|
663 | export DEFAULT_ABI_SAVED="true" |
| 662 | fi |
664 | fi |
| 663 | fi |
|
|
| 664 | export CCACHE_DISABLE |
|
|
| 665 | |
665 | |
| 666 | if has_version app-admin/eselect-compiler ; then |
666 | # Set the CHOST native first so that we pick up the native |
| 667 | # Binutils doesn't have wrappers for ld and as (yet). Eventually it |
667 | # toolchain and not a cross-compiler by accident #202811. |
| 668 | # will, and all this can just be handled with CHOST. |
668 | export CHOST=$(get_abi_CHOST ${DEFAULT_ABI}) |
| 669 | export LD="ld $(get_abi_LDFLAGS $1)" |
|
|
| 670 | export AS="as $(get_abi_ASFLAGS $1)" |
669 | export AS="$(tc-getAS) $(get_abi_ASFLAGS)" |
| 671 | |
670 | export CC="$(tc-getCC) $(get_abi_CFLAGS)" |
|
|
671 | export CXX="$(tc-getCXX) $(get_abi_CFLAGS)" |
|
|
672 | export LD="$(tc-getLD) $(get_abi_LDFLAGS)" |
| 672 | export CHOST=$(get_abi_CHOST $1) |
673 | export CHOST=$(get_abi_CHOST $1) |
| 673 | export CBUILD=$(get_abi_CHOST $1) |
674 | export CBUILD=$(get_abi_CHOST $1) |
| 674 | else |
675 | |
| 675 | tc-export CC |
676 | elif [[ ${DEFAULT_ABI_SAVED} == "true" ]] ; then |
|
|
677 | for v in CHOST CBUILD AS CC CXX LD ; do |
|
|
678 | vv="__abi_saved_${v}" |
|
|
679 | export ${v}=${!vv} |
|
|
680 | done |
| 676 | fi |
681 | fi |
| 677 | } |
682 | } |