| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.5 2004/10/19 13:23:46 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.6 2004/10/26 13:01:58 vapier Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Toolchain Ninjas <ninjas@gentoo.org> |
5 | # Author: Toolchain Ninjas <ninjas@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass contains (or should) functions to get common info |
7 | # This eclass contains (or should) functions to get common info |
| 8 | # about the toolchain (libc/compiler/binutils/etc...) |
8 | # about the toolchain (libc/compiler/binutils/etc...) |
| … | |
… | |
| 23 | echo "${!var}" |
23 | echo "${!var}" |
| 24 | return 0 |
24 | return 0 |
| 25 | fi |
25 | fi |
| 26 | |
26 | |
| 27 | # how should we handle the host/target/build ? |
27 | # how should we handle the host/target/build ? |
| 28 | if [ -n "${CHOST}" ] ; then |
28 | if [ -n "${CTARGET}" ] ; then |
| 29 | search="$(type -p "${CHOST}-${prog}")" |
29 | search="$(type -p "${CTARGET}-${prog}")" |
| 30 | else |
30 | else |
| 31 | if [ -n "${CTARGET}" ] ; then |
31 | if [ -n "${CHOST}" ] ; then |
| 32 | search="$(type -p "${CTARGET}-${prog}")" |
32 | search="$(type -p "${CHOST}-${prog}")" |
| 33 | fi |
33 | fi |
| 34 | fi |
34 | fi |
| 35 | |
35 | |
| 36 | if [ -n "${search}" ] ; then |
36 | if [ -n "${search}" ] ; then |
| 37 | prog="${search##*/}" |
37 | prog="${search##*/}" |