if test x$with_libnl != xno ; then
have_any_nl="no"
+ incdir=-I/usr/include/libnl3
+ libnldir=
+ if test x$withval != x ; then
+ libnldir=-L${withval}/lib/.libs
+ incdir=-I${withval}/include
+ fi
+
#
# Try libnl 3.x first.
#
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
- LIBS="-lnl-3 $LIBS"
+ LIBS="-lnl-3 ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#
# Yes, we have libnl 3.x.
#
- LIBS="-lnl-genl-3 -lnl-3 $LIBS"
+ LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
$as_echo "#define HAVE_LIBNL 1" >>confdefs.h
$as_echo "#define HAVE_LIBNL_SOCKETS 1" >>confdefs.h
- V_INCLS="$V_INCLS -I/usr/include/libnl3"
+ V_INCLS="$V_INCLS ${incdir}"
have_any_nl="yes"
fi
#
# Yes, we have libnl 2.x.
#
- LIBS="-lnl-genl -lnl $LIBS"
+ LIBS="${libnldir} -lnl-genl -lnl $LIBS"
$as_echo "#define HAVE_LIBNL 1" >>confdefs.h
#
# Yes.
#
- LIBS="-lnl $LIBS"
+ LIBS="${libnldir} -lnl $LIBS"
$as_echo "#define HAVE_LIBNL 1" >>confdefs.h
if test "${enable_bluetooth+set}" = set; then :
enableval=$enable_bluetooth;
else
- enable_bluetooth=yes
+ enable_bluetooth=ifsupportavailable
fi
BT_MONITOR_SRC=pcap-bt-monitor-linux.c
fi
fi
+ ac_lbl_bluetooth_available=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: Bluetooth sniffing is not supported; install bluez-lib devel to enable it" >&5
-$as_echo "$as_me: Bluetooth sniffing is not supported; install bluez-lib devel to enable it" >&6;}
+ ac_lbl_bluetooth_available=no
fi
+ if test "x$ac_lbl_bluetooth_available" == "xno" ; then
+ if test "x$enable_bluetooth" = "xyes" ; then
+ as_fn_error $? "Bluetooth sniffing is not supported; install bluez-lib devel to enable it" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Bluetooth sniffing is not supported; install bluez-lib devel to enable it" >&5
+$as_echo "$as_me: Bluetooth sniffing is not supported; install bluez-lib devel to enable it" >&6;}
+ fi
+ fi
;;
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: no Bluetooth sniffing support implemented for $host_os" >&5
+ if test "x$enable_bluetooth" = "xyes" ; then
+ as_fn_error $? "no Bluetooth sniffing support implemented for $host_os" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: no Bluetooth sniffing support implemented for $host_os" >&5
$as_echo "$as_me: no Bluetooth sniffing support implemented for $host_os" >&6;}
+ fi
;;
esac
if test "${enable_canusb+set}" = set; then :
enableval=$enable_canusb;
else
- enable_canusb=yes
+ enable_canusb=ifsupportavailable
fi
ac_fn_c_check_header_mongrel "$LINENO" "libusb-1.0/libusb.h" "ac_cv_header_libusb_1_0_libusb_h" "$ac_includes_default"
if test "x$ac_cv_header_libusb_1_0_libusb_h" = xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb_init in -lusb-1.0" >&5
+$as_echo_n "checking for libusb_init in -lusb-1.0... " >&6; }
+if ${ac_cv_lib_usb_1_0_libusb_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lusb-1.0 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char libusb_init ();
+int
+main ()
+{
+return libusb_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_usb_1_0_libusb_init=yes
+else
+ ac_cv_lib_usb_1_0_libusb_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_1_0_libusb_init" >&5
+$as_echo "$ac_cv_lib_usb_1_0_libusb_init" >&6; }
+if test "x$ac_cv_lib_usb_1_0_libusb_init" = xyes; then :
+
$as_echo "#define PCAP_SUPPORT_CANUSB 1" >>confdefs.h
- CANUSB_SRC=pcap-canusb-linux.c
- 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;}
+ CANUSB_SRC=pcap-canusb-linux.c
+ LIBS="-lusb-1.0 -lpthread $LIBS"
+ ac_lbl_has_libusb=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: canusb sniffing is not supported; install libusb1.0 lib devel to enable it" >&5
-$as_echo "$as_me: canusb sniffing is not supported; install libusb1.0 lib devel to enable it" >&6;}
+ ac_lbl_has_libusb=no
fi
+else
+ ac_lbl_has_libusb=no
+
+fi
+
+
+ if test "x$ac_lbl_has_libusb" = "xyes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: canusb sniffing is supported" >&5
+$as_echo "$as_me: canusb sniffing is supported" >&6;}
+ else
+ if test "x$enable_canusb" = "xyes" ; then
+ as_fn_error $? "canusb sniffing is not supported; install libusb1.0 lib devel to enable it" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: canusb sniffing is not supported; install libusb1.0 lib devel to enable it" >&5
+$as_echo "$as_me: canusb sniffing is not supported; install libusb1.0 lib devel to enable it" >&6;}
+ fi
+ fi
;;
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: no canusb support implemented for $host_os" >&5
+ if test "x$enable_canusb" = "xyes" ; then
+ as_fn_error $? "no canusb support implemented for $host_os" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: no canusb support implemented for $host_os" >&5
$as_echo "$as_me: no canusb support implemented for $host_os" >&6;}
+ fi
;;
esac
if test "${enable_can+set}" = set; then :
enableval=$enable_can;
else
- enable_can=yes
+ enable_can=ifsupportavailable
fi
"
if test "x$ac_cv_header_linux_can_h" = xyes; then :
+
$as_echo "#define PCAP_SUPPORT_CAN 1" >>confdefs.h
- CAN_SRC=pcap-can-linux.c
- { $as_echo "$as_me:${as_lineno-$LINENO}: CAN sniffing is supported" >&5
+ CAN_SRC=pcap-can-linux.c
+ { $as_echo "$as_me:${as_lineno-$LINENO}: CAN sniffing is supported" >&5
$as_echo "$as_me: CAN sniffing is supported" >&6;}
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: CAN sniffing is not supported" >&5
+
+ if test "x$enable_can" = "xyes" ; then
+ as_fn_error $? "CAN sniffing is not supported" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: CAN sniffing is not supported" >&5
$as_echo "$as_me: CAN sniffing is not supported" >&6;}
+ fi
+
fi
;;
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: no CAN sniffing support implemented for $host_os" >&5
+ if test "x$enable_can" = "xyes" ; then
+ as_fn_error $? "no CAN sniffing support implemented for $host_os" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: no CAN sniffing support implemented for $host_os" >&5
$as_echo "$as_me: no CAN sniffing support implemented for $host_os" >&6;}
+ fi
;;
esac
#
# Checks to see if Solaris has the public libdlpi(3LIB) library.
# Note: The existence of /usr/include/libdlpi.h does not mean it is the
- # public libdlpi(3LIB) version. Before libdlpi was made public, a
- # private version also existed, which did not have the same APIs.
+ # public libdlpi(3LIB) version. Before libdlpi was made public, a
+ # private version also existed, which did not have the same APIs.
# Due to a gcc bug, the default search path for 32-bit libraries does
# not include /lib, we add it explicitly here.
- # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
+ # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
# Also, due to the bug above applications that link to libpcap with
# libdlpi will have to add "-L/lib" option to "configure".
#
if test x$with_libnl != xno ; then
have_any_nl="no"
+ incdir=-I/usr/include/libnl3
+ libnldir=
+ if test x$withval != x ; then
+ libnldir=-L${withval}/lib/.libs
+ incdir=-I${withval}/include
+ fi
+
#
# Try libnl 3.x first.
#
#
# Yes, we have libnl 3.x.
#
- LIBS="-lnl-genl-3 -lnl-3 $LIBS"
+ LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
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"
+ V_INCLS="$V_INCLS ${incdir}"
have_any_nl="yes"
- ])
+ ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
if test x$have_any_nl = xno ; then
#
#
# Yes, we have libnl 2.x.
#
- LIBS="-lnl-genl -lnl $LIBS"
+ LIBS="${libnldir} -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])
#
# Yes.
#
- LIBS="-lnl $LIBS"
+ LIBS="${libnldir} -lnl $LIBS"
AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
have_any_nl="yes"
])
#include <net/if.h>
#include <net/bpf.h>],
[return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
- [
+ [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
[define if the system supports zerocopy BPF])
if test -z "$dag_lib_dir"; then
dag_lib_dir="$dag_root/lib"
fi
-
+
if test -z "$dag_tools_dir"; then
dag_tools_dir="$dag_root/tools"
fi
AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
LIBS="$LIBS -ldag"
LDFLAGS="$LDFLAGS -L$dag_lib_dir"
-
+
AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
if test "$ac_dag_have_vdag" = 1; then
AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
AC_ARG_ENABLE([bluetooth],
[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
[],
- [enable_bluetooth=yes])
+ [enable_bluetooth=ifsupportavailable])
if test "x$enable_bluetooth" != "xno" ; then
dnl check for Bluetooth sniffing support
BT_MONITOR_SRC=pcap-bt-monitor-linux.c
fi
fi
+ ac_lbl_bluetooth_available=yes
],
- AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
+ ac_lbl_bluetooth_available=no
)
+ if test "x$ac_lbl_bluetooth_available" == "xno" ; then
+ if test "x$enable_bluetooth" = "xyes" ; then
+ AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
+ else
+ AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
+ fi
+ fi
;;
*)
- AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
+ if test "x$enable_bluetooth" = "xyes" ; then
+ AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
+ else
+ AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
+ fi
;;
esac
AC_SUBST(PCAP_SUPPORT_BT)
AC_ARG_ENABLE([canusb],
[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
[],
- [enable_canusb=yes])
+ [enable_canusb=ifsupportavailable])
if test "x$enable_canusb" != "xno" ; then
dnl check for canusb support
linux*)
AC_CHECK_HEADER(libusb-1.0/libusb.h,
[
- AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb])
- CANUSB_SRC=pcap-canusb-linux.c
- LIBS="-lusb-1.0 -lpthread $LIBS"
- AC_MSG_NOTICE(canusb sniffing is supported)
+ AC_CHECK_LIB(usb-1.0, libusb_init,
+ [
+ AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb])
+ CANUSB_SRC=pcap-canusb-linux.c
+ LIBS="-lusb-1.0 -lpthread $LIBS"
+ ac_lbl_has_libusb=yes
+ ],
+ ac_lbl_has_libusb=no
+ )
],
- AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
+ ac_lbl_has_libusb=no
)
+ if test "x$ac_lbl_has_libusb" = "xyes" ; then
+ AC_MSG_NOTICE(canusb sniffing is supported)
+ else
+ if test "x$enable_canusb" = "xyes" ; then
+ AC_MSG_ERROR(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
+ else
+ AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
+ fi
+ fi
;;
*)
- AC_MSG_NOTICE(no canusb support implemented for $host_os)
+ if test "x$enable_canusb" = "xyes" ; then
+ AC_MSG_ERROR(no canusb support implemented for $host_os)
+ else
+ AC_MSG_NOTICE(no canusb support implemented for $host_os)
+ fi
;;
esac
AC_SUBST(PCAP_SUPPORT_CANUSB)
AC_ARG_ENABLE([can],
[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
[],
- [enable_can=yes])
+ [enable_can=ifsupportavailable])
if test "x$enable_can" != "xno" ; then
dnl check for CAN sniffing support
case "$host_os" in
linux*)
AC_CHECK_HEADER(linux/can.h,
- [ AC_DEFINE(PCAP_SUPPORT_CAN, 1, [target host supports CAN sniffing])
- CAN_SRC=pcap-can-linux.c
- AC_MSG_NOTICE(CAN sniffing is supported)],
- AC_MSG_NOTICE(CAN sniffing is not supported),
+ [
+ AC_DEFINE(PCAP_SUPPORT_CAN, 1, [target host supports CAN sniffing])
+ CAN_SRC=pcap-can-linux.c
+ AC_MSG_NOTICE(CAN sniffing is supported)
+ ],
+ [
+ if test "x$enable_can" = "xyes" ; then
+ AC_MSG_ERROR(CAN sniffing is not supported)
+ else
+ AC_MSG_NOTICE(CAN sniffing is not supported)
+ fi
+ ],
[#include <sys/socket.h>]
)
;;
*)
- AC_MSG_NOTICE(no CAN sniffing support implemented for $host_os)
+ if test "x$enable_can" = "xyes" ; then
+ AC_MSG_ERROR(no CAN sniffing support implemented for $host_os)
+ else
+ AC_MSG_NOTICE(no CAN sniffing support implemented for $host_os)
+ fi
;;
esac
AC_SUBST(PCAP_SUPPORT_CAN)