From patchwork Fri Sep 3 04:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 1524030 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@lists.buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H14pb2GhSz9sCD for ; Fri, 3 Sep 2021 14:40:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DB469425AA; Fri, 3 Sep 2021 04:40:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H65KPLG43A69; Fri, 3 Sep 2021 04:40:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 30B244252E; Fri, 3 Sep 2021 04:40:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 558521BF373 for ; Fri, 3 Sep 2021 04:39:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4BE5482E9D for ; Fri, 3 Sep 2021 04:39:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t-AlGqdiHnor for ; Fri, 3 Sep 2021 04:39:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by smtp1.osuosl.org (Postfix) with ESMTPS id F34328297F for ; Fri, 3 Sep 2021 04:39:56 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id D2D3344042B; Fri, 3 Sep 2021 07:39:36 +0300 (IDT) From: Baruch Siach To: buildroot@busybox.net Date: Fri, 3 Sep 2021 07:39:28 +0300 Message-Id: X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/netsniff-ng: fix static build of mausezahn X-BeenThere: buildroot@lists.buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joris Lijssens Errors-To: buildroot-bounces@lists.buildroot.org Sender: "buildroot" The configure script fails to detect libpcap in static build because it does not take into account the libnl dependency on link. As a result the configure script silently disables mausezahn build even when BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN is enabled. Add upstream patch to use pkg-config for libpcap link flags. Cc: Joris Lijssens Signed-off-by: Baruch Siach --- ...ibpcap-dependencies-using-pkg-config.patch | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 package/netsniff-ng/0001-Detect-libpcap-dependencies-using-pkg-config.patch diff --git a/package/netsniff-ng/0001-Detect-libpcap-dependencies-using-pkg-config.patch b/package/netsniff-ng/0001-Detect-libpcap-dependencies-using-pkg-config.patch new file mode 100644 index 000000000000..bbcbd2bfc391 --- /dev/null +++ b/package/netsniff-ng/0001-Detect-libpcap-dependencies-using-pkg-config.patch @@ -0,0 +1,51 @@ +From 194ec61843b9598ce90873c812b817c4b96e2e0d Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Thu, 2 Sep 2021 12:56:00 +0300 +Subject: [PATCH] Detect libpcap dependencies using pkg-config + +When building statically the link command line must include all +dependencies of all libraries. libpcap can optionally depend on libnl. +mausezahn can't build statically in this case. + +Use pkg-config in configure and in the link command to construct the +library flags we need to link with libpcap. + +Signed-off-by: Baruch Siach +Signed-off-by: Tobias Klauser +--- +Upstream status: commit 194ec61843b9598ce90873c812b817c4b96e2e0d + + configure | 4 +++- + mausezahn/Makefile | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 510826a798f5..598ae2433a7a 100755 +--- a/configure ++++ b/configure +@@ -588,7 +588,9 @@ int main(void) + } + EOF + +- $CC -o $TMPDIR/pcaptest $TMPDIR/pcaptest.c -lpcap >> config.log 2>&1 ++ $CC -o $TMPDIR/pcaptest $TMPDIR/pcaptest.c \ ++ $($PKG_CONFIG --libs libpcap 2>> config.log) \ ++ >> config.log 2>&1 + if [ ! -x $TMPDIR/pcaptest ] ; then + echo "[NO]" + echo "CONFIG_LIBPCAP=0" >> Config +diff --git a/mausezahn/Makefile b/mausezahn/Makefile +index ca16b6579583..9544565355cc 100644 +--- a/mausezahn/Makefile ++++ b/mausezahn/Makefile +@@ -1,6 +1,6 @@ + mausezahn-libs = -lcli \ + -lnet \ +- -lpcap \ ++ $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs libpcap 2> /dev/null ) \ + -lrt \ + -lpthread \ + -lm +-- +2.33.0 +