/[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.163 Revision 1.165
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.163 2011/12/28 06:28:55 dirtyepic Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.165 2012/01/14 08:05:32 vapier Exp $
4 4
5# @ECLASS: flag-o-matic.eclass 5# @ECLASS: flag-o-matic.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# toolchain@gentoo.org 7# toolchain@gentoo.org
8# @BLURB: common functions to manipulate and query toolchain flags 8# @BLURB: common functions to manipulate and query toolchain flags
12 12
13if [[ ${___ECLASS_ONCE_FLAG_O_MATIC} != "recur -_+^+_- spank" ]] ; then 13if [[ ${___ECLASS_ONCE_FLAG_O_MATIC} != "recur -_+^+_- spank" ]] ; then
14___ECLASS_ONCE_FLAG_O_MATIC="recur -_+^+_- spank" 14___ECLASS_ONCE_FLAG_O_MATIC="recur -_+^+_- spank"
15 15
16inherit eutils toolchain-funcs multilib 16inherit eutils toolchain-funcs multilib
17
18################ DEPRECATED functions ################
19# The following are still present to avoid breaking existing
20# code more than necessary; however they are deprecated. Please
21# use gcc-specs-* from toolchain-funcs.eclass instead, if you
22# need to know which hardened techs are active in the compiler.
23# See bug #100974
24#
25# has_hardened
26# has_pie
27# has_pic
28# has_ssp_all
29# has_ssp
30
31 17
32# {C,CXX,F,FC}FLAGS that we allow in strip-flags 18# {C,CXX,F,FC}FLAGS that we allow in strip-flags
33# Note: shell globs and character lists are allowed 19# Note: shell globs and character lists are allowed
34setup-allowed-flags() { 20setup-allowed-flags() {
35 ALLOWED_FLAGS="-pipe" 21 ALLOWED_FLAGS="-pipe"
111} 97}
112 98
113# @FUNCTION: filter-flags 99# @FUNCTION: filter-flags
114# @USAGE: <flags> 100# @USAGE: <flags>
115# @DESCRIPTION: 101# @DESCRIPTION:
116# Remove particular <flags> from {C,CPP,CXX,F,FC}FLAGS. Accepts shell globs. 102# Remove particular <flags> from {C,CPP,CXX,F,FC,LD}FLAGS. Accepts shell globs.
117filter-flags() { 103filter-flags() {
118 _filter-hardened "$@" 104 _filter-hardened "$@"
105 local v
106 for v in C CPP CXX F FC LD ; do
119 _filter-var CFLAGS "$@" 107 _filter-var ${v}FLAGS "$@"
120 _filter-var CPPFLAGS "$@" 108 done
121 _filter-var CXXFLAGS "$@"
122 _filter-var FFLAGS "$@"
123 _filter-var FCFLAGS "$@"
124 return 0 109 return 0
125} 110}
126 111
127# @FUNCTION: filter-lfs-flags 112# @FUNCTION: filter-lfs-flags
128# @DESCRIPTION: 113# @DESCRIPTION:
525 return 0 510 return 0
526 fi 511 fi
527 done 512 done
528 return 1 513 return 1
529} 514}
530
531# DEAD FUNCS. Remove by Dec 2011.
532test_flag() { die "$0: deprecated, please use test-flags()!" ; }
533has_hardened() { die "$0: deprecated, please use gcc-specs-{relro,now}()!" ; }
534has_pic() { die "$0: deprecated, please use gcc-specs-pie()!" ; }
535has_pie() { die "$0: deprecated, please use gcc-specs-pie()!" ; }
536has_ssp_all() { die "$0: deprecated, please use gcc-specs-ssp()!" ; }
537has_ssp() { die "$0: deprecated, please use gcc-specs-ssp()!" ; }
538 515
539# @FUNCTION: has_m64 516# @FUNCTION: has_m64
540# @DESCRIPTION: 517# @DESCRIPTION:
541# This doesn't test if the flag is accepted, it tests if the flag actually 518# This doesn't test if the flag is accepted, it tests if the flag actually
542# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works 519# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works

Legend:
Removed from v.1.163  
changed lines
  Added in v.1.165

  ViewVC Help
Powered by ViewVC 1.1.20