| 1 | # Copyright 1999-2002 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2002 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 | # Author Bart Verwilst <verwilst@gentoo.org> |
3 | # Author Bart Verwilst <verwilst@gentoo.org> |
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.9 2002/10/20 06:43:10 seemant Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.10 2002/11/25 04:39:33 vapier Exp $ |
| 5 | |
5 | |
| 6 | ECLASS=flag-o-matic |
6 | ECLASS=flag-o-matic |
| 7 | INHERITED="$INHERITED $ECLASS" |
7 | INHERITED="$INHERITED $ECLASS" |
| 8 | |
8 | |
| 9 | # |
9 | # |
| … | |
… | |
| 21 | # Matches only complete flag |
21 | # Matches only complete flag |
| 22 | # |
22 | # |
| 23 | #### strip-flags #### |
23 | #### strip-flags #### |
| 24 | # Strip C[XX]FLAGS of everything except known |
24 | # Strip C[XX]FLAGS of everything except known |
| 25 | # good options. |
25 | # good options. |
|
|
26 | # |
|
|
27 | #### get-flag <flag> #### |
|
|
28 | # Find and echo the value for a particular flag |
| 26 | # |
29 | # |
| 27 | |
30 | |
| 28 | filter-flags () { |
31 | filter-flags () { |
| 29 | |
32 | |
| 30 | for x in $1 |
33 | for x in $1 |
| … | |
… | |
| 107 | |
110 | |
| 108 | export CFLAGS="${NEW_CFLAGS}" |
111 | export CFLAGS="${NEW_CFLAGS}" |
| 109 | export CXXFLAGS="${NEW_CXXFLAGS}" |
112 | export CXXFLAGS="${NEW_CXXFLAGS}" |
| 110 | } |
113 | } |
| 111 | |
114 | |
|
|
115 | get-flag() { |
|
|
116 | local findflag="$1" |
|
|
117 | |
|
|
118 | for f in ${CFLAGS} ${CXXFLAGS} ; do |
|
|
119 | if [ "${f/${findflag}}" != "${f}" ] ; then |
|
|
120 | echo "${f/-${findflag}=}" |
|
|
121 | return |
|
|
122 | fi |
|
|
123 | done |
|
|
124 | } |