Only compile mnl_utils when HAVE_MNL is defined

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: 72858c7b77 ("lib: Extract from devlink/mnlg a helper, mnlu_socket_open()")
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2020-12-03 04:07:24 +00:00
parent ea130da81e
commit b3c4a55064
1 changed files with 4 additions and 1 deletions

View 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