From patchwork Fri Feb 10 08:45:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gaoxingwang X-Patchwork-Id: 13135497 X-Patchwork-Delegate: stephen@networkplumber.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59687C05027 for ; Fri, 10 Feb 2023 08:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbjBJIpJ (ORCPT ); Fri, 10 Feb 2023 03:45:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjBJIpI (ORCPT ); Fri, 10 Feb 2023 03:45:08 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92280113E2 for ; Fri, 10 Feb 2023 00:45:06 -0800 (PST) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PCnLL1LgxznVx5; Fri, 10 Feb 2023 16:42:50 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpemm500012.china.huawei.com (7.185.36.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 10 Feb 2023 16:45:04 +0800 From: gaoxingwang To: , CC: , , , Subject: [PATCH] testsuite: fix testsuite build failure when iproute build without libcap-devel Date: Fri, 10 Feb 2023 16:45:31 +0800 Message-ID: <20230210084531.98534-1-gaoxingwang1@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500012.china.huawei.com (7.185.36.89) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- testsuite/tools/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testsuite/tools/Makefile b/testsuite/tools/Makefile index e0162cc..0356dda 100644 --- a/testsuite/tools/Makefile +++ b/testsuite/tools/Makefile @@ -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