summaryrefslogtreecommitdiffstats
path: root/contrib/libpcap/configure.in
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-05-30 08:02:00 +0000
committerdelphij <delphij@FreeBSD.org>2013-05-30 08:02:00 +0000
commit8be1d9016e057c1f30a906165802d48b52b73938 (patch)
tree5ab08c0c24a5cec0f64a701f8ba689a47b1d5fec /contrib/libpcap/configure.in
parent351801626880685262a58abdd5f5db9dca6da379 (diff)
downloadFreeBSD-src-8be1d9016e057c1f30a906165802d48b52b73938.zip
FreeBSD-src-8be1d9016e057c1f30a906165802d48b52b73938.tar.gz
MFV: libpcap 1.4.0.
MFC after: 4 weeks
Diffstat (limited to 'contrib/libpcap/configure.in')
-rw-r--r--contrib/libpcap/configure.in97
1 files changed, 75 insertions, 22 deletions
diff --git a/contrib/libpcap/configure.in b/contrib/libpcap/configure.in
index 8432d2a..b3a10ab 100644
--- a/contrib/libpcap/configure.in
+++ b/contrib/libpcap/configure.in
@@ -430,19 +430,44 @@ linux)
with_libnl=$withval,,)
if test x$with_libnl != xno ; then
+ have_any_nl="no"
+
#
- # Try libnl 2.x first.
+ # Try libnl 3.x first.
#
- AC_CHECK_LIB(nl, nl_socket_alloc,
+ AC_CHECK_LIB(nl-3, nl_socket_alloc,
[
#
- # Yes, we have libnl 2.x.
+ # Yes, we have libnl 3.x.
#
- LIBS="-lnl-genl -lnl $LIBS"
+ LIBS="-lnl-genl-3 -lnl-3 $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
- AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
- ],
- [
+ AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
+ AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
+ AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
+ V_INCLS="$V_INCLS -I/usr/include/libnl3"
+ have_any_nl="yes"
+ ])
+
+ if test x$have_any_nl = xno ; then
+ #
+ # Try libnl 2.x
+ #
+ AC_CHECK_LIB(nl, nl_socket_alloc,
+ [
+ #
+ # Yes, we have libnl 2.x.
+ #
+ LIBS="-lnl-genl -lnl $LIBS"
+ AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
+ AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
+ AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
+ AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
+ have_any_nl="yes"
+ ])
+ fi
+
+ if test x$have_any_nl = xno ; then
#
# No, we don't; do we have libnl 1.x?
#
@@ -453,16 +478,18 @@ linux)
#
LIBS="-lnl $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
- ],
- [
- #
- # No, we don't have libnl at all.
- #
- if test x$with_libnl = xyes ; then
- AC_MSG_ERROR([libnl support requested but libnl not found])
- fi
+ have_any_nl="yes"
])
- ])
+ fi
+
+ if test x$have_any_nl = xno ; then
+ #
+ # No, we don't have libnl at all.
+ #
+ if test x$with_libnl = xyes ; then
+ AC_MSG_ERROR([libnl support requested but libnl not found])
+ fi
+ fi
fi
AC_CHECK_HEADERS(linux/ethtool.h,,,
@@ -1347,11 +1374,14 @@ linux*)
AC_TRY_COMPILE([
AC_INCLUDES_DEFAULT
#include <sys/socket.h>
+#include <netinet/in.h>
#include <linux/types.h>
#include <linux/netlink.h>
+#include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink.h>
-#include <linux/netfilter/nfnetlink_log.h>],
+#include <linux/netfilter/nfnetlink_log.h>
+#include <linux/netfilter/nfnetlink_queue.h>],
[],
ac_cv_netfilter_can_compile=yes,
ac_cv_netfilter_can_compile=no))
@@ -1371,7 +1401,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
@@ -1382,6 +1413,26 @@ if test "x$enable_bluetooth" != "xno" ; then
AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
BT_SRC=pcap-bt-linux.c
AC_MSG_NOTICE(Bluetooth sniffing is supported)
+
+ #
+ # OK, does struct sockaddr_hci have an hci_channel
+ # member?
+ #
+ AC_MSG_CHECKING(if struct sockaddr_hci has hci_channel member)
+ AC_CACHE_VAL(ac_cv_lbl_sockaddr_hci_has_hci_channel,
+ AC_TRY_COMPILE(
+[
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+],
+ [u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)],
+ ac_cv_lbl_sockaddr_hci_has_hci_channel=yes,
+ ac_cv_lbl_sockaddr_hci_has_hci_channel=no))
+ AC_MSG_RESULT($ac_cv_lbl_sockaddr_hci_has_hci_channel)
+ if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then
+ AC_DEFINE(SOCKADDR_HCI_HAS_HCI_CHANNEL,,
+ [if struct sockaddr_hci has hci_channel member])
+ fi
],
AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
)
@@ -1395,8 +1446,9 @@ if test "x$enable_bluetooth" != "xno" ; then
fi
AC_ARG_ENABLE([canusb],
-[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])]
-,enable_canusb=yes)
+[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
+ [],
+ [enable_canusb=yes])
if test "x$enable_canusb" != "xno" ; then
dnl check for canusb support
@@ -1406,7 +1458,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)
@@ -1422,7 +1474,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
OpenPOWER on IntegriCloud