diff options
Diffstat (limited to 'configure.in')
-rwxr-xr-x | configure.in | 97 |
1 files changed, 75 insertions, 22 deletions
diff --git a/configure.in b/configure.in index 8432d2a8538d..b3a10abc488f 100755 --- a/configure.in +++ b/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 |