From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2AE043801; Wed, 3 Jan 2024 00:27:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C7DC402BC; Wed, 3 Jan 2024 00:27:25 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B0A8A402A3 for ; Wed, 3 Jan 2024 00:27:23 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 9D96720B3CC1; Tue, 2 Jan 2024 15:27:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9D96720B3CC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1704238042; bh=cvSwa2j4ZxPlmcmLRWml2CDNSVlvZuJi5/ndHJpJfXE=; h=From:To:Cc:Subject:Date:From; b=mMWhOl48Z8JlZCn1FeERjkbgbSppCobnjyNPaO2Qc0BrauF7PVQx985j96LWV+TSI z5H6lJ/0w5fIB32YEs5thxaT6o5cR5HWa6ECiMWQnrY6TVF1HOIOxVZAXGQ9mKvMIW HfQx1JsBYwehq6APMiDQRFUEtNEOgMcFkxnl4bBQ= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Tyler Retzlaff Subject: [PATCH] build: set rte toolchain macros from predefined macros Date: Tue, 2 Jan 2024 15:27:21 -0800 Message-Id: <1704238041-25304-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Stop writing RTE_TOOLCHAIN_XXX macros to rte_build_config.h. When an application builds it doesn't necessarily use the same toolchain that DPDK was built with. Instead evaluate toolchain predefined macros and define RTE_TOOLCHAIN_XXX macros as appropriate each time rte_config.h is preprocessed. Signed-off-by: Tyler Retzlaff --- config/meson.build | 2 -- config/rte_config.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/meson.build b/config/meson.build index a9ccd56..0c3550e 100644 --- a/config/meson.build +++ b/config/meson.build @@ -180,8 +180,6 @@ if not is_ms_compiler endif toolchain = cc.get_id() -dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain) -dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper().underscorify(), 1) dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8) dpdk_conf.set('RTE_ARCH_32', cc.sizeof('void *') == 4) diff --git a/config/rte_config.h b/config/rte_config.h index da265d7..460fe94 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -14,6 +14,17 @@ #include +#ifdef __clang__ +#define RTE_TOOLCHAIN "clang" +#define RTE_TOOLCHAIN_CLANG 1 +#elif __GNUC__ +#define RTE_TOOLCHAIN "gcc" +#define RTE_TOOLCHAIN_GCC 1 +#elif _MSC_VER +#define RTE_TOOLCHAIN "msvc" +#define RTE_TOOLCHAIN_MSVC 1 +#endif + /* legacy defines */ #ifdef RTE_EXEC_ENV_LINUX #define RTE_EXEC_ENV_LINUXAPP 1 -- 1.8.3.1