| 1 | # Copyright 1999-2009 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.156 2011/10/08 18:37:30 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.157 2011/11/11 07:06:25 dirtyepic 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 |
| … | |
… | |
| 152 | # @USAGE: <flags> |
152 | # @USAGE: <flags> |
| 153 | # @DESCRIPTION: |
153 | # @DESCRIPTION: |
| 154 | # Add extra <flags> to the current CFLAGS. |
154 | # Add extra <flags> to the current CFLAGS. |
| 155 | append-cflags() { |
155 | append-cflags() { |
| 156 | [[ -z $* ]] && return 0 |
156 | [[ -z $* ]] && return 0 |
| 157 | export CFLAGS="${CFLAGS} $*" |
157 | export CFLAGS=$(test-flags-CC ${CFLAGS} $*) |
| 158 | return 0 |
158 | return 0 |
| 159 | } |
159 | } |
| 160 | |
160 | |
| 161 | # @FUNCTION: append-cxxflags |
161 | # @FUNCTION: append-cxxflags |
| 162 | # @USAGE: <flags> |
162 | # @USAGE: <flags> |
| 163 | # @DESCRIPTION: |
163 | # @DESCRIPTION: |
| 164 | # Add extra <flags> to the current CXXFLAGS. |
164 | # Add extra <flags> to the current CXXFLAGS. |
| 165 | append-cxxflags() { |
165 | append-cxxflags() { |
| 166 | [[ -z $* ]] && return 0 |
166 | [[ -z $* ]] && return 0 |
| 167 | export CXXFLAGS="${CXXFLAGS} $*" |
167 | export CXXFLAGS=$(test-flags-CXX ${CXXFLAGS} $*) |
| 168 | return 0 |
168 | return 0 |
| 169 | } |
169 | } |
| 170 | |
170 | |
| 171 | # @FUNCTION: append-fflags |
171 | # @FUNCTION: append-fflags |
| 172 | # @USAGE: <flags> |
172 | # @USAGE: <flags> |
| 173 | # @DESCRIPTION: |
173 | # @DESCRIPTION: |
| 174 | # Add extra <flags> to the current {F,FC}FLAGS. |
174 | # Add extra <flags> to the current {F,FC}FLAGS. |
| 175 | append-fflags() { |
175 | append-fflags() { |
| 176 | [[ -z $* ]] && return 0 |
176 | [[ -z $* ]] && return 0 |
| 177 | export FFLAGS="${FFLAGS} $*" |
177 | export FFLAGS=$(test-flags-F77 ${FFLAGS} $*) |
| 178 | export FCFLAGS="${FCFLAGS} $*" |
178 | export FCFLAGS=$(test-flags-FC ${FCFLAGS} $*) |
| 179 | return 0 |
179 | return 0 |
| 180 | } |
180 | } |
| 181 | |
181 | |
| 182 | # @FUNCTION: append-lfs-flags |
182 | # @FUNCTION: append-lfs-flags |
| 183 | # @DESCRIPTION: |
183 | # @DESCRIPTION: |