]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Only compile mnl_utils when HAVE_MNL is defined
authorDavid Ahern <dsahern@gmail.com>
Thu, 3 Dec 2020 04:07:24 +0000 (04:07 +0000)
committerDavid Ahern <dsahern@gmail.com>
Fri, 4 Dec 2020 16:19:05 +0000 (16:19 +0000)
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_MNL.

Fixes: 72858c7b77d0 ("lib: Extract from devlink/mnlg a helper, mnlu_socket_open()")
Signed-off-by: David Ahern <dsahern@gmail.com>
lib/Makefile

index e37585c61340c12ceedcd42953e90ef871365604..764c9137d0ecd188e94a719631d7da7ea09324a7 100644 (file)
@@ -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_MNL),y)
+NLOBJ += mnl_utils.o
+endif
 
 all: libnetlink.a libutil.a