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 95F66138334 for ; Tue, 14 Aug 2018 20:34:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 82F14E0933; Tue, 14 Aug 2018 20:33:42 +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 3A704E0930 for ; Tue, 14 Aug 2018 20:33:42 +0000 (UTC) Received: from symphony.aura-online.co.uk (154.189.187.81.in-addr.arpa [81.187.189.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chewi) by smtp.gentoo.org (Postfix) with ESMTPSA id 1A473335CB7; Tue, 14 Aug 2018 20:33:39 +0000 (UTC) From: James Le Cuirot To: gentoo-dev@lists.gentoo.org Cc: James Le Cuirot Subject: [gentoo-dev] [arm17] [PATCH 1/3] toolchain-funcs.eclass: New tc-getTARGET_CPP function Date: Tue, 14 Aug 2018 21:33:02 +0100 Message-Id: <20180814203304.27305-2-chewi@gentoo.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180814203304.27305-1-chewi@gentoo.org> References: <20180814203304.27305-1-chewi@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: 0f5a7009-783c-458e-8452-03b21a8e88b8 X-Archives-Hash: 09eba5dbbe08ad878780f71930bd53e9 This returns the name of the C preprocessor for the toolchain being built if CTARGET is defined, or the toolchain being used otherwise. It is primarily intended to determine characteristics about an existing toolchain's target as these may differ from what the tuple suggests. It is not necessary to add the full set of tc-getTARGET_* helper functions as this is probably the only reason we would ever invoke a toolchain in the context of CTARGET. --- eclass/toolchain-funcs.eclass | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index cea8949b45d7..fbd1a8d5e2bf 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -167,6 +167,17 @@ tc-getBUILD_OBJCOPY() { tc-getBUILD_PROG OBJCOPY objcopy "$@"; } # @RETURN: name of the pkg-config tool for building binaries to run on the build machine tc-getBUILD_PKG_CONFIG() { tc-getBUILD_PROG PKG_CONFIG pkg-config "$@"; } +# @FUNCTION: tc-getTARGET_CPP +# @USAGE: [toolchain prefix] +# @RETURN: name of the C preprocessor for the toolchain being built (or used) +tc-getTARGET_CPP() { + if [[ -n ${CTARGET} ]]; then + _tc-getPROG CTARGET TARGET_CPP "gcc -E" "$@" + else + tc-getCPP "$@" + fi +} + # @FUNCTION: tc-export # @USAGE: # @DESCRIPTION: -- 2.17.0