From patchwork Tue Jun 26 14:19:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Zacarias X-Patchwork-Id: 167408 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 3EFD2B700D for ; Wed, 27 Jun 2012 00:20:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0169332022; Tue, 26 Jun 2012 14:20:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mtxiMdQXw331; Tue, 26 Jun 2012 14:20:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 51A5731FEA; Tue, 26 Jun 2012 14:20:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 260A68F753 for ; Tue, 26 Jun 2012 14:20:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1A7DF8C8E7 for ; Tue, 26 Jun 2012 14:20:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ytsWTijLIupk for ; Tue, 26 Jun 2012 14:20:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from loknar.toptech.com.ar (loknar.toptech.com.ar [74.118.36.95]) by whitealder.osuosl.org (Postfix) with ESMTPS id E25EA8C7C2 for ; Tue, 26 Jun 2012 14:20:06 +0000 (UTC) Received: from asgard (host99.190-231-12.telecom.net.ar [190.231.12.99]) (authenticated bits=0) by loknar.toptech.com.ar (8.14.5/8.14.5) with ESMTP id q5QEK1IG015674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Jun 2012 11:20:03 -0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zacarias.com.ar; s=dkey; t=1340720405; bh=Tc8gNdz057u2tbE5tsqwJRUVcprRWMlH8Vrns/+Y+HE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=b7gnvoAsFkDOyt1Un9W6D8dBGfOoAGhLgdOMty8feDL56DHzkTI/44FGj2u+Kx5aj neOZfoCOMjolg3mHT3K8xkqO8yIYlDe5EU5BWVB+yZJTIQugLJMsN4EVyuzevxoaqe ZersKLcZecphIWQsyv4XOhp66vPYhNb3Z54iv//s= Received: by asgard (sSMTP sendmail emulation); Tue, 26 Jun 2012 11:20:00 -0300 From: Gustavo Zacarias To: buildroot@busybox.net Date: Tue, 26 Jun 2012 11:19:50 -0300 Message-Id: <1340720390-22117-3-git-send-email-gustavo@zacarias.com.ar> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1340720390-22117-1-git-send-email-gustavo@zacarias.com.ar> References: <1340720390-22117-1-git-send-email-gustavo@zacarias.com.ar> X-Virus-Scanned: clamav-milter 0.97.3 at loknar X-Virus-Status: Clean Subject: [Buildroot] [PATCH 3/3] libpcap: canusb support needs pthreads X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net canusb support in libpcap uses pthreads but the configure script doesn't account for -lpthread usage so it doesn't get added into LIBS which in turn doesn't add the appropiate entry in pcap-config, causing build failures for programs that link to libpcap that don't use pthreads themselves (for example tcpdump). Also add the conditional dependency on BR2_PACKAGE_LIBUSB for canusb. Signed-off-by: Gustavo Zacarias --- .../libpcap/libpcap-canusb-requires-pthread.patch | 29 ++++++++++++++++++++ package/libpcap/libpcap.mk | 3 +- 2 files changed, 31 insertions(+), 1 deletions(-) create mode 100644 package/libpcap/libpcap-canusb-requires-pthread.patch diff --git a/package/libpcap/libpcap-canusb-requires-pthread.patch b/package/libpcap/libpcap-canusb-requires-pthread.patch new file mode 100644 index 0000000..ed3bc1a --- /dev/null +++ b/package/libpcap/libpcap-canusb-requires-pthread.patch @@ -0,0 +1,29 @@ +canusb uses pthreads, but -lpthread is never added to LIBS hence missing +from pcap-config, causing build failures. Fix this. + +Signed-off-by: Gustavo Zacarias + +diff -Nura libpcap-1.3.0.orig//configure libpcap-1.3.0/configure +--- libpcap-1.3.0.orig//configure 2012-06-26 09:42:06.072155279 -0300 ++++ libpcap-1.3.0/configure 2012-06-26 09:42:12.617196326 -0300 +@@ -7607,7 +7607,7 @@ + $as_echo "#define PCAP_SUPPORT_CANUSB 1" >>confdefs.h + + CANUSB_SRC=pcap-canusb-linux.c +- LIBS="-lusb-1.0 $LIBS" ++ LIBS="-lusb-1.0 -lpthread $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: canusb sniffing is supported" >&5 + $as_echo "$as_me: canusb sniffing is supported" >&6;} + +diff -Nura libpcap-1.3.0.orig//configure.in libpcap-1.3.0/configure.in +--- libpcap-1.3.0.orig//configure.in 2012-06-26 09:42:06.067155242 -0300 ++++ libpcap-1.3.0/configure.in 2012-06-26 09:42:22.267256741 -0300 +@@ -1406,7 +1406,7 @@ + [ + AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb]) + CANUSB_SRC=pcap-canusb-linux.c +- LIBS="-lusb-1.0 $LIBS" ++ LIBS="-lusb-1.0 -lpthread $LIBS" + AC_MSG_NOTICE(canusb sniffing is supported) + ], + AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it) diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk index 51e1106..324ec33 100644 --- a/package/libpcap/libpcap.mk +++ b/package/libpcap/libpcap.mk @@ -12,7 +12,8 @@ LIBPCAP_INSTALL_TARGET_OPT= DESTDIR="$(TARGET_DIR)" \ $(if $(BR2_PREFER_STATIC_LIB),install,install-shared) LIBPCAP_INSTALL_STAGING_OPT= DESTDIR="$(STAGING_DIR)" install \ $(if $(BR2_PREFER_STATIC_LIB),,install-shared) -LIBPCAP_DEPENDENCIES = zlib +LIBPCAP_DEPENDENCIES = zlib \ + $(if $(BR2_PACKAGE_LIBUSB),libusb) LIBPCAP_CONF_ENV = ac_cv_linux_vers=2 \ ac_cv_header_linux_wireless_h=yes # configure misdetects this LIBPCAP_CONF_OPT = --disable-yydebug --with-pcap=linux