/[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.16 Revision 1.17
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 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# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.16 2003/04/19 18:20:56 joker Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.17 2003/04/27 20:57:46 azarah Exp $
4# 4#
5# Author Bart Verwilst <verwilst@gentoo.org> 5# Author Bart Verwilst <verwilst@gentoo.org>
6 6
7ECLASS=flag-o-matic 7ECLASS=flag-o-matic
8INHERITED="$INHERITED $ECLASS" 8INHERITED="$INHERITED $ECLASS"
32# Sets mcpu to v8 and uses the original value 32# Sets mcpu to v8 and uses the original value
33# as mtune if none specified. 33# as mtune if none specified.
34# 34#
35 35
36 36
37# C[XX]FLAGS that we allow in strip-flags
37ALLOWED_FLAGS="-O -mcpu -march -mtune -fstack-protector -pipe -g" 38ALLOWED_FLAGS="-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g"
38 39
40# C[XX]FLAGS that we are think is ok, but needs testing
41# NOTE: currently -Os have issues with gcc3 and K6* arch's
42UNSTABLE_FLAGS="-Os -O3 -freorder-blocks -fprefetch-loop-arrays"
39 43
40filter-flags () { 44filter-flags () {
41 45
42 for x in $1 46 for x in $1
43 do 47 do
77strip-flags() { 81strip-flags() {
78 82
79 local NEW_CFLAGS="" 83 local NEW_CFLAGS=""
80 local NEW_CXXFLAGS="" 84 local NEW_CXXFLAGS=""
81 85
86 # Allow unstable C[XX]FLAGS if we are using unstable profile ...
87 if [ "${ACCEPT_KEYWORDS/~/}" != "${ACCEPT_KEYWORDS}" -a \
88 "${ACCEPT_KEYWORDS/-~/}" = "${ACCEPT_KEYWORDS}" ]
89 then
90 if use debug &> /dev/null
91 then
92 einfo "Enabling the use of some unstable flags"
93 fi
94
95 ALLOWED_FLAGS="${ALLOWED_FLAGS} ${UNSTABLE_FLAGS}"
96 fi
97
82 set -f 98 set -f
83 99
84 for x in ${CFLAGS} 100 for x in ${CFLAGS}
85 do 101 do
86 for y in ${ALLOWED_FLAGS} 102 for y in ${ALLOWED_FLAGS}
107 done 123 done
108 done 124 done
109 125
110 set +f 126 set +f
111 127
128 use debug &>/dev/null && einfo "CFLAGS=\"${NEW_CFLAGS}\""
129 use debug &>/dev/null && einfo "CXXFLAGS=\"${NEW_CXXFLAGS}\""
130
112 export CFLAGS="${NEW_CFLAGS}" 131 export CFLAGS="${NEW_CFLAGS}"
113 export CXXFLAGS="${NEW_CXXFLAGS}" 132 export CXXFLAGS="${NEW_CXXFLAGS}"
114} 133}
115 134
116get-flag() { 135get-flag() {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20