From: Guy Harris Date: Thu, 9 Jul 2009 20:55:49 +0000 (-0700) Subject: commit e61f27f56bef0f229f0bf02911f76cfcfa12f083 X-Git-Tag: libpcap-1.1.0~120 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/6f7074d4b01554ff275223c12244d5db9d2be75f commit e61f27f56bef0f229f0bf02911f76cfcfa12f083 Author: Peter Volkov Date: Wed Jul 8 16:06:18 2009 +0400 Add --without-libnl configure switch Allow build libpcap with libnl disabled even in case libnl is installed at system. --- diff --git a/configure b/configure index acba7987..83dda299 100755 --- a/configure +++ b/configure @@ -1299,6 +1299,8 @@ Optional Packages: --without-gcc don't use gcc --with-sita include SITA support --with-pcap=TYPE use packet capture TYPE + --without-libnl disable libnl support [default=yes, on Linux, if + present] --with-dag[=DIR] include Endace DAG support ["yes", "no" or DIR; default="yes" on BSD and Linux if present] --with-dag-includes=DIR Endace DAG include directory @@ -7283,7 +7285,15 @@ done # # Do we have libnl? # - { echo "$as_me:$LINENO: checking for nl_handle_alloc in -lnl" >&5 + +# Check whether --with-libnl was given. +if test "${with_libnl+set}" = set; then + withval=$with_libnl; with_libnl=$withval +fi + + + if test x$with_libnl != xno ; then + { echo "$as_me:$LINENO: checking for nl_handle_alloc in -lnl" >&5 echo $ECHO_N "checking for nl_handle_alloc in -lnl... $ECHO_C" >&6; } if test "${ac_cv_lib_nl_nl_handle_alloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7351,8 +7361,16 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_LIBNL 1 _ACEOF +else + if test x$with_libnl = xyes ; then + { { echo "$as_me:$LINENO: error: libnl support requested but libnl not found" >&5 +echo "$as_me: error: libnl support requested but libnl not found" >&2;} + { (exit 1); exit 1; }; } + fi + fi + fi { echo "$as_me:$LINENO: checking if if_packet.h has tpacket_stats defined" >&5 echo $ECHO_N "checking if if_packet.h has tpacket_stats defined... $ECHO_C" >&6; } diff --git a/configure.in b/configure.in index 88a71efe..397a9c7f 100644 --- a/configure.in +++ b/configure.in @@ -437,9 +437,19 @@ linux) # # Do we have libnl? # - AC_CHECK_LIB(nl, nl_handle_alloc, - LIBS="-lnl $LIBS" - AC_DEFINE(HAVE_LIBNL,1,[if libnl exists]),) + AC_ARG_WITH(libnl, + AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]), + with_libnl=$withval,,) + + if test x$with_libnl != xno ; then + AC_CHECK_LIB(nl, nl_handle_alloc, + LIBS="-lnl $LIBS" + AC_DEFINE(HAVE_LIBNL,1,[if libnl exists]), + if test x$with_libnl = xyes ; then + AC_MSG_ERROR([libnl support requested but libnl not found]) + fi + ) + fi AC_LBL_TPACKET_STATS AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI