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 9DBA51396D0 for ; Fri, 8 Sep 2017 08:33:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 154D51FC06E; Fri, 8 Sep 2017 08:33:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 C89371FC048 for ; Fri, 8 Sep 2017 08:33:21 +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 C23383416F0; Fri, 8 Sep 2017 08:33:19 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: toolchain@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross Date: Fri, 8 Sep 2017 10:33:11 +0200 Message-Id: <20170908083311.5790-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.14.1 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: 197182fc-00a9-48c8-abe6-aceab5b580ea X-Archives-Hash: 5c4b6c92a893d03b2f7b584f1b0e555c Make tc-getBUILD* functions respect host variables (CC & co.) when not cross-compiling. This removes the necessity of overriding BUILD_* along with the regular variables on the systems that are not concerned about cross-compilation, and does not change the behavior for those which are. Closes: https://bugs.gentoo.org/630282 --- eclass/toolchain-funcs.eclass | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index aeb6f7c70299..75fa638efff3 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -40,7 +40,13 @@ _tc-getPROG() { export ${var}="${prog[*]}" echo "${!var}" } -tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; } +tc-getBUILD_PROG() { + local vars="BUILD_$1 $1_FOR_BUILD HOST$1" + # respect host vars if not cross-compiling + # https://bugs.gentoo.org/630282 + tc-is-cross-compiler || vars+=" $1" + _tc-getPROG CBUILD "${vars}" "${@:2}" +} tc-getPROG() { _tc-getPROG CHOST "$@"; } # @FUNCTION: tc-getAR -- 2.14.1