| 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.66 2004/07/28 02:18:38 lv Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.67 2004/08/07 04:24:41 agriffis 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" |
| … | |
… | |
| 174 | |
174 | |
| 175 | is-flag() { |
175 | is-flag() { |
| 176 | local x |
176 | local x |
| 177 | |
177 | |
| 178 | for x in ${CFLAGS} ${CXXFLAGS} ; do |
178 | for x in ${CFLAGS} ${CXXFLAGS} ; do |
|
|
179 | # Note this should work with globs like -mcpu=ultrasparc* |
| 179 | if [ "${x}" == "$1" ] ; then |
180 | if [[ ${x} == ${1} ]]; then |
| 180 | echo true |
181 | echo true |
| 181 | return 0 |
182 | return 0 |
| 182 | fi |
183 | fi |
| 183 | done |
184 | done |
| 184 | return 1 |
185 | return 1 |