diff options
-rw-r--r-- | eclass/flag-o-matic.eclass | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 114e2856679e..940bd106e81d 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.40 2004/03/12 11:21:15 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.41 2004/03/16 21:37:09 solar Exp $ # # Author Bart Verwilst <verwilst@gentoo.org> @@ -49,6 +49,10 @@ INHERITED="$INHERITED $ECLASS" #### append-ldflags #### # Add extra flags to your current LDFLAGS # +#### filter-ldflags <flags> #### +# Remove particular flags from LDFLAGS +# Matches only complete flags +# #### etexec-flags #### # hooked function for hardened-gcc that appends # -yet_exec {C,CXX,LD}FLAGS when hardened-gcc is installed @@ -296,6 +300,17 @@ append-ldflags() { return 0 } +filter-ldflags() { + # we do this fancy spacing stuff so as to not filter + # out part of a flag ... we want flag atoms ! :D + LDFLAGS=" ${LDFLAGS} " + for x in "$@" ; do + LDFLAGS="${LDFLAGS// ${x} / }" + done + LDFLAGS="${LDFLAGS:1:${#LDFLAGS}-2}" + return 0 +} + etexec-flags() { has_version sys-devel/hardened-gcc if [ $? == 0 ] ; then |