diff options
author | Dan Armak <danarmak@gentoo.org> | 2002-09-08 08:43:36 +0000 |
---|---|---|
committer | Dan Armak <danarmak@gentoo.org> | 2002-09-08 08:43:36 +0000 |
commit | 4bf9814b2480c1c2aa45a28117ef004877e44c77 (patch) | |
tree | 4a95441afe3807526581df604594ecd4165605cf /eclass | |
parent | Bug fix for bug #7641 (diff) | |
download | historical-4bf9814b2480c1c2aa45a28117ef004877e44c77.tar.gz historical-4bf9814b2480c1c2aa45a28117ef004877e44c77.tar.bz2 historical-4bf9814b2480c1c2aa45a28117ef004877e44c77.zip |
add an is-flag function that returns true if its parameter exists in or
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/flag-o-matic.eclass | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 0a053e038eac..14ff1af8b423 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -14,7 +14,10 @@ INHERITED="$INHERITED $ECLASS" #### replace-flags <orig.flag> <new.flag> ### # Replace a flag by another one # - +#### is-flag <flag> #### +# Returns "true" if flag is set in C[XX]FLAGS +# Matches only complete flag +# filter-flags () { @@ -39,3 +42,14 @@ replace-flags () { CXXFLAGS="${CXXFLAGS/${1}/${2}}" } + +is-flag() { + + for x in $CFLAGS $CXXFLAGS; do + if [ "$x" == "$1" ]; then + echo true + break + fi + done + +} |