/[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.13 Revision 1.15
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.13 2003/03/04 22:07:17 verwilst Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.15 2003/04/06 23:35:41 method 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"
27# 27#
28#### get-flag <flag> #### 28#### get-flag <flag> ####
29# Find and echo the value for a particular flag 29# Find and echo the value for a particular flag
30# 30#
31 31
32ALLOWED_FLAGS="-O -mcpu -march -pipe -g" 32ALLOWED_FLAGS="-O -mcpu -march -mtune -fstack-protector -pipe -g"
33 33
34 34
35filter-flags () { 35filter-flags () {
36 36
37 for x in $1 37 for x in $1
78 78
79 for x in ${CFLAGS} 79 for x in ${CFLAGS}
80 do 80 do
81 for y in ${ALLOWED_FLAGS} 81 for y in ${ALLOWED_FLAGS}
82 do 82 do
83 flag=${x%%=*}
83 if [ "${x/${y}}" != "${x}" ] 84 if [ "${flag%%${y}}" = "" ]
84 then 85 then
85 if [ -z "${NEW_CFLAGS}" ]
86 then
87 NEW_CFLAGS="${x}"
88 else
89 NEW_CFLAGS="${NEW_CFLAGS} ${x}" 86 NEW_CFLAGS="${NEW_CFLAGS} ${x}"
90 fi 87 break
91 fi 88 fi
92 done 89 done
93 done 90 done
94 91
95 for x in ${CXXFLAGS} 92 for x in ${CXXFLAGS}
96 do 93 do
97 for y in ${ALLOWED_FLAGS} 94 for y in ${ALLOWED_FLAGS}
98 do 95 do
96 flag=${x%%=*}
99 if [ "${x/${y}}" != "${x}" ] 97 if [ "${flag%%${y}}" = "" ]
100 then 98 then
101 if [ -z "${NEW_CXXFLAGS}" ]
102 then
103 NEW_CXXFLAGS="${x}"
104 else
105 NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}" 99 NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}"
106 fi 100 break
107 fi 101 fi
108 done 102 done
109 done 103 done
110 104
111 set +f 105 set +f

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20