[Buildroot] [git commit] package/libnids: disable libnet only if not available

Yann E. MORIN yann.morin.1998 at free.fr
Wed Jun 24 19:16:43 UTC 2020

commit: https://git.buildroot.net/buildroot/commit/?id=9a54b16058e1d3fafdafe1ccb4dad8803cb34312
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

libnids can be built against an existing libnet lib,
take advantage of that.

Unfortunately, pkg-config is not available for libnet,
so configure --with-libnet is our only option at the

--with-libnet expects a build directory,
not an installation path like in our context.
We use --with-libnet=yes to skip tests that would fail.
In this situation, 'LIBNET' goes undefined, so we
need to define it ourselves.
This works because we make sure -lnet is installed
prior anything related to libnids.

Signed-off-by: Guillaume W. Bres <guillaume.bressaix at gmail.com>
[yann.morin.1998 at free.fr: slightly compact the code]
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
 package/libnids/libnids.mk | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/package/libnids/libnids.mk b/package/libnids/libnids.mk
index f0330787c7..4a67215242 100644
--- a/package/libnids/libnids.mk
+++ b/package/libnids/libnids.mk
 LIBNIDS_DEPENDENCIES = host-pkgconf libpcap
-LIBNIDS_CONF_OPTS = --disable-libnet
+# disable libnet if not available
+# Tests in configure.in expect --with-libnet=$build_dir
+# not an installation patch like in our context.
+# We use with-libnet=yes to skip the unusual paths tests.
+# But 'LNETLIB' gets left out, so we need to define it ourselves.
+ifeq ($(BR2_PACKAGE_LIBNET),y)
+LIBNIDS_CONF_OPTS += --enable-libnet --with-libnet=yes LNETLIB=-lnet
+LIBNIDS_CONF_OPTS += --disable-libnet
 # disable libglib2 if not available
 # The test in configure.in is flawed: passing --enable-libglib would also

More information about the buildroot mailing list