| 1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 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.185 2012/12/03 21:20:54 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.186 2012/12/20 21:01:50 jlec Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: flag-o-matic.eclass |
5 | # @ECLASS: flag-o-matic.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # toolchain@gentoo.org |
7 | # toolchain@gentoo.org |
| 8 | # @BLURB: common functions to manipulate and query toolchain flags |
8 | # @BLURB: common functions to manipulate and query toolchain flags |
| … | |
… | |
| 390 | |
390 | |
| 391 | [[ -z ${comp} || -z ${flag} ]] && return 1 |
391 | [[ -z ${comp} || -z ${flag} ]] && return 1 |
| 392 | |
392 | |
| 393 | # use -c so we can test the assembler as well |
393 | # use -c so we can test the assembler as well |
| 394 | local PROG=$(tc-get${comp}) |
394 | local PROG=$(tc-get${comp}) |
|
|
395 | if $( ${PROG} "${flag}" -c -o /dev/null -x${lang} - < /dev/null > /dev/null 2>&1 ); then |
| 395 | ${PROG} "${flag}" -c -o /dev/null -x${lang} - < /dev/null \ |
396 | ${PROG} "${flag}" -c -o /dev/null -x${lang} - < /dev/null \ |
| 396 | > /dev/null 2>&1 |
397 | > /dev/null 2>&1 |
|
|
398 | else |
|
|
399 | ${PROG} "${flag}" -c -o /dev/null /dev/null \ |
|
|
400 | > /dev/null 2>&1 |
|
|
401 | fi |
| 397 | } |
402 | } |
| 398 | |
403 | |
| 399 | # @FUNCTION: test-flag-CC |
404 | # @FUNCTION: test-flag-CC |
| 400 | # @USAGE: <flag> |
405 | # @USAGE: <flag> |
| 401 | # @DESCRIPTION: |
406 | # @DESCRIPTION: |