/[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.117 Revision 1.119
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.117 2007/03/04 21:13:17 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.119 2007/05/12 11:45:51 vapier Exp $
4# 4#
5# Maintainer: toolchain@gentoo.org 5# Maintainer: toolchain@gentoo.org
6 6
7# need access to emktemp() 7# need access to emktemp()
8inherit eutils toolchain-funcs multilib 8inherit eutils toolchain-funcs multilib
96setup-allowed-flags() { 96setup-allowed-flags() {
97 if [[ -z ${ALLOWED_FLAGS} ]] ; then 97 if [[ -z ${ALLOWED_FLAGS} ]] ; then
98 export ALLOWED_FLAGS="-pipe" 98 export ALLOWED_FLAGS="-pipe"
99 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -march -mtune" 99 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -march -mtune"
100 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all" 100 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all"
101 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking -fno-bounds-checking" 101 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking"
102 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time" 102 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time"
103 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g[0-9] -ggdb -ggdb[0-9] -gstabs -gstabs+" 103 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g[0-9] -ggdb -ggdb[0-9] -gstabs -gstabs+"
104 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-ident" 104 export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-ident"
105 fi 105 fi
106 # allow a bunch of flags that negate features / control ABI 106 # allow a bunch of flags that negate features / control ABI
107 ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all" 107 ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all \
108 -fno-strict-aliasing -fno-bounds-checking"
108 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \ 109 ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \
109 -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow \ 110 -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow \
110 -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 \ 111 -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 \
111 -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \ 112 -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \
112 -mieee -mieee-with-inexact -mschedule \ 113 -mieee -mieee-with-inexact -mschedule \
165} 166}
166 167
167filter-flags() { 168filter-flags() {
168 _filter-hardened "$@" 169 _filter-hardened "$@"
169 _filter-var CFLAGS "$@" 170 _filter-var CFLAGS "$@"
171 _filter-var CPPFLAGS "$@"
170 _filter-var CXXFLAGS "$@" 172 _filter-var CXXFLAGS "$@"
171 return 0 173 return 0
172} 174}
173 175
174filter-lfs-flags() { 176filter-lfs-flags() {
175 [[ -n $@ ]] && die "filter-lfs-flags takes no arguments" 177 [[ -n $@ ]] && die "filter-lfs-flags takes no arguments"
176 filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 178 filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
177} 179}
178 180
181append-cppflags() {
182 [[ -z $* ]] && return 0
183 export CPPFLAGS="${CPPFLAGS} $*"
184 return 0
185}
186
179append-lfs-flags() { 187append-lfs-flags() {
180 [[ -n $@ ]] && die "append-lfs-flags takes no arguments" 188 [[ -n $@ ]] && die "append-lfs-flags takes no arguments"
181 append-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 189 append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
182} 190}
183 191
184append-flags() { 192append-flags() {
185 [[ -z $* ]] && return 0 193 [[ -z $* ]] && return 0
186 export CFLAGS="${CFLAGS} $*" 194 export CFLAGS="${CFLAGS} $*"

Legend:
Removed from v.1.117  
changed lines
  Added in v.1.119

  ViewVC Help
Powered by ViewVC 1.1.20