/[gentoo-x86]/eclass/flag-o-matic.eclass
Gentoo

Diff of /eclass/flag-o-matic.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.62 Revision 1.63
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.62 2004/07/15 04:59:44 lv Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.63 2004/07/18 04:59:30 vapier Exp $
4# 4#
5# Author Bart Verwilst <verwilst@gentoo.org> 5# Author Bart Verwilst <verwilst@gentoo.org>
6 6
7ECLASS=flag-o-matic 7ECLASS=flag-o-matic
8INHERITED="$INHERITED $ECLASS" 8INHERITED="$INHERITED $ECLASS"
9
9IUSE="$IUSE debug" 10IUSE="debug"
10 11
11# 12#
12#### filter-flags <flags> #### 13#### filter-flags <flags> ####
13# Remove particular flags from C[XX]FLAGS 14# Remove particular flags from C[XX]FLAGS
14# Matches only complete flags 15# Matches only complete flags
205 set -f # disable pathname expansion 206 set -f # disable pathname expansion
206 207
207 for x in ${CFLAGS}; do 208 for x in ${CFLAGS}; do
208 for y in ${ALLOWED_FLAGS}; do 209 for y in ${ALLOWED_FLAGS}; do
209 flag=${x%%=*} 210 flag=${x%%=*}
210 if [ "${flag%%${y}}" = "" ]; then 211 if [ "${flag%%${y}}" = "" ] || [ "${flag:0:5}" = "-fno-" ] || [ "${flag:0:5}" = "-mno-" ] ; then
211 NEW_CFLAGS="${NEW_CFLAGS} ${x}" 212 NEW_CFLAGS="${NEW_CFLAGS} ${x}"
212 break 213 break
213 fi 214 fi
214 done 215 done
215 done 216 done
216 217
217 for x in ${CXXFLAGS}; do 218 for x in ${CXXFLAGS}; do
218 for y in ${ALLOWED_FLAGS}; do 219 for y in ${ALLOWED_FLAGS}; do
219 flag=${x%%=*} 220 flag=${x%%=*}
220 if [ "${flag%%${y}}" = "" ]; then 221 if [ "${flag%%${y}}" = "" ] || [ "${flag:0:5}" = "-fno-" ] || [ "${flag:0:5}" = "-mno-" ] ; then
221 NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}" 222 NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}"
222 break 223 break
223 fi 224 fi
224 done 225 done
225 done 226 done

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.20