with_bison
enable_universal
enable_shared
+enable_usb
enable_bluetooth
enable_canusb
enable_can
--disable-universal don't build universal on OS X
--enable-shared build shared libraries [default=yes, if support
available]
+ --enable-usb enable nusb support [default=yes, if support
+ available]
--enable-bluetooth enable Bluetooth support [default=yes, if support
available]
--enable-canusb enable canusb support [default=yes, if support
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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for USB sniffing support" >&5
+# Check whether --enable-usb was given.
+if test "${enable_usb+set}" = set; then :
+ enableval=$enable_usb;
+else
+ enable_usb=yes
+fi
+
+
+if test "x$enable_usb" != "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for USB sniffing support" >&5
$as_echo_n "checking for USB sniffing support... " >&6; }
-case "$host_os" in
-linux*)
+ case "$host_os" in
+ linux*)
$as_echo "#define PCAP_SUPPORT_USB 1" >>confdefs.h
fi
fi
;;
-*)
+ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
;;
esac
+fi
case "$host_os" in
darwin*)
+ #
+ # We don't support D-Bus sniffing on OS X; see
#
# https://bugs.freedesktop.org/show_bug.cgi?id=74029
#
+ # The user requested it, so fail.
+ #
as_fn_error $? "Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X" "$LINENO" 5
- ;;
esac
else
case "$host_os" in
darwin*)
+ #
+ # We don't support D-Bus sniffing on OS X; see
#
# https://bugs.freedesktop.org/show_bug.cgi?id=74029
#
+ # The user dind't explicitly request it, so just
+ # silently refuse to enable it.
+ #
+ enable_dbus="no"
;;
+ esac
+ fi
+fi
- *)
- # Extract the first word of "pkg-config", so it can be a program name with args.
+if test "x$enable_dbus" != "xno"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
fi
- if test "x$PKGCONFIG" != "xno"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for D-Bus" >&5
+ if test "x$PKGCONFIG" != "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for D-Bus" >&5
$as_echo_n "checking for D-Bus... " >&6; }
- if "$PKGCONFIG" dbus-1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ if "$PKGCONFIG" dbus-1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
- DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
- save_CFLAGS="$CFLAGS"
- save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $DBUS_CFLAGS"
- LIBS="$LIBS $DBUS_LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D-Bus library defines dbus_connection_read_write" >&5
+ DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
+ DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $DBUS_CFLAGS"
+ LIBS="$LIBS $DBUS_LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D-Bus library defines dbus_connection_read_write" >&5
$as_echo_n "checking whether the D-Bus library defines dbus_connection_read_write... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
- #include <time.h>
- #include <sys/time.h>
+ #include <time.h>
+ #include <sys/time.h>
- #include <dbus/dbus.h>
+ #include <dbus/dbus.h>
int
main ()
{
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define PCAP_SUPPORT_DBUS 1" >>confdefs.h
- DBUS_SRC=pcap-dbus.c
- V_INCLS="$V_INCLS $DBUS_CFLAGS"
+ DBUS_SRC=pcap-dbus.c
+ V_INCLS="$V_INCLS $DBUS_CFLAGS"
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- if test "x$enable_dbus" = "xyes"; then
- as_fn_error $? "--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()" "$LINENO" 5
- fi
- LIBS="$save_LIBS"
+ if test "x$enable_dbus" = "xyes"; then
+ as_fn_error $? "--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()" "$LINENO" 5
+ fi
+ LIBS="$save_LIBS"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ CFLAGS="$save_CFLAGS"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- if test "x$enable_dbus" = "xyes"; then
- as_fn_error $? "--enable-dbus was given, but the dbus-1 package is not installed" "$LINENO" 5
- fi
- fi
+ if test "x$enable_dbus" = "xyes"; then
+ as_fn_error $? "--enable-dbus was given, but the dbus-1 package is not installed" "$LINENO" 5
fi
- ;;
- esac
+ fi
fi
#
# 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 ${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_SUBST(MAN_FILE_FORMATS)
AC_SUBST(MAN_MISC_INFO)
-dnl check for USB sniffing support
-AC_MSG_CHECKING(for USB sniffing support)
-case "$host_os" in
-linux*)
+AC_ARG_ENABLE([usb],
+[AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=yes, if support available@:>@])],
+ [],
+ [enable_usb=yes])
+
+if test "x$enable_usb" != "xno" ; then
+ dnl check for USB sniffing support
+ AC_MSG_CHECKING(for USB sniffing support)
+ case "$host_os" in
+ linux*)
AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
USB_SRC=pcap-usb-linux.c
AC_MSG_RESULT(yes)
fi
fi
;;
-*)
+ *)
AC_MSG_RESULT(no)
;;
esac
+fi
AC_SUBST(PCAP_SUPPORT_USB)
AC_SUBST(USB_SRC)
if test "x$enable_canusb" != "xno" ; then
dnl check for canusb support
case "$host_os" in
- linux*)
+ linux*|uclinux*)
AC_CHECK_HEADER(libusb-1.0/libusb.h,
[
AC_CHECK_LIB(usb-1.0, libusb_init,
LIBS="-lusb-1.0 -lpthread $LIBS"
ac_lbl_has_libusb=yes
],
- ac_lbl_has_libusb=no
+ ac_lbl_has_libusb=no,
+ -lpthread
)
],
ac_lbl_has_libusb=no
case "$host_os" in
darwin*)
+ #
+ # We don't support D-Bus sniffing on OS X; see
#
# https://bugs.freedesktop.org/show_bug.cgi?id=74029
#
+ # The user requested it, so fail.
+ #
AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X])
- ;;
esac
-- else
++ else
case "$host_os" in
darwin*)
+ #
+ # We don't support D-Bus sniffing on OS X; see
#
# https://bugs.freedesktop.org/show_bug.cgi?id=74029
#
+ # The user dind't explicitly request it, so just
+ # silently refuse to enable it.
+ #
+ enable_dbus="no"
;;
+ esac
+ fi
+fi
- *)
- AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
- if test "x$PKGCONFIG" != "xno"; then
- AC_MSG_CHECKING([for D-Bus])
- if "$PKGCONFIG" dbus-1; then
- AC_MSG_RESULT([yes])
- DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
- DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
- save_CFLAGS="$CFLAGS"
- save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $DBUS_CFLAGS"
- LIBS="$LIBS $DBUS_LIBS"
- AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
- AC_TRY_LINK(
- [#include <string.h>
-
- #include <time.h>
- #include <sys/time.h>
-
- #include <dbus/dbus.h>],
- [return dbus_connection_read_write(NULL, 0);],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
- DBUS_SRC=pcap-dbus.c
- V_INCLS="$V_INCLS $DBUS_CFLAGS"
- ],
- [
- AC_MSG_RESULT([no])
- if test "x$enable_dbus" = "xyes"; then
- AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
- fi
- LIBS="$save_LIBS"
- ])
- CFLAGS="$save_CFLAGS"
- else
- AC_MSG_RESULT([no])
- if test "x$enable_dbus" = "xyes"; then
- AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
- fi
+if test "x$enable_dbus" != "xno"; then
+ AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
+ if test "x$PKGCONFIG" != "xno"; then
+ AC_MSG_CHECKING([for D-Bus])
+ if "$PKGCONFIG" dbus-1; then
+ AC_MSG_RESULT([yes])
+ DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
+ DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $DBUS_CFLAGS"
+ LIBS="$LIBS $DBUS_LIBS"
+ AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
+ AC_TRY_LINK(
+ [#include <string.h>
+
+ #include <time.h>
+ #include <sys/time.h>
+
+ #include <dbus/dbus.h>],
+ [return dbus_connection_read_write(NULL, 0);],
+ [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
+ DBUS_SRC=pcap-dbus.c
+ V_INCLS="$V_INCLS $DBUS_CFLAGS"
+ ],
+ [
+ AC_MSG_RESULT([no])
+ if test "x$enable_dbus" = "xyes"; then
+ AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
fi
+ LIBS="$save_LIBS"
+ ])
+ CFLAGS="$save_CFLAGS"
+ else
+ AC_MSG_RESULT([no])
+ if test "x$enable_dbus" = "xyes"; then
+ AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
fi
- ;;
- esac
+ fi
fi
AC_SUBST(PCAP_SUPPORT_DBUS)
AC_SUBST(DBUS_SRC)
;;
esac
+dnl The packet ring capture facility of Linux, described in
+dnl Documentation/networking/packet_mmap.txt, is not 32/64-bit compatible before
+dnl version 2.6.27. A 32-bit kernel requires a 32-bit userland, and likewise for
+dnl 64-bit. The effect of this is that a 32-bit libpcap binary will not run
+dnl correctly on a 64-bit kernel (the binary will use the wrong offsets into a
+dnl kernel struct). This problem was solved in Linux 2.6.27. Use
+dnl --disable-packet-ring whenever a 32-bit application must run on a 64-bit
+dnl target host, and either the build host or the target host run Linux 2.6.26
+dnl or earlier.
+AC_ARG_ENABLE([packet-ring],
+[AC_HELP_STRING([--enable-packet-ring],[enable Linux packet ring support @<:@default=yes@:>@])],
+,enable_packet_ring=yes)
+
+if test "x$enable_packet_ring" != "xno" ; then
+ AC_DEFINE(PCAP_SUPPORT_PACKET_RING, 1, [use Linux packet ring capture if available])
+ AC_SUBST(PCAP_SUPPORT_PACKET_RING)
+fi
+
AC_PROG_INSTALL
AC_CONFIG_HEADER(config.h)