| 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.79 2004/12/25 18:45:56 chriswhite Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.80 2005/01/20 18:29:13 eradicator 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" |
| 9 | |
9 | |
| 10 | IUSE="debug" |
10 | IUSE="debug" |
| 11 | |
11 | |
| 12 | # need access to emktemp() |
12 | # need access to emktemp() |
| 13 | inherit eutils toolchain-funcs |
13 | inherit eutils toolchain-funcs multilib |
| 14 | |
14 | |
| 15 | # |
15 | # |
| 16 | #### filter-flags <flags> #### |
16 | #### filter-flags <flags> #### |
| 17 | # Remove particular flags from C[XX]FLAGS |
17 | # Remove particular flags from C[XX]FLAGS |
| 18 | # Matches only complete flags |
18 | # Matches only complete flags |
| … | |
… | |
| 363 | has_m32() { |
363 | has_m32() { |
| 364 | # this doesnt test if the flag is accepted, it tests if the flag |
364 | # this doesnt test if the flag is accepted, it tests if the flag |
| 365 | # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! |
365 | # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! |
| 366 | # please dont replace this function with test_flag in some future |
366 | # please dont replace this function with test_flag in some future |
| 367 | # clean-up! |
367 | # clean-up! |
|
|
368 | |
|
|
369 | [ "$(tc-arch)" = "amd64" ] && has_multilib_profile && return 0 |
|
|
370 | |
| 368 | local temp="$(emktemp)" |
371 | local temp="$(emktemp)" |
| 369 | echo "int main() { return(0); }" > ${temp}.c |
372 | echo "int main() { return(0); }" > ${temp}.c |
| 370 | MY_CC=$(tc-getCC) |
373 | MY_CC=$(tc-getCC) |
| 371 | ${MY_CC/ .*/} -m32 -o "$(emktemp)" ${temp}.c > /dev/null 2>&1 |
374 | ${MY_CC/ .*/} -m32 -o "$(emktemp)" ${temp}.c > /dev/null 2>&1 |
| 372 | local ret=$? |
375 | local ret=$? |