]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
testsuite: fix testsuite build failure when iproute build without libcap-devel
authorgaoxingwang <gaoxingwang1@huawei.com>
Fri, 10 Feb 2023 08:45:31 +0000 (16:45 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sat, 18 Feb 2023 01:40:42 +0000 (17:40 -0800)
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>
testsuite/tools/Makefile

index e0162ccc270c933bd141fc9b1b04a7ed652d9c03..0356ddaeab55ddb6b4fe723ab6292dcd8286c158 100644 (file)
@@ -1,9 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS=
+LDLIBS=
 include ../../config.mk
+ifeq ($(HAVE_CAP),y)
+LDLIBS+= -lcap
+endif
 
 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:
        rm -f generate_nlmsg