/[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.6 Revision 1.7
12# Add extra flags to your current C[XX]FLAGS 12# Add extra flags to your current C[XX]FLAGS
13# 13#
14#### replace-flags <orig.flag> <new.flag> ### 14#### replace-flags <orig.flag> <new.flag> ###
15# Replace a flag by another one 15# Replace a flag by another one
16# 16#
17 17#### is-flag <flag> ####
18# Returns "true" if flag is set in C[XX]FLAGS
19# Matches only complete flag
20#
18 21
19filter-flags () { 22filter-flags () {
20 23
21 for x in $1; do 24 for x in $1; do
22 CFLAGS="${CFLAGS/$x}" 25 CFLAGS="${CFLAGS/$x}"
37 40
38 CFLAGS="${CFLAGS/${1}/${2}}" 41 CFLAGS="${CFLAGS/${1}/${2}}"
39 CXXFLAGS="${CXXFLAGS/${1}/${2}}" 42 CXXFLAGS="${CXXFLAGS/${1}/${2}}"
40 43
41} 44}
45
46is-flag() {
47
48 for x in $CFLAGS $CXXFLAGS; do
49 if [ "$x" == "$1" ]; then
50 echo true
51 break
52 fi
53 done
54
55}

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20