mirror of
https://git.yoctoproject.org/poky
synced 2026-04-13 14:02:21 +02:00
libpcap: Turn canusb support into PACKAGECONFIG
libpcap notices libusb in its configure if its sysrooted and ignores it if its not. But this causes problems since there is no explicit dependency on libusb. Rebuild from shared state sometimes fails when libusb has not been yet populated in sysroot and libpcap has. And do_configure of consumers of libpcap e.g. tcpdump are probing for features on libpcap. All the tests fail since none of link steps succeed and it sees as if libpcap does not have required features and configure of tcpdump bails out. turn canusb into PACKAGECONFIG and let it be disabled by default. Backport additional patches needed for disable-canusb to work (From OE-Core rev: a7cfc0ce9885c51ccefcaba001e6672d7b3e36e5) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,51 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
From fffa60a0693182085a7d4351150137eda26dbf82 Mon Sep 17 00:00:00 2001
|
||||
From: Guy Harris <guy@alum.mit.edu>
|
||||
Date: Wed, 13 Jun 2012 12:20:19 -0700
|
||||
Subject: [PATCH] The leading comma looked weird; remove it.
|
||||
|
||||
That might be how the --disable-canusb bug got in. Hopefully this will
|
||||
make the code look a little clearer and possibly avoid future bugs of
|
||||
that sort.
|
||||
---
|
||||
configure.in | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index d8554ca..ba5b64e 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1371,7 +1371,8 @@ AC_SUBST(NETFILTER_SRC)
|
||||
|
||||
AC_ARG_ENABLE([bluetooth],
|
||||
[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
|
||||
-,enable_bluetooth=yes)
|
||||
+ [],
|
||||
+ [enable_bluetooth=yes])
|
||||
|
||||
if test "x$enable_bluetooth" != "xno" ; then
|
||||
dnl check for Bluetooth sniffing support
|
||||
@@ -1396,7 +1397,8 @@ fi
|
||||
|
||||
AC_ARG_ENABLE([canusb],
|
||||
[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
|
||||
-,enable_canusb=yes)
|
||||
+ [],
|
||||
+ [enable_canusb=yes])
|
||||
|
||||
if test "x$enable_canusb" != "xno" ; then
|
||||
dnl check for canusb support
|
||||
@@ -1422,7 +1424,8 @@ fi
|
||||
|
||||
AC_ARG_ENABLE([can],
|
||||
[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
|
||||
-,enable_can=yes)
|
||||
+ [],
|
||||
+ [enable_can=yes])
|
||||
|
||||
if test "x$enable_can" != "xno" ; then
|
||||
dnl check for CAN sniffing support
|
||||
--
|
||||
1.7.9.5
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
From 2259a62edaf667d4bc9d1a28e612e3a7c0011545 Mon Sep 17 00:00:00 2001
|
||||
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
Date: Sat, 30 Jun 2012 10:48:14 -0700
|
||||
Subject: [PATCH] canusb: needs -lpthread
|
||||
|
||||
canusb uses pthreads, but -lpthread is never added to LIBS hence missing
|
||||
from pcap-config, causing build failures. Fix this.
|
||||
---
|
||||
configure | 2 +-
|
||||
configure.in | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 1368ac5..24587c8 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -11529,7 +11529,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||
_ACEOF
|
||||
|
||||
CANUSB_SRC=pcap-canusb-linux.c
|
||||
- LIBS="-lusb-1.0 $LIBS"
|
||||
+ LIBS="-lusb-1.0 -lpthread $LIBS"
|
||||
{ echo "$as_me:$LINENO: canusb sniffing is supported" >&5
|
||||
echo "$as_me: canusb sniffing is supported" >&6;}
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index ba5b64e..47e0b70 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1408,7 +1408,7 @@ if test "x$enable_canusb" != "xno" ; then
|
||||
[
|
||||
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)
|
||||
--
|
||||
1.7.9.5
|
||||
|
||||
@@ -12,6 +12,7 @@ DEPENDS = "flex-native bison-native libnl"
|
||||
|
||||
PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluetooth', '', d)}"
|
||||
PACKAGECONFIG[bluetooth] = "--enable-bluetooth,--disable-bluetooth,bluez4"
|
||||
PACKAGECONFIG[canusb] = "--enable-canusb,--enable-canusb=no,libusb"
|
||||
|
||||
INC_PR = "r4"
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@ require libpcap.inc
|
||||
PR = "${INC_PR}.0"
|
||||
|
||||
SRC_URI += "file://aclocal.patch \
|
||||
file://ieee80215-arphrd.patch"
|
||||
file://ieee80215-arphrd.patch \
|
||||
file://0001-Fix-disable-canusb.patch \
|
||||
file://0001-The-leading-comma-looked-weird-remove-it.patch \
|
||||
file://0001-canusb-needs-lpthread.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "f78455a92622b7a3c05c58b6ad1cec7e"
|
||||
SRC_URI[sha256sum] = "41cbd9ed68383afd9f1fda279cb78427d36879d9e34ee707e31a16a1afd872b9"
|
||||
|
||||
Reference in New Issue
Block a user