From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B19E11396D0 for ; Fri, 11 Aug 2017 15:27:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24061E0CCD; Fri, 11 Aug 2017 15:26:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D9D45E0CBD for ; Fri, 11 Aug 2017 15:26:51 +0000 (UTC) Received: from localhost.localdomain (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 0E12634178B; Fri, 11 Aug 2017 15:26:49 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/3] flag-o-matic.eclass: test-flag-PROG, refactor to reduce duplication Date: Fri, 11 Aug 2017 17:26:40 +0200 Message-Id: <20170811152642.24661-2-mgorny@gentoo.org> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170811152642.24661-1-mgorny@gentoo.org> References: <20170811152642.24661-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 2ff8f18c-0e43-4606-8c79-89dcd0a8cc39 X-Archives-Hash: 36264e7e30eec3d045e71940b99bac2e --- eclass/flag-o-matic.eclass | 10 +++++++--- 1 file 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 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 -- 2.14.0