Only compile mnl_utils when HAVE_LIBMNL is defined
Subsystems (3)
PATCH 1/1 Only compile mnl_utils when HAVE_LIBMNL is defined
From: David Ahern <[email protected]>
New lib/mnl_utils.c fails to compile if libmnl is not installed:
mnl_utils.c:9:10: fatal error: libmnl/libmnl.h: No such file or directory
9 | #include <libmnl/libmnl.h>
Make it dependent on HAVE_LIBMNL.
Fixes 72858c7b77d0 ("lib: Extract from devlink/mnlg a helper, mnlu_socket_open()")
Signed-off-by David Ahern <[email protected]>
--- lib/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
lib/Makefile +4 -1
@@ -13,7 +13,10 @@ UTILOBJ += bpf_libbpf.o endif endif -NLOBJ=libgenl.o libnetlink.o mnl_utils.o +NLOBJ=libgenl.o libnetlink.o +ifeq ($(HAVE_LIBMNL),y) +NLOBJ += mnl_utils.o +endif all: libnetlink.a libutil.a
Signature · 1 line
2.27.0
lib/Makefile UTILOBJ += bpf_libbpf.o · line 17
Quoted 11 lines · David Ahern
lib/Makefile +2
-1@@ -13,7 +13,10 @@ UTILOBJ += bpf_libbpf.o endif endif -NLOBJ=libgenl.o libnetlink.o mnl_utils.o +NLOBJ=libgenl.o libnetlink.o +ifeq ($(HAVE_LIBMNL),y)
This should test HAVE_MNL, not HAVE_LIBMNL.
Quoted 11 lines · Petr Machata
Quoted 8 lines · David Ahern
lib/Makefile +0
-0@@ -13,7 +13,10 @@ UTILOBJ += bpf_libbpf.o endif endif
Quoted 6 lines
lib/Makefile UTILOBJ += bpf_libbpf.o · line 17
Quoted 3 lines
lib/Makefile +2
-1-NLOBJ=libgenl.o libnetlink.o mnl_utils.o +NLOBJ=libgenl.o libnetlink.o +ifeq ($(HAVE_LIBMNL),y)This should test
HAVE_MNL, notHAVE_LIBMNL.
d'oh. thanks for catching that.