summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Birchinger <joker@gentoo.org>2003-04-19 18:20:56 +0000
committerChristian Birchinger <joker@gentoo.org>2003-04-19 18:20:56 +0000
commit4dde6529ef00c4c1e551028fec71fae0f1ab6408 (patch)
treecaa77b2a3d717ea7fe0c77f373de09552b021c2c /eclass/flag-o-matic.eclass
parentbug #19602, fixed use flag (diff)
downloadhistorical-4dde6529ef00c4c1e551028fec71fae0f1ab6408.tar.gz
historical-4dde6529ef00c4c1e551028fec71fae0f1ab6408.tar.bz2
historical-4dde6529ef00c4c1e551028fec71fae0f1ab6408.zip
Added the function replace-sparc64-flags
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass39
1 files changed, 38 insertions, 1 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 978780a96258..906cfaf6fedd 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.15 2003/04/06 23:35:41 method Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.16 2003/04/19 18:20:56 joker Exp $
#
# Author Bart Verwilst <verwilst@gentoo.org>
@@ -28,6 +28,11 @@ INHERITED="$INHERITED $ECLASS"
#### get-flag <flag> ####
# Find and echo the value for a particular flag
#
+#### replace-sparc64-flags ####
+# Sets mcpu to v8 and uses the original value
+# as mtune if none specified.
+#
+
ALLOWED_FLAGS="-O -mcpu -march -mtune -fstack-protector -pipe -g"
@@ -118,3 +123,35 @@ get-flag() {
fi
done
}
+
+replace-sparc64-flags () {
+
+ local SPARC64_CPUS="ultrasparc v9"
+
+ if [ "${CFLAGS/mtune}" != "${CFLAGS}" ]
+ then
+ for x in ${SPARC64_CPUS}
+ do
+ CFLAGS="${CFLAGS/-mcpu=${x}/-mcpu=v8}"
+ done
+ else
+ for x in ${SPARC64_CPUS}
+ do
+ CFLAGS="${CFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}"
+ done
+ fi
+
+ if [ "${CXXFLAGS/mtune}" != "${CXXFLAGS}" ]
+ then
+ for x in ${SPARC64_CPUS}
+ do
+ CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8}"
+ done
+ else
+ for x in ${SPARC64_CPUS}
+ do
+ CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}"
+ done
+ fi
+
+}