]> The Tcpdump Group git mirrors - tcpslice/commitdiff
autoconf: replace --with-system-libpcap with --disable-local-libpcap.
authorGuy Harris <[email protected]>
Mon, 20 Jul 2020 03:12:32 +0000 (20:12 -0700)
committerDenis Ovsienko <[email protected]>
Sun, 26 Mar 2023 23:28:34 +0000 (00:28 +0100)
(ported from tcpdump commit daff285)

aclocal.m4

index 7306aa0851fb41ac12465d5c27dbd676e3b1e5a3..951b9ef381ee6e3979503714417be5fb6f83f97b 100644 (file)
@@ -362,52 +362,61 @@ dnl
 AC_DEFUN(AC_LBL_LIBPCAP,
 [
     libpcap=FAIL
-    AC_ARG_WITH([system-libpcap],
-        [AS_HELP_STRING([--with-system-libpcap], [don't use local pcap library])],
-        [
+    AC_MSG_CHECKING([whether to look for a local libpcap])
+    AC_ARG_ENABLE(local-libpcap,
+        AS_HELP_STRING([--disable-local-libpcap],
+                       [don't look for a local libpcap @<:@default=check for a local libpcap@:>@]),,
+        enableval=yes)
+    case "$enableval" in
+
+    no)
+        AC_MSG_RESULT(no)
+        #
+        # Don't look for a local libpcap.
+        #
+        using_local_libpcap=no
+        ;;
+       
+    *)
+        AC_MSG_RESULT(yes)
+        #
+        # Look for a local pcap library.
+        #
+        AC_MSG_CHECKING(for local pcap library)
+        lastdir=FAIL
+        places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
+            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
+        places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
+            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
+        for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
+            basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
+                sed -e 's/-PRE-GIT$//' `
+            if test $lastdir = $basedir ; then
+                dnl skip alphas when an actual release is present
+                continue;
+            fi
+            lastdir=$dir
+            if test -r $dir/libpcap.a ; then
+                libpcap=$dir/libpcap.a
+                local_pcap_dir=$dir
+                dnl continue and select the last one that exists
+            fi
+        done
+        if test $libpcap = FAIL ; then
             #
-            # Don't look for a local libpcap.
+            # We didn't find a local libpcap.
             #
-            using_local_libpcap=no
-        ],
-        [
+            AC_MSG_RESULT(not found)
+            using_local_libpcap=no;
+        else
             #
-            # Look for a local pcap library.
+            # We found a local libpcap.
             #
-            AC_MSG_CHECKING(for local pcap library)
-            lastdir=FAIL
-            places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-                egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
-            places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
-                egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
-            for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
-                basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
-                    sed -e 's/-PRE-GIT$//' `
-                if test $lastdir = $basedir ; then
-                    dnl skip alphas when an actual release is present
-                    continue;
-                fi
-                lastdir=$dir
-                if test -r $dir/libpcap.a ; then
-                    libpcap=$dir/libpcap.a
-                    local_pcap_dir=$dir
-                    dnl continue and select the last one that exists
-                fi
-            done
-            if test $libpcap = FAIL ; then
-                #
-                # We didn't find a local libpcap.
-                #
-                AC_MSG_RESULT(not found)
-                using_local_libpcap=no;
-            else
-                #
-                # We found a local libpcap.
-                #
-                AC_MSG_RESULT($libpcap)
-                using_local_libpcap=yes
-            fi
-        ])
+            AC_MSG_RESULT($libpcap)
+            using_local_libpcap=yes
+        fi
+        ;;
+    esac
 
     if test $using_local_libpcap = no ; then
         #