/[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.2 Revision 1.3
3# Author Bart Verwilst <verwilst@gentoo.org> 3# Author Bart Verwilst <verwilst@gentoo.org>
4# /space/gentoo/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass 4# /space/gentoo/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass
5ECLASS=flag-o-matic 5ECLASS=flag-o-matic
6 6
7# 7#
8#### filter-flags <flag> ####
8#Remove particular flags from C[XX]FLAGS 9# Remove particular flags from C[XX]FLAGS
9# 10#
11#### append-flags <flag> ####
12# Add extra flags to your current C[XX]FLAGS
13#
14#### change-flags <orig.flag> <new.flag> ###
15# Replace a flag by another one
16#
17
18
10filter-flags () { 19filter-flags () {
11 20
12 for x in $1; do 21 for x in $1; do
13 CFLAGS="${CFLAGS/$x}" 22 CFLAGS="${CFLAGS/$x}"
14 CXXFLAGS="${CXXFLAGS/$x}" 23 CXXFLAGS="${CXXFLAGS/$x}"
15 done 24 done
16 25
17} 26}
18 27
19#
20#Add flags to the current C[XX]FLAGS
21#
22append-flags () { 28append-flags () {
23 29
24 30
25 CFLAGS="$CFLAGS $1" 31 CFLAGS="$CFLAGS $1"
26 CXXFLAGS="$CXXFLAGS $1" 32 CXXFLAGS="$CXXFLAGS $1"
27 33
28} 34}
29 35
30max-optim () { 36change-flags () {
31 37
32 for x in $CFLAGS; do 38 CFLAGS="${CFLAGS/${1}/${2}"
33 echo $x 39 CXXFLAGS="${CXXFLAGS/${1}/${2}"
34 done
35 40
36} 41}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20