summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-08-11 17:14:55 +0200
committerMichał Górny <mgorny@gentoo.org>2017-08-25 15:53:11 +0200
commit3987c6edac86e035b1fa4b629284cdf245d66174 (patch)
treefdb2aa3238274d66fe2629dfcde3bc64e50fb05c /eclass
parentgit-r3.eclass: Explicitly warn about unsecure protocols (diff)
downloadgentoo-3987c6edac86e035b1fa4b629284cdf245d66174.tar.gz
gentoo-3987c6edac86e035b1fa4b629284cdf245d66174.tar.bz2
gentoo-3987c6edac86e035b1fa4b629284cdf245d66174.zip
flag-o-matic.eclass: test-flag-PROG, refactor to reduce duplication
Diffstat (limited to 'eclass')
-rw-r--r--eclass/flag-o-matic.eclass10
1 files changed, 7 insertions, 3 deletions
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 >/dev/null 2>&1 ; then
- "${cmdline[@]}" "${flag}" -x${lang} - </dev/null >/dev/null 2>&1
+ if "${cmdline[@]}" -x${lang} - </dev/null &>/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 &>/dev/null
}
# @FUNCTION: test-flag-CC