testsuite: fix testsuite build failure when iproute build without libcap-devel

iproute allows to build without libcap.The testsuite will fail to
compile when libcap dose not exists.It was required in 6d68d7f85d.

Fixes: 6d68d7f85d ("testsuite: fix build failure")
Signed-off-by: gaoxingwang <gaoxingwang1@huawei.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
gaoxingwang 2023-02-10 16:45:31 +08:00 committed by Stephen Hemminger
parent 62566ad5c0
commit c0a06885b9

View File

@ -1,9 +1,13 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
CFLAGS= CFLAGS=
LDLIBS=
include ../../config.mk include ../../config.mk
ifeq ($(HAVE_CAP),y)
LDLIBS+= -lcap
endif
generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.a ../../lib/libutil.a generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.a ../../lib/libutil.a
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -I../../include -I../../include/uapi -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl -lcap $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -I../../include -I../../include/uapi -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl $(LDLIBS)
clean: clean:
rm -f generate_nlmsg rm -f generate_nlmsg