summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-01-11 01:07:49 +0000
committerMike Frysinger <vapier@gentoo.org>2005-01-11 01:07:49 +0000
commitffd29623698af0f814361aa99f2f7a969d83092d (patch)
tree475154c9850b9029a5d013ea9e53731373bd3ff3 /eclass/toolchain-funcs.eclass
parent2.6.9-r14 stable, 2.6.10-r4 testing (Manifest recommit) (diff)
downloadgentoo-2-ffd29623698af0f814361aa99f2f7a969d83092d.tar.gz
gentoo-2-ffd29623698af0f814361aa99f2f7a969d83092d.tar.bz2
gentoo-2-ffd29623698af0f814361aa99f2f7a969d83092d.zip
change the names of the arch functions to be like all the other tc-funcs. also add a func to figure out endian.
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r--eclass/toolchain-funcs.eclass39
1 files changed, 31 insertions, 8 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 58d10261634c..106cd40ba74e 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.19 2005/01/10 02:41:58 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.20 2005/01/11 01:07:49 vapier Exp $
#
# Author: Toolchain Ninjas <ninjas@gentoo.org>
#
@@ -88,13 +88,14 @@ tc-is-cross-compiler() {
}
-# Translate a CBUILD/CHOST/CTARGET into the kernel/portage
-# equivalent of $ARCH
-ninja_magic_to_arch() {
+# Parse information from CBUILD/CHOST/CTARGET rather than
+# use external variables from the profile.
+tc-ninja_magic_to_arch() {
ninj() { [[ ${type} = "kern" ]] && echo $1 || echo $2 ; }
local type=$1
local host=$2
+ [[ -z ${host} ]] && arg=${CHOST}
case ${host} in
alpha*) echo alpha;;
@@ -114,13 +115,35 @@ ninj() { [[ ${type} = "kern" ]] && echo $1 || echo $2 ; }
*) echo wtf;;
esac
}
-host_to_arch_kernel() {
- ninja_magic_to_arch kern $@
+tc-arch-kernel() {
+ tc-ninja_magic_to_arch kern $@
}
-host_to_arch_portage() {
- ninja_magic_to_arch portage $@
+tc-arch() {
+ tc-ninja_magic_to_arch portage $@
}
+tc-endian() {
+ local host=$1
+ [[ -z ${host} ]] && host=${CHOST}
+ case ${host} in
+ alpha*) echo big;;
+ x86_64*) echo little;;
+ arm*eb-*) echo big;;
+ arm*) echo little;;
+ hppa*) echo big;;
+ ia64*) echo little;;
+ m68k*) echo big;;
+ mips*el-*) echo little;;
+ mips*) echo big;;
+ powerpc*) echo big;;
+ sparc*) echo big;;
+ s390*) echo big;;
+ sh*el-) echo little;;
+ sh*) echo big;;
+ i?86*) echo little;;
+ *) echo wtf;;
+ esac
+}
# Returns the version as by `$CC -dumpversion`
gcc-fullversion() {