From 3987c6edac86e035b1fa4b629284cdf245d66174 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Fri, 11 Aug 2017 17:14:55 +0200 Subject: flag-o-matic.eclass: test-flag-PROG, refactor to reduce duplication --- eclass/flag-o-matic.eclass | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'eclass') diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index b2f3742b3ecf..0393a30b74c3 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -433,11 +433,15 @@ test-flag-PROG() { # Use -c so we can test the assembler as well. -c -o /dev/null ) - if "${cmdline[@]}" -x${lang} - /dev/null 2>&1 ; then - "${cmdline[@]}" "${flag}" -x${lang} - /dev/null 2>&1 + if "${cmdline[@]}" -x${lang} - /dev/null ; then + cmdline+=( "${flag}" -x${lang} - ) else - "${cmdline[@]}" "${flag}" -c -o /dev/null /dev/null >/dev/null 2>&1 + # XXX: what's the purpose of this? does it even work with + # any compiler? + cmdline+=( "${flag}" -c -o /dev/null /dev/null ) fi + + "${cmdline[@]}" /dev/null } # @FUNCTION: test-flag-CC -- cgit v1.2.3-65-gdbad