Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 25 Aug 2017 13:53:25
Message-Id: 1503669191.3987c6edac86e035b1fa4b629284cdf245d66174.mgorny@gentoo
1 commit: 3987c6edac86e035b1fa4b629284cdf245d66174
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 11 15:14:55 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 25 13:53:11 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3987c6ed
7
8 flag-o-matic.eclass: test-flag-PROG, refactor to reduce duplication
9
10 eclass/flag-o-matic.eclass | 10 +++++++---
11 1 file changed, 7 insertions(+), 3 deletions(-)
12
13 diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
14 index b2f3742b3ec..0393a30b74c 100644
15 --- a/eclass/flag-o-matic.eclass
16 +++ b/eclass/flag-o-matic.eclass
17 @@ -433,11 +433,15 @@ test-flag-PROG() {
18 # Use -c so we can test the assembler as well.
19 -c -o /dev/null
20 )
21 - if "${cmdline[@]}" -x${lang} - </dev/null >/dev/null 2>&1 ; then
22 - "${cmdline[@]}" "${flag}" -x${lang} - </dev/null >/dev/null 2>&1
23 + if "${cmdline[@]}" -x${lang} - </dev/null &>/dev/null ; then
24 + cmdline+=( "${flag}" -x${lang} - )
25 else
26 - "${cmdline[@]}" "${flag}" -c -o /dev/null /dev/null >/dev/null 2>&1
27 + # XXX: what's the purpose of this? does it even work with
28 + # any compiler?
29 + cmdline+=( "${flag}" -c -o /dev/null /dev/null )
30 fi
31 +
32 + "${cmdline[@]}" </dev/null &>/dev/null
33 }
34
35 # @FUNCTION: test-flag-CC