]> The Tcpdump Group git mirrors - libpcap/commitdiff
commit e61f27f56bef0f229f0bf02911f76cfcfa12f083
authorGuy Harris <[email protected]>
Thu, 9 Jul 2009 20:55:49 +0000 (13:55 -0700)
committerGuy Harris <[email protected]>
Thu, 9 Jul 2009 20:55:49 +0000 (13:55 -0700)
Author: Peter Volkov <[email protected]>
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.

configure
configure.in

index acba798759bc4065ce376e1a29eabff29b11b49a..83dda299547c31664fb38ae2d6190cdc593249b4 100755 (executable)
--- 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; }
index 88a71efebe29bcefa1b58038f815c986d06b5d56..397a9c7fbb4d8ace2fb834d875c5096441f3a254 100644 (file)
@@ -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