diff mbox series

[v2] package/iproute2: add optional dependency on libbpf

Message ID 20230703211559.qpoachdrbjt43btk@zenon.in.qult.net
State Accepted
Headers show
Series [v2] package/iproute2: add optional dependency on libbpf | expand

Commit Message

Ignacy Gawędzki July 3, 2023, 9:15 p.m. UTC
The configure script will automatically detect used pkg-config if
libbpf is available.

Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
---
v2: Add --libbpf_force to configure, in order to force libbpf support
    depending on BR2_PACKAGE_LIBBPF.

 package/iproute2/iproute2.mk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni July 10, 2023, 5:32 p.m. UTC | #1
On Mon, 3 Jul 2023 23:15:59 +0200
Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr> wrote:

> The configure script will automatically detect used pkg-config if
> libbpf is available.

This sentence in the commit log did not really make sense anymore now
that you have added explicit usage of the --libbpf_force option.

> +IPROUTE2_CONFIGURE_OPTS =

This is not needed, and we rarely do this in Buildroot. Non-existing
variables are by default empty, so doing a += to a non-existing
variable is perfectly correct.

Applied with those two small nits addressed. Thanks a lot!

Thomas
diff mbox series

Patch

diff --git a/package/iproute2/iproute2.mk b/package/iproute2/iproute2.mk
index 15af076db9..5f1154287d 100644
--- a/package/iproute2/iproute2.mk
+++ b/package/iproute2/iproute2.mk
@@ -12,6 +12,7 @@  IPROUTE2_DEPENDENCIES = host-bison host-flex host-pkgconf \
 IPROUTE2_LICENSE = GPL-2.0+
 IPROUTE2_LICENSE_FILES = COPYING
 IPROUTE2_CPE_ID_VENDOR = iproute2_project
+IPROUTE2_CONFIGURE_OPTS =
 
 ifeq ($(BR2_PACKAGE_ELFUTILS),y)
 IPROUTE2_DEPENDENCIES += elfutils
@@ -38,8 +39,16 @@  ifeq ($(BR2_PACKAGE_BERKELEYDB_COMPAT185),y)
 IPROUTE2_DEPENDENCIES += berkeleydb
 endif
 
+ifeq ($(BR2_PACKAGE_LIBBPF),y)
+IPROUTE2_DEPENDENCIES += libbpf
+IPROUTE2_CONFIGURE_OPTS += --libbpf_force on
+else
+IPROUTE2_CONFIGURE_OPTS += --libbpf_force off
+endif
+
 define IPROUTE2_CONFIGURE_CMDS
-	cd $(@D) && $(TARGET_CONFIGURE_OPTS) ./configure
+	cd $(@D) && $(TARGET_CONFIGURE_OPTS) ./configure \
+		$(IPROUTE2_CONFIGURE_OPTS)
 	$(IPROUTE2_DISABLE_IPTABLES)
 endef