/[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.204 Revision 1.205
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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.204 2014/12/31 08:26:48 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.205 2015/05/06 07:04:53 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
413 local lang=$2 413 local lang=$2
414 local flag=$3 414 local flag=$3
415 415
416 [[ -z ${comp} || -z ${flag} ]] && return 1 416 [[ -z ${comp} || -z ${flag} ]] && return 1
417 417
418 local cmdline=(
419 $(tc-get${comp})
420 # Clang will warn about unknown gcc flags but exit 0.
421 # Need -Werror to force it to exit non-zero.
422 -Werror
418 # use -c so we can test the assembler as well 423 # Use -c so we can test the assembler as well.
419 local PROG=$(tc-get${comp}) 424 -c -o /dev/null
420 if ${PROG} -c -o /dev/null -x${lang} - < /dev/null > /dev/null 2>&1 ; then 425 )
421 ${PROG} "${flag}" -c -o /dev/null -x${lang} - < /dev/null \ 426 if "${cmdline[@]}" -x${lang} - </dev/null >/dev/null 2>&1 ; then
422 > /dev/null 2>&1 427 "${cmdline[@]}" "${flag}" -x${lang} - </dev/null >/dev/null 2>&1
423 else 428 else
424 ${PROG} "${flag}" -c -o /dev/null /dev/null > /dev/null 2>&1 429 "${cmdline[@]}" "${flag}" -c -o /dev/null /dev/null >/dev/null 2>&1
425 fi 430 fi
426} 431}
427 432
428# @FUNCTION: test-flag-CC 433# @FUNCTION: test-flag-CC
429# @USAGE: <flag> 434# @USAGE: <flag>

Legend:
Removed from v.1.204  
changed lines
  Added in v.1.205

  ViewVC Help
Powered by ViewVC 1.1.20