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 1D43243801; Wed, 3 Jan 2024 01:11:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93729402BC; Wed, 3 Jan 2024 01:11:19 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2376D402A3 for ; Wed, 3 Jan 2024 01:11:18 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4937520ACEE9; Tue, 2 Jan 2024 16:11:17 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4937520ACEE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1704240677; bh=kfNKSZUPARMchFfkvLTrihEnEvF3BWhDLzo3YFDCOfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zd/+CAlNiM1oiv5zu29T46B1NEjEY/mo61ITQ3CQUlVa91hvoscR/Fc5QL0lWVJJd oPLFEIMR6tz7SaB4TyU0h6oD7gkTXCv60xIS8oi+23cNV9C6E7BOwtj3/3u01RhhyE FMP0ndFz/huCxMdtXh8feEmdV5i4tQwUoCa19qtc= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Tyler Retzlaff Subject: [PATCH v2] build: set rte toolchain macros from predefined macros Date: Tue, 2 Jan 2024 16:11:15 -0800 Message-Id: <1704240675-3964-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1704238041-25304-1-git-send-email-roretzla@linux.microsoft.com> References: <1704238041-25304-1-git-send-email-roretzla@linux.microsoft.com> 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 --- v2: * use defined(macro) to correctly test for predefined macros 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..d743a5c 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -14,6 +14,17 @@ #include +#if defined(__clang__) +#define RTE_TOOLCHAIN "clang" +#define RTE_TOOLCHAIN_CLANG 1 +#elif defined(__GNUC__) +#define RTE_TOOLCHAIN "gcc" +#define RTE_TOOLCHAIN_GCC 1 +#elif defined(_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