Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/3] flag-o-matic.eclass: test-flag-PROG, refactor to reduce duplication
Date: Fri, 11 Aug 2017 15:27:27
Message-Id: 20170811152642.24661-2-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH] flag-o-matic.eclass: LDFLAGS stripping, take two by "Michał Górny"
1 ---
2 eclass/flag-o-matic.eclass | 10 +++++++---
3 1 file changed, 7 insertions(+), 3 deletions(-)
4
5 diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
6 index b2f3742b3ecf..0393a30b74c3 100644
7 --- a/eclass/flag-o-matic.eclass
8 +++ b/eclass/flag-o-matic.eclass
9 @@ -433,11 +433,15 @@ test-flag-PROG() {
10 # Use -c so we can test the assembler as well.
11 -c -o /dev/null
12 )
13 - if "${cmdline[@]}" -x${lang} - </dev/null >/dev/null 2>&1 ; then
14 - "${cmdline[@]}" "${flag}" -x${lang} - </dev/null >/dev/null 2>&1
15 + if "${cmdline[@]}" -x${lang} - </dev/null &>/dev/null ; then
16 + cmdline+=( "${flag}" -x${lang} - )
17 else
18 - "${cmdline[@]}" "${flag}" -c -o /dev/null /dev/null >/dev/null 2>&1
19 + # XXX: what's the purpose of this? does it even work with
20 + # any compiler?
21 + cmdline+=( "${flag}" -c -o /dev/null /dev/null )
22 fi
23 +
24 + "${cmdline[@]}" </dev/null &>/dev/null
25 }
26
27 # @FUNCTION: test-flag-CC
28 --
29 2.14.0