/[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.69 Revision 1.70
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.69 2004/09/14 02:06:36 lv Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.70 2004/09/25 07:37:19 vapier 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"
20# Add extra flags to your current C[XX]FLAGS 20# Add extra flags to your current C[XX]FLAGS
21# 21#
22#### replace-flags <orig.flag> <new.flag> ### 22#### replace-flags <orig.flag> <new.flag> ###
23# Replace a flag by another one 23# Replace a flag by another one
24# 24#
25#### replace-cpu-flags <new.cpu> <old.cpus> ### 25#### replace-cpu-flags <old.cpus> <new.cpu> ###
26# Replace march/mcpu flags that specify <old.cpus> 26# Replace march/mcpu flags that specify <old.cpus>
27# with flags that specify <new.cpu> 27# with flags that specify <new.cpu>
28# 28#
29#### is-flag <flag> #### 29#### is-flag <flag> ####
30# Returns "true" if flag is set in C[XX]FLAGS 30# Returns "true" if flag is set in C[XX]FLAGS
159 159
160 return 0 160 return 0
161} 161}
162 162
163replace-cpu-flags() { 163replace-cpu-flags() {
164 local oldcpu newcpu="$1" ; shift 164 local newcpu="$#" ; newcpu="${!newcpu}"
165 for oldcpu in "$@" ; do 165 while [ $# -gt 1 ] ; do
166 # quote to make sure that no globbing is done (particularly on 166 # quote to make sure that no globbing is done (particularly on
167 # ${oldcpu} prior to calling replace-flags 167 # ${oldcpu} prior to calling replace-flags
168 replace-flags "-march=${oldcpu}" "-march=${newcpu}" 168 replace-flags "-march=${1}" "-march=${newcpu}"
169 replace-flags "-mcpu=${oldcpu}" "-mcpu=${newcpu}" 169 replace-flags "-mcpu=${1}" "-mcpu=${newcpu}"
170 replace-flags "-mtune=${oldcpu}" "-mtune=${newcpu}" 170 replace-flags "-mtune=${1}" "-mtune=${newcpu}"
171 shift
171 done 172 done
172 return 0 173 return 0
173} 174}
174 175
175is-flag() { 176is-flag() {

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.70

  ViewVC Help
Powered by ViewVC 1.1.20