/[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.178 Revision 1.179
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.178 2012/10/30 20:20:37 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.179 2012/10/30 20:51:44 vapier 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
263 done 263 done
264 return 0 264 return 0
265} 265}
266 266
267_is_flagq() { 267_is_flagq() {
268 local x 268 local x var
269 eval var=\""\${$1[*]}"\"
269 for x in ${!1} ; do 270 for x in ${var} ; do
270 [[ ${x} == $2 ]] && return 0 271 [[ ${x} == $2 ]] && return 0
271 done 272 done
272 return 1 273 return 1
273} 274}
274 275
368 fi 369 fi
369 done 370 done
370 done 371 done
371 372
372 # In case we filtered out all optimization flags fallback to -O2 373 # In case we filtered out all optimization flags fallback to -O2
373 if _is_flagq ${var} "-O*" && ! (_is_flagq new "-O*" || _is_flagq new -O) ; then 374 if _is_flagq ${var} "-O*" && ! _is_flagq new "-O*" ; then
374 new+=( -O2 ) 375 new+=( -O2 )
375 fi 376 fi
376 377
377 eval export ${var}=\""${new[*]}"\" 378 eval export ${var}=\""${new[*]}"\"
378 done 379 done

Legend:
Removed from v.1.178  
changed lines
  Added in v.1.179

  ViewVC Help
Powered by ViewVC 1.1.20