[PATCH v2 2/3] build: determine execution environment at config time

Tyler Retzlaff roretzla at linux.microsoft.com
Thu Jan 26 19:03:23 CET 2023


Move execution environment determination and definitions to config. The
RTE_EXEC_ENV macros are actually used by libraries built before EAL.

Currently it does not matter that this is determined in lib/eal since
the definitions are consumed before anything is built including libs
built before lib/eal. By moving this logic to config it allows kvargs
and telemetry to be built without EAL.

No functional change intended.

Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 config/meson.build  | 8 ++++++++
 lib/eal/meson.build | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 898b743..e0b9e4e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -14,6 +14,14 @@ foreach env:supported_exec_envs
     set_variable('is_' + env, exec_env == env)
 endforeach
 
+exec_envs = {'freebsd': 0, 'linux': 1, 'windows': 2}
+foreach env, id:exec_envs
+    dpdk_conf.set('RTE_ENV_' + env.to_upper(), id)
+    dpdk_conf.set10('RTE_EXEC_ENV_IS_' + env.to_upper(), (exec_env == env))
+endforeach
+dpdk_conf.set('RTE_EXEC_ENV', exec_envs[exec_env])
+dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
+
 # MS linker requires special treatment.
 # TODO: use cc.get_linker_id() with Meson >= 0.54
 is_ms_compiler = is_windows and (cc.get_id() == 'msvc')
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index 056beb9..26c638f 100644
--- a/lib/eal/meson.build
+++ b/lib/eal/meson.build
@@ -10,14 +10,6 @@ if not is_windows
     subdir('unix')
 endif
 
-exec_envs = {'freebsd': 0, 'linux': 1, 'windows': 2}
-foreach env, id:exec_envs
-    dpdk_conf.set('RTE_ENV_' + env.to_upper(), id)
-    dpdk_conf.set10('RTE_EXEC_ENV_IS_' + env.to_upper(), (exec_env == env))
-endforeach
-dpdk_conf.set('RTE_EXEC_ENV', exec_envs[exec_env])
-
-dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
 subdir(exec_env)
 
 subdir(arch_subdir)
-- 
1.8.3.1



More information about the dev mailing list