summaryrefslogtreecommitdiff
blob: 0a053e038eac24837cc7aabf8d1f94a8e844191d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# Author Bart Verwilst <verwilst@gentoo.org>
# /space/gentoo/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass
ECLASS=flag-o-matic
INHERITED="$INHERITED $ECLASS"
#
#### filter-flags <flag> ####
# Remove particular flags from C[XX]FLAGS
#
#### append-flags <flag> ####
# Add extra flags to your current C[XX]FLAGS
#
#### replace-flags <orig.flag> <new.flag> ###
# Replace a flag by another one
#


filter-flags () {

	for x in $1; do
		CFLAGS="${CFLAGS/$x}"
		CXXFLAGS="${CXXFLAGS/$x}"
	done

}

append-flags () {


	CFLAGS="$CFLAGS $1"
	CXXFLAGS="$CXXFLAGS $1"

}

replace-flags () {

	CFLAGS="${CFLAGS/${1}/${2}}"
	CXXFLAGS="${CXXFLAGS/${1}/${2}}"

}