/[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.106 Revision 1.109
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
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.106 2006/02/19 23:18:30 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.109 2006/07/16 05:49:47 vapier Exp $
4 4#
5# Maintainer: base-system@gentoo.org
5 6
6# need access to emktemp() 7# need access to emktemp()
7inherit eutils toolchain-funcs multilib 8inherit eutils toolchain-funcs multilib
8 9
9# 10#
97 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -march -mtune" 98 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -march -mtune"
98 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all" 99 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all"
99 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking -fno-bounds-checking" 100 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking -fno-bounds-checking"
100 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time" 101 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time"
101 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g0 -g1 -g2 -g3 -ggdb -ggdb0 -ggdb1 -ggdb2 -ggdb3" 102 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g0 -g1 -g2 -g3 -ggdb -ggdb0 -ggdb1 -ggdb2 -ggdb3"
103 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-ident"
102 fi 104 fi
103 # allow a bunch of flags that negate features / control ABI 105 # allow a bunch of flags that negate features / control ABI
104 ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all" 106 ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all"
105 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \ 107 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \
106 -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow \ 108 -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow \
263 265
264filter-mfpmath() { 266filter-mfpmath() {
265 local orig_mfpmath new_math prune_math 267 local orig_mfpmath new_math prune_math
266 268
267 # save the original -mfpmath flag 269 # save the original -mfpmath flag
268 orig_mfpmath="`get-flag -mfpmath`" 270 orig_mfpmath=$(get-flag -mfpmath)
269 # get the value of the current -mfpmath flag 271 # get the value of the current -mfpmath flag
270 new_math=" `get-flag mfpmath | tr , ' '` " 272 new_math=$(get-flag mfpmath)
273 new_math=" ${new_math//,/ } "
271 # figure out which math values are to be removed 274 # figure out which math values are to be removed
272 prune_math="" 275 prune_math=""
273 for prune_math in "$@" ; do 276 for prune_math in "$@" ; do
274 new_math="${new_math/ ${prune_math} / }" 277 new_math=${new_math/ ${prune_math} / }
275 done 278 done
276 new_math="`echo ${new_math:1:${#new_math}-2} | tr ' ' ,`" 279 new_math=$(echo ${new_math})
280 new_math=${new_math// /,}
277 281
278 if [ -z "${new_math}" ] ; then 282 if [[ -z ${new_math} ]] ; then
279 # if we're removing all user specified math values are 283 # if we're removing all user specified math values are
280 # slated for removal, then we just filter the flag 284 # slated for removal, then we just filter the flag
281 filter-flags ${orig_mfpmath} 285 filter-flags ${orig_mfpmath}
282 else 286 else
283 # if we only want to filter some of the user specified 287 # if we only want to filter some of the user specified

Legend:
Removed from v.1.106  
changed lines
  Added in v.1.109

  ViewVC Help
Powered by ViewVC 1.1.20