/[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.27 Revision 1.28
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.27 2003/09/24 05:51:32 solar Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.28 2003/10/26 00:40:52 vapier 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"
107 107
108append-flags() { 108append-flags() {
109 CFLAGS="${CFLAGS} $@" 109 CFLAGS="${CFLAGS} $@"
110 CXXFLAGS="${CXXFLAGS} $@" 110 CXXFLAGS="${CXXFLAGS} $@"
111 for x in $@; do 111 for x in $@; do
112 [ "${x}" = "-fno-stack-protector" ] && 112 [ "${x}" = "-fno-stack-protector" ] && fstack-flags
113 fstack-flags
114 done 113 done
114 return 0
115} 115}
116 116
117replace-flags() { 117replace-flags() {
118 CFLAGS="${CFLAGS/${1}/${2} }" 118 CFLAGS="${CFLAGS/${1}/${2} }"
119 CXXFLAGS="${CXXFLAGS/${1}/${2} }" 119 CXXFLAGS="${CXXFLAGS/${1}/${2} }"
120 return 0
120} 121}
121 122
122is-flag() { 123is-flag() {
123 for x in ${CFLAGS} ${CXXFLAGS} ; do 124 for x in ${CFLAGS} ${CXXFLAGS} ; do
124 if [ "${x}" == "$1" ] ; then 125 if [ "${x}" == "$1" ] ; then
177 export CXXFLAGS="${NEW_CXXFLAGS}" 178 export CXXFLAGS="${NEW_CXXFLAGS}"
178} 179}
179 180
180get-flag() { 181get-flag() {
181 local findflag="$1" 182 local findflag="$1"
182
183 for f in ${CFLAGS} ${CXXFLAGS} ; do 183 for f in ${CFLAGS} ${CXXFLAGS} ; do
184 if [ "${f/${findflag}}" != "${f}" ] ; then 184 if [ "${f/${findflag}}" != "${f}" ] ; then
185 echo "${f/-${findflag}=}" 185 echo "${f/-${findflag}=}"
186 return 186 return 0
187 fi 187 fi
188 done 188 done
189 return 1
189} 190}
190 191
191replace-sparc64-flags() { 192replace-sparc64-flags() {
192 local SPARC64_CPUS="ultrasparc v9" 193 local SPARC64_CPUS="ultrasparc v9"
193 194
218 fi 219 fi
219} 220}
220 221
221append-ldflags() { 222append-ldflags() {
222 LDFLAGS="${LDFLAGS} $@" 223 LDFLAGS="${LDFLAGS} $@"
224 return 0
223} 225}
224 226
225etexec-flags() { 227etexec-flags() {
226 has_version 'sys-devel/hardened-gcc' && { 228 has_version 'sys-devel/hardened-gcc' && {
227 debug-print ">>> appending flags -yet_exec" 229 debug-print ">>> appending flags -yet_exec"

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20