From a8fc2ad4fb53452ad92d6c3d06be1f7653a88b61 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 13 Dec 2004 23:49:07 +0000 Subject: [PATCH] tc-is-cross-compiler() --- eclass/toolchain-funcs.eclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index f1a4eb2fcd53..5b54c6fabc57 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.11 2004/12/07 22:30:24 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.12 2004/12/13 23:49:07 vapier Exp $ # # Author: Toolchain Ninjas # @@ -87,6 +87,16 @@ tc-export() { done } +# A simple way to see if we're using a cross-compiler ... +tc-is-cross-compiler() { + local ret tmpfile=$(emktemp).c + echo 'int main(){return 0;}' > "${tmpfile}" + $(tc-getCC) "${tmpfile}" -o "${tmpfile}".bin + "${tmpfile}".bin &>/dev/null + ret=$? + rm -f "${tmpfile}" "${tmpfile}".bin +} + # Returns the version as by `$CC -dumpversion` gcc-fullversion() { -- 2.26.2