| 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/flag-o-matic.eclass,v 1.61 2004/07/12 02:31:55 agriffis Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.62 2004/07/15 04:59:44 lv Exp $ |
| 4 | # |
4 | # |
| 5 | # Author Bart Verwilst <verwilst@gentoo.org> |
5 | # Author Bart Verwilst <verwilst@gentoo.org> |
| 6 | |
6 | |
| 7 | ECLASS=flag-o-matic |
7 | ECLASS=flag-o-matic |
| 8 | INHERITED="$INHERITED $ECLASS" |
8 | INHERITED="$INHERITED $ECLASS" |
| … | |
… | |
| 312 | test_version_info ssp && return 0 |
312 | test_version_info ssp && return 0 |
| 313 | return 1 |
313 | return 1 |
| 314 | } |
314 | } |
| 315 | |
315 | |
| 316 | has_m64() { |
316 | has_m64() { |
| 317 | test_flag -m64 |
317 | # this doesnt test if the flag is accepted, it tests if the flag |
|
|
318 | # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! |
|
|
319 | # please dont replace this function with test_flag in some future |
|
|
320 | # clean-up! |
|
|
321 | temp=`mktemp` |
|
|
322 | echo "int main() { return(0); }" > ${temp}.c |
|
|
323 | ${CC/ .*/} -m64 -o /dev/null ${temp}.c > /dev/null 2>&1 |
|
|
324 | ret=$? |
|
|
325 | rm -f ${temp}.c |
|
|
326 | [ "$ret" != "1" ] && return 0 |
| 318 | return $? |
327 | return 1 |
| 319 | } |
328 | } |
| 320 | |
329 | |
| 321 | has_m32() { |
330 | has_m32() { |
| 322 | test_flag -m32 |
331 | # this doesnt test if the flag is accepted, it tests if the flag |
|
|
332 | # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! |
|
|
333 | # please dont replace this function with test_flag in some future |
|
|
334 | # clean-up! |
|
|
335 | temp=`mktemp` |
|
|
336 | echo "int main() { return(0); }" > ${temp}.c |
|
|
337 | ${CC/ .*/} -m32 -o /dev/null ${temp}.c > /dev/null 2>&1 |
|
|
338 | ret=$? |
|
|
339 | rm -f ${temp}.c |
|
|
340 | [ "$ret" != "1" ] && return 0 |
| 323 | return $? |
341 | return 1 |
| 324 | } |
342 | } |
| 325 | |
343 | |
| 326 | replace-sparc64-flags() { |
344 | replace-sparc64-flags() { |
| 327 | local SPARC64_CPUS="ultrasparc v9" |
345 | local SPARC64_CPUS="ultrasparc v9" |
| 328 | |
346 | |