summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ahlberg <aliz@gentoo.org>2003-07-22 12:48:11 +0000
committerDaniel Ahlberg <aliz@gentoo.org>2003-07-22 12:48:11 +0000
commitd92721c01011fb85ad9685e83d627b972e54a83a (patch)
tree76d6a7c3ae99472d7fa288419cca2789103f3778 /eclass/flag-o-matic.eclass
parentstable on x86 (diff)
downloadgentoo-2-d92721c01011fb85ad9685e83d627b972e54a83a.tar.gz
gentoo-2-d92721c01011fb85ad9685e83d627b972e54a83a.tar.bz2
gentoo-2-d92721c01011fb85ad9685e83d627b972e54a83a.zip
added filter-mfpmath function
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass22
1 files changed, 21 insertions, 1 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 496cc2d2898f..a4c11fad626f 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.23 2003/07/18 20:11:22 tester Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.24 2003/07/22 12:48:11 aliz Exp $
#
# Author Bart Verwilst <verwilst@gentoo.org>
@@ -46,6 +46,26 @@ esac
# NOTE: currently -Os have issues with gcc3 and K6* arch's
UNSTABLE_FLAGS="-Os -O3 -freorder-blocks -fprefetch-loop-arrays"
+filter-mfpmath() {
+ for a in $CFLAGS; do
+ if [ "${a:0:8}" == "-mfpmath" ]; then
+ orig_mfpmath=$a
+ fi
+ done
+
+ mfpmath="$( echo $orig_mfpmath | awk -F '=' '{print $2}' | tr "," " " )"
+ for b in $@; do
+ mfpmath="${mfpmath/$b}"
+ done
+
+ if [ -z "${mfpmath/ }" ]; then
+ filter-flags "$orig_mfpmath"
+ else
+ new_mfpmath="-mfpmath=$( echo $mfpmath | sed -e "s/ /,/g" -e "s/,,/,/g" )"
+ replace-flags "$orig_mfpmath" "$new_mfpmath"
+ fi
+}
+
filter-flags() {
# we do this fancy spacing stuff so as to not filter
# out part of a flag ... we want flag atoms ! :D