diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-12-14 14:28:57 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-12-14 14:28:57 +0000 |
commit | 7794729ee8eee5113b6bdd214945f4e639e37557 (patch) | |
tree | f74735f3f67b63150eb24182b1d7dfbf6537d8cd /eclass/toolchain-funcs.eclass | |
parent | Latest = stable, cleanup (diff) | |
download | historical-7794729ee8eee5113b6bdd214945f4e639e37557.tar.gz historical-7794729ee8eee5113b6bdd214945f4e639e37557.tar.bz2 historical-7794729ee8eee5113b6bdd214945f4e639e37557.zip |
use CBUILD / CHOST in the default case of tc-is-cross-compiler
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r-- | eclass/toolchain-funcs.eclass | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 40028551fb74..bc2b25afa474 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.14 2004/12/14 05:31:32 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.15 2004/12/14 14:28:57 vapier Exp $ # # Author: Toolchain Ninjas <ninjas@gentoo.org> # @@ -89,6 +89,12 @@ tc-export() { # A simple way to see if we're using a cross-compiler ... tc-is-cross-compiler() { + # Simple case ... the user tells us what's going on + if [[ -n ${CBUILD} ]] ; then + return $([[ ${CBUILD} != ${CHOST} ]]) + fi + + # Hard case ... compile a simple prog and run it ... local ret tmpfile=$(emktemp).c echo 'int main(){return 0;}' > "${tmpfile}" $(tc-getCC) "${tmpfile}" -o "${tmpfile}".bin |