| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 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.74 2007/08/17 10:14:13 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.77 2008/06/01 08:56:56 aballier Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: toolchain-funcs.eclass |
5 | # @ECLASS: toolchain-funcs.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Toolchain Ninjas <toolchain@gentoo.org> |
7 | # Toolchain Ninjas <toolchain@gentoo.org> |
| 8 | # @BLURB: functions to query common info about the toolchain |
8 | # @BLURB: functions to query common info about the toolchain |
| … | |
… | |
| 168 | arm*) echo arm;; |
168 | arm*) echo arm;; |
| 169 | avr*) ninj avr32 avr;; |
169 | avr*) ninj avr32 avr;; |
| 170 | bfin*) ninj blackfin bfin;; |
170 | bfin*) ninj blackfin bfin;; |
| 171 | cris*) echo cris;; |
171 | cris*) echo cris;; |
| 172 | hppa*) ninj parisc hppa;; |
172 | hppa*) ninj parisc hppa;; |
| 173 | i?86*) ninj i386 x86;; |
173 | i?86*) |
|
|
174 | # Starting with linux-2.6.24, the 'x86_64' and 'i386' |
|
|
175 | # trees have been unified into 'x86'. |
|
|
176 | # FreeBSD still uses i386 |
|
|
177 | if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -lt $(KV_to_int 2.6.24) || ${host} == *freebsd* ]] ; then |
|
|
178 | echo i386 |
|
|
179 | else |
|
|
180 | echo x86 |
|
|
181 | fi |
|
|
182 | ;; |
| 174 | ia64*) echo ia64;; |
183 | ia64*) echo ia64;; |
| 175 | m68*) echo m68k;; |
184 | m68*) echo m68k;; |
| 176 | mips*) echo mips;; |
185 | mips*) echo mips;; |
| 177 | nios2*) echo nios2;; |
186 | nios2*) echo nios2;; |
| 178 | nios*) echo nios;; |
187 | nios*) echo nios;; |
| … | |
… | |
| 203 | sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \ |
212 | sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \ |
| 204 | && ninj sparc64 sparc \ |
213 | && ninj sparc64 sparc \ |
| 205 | || echo sparc |
214 | || echo sparc |
| 206 | ;; |
215 | ;; |
| 207 | vax*) echo vax;; |
216 | vax*) echo vax;; |
| 208 | x86_64*) ninj x86_64 amd64;; |
217 | x86_64*) |
|
|
218 | # Starting with linux-2.6.24, the 'x86_64' and 'i386' |
|
|
219 | # trees have been unified into 'x86'. |
|
|
220 | if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.24) ]] ; then |
|
|
221 | echo x86 |
|
|
222 | else |
|
|
223 | ninj x86_64 amd64 |
|
|
224 | fi |
|
|
225 | ;; |
| 209 | |
226 | |
| 210 | # since our usage of tc-arch is largely concerned with |
227 | # since our usage of tc-arch is largely concerned with |
| 211 | # normalizing inputs for testing ${CTARGET}, let's filter |
228 | # normalizing inputs for testing ${CTARGET}, let's filter |
| 212 | # other cross targets (mingw and such) into the unknown. |
229 | # other cross targets (mingw and such) into the unknown. |
| 213 | *) echo unknown;; |
230 | *) echo unknown;; |
| … | |
… | |
| 279 | } |
296 | } |
| 280 | |
297 | |
| 281 | # Returns the installation directory - internal toolchain |
298 | # Returns the installation directory - internal toolchain |
| 282 | # function for use by _gcc-specs-exists (for flag-o-matic). |
299 | # function for use by _gcc-specs-exists (for flag-o-matic). |
| 283 | _gcc-install-dir() { |
300 | _gcc-install-dir() { |
| 284 | echo "$($(tc-getCC) -print-search-dirs 2> /dev/null |\ |
301 | echo "$(LC_ALL=C $(tc-getCC) -print-search-dirs 2> /dev/null |\ |
| 285 | awk '$1=="install:" {print $2}')" |
302 | awk '$1=="install:" {print $2}')" |
| 286 | } |
303 | } |
| 287 | # Returns true if the indicated specs file exists - internal toolchain |
304 | # Returns true if the indicated specs file exists - internal toolchain |
| 288 | # function for use by flag-o-matic. |
305 | # function for use by flag-o-matic. |
| 289 | _gcc-specs-exists() { |
306 | _gcc-specs-exists() { |