1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 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.110 2012/05/10 03:31:22 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.111 2012/06/09 06:56:14 vapier 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 |
… | |
… | |
177 | # @FUNCTION: tc-is-softfloat |
177 | # @FUNCTION: tc-is-softfloat |
178 | # @DESCRIPTION: |
178 | # @DESCRIPTION: |
179 | # See if this toolchain is a softfloat based one. |
179 | # See if this toolchain is a softfloat based one. |
180 | # @CODE |
180 | # @CODE |
181 | # The possible return values: |
181 | # The possible return values: |
182 | # - only: the target is always softfloat (never had fpu) |
182 | # - only: the target is always softfloat (never had fpu) |
183 | # - yes: the target should support softfloat |
183 | # - yes: the target should support softfloat |
|
|
184 | # - softfp: (arm specific) the target should use hardfloat insns, but softfloat calling convention |
184 | # - no: the target doesn't support softfloat |
185 | # - no: the target doesn't support softfloat |
185 | # @CODE |
186 | # @CODE |
186 | # This allows us to react differently where packages accept |
187 | # This allows us to react differently where packages accept |
187 | # softfloat flags in the case where support is optional, but |
188 | # softfloat flags in the case where support is optional, but |
188 | # rejects softfloat flags where the target always lacks an fpu. |
189 | # rejects softfloat flags where the target always lacks an fpu. |
189 | tc-is-softfloat() { |
190 | tc-is-softfloat() { |
190 | local CTARGET=${CTARGET:-${CHOST}} |
191 | local CTARGET=${CTARGET:-${CHOST}} |
191 | case ${CTARGET} in |
192 | case ${CTARGET} in |
192 | bfin*|h8300*) |
193 | bfin*|h8300*) |
193 | echo "only" ;; |
194 | echo "only" ;; |
194 | *) |
195 | *) |
195 | [[ ${CTARGET//_/-} == *-softfloat-* ]] \ |
196 | if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then |
196 | && echo "yes" \ |
197 | echo "yes" |
|
|
198 | elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then |
|
|
199 | echo "softfp" |
|
|
200 | else |
197 | || echo "no" |
201 | echo "no" |
|
|
202 | fi |
198 | ;; |
203 | ;; |
199 | esac |
204 | esac |
200 | } |
|
|
201 | |
|
|
202 | # @FUNCTION: tc-is-hardfloat |
|
|
203 | # @DESCRIPTION: |
|
|
204 | # See if this toolchain is a hardfloat based one. |
|
|
205 | # @CODE |
|
|
206 | # The possible return values: |
|
|
207 | # - yes: the target should support hardfloat |
|
|
208 | # - no: the target doesn't support hardfloat |
|
|
209 | tc-is-hardfloat() { |
|
|
210 | [[ ${CTARGET//_/-} == *-hardfloat-* ]] \ |
|
|
211 | && echo "yes" \ |
|
|
212 | || echo "no" |
|
|
213 | } |
205 | } |
214 | |
206 | |
215 | # @FUNCTION: tc-is-static-only |
207 | # @FUNCTION: tc-is-static-only |
216 | # @DESCRIPTION: |
208 | # @DESCRIPTION: |
217 | # Return shell true if the target does not support shared libs, shell false |
209 | # Return shell true if the target does not support shared libs, shell false |