All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/iproute2: add optional dependency on libbpf
@ 2023-07-03 10:58 Ignacy Gawędzki
  2023-07-03 19:09 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Ignacy Gawędzki @ 2023-07-03 10:58 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
---
 package/iproute2/iproute2.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/iproute2/iproute2.mk b/package/iproute2/iproute2.mk
index 15af076db9..096e650b1d 100644
--- a/package/iproute2/iproute2.mk
+++ b/package/iproute2/iproute2.mk
@@ -38,6 +38,10 @@ ifeq ($(BR2_PACKAGE_BERKELEYDB_COMPAT185),y)
 IPROUTE2_DEPENDENCIES += berkeleydb
 endif
 
+ifeq ($(BR2_PACKAGE_LIBBPF),y)
+IPROUTE2_DEPENDENCIES += libbpf
+endif
+
 define IPROUTE2_CONFIGURE_CMDS
 	cd $(@D) && $(TARGET_CONFIGURE_OPTS) ./configure
 	$(IPROUTE2_DISABLE_IPTABLES)
-- 
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] package/iproute2: add optional dependency on libbpf
  2023-07-03 10:58 [Buildroot] [PATCH] package/iproute2: add optional dependency on libbpf Ignacy Gawędzki
@ 2023-07-03 19:09 ` Thomas Petazzoni via buildroot
  2023-07-03 21:15   ` [Buildroot] [PATCH v2] " Ignacy Gawędzki
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-03 19:09 UTC (permalink / raw)
  To: Ignacy Gawędzki; +Cc: buildroot

Hello Ignacy,

Thanks for the patch!

On Mon, 3 Jul 2023 12:58:19 +0200
Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr> wrote:

> +ifeq ($(BR2_PACKAGE_LIBBPF),y)
> +IPROUTE2_DEPENDENCIES += libbpf
> +endif

Could you test an improved version that passes LIBBPF_FORCE=on in the
enabled case and LIBBPF_FORCE=off in the disabled case?

According to the configure script:

check_force_libbpf_on()
{
    # if set LIBBPF_FORCE=on but no libbpf support, just exist the config
    # process to make sure we don't build without libbpf.
    if [ "$LIBBPF_FORCE" = on ]; then
        echo "  LIBBPF_FORCE=on set, but couldn't find a usable libbpf"
        exit 1
    fi
}

check_libbpf()
{
    # if set LIBBPF_FORCE=off, disable libbpf entirely
    if [ "$LIBBPF_FORCE" = off ]; then
        echo "no"
        return
    fi

Of course, both the enabled and disabled case need to be verified
before submitting v2 :-)

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2] package/iproute2: add optional dependency on libbpf
  2023-07-03 19:09 ` Thomas Petazzoni via buildroot
@ 2023-07-03 21:15   ` Ignacy Gawędzki
  2023-07-10 17:32     ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Ignacy Gawędzki @ 2023-07-03 21:15 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni

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(-)

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
 
-- 
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v2] package/iproute2: add optional dependency on libbpf
  2023-07-03 21:15   ` [Buildroot] [PATCH v2] " Ignacy Gawędzki
@ 2023-07-10 17:32     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-10 17:32 UTC (permalink / raw)
  To: Ignacy Gawędzki; +Cc: buildroot

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
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-10 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 10:58 [Buildroot] [PATCH] package/iproute2: add optional dependency on libbpf Ignacy Gawędzki
2023-07-03 19:09 ` Thomas Petazzoni via buildroot
2023-07-03 21:15   ` [Buildroot] [PATCH v2] " Ignacy Gawędzki
2023-07-10 17:32     ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.