| 1 | # Copyright 1999-2003 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2003 Gentoo Technologies, Inc. |
| 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.56 2004/06/10 00:24:57 lv Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.57 2004/06/10 00:41: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" |
| … | |
… | |
| 302 | } |
302 | } |
| 303 | |
303 | |
| 304 | has_m64() { |
304 | has_m64() { |
| 305 | temp=`mktemp` |
305 | temp=`mktemp` |
| 306 | echo "int main() { return(0); }" > ${temp}.c |
306 | echo "int main() { return(0); }" > ${temp}.c |
| 307 | gcc -m64 -o /dev/null ${temp}.c > /dev/null 2>&1 |
307 | ${CC/ .*/} -m64 -o /dev/null ${temp}.c > /dev/null 2>&1 |
| 308 | ret=$? |
308 | ret=$? |
| 309 | rm -f ${temp}.c |
309 | rm -f ${temp}.c |
| 310 | [ "$ret" != "1" ] && return 0 |
310 | [ "$ret" != "1" ] && return 0 |
| 311 | return 1 |
311 | return 1 |
| 312 | } |
312 | } |
| 313 | |
313 | |
| 314 | has_m32() { |
314 | has_m32() { |
| 315 | temp=`mktemp` |
315 | temp=`mktemp` |
| 316 | echo "int main() { return(0); }" > ${temp}.c |
316 | echo "int main() { return(0); }" > ${temp}.c |
| 317 | gcc -m32 -o /dev/null ${temp}.c > /dev/null 2>&1 |
317 | ${CC/ .*/} -m32 -o /dev/null ${temp}.c > /dev/null 2>&1 |
| 318 | ret=$? |
318 | ret=$? |
| 319 | rm -f ${temp}.c |
319 | rm -f ${temp}.c |
| 320 | [ "$ret" != "1" ] && return 0 |
320 | [ "$ret" != "1" ] && return 0 |
| 321 | return 1 |
321 | return 1 |
| 322 | } |
322 | } |