/[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.40 Revision 1.41
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.40 2004/03/12 11:21:15 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.41 2004/03/16 21:37:09 solar 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"
46# If the user has -mfpmath=sse,386, running `filter-mfpmath sse` 46# If the user has -mfpmath=sse,386, running `filter-mfpmath sse`
47# will leave the user with -mfpmath=386 47# will leave the user with -mfpmath=386
48# 48#
49#### append-ldflags #### 49#### append-ldflags ####
50# Add extra flags to your current LDFLAGS 50# Add extra flags to your current LDFLAGS
51#
52#### filter-ldflags <flags> ####
53# Remove particular flags from LDFLAGS
54# Matches only complete flags
51# 55#
52#### etexec-flags #### 56#### etexec-flags ####
53# hooked function for hardened-gcc that appends 57# hooked function for hardened-gcc that appends
54# -yet_exec {C,CXX,LD}FLAGS when hardened-gcc is installed 58# -yet_exec {C,CXX,LD}FLAGS when hardened-gcc is installed
55# and a package is filtering -fPIC,-fpic, -fPIE, -fpie 59# and a package is filtering -fPIC,-fpic, -fPIE, -fpie
294append-ldflags() { 298append-ldflags() {
295 LDFLAGS="${LDFLAGS} $@" 299 LDFLAGS="${LDFLAGS} $@"
296 return 0 300 return 0
297} 301}
298 302
303filter-ldflags() {
304 # we do this fancy spacing stuff so as to not filter
305 # out part of a flag ... we want flag atoms ! :D
306 LDFLAGS=" ${LDFLAGS} "
307 for x in "$@" ; do
308 LDFLAGS="${LDFLAGS// ${x} / }"
309 done
310 LDFLAGS="${LDFLAGS:1:${#LDFLAGS}-2}"
311 return 0
312}
313
299etexec-flags() { 314etexec-flags() {
300 has_version sys-devel/hardened-gcc 315 has_version sys-devel/hardened-gcc
301 if [ $? == 0 ] ; then 316 if [ $? == 0 ] ; then
302 if [ "`is-flag -yet_exec`" != "true" ]; then 317 if [ "`is-flag -yet_exec`" != "true" ]; then
303 debug-print ">>> appending flags -yet_exec" 318 debug-print ">>> appending flags -yet_exec"

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20