From: Mike Frysinger Date: Fri, 15 Oct 2004 20:10:45 +0000 (+0000) Subject: tc-getBUILD_CC() X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ad97b7371a72da7d758a826ae4f539f3231b642;p=gentoo.git tc-getBUILD_CC() --- diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 4891230e2648..cbb136374678 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.3 2004/10/13 23:44:35 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.4 2004/10/15 20:10:45 vapier Exp $ # # Author: Toolchain Ninjas # @@ -55,6 +55,22 @@ tc-getNM() { tc-getPROG NM nm; } # Returns the name of the archiver indexer tc-getRANLIB() { tc-getPROG RANLIB ranlib; } +# Returns the name of the C compiler for build +tc-getBUILD_CC() { + if [ -n "${CC_FOR_BUILD}" ] ; then + echo "${CC_FOR_BUILD}" + return 0 + fi + + if [ -n "${CBUILD}" ] ; then + local cc="$(type -p "${CBUILD}-gcc")" + if [ -n "${cc}" ] ; then + echo "${cc}" + fi + fi + + echo "gcc" +} # Returns the version as by `$CC -dumpversion`