From: Mike Frysinger Date: Mon, 10 Jan 2005 02:41:58 +0000 (+0000) Subject: add function to translate CHOST tuples into ARCH for portage/kernel X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fe822c1fae1b31850f4ab637eb9be43c23db2ae2;p=gentoo.git add function to translate CHOST tuples into ARCH for portage/kernel --- diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 4e54e074ce28..58d10261634c 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.18 2004/12/31 03:18:42 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.19 2005/01/10 02:41:58 vapier Exp $ # # Author: Toolchain Ninjas # @@ -88,6 +88,40 @@ tc-is-cross-compiler() { } +# Translate a CBUILD/CHOST/CTARGET into the kernel/portage +# equivalent of $ARCH +ninja_magic_to_arch() { +ninj() { [[ ${type} = "kern" ]] && echo $1 || echo $2 ; } + + local type=$1 + local host=$2 + + case ${host} in + alpha*) echo alpha;; + x86_64*) ninj x86_64 amd64;; + arm*) echo arm;; + hppa*) ninj parisc hppa;; + ia64*) echo ia64;; + mips*) echo mips;; + powerpc64*) echo ppc64;; + powerpc*) echo ppc;; + sparc64*) ninj sparc64 sparc;; + sparc*) echo sparc;; + s390*) echo s390;; + sh64*) ninj sh64 sh;; + sh*) echo sh;; + i?86*) echo x86;; + *) echo wtf;; + esac +} +host_to_arch_kernel() { + ninja_magic_to_arch kern $@ +} +host_to_arch_portage() { + ninja_magic_to_arch portage $@ +} + + # Returns the version as by `$CC -dumpversion` gcc-fullversion() { echo "$($(tc-getCC) -dumpversion)"