From: Mike Frysinger Date: Thu, 15 Sep 2005 00:13:10 +0000 (+0000) Subject: handle CBUILD better since it is forced in portage now and check for CC_FOR_BUILD... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=12a591c9881a9dddb54f4742626d1c23642aedd3;p=gentoo.git handle CBUILD better since it is forced in portage now and check for CC_FOR_BUILD BUILD_CC HOSTCC as the build cc --- diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index d914f2e801de..3852416fdcce 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.42 2005/08/02 13:26:59 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.43 2005/09/15 00:13:10 vapier Exp $ # # Author: Toolchain Ninjas # @@ -9,7 +9,6 @@ inherit multilib - DESCRIPTION="Based on the ${ECLASS} eclass" tc-getPROG() { @@ -52,11 +51,14 @@ tc-getGCJ() { tc-getPROG GCJ gcj "$@"; } # Returns the name of the C compiler for build tc-getBUILD_CC() { - if [[ -n ${CC_FOR_BUILD} ]] ; then - export BUILD_CC=${CC_FOR_BUILD} - echo "${CC_FOR_BUILD}" - return 0 - fi + local v + for v in CC_FOR_BUILD BUILD_CC HOSTCC ; do + if [[ -n ${!v} ]] ; then + export BUILD_CC=${!v} + echo "${!v}" + return 0 + fi + done local search= if [[ -n ${CBUILD} ]] ; then @@ -80,10 +82,7 @@ tc-export() { # A simple way to see if we're using a cross-compiler ... tc-is-cross-compiler() { - if [[ -n ${CBUILD} ]] ; then - return $([[ ${CBUILD} != ${CHOST} ]]) - fi - return 1 + return $([[ ${CBUILD:-${CHOST}} != ${CHOST} ]]) } @@ -212,4 +211,3 @@ gcc-specs-ssp() { directive=$(gcc-specs-directive cc1) return $([[ ${directive/\{!fno-stack-protector:} != ${directive} ]]) } -