From patchwork Thu Nov 12 16:31:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 84068 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 36139A09D3; Thu, 12 Nov 2020 17:32:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C30156A3; Thu, 12 Nov 2020 17:32:11 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 37FB256A3 for ; Thu, 12 Nov 2020 17:32:08 +0100 (CET) IronPort-SDR: 2uCYJaqnLYXhm7WqABojfDFRvrqpRvEbLZlc5rECSU+HefA4ahtUMDHNu/GDNodf+ABqG0lnVc oBn/3Xi4rLPA== X-IronPort-AV: E=McAfee;i="6000,8403,9803"; a="149608846" X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="149608846" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 08:31:48 -0800 IronPort-SDR: U4ILxxZZ9eVfFVg0/CBbwsql4VkS/oMJi67W9ttTBlpurSoSKtUjC9SWRiwICSPC0ltmv99ICC vTXiyw/A819A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="532228513" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by fmsmga005.fm.intel.com with ESMTP; 12 Nov 2020 08:31:46 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Thu, 12 Nov 2020 16:31:34 +0000 Message-Id: <20201112163134.1893190-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [RFC PATCH] build: allow passing extra config header to build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" To allow per-build override of some settings, without having to change DPDK source-code files, i.e. rte_config.h, we can add an option to allow the user to pass in a file containing their own defines for the build. Signed-off-by: Bruce Richardson --- This is just a quick RFC to show what might be possible and to help keep the discussion going on how to improve build config in DPDK! --- config/meson.build | 10 ++++++++++ config/rte_config.h | 4 ++++ meson_options.txt | 2 ++ 3 files changed, 16 insertions(+) -- 2.25.1 diff --git a/config/meson.build b/config/meson.build index 258b01d06..5c137e4f5 100644 --- a/config/meson.build +++ b/config/meson.build @@ -14,6 +14,16 @@ foreach env:supported_exec_envs set_variable('is_' + env, exec_env == env) endforeach +if get_option('extra_config') != '' + extra_config = files(get_option('extra_config')) + configure_file(copy: true, + input: extra_config, + output: 'rte_build_config_extra.h', + install_dir: join_paths(get_option('includedir'), + get_option('include_subdir_arch'))) + dpdk_conf.set('RTE_BUILD_CONFIG_EXTRA', 1) +endif + # MS linker requires special treatment. # TODO: use cc.get_linker_id() with Meson >= 0.54 is_ms_linker = is_windows and (cc.get_id() == 'clang') diff --git a/config/rte_config.h b/config/rte_config.h index 25219f04a..2f5ecf999 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -148,4 +148,8 @@ #define RTE_LIBRTE_PMD_DLB2_SW_CREDIT_QUANTA 32 #define RTE_PMD_DLB2_DEFAULT_DEPTH_THRESH 256 +#ifdef RTE_BUILD_CONFIG_EXTRA +#include +#endif + #endif /* _RTE_CONFIG_H_ */ diff --git a/meson_options.txt b/meson_options.txt index 9bf18ab6b..91319b0e4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,6 +2,8 @@ option('armv8_crypto_dir', type: 'string', value: '', description: 'path to the armv8_crypto library installation directory') +option('extra_config', type: 'string', value: '', + description: 'path to a header file with extra build defines. Will be installed as rte_build_config_extra.h') option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-',