[Buildroot] [PATCH 4/5] package/dpdk: make libraries selectable

Maxime Leroy maxime at leroys.fr
Tue Oct 21 12:03:41 UTC 2025


Add BR2_PACKAGE_DPDK_LIBS_LIST to control which DPDK libraries are
built:
  - empty : use DPDK defaults
  - none  : disable all libs (-Ddisable_libs='*')
  - list  : pass to -Denable_libs= (comma-separated)

Signed-off-by: Maxime Leroy <maxime at leroys.fr>
---
 package/dpdk/Config.in | 14 ++++++++++++++
 package/dpdk/dpdk.mk   |  9 +++++++++
 2 files changed, 23 insertions(+)

diff --git a/package/dpdk/Config.in b/package/dpdk/Config.in
index 5de1c63937..e311611548 100644
--- a/package/dpdk/Config.in
+++ b/package/dpdk/Config.in
@@ -64,6 +64,20 @@ config BR2_PACKAGE_DPDK_DRIVERS_LIST
 	    find drivers -mindepth 2 -maxdepth 2 -type d \
 	    ! -printf '%P\n' | sort
 
+config BR2_PACKAGE_DPDK_LIBS_LIST
+	string "Comma-separated libraries (e.g. graph,hash,fib)"
+	help
+	  Controls which DPDK libraries are built.
+
+	  Values:
+	    (empty): use DPDK defaults
+	    none   : build no libraries
+	    list   : e.g. "graph,hash,fib"
+
+	  To list all libraries found in the DPDK source tree:
+	    find lib -mindepth 2 -maxdepth 2 -type f -name meson.build \
+	      -printf '%h\n' | xargs -n1 basename | sort -u
+
 endif
 
 comment "dpdk needs a glibc toolchain w/ threads, gcc >= 4.9, headers >= 4.19"
diff --git a/package/dpdk/dpdk.mk b/package/dpdk/dpdk.mk
index 9333a67c31..e54668ca2d 100644
--- a/package/dpdk/dpdk.mk
+++ b/package/dpdk/dpdk.mk
@@ -56,6 +56,15 @@ ifneq ($(DPDK_DRIVERS),)
   endif
 endif
 
+DPDK_LIBS := $(call qstrip,$(BR2_PACKAGE_DPDK_LIBS_LIST))
+ifneq ($(DPDK_LIBS),)
+  ifeq ($(DPDK_LIBS),none)
+    DPDK_CONF_OPTS += -Ddisable_libs='*'
+  else
+    DPDK_CONF_OPTS += -Denable_libs='$(DPDK_LIBS)'
+  endif
+endif
+
 ifeq ($(BR2_PACKAGE_DPDK_TESTS),y)
 DPDK_CONF_OPTS += -Dtests=true
 else
-- 
2.43.0



More information about the buildroot mailing list