/[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.9 Revision 1.10
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
6ECLASS=flag-o-matic 6ECLASS=flag-o-matic
7INHERITED="$INHERITED $ECLASS" 7INHERITED="$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
28filter-flags () { 31filter-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
115get-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}

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20