]> The Tcpdump Group git mirrors - tcpdump/commitdiff
configure: don't use egrep, use $EGREP.
authorGuy Harris <[email protected]>
Sun, 12 Feb 2023 10:23:18 +0000 (02:23 -0800)
committerGuy Harris <[email protected]>
Sun, 12 Feb 2023 10:23:18 +0000 (02:23 -0800)
POSIX does not require that a system support egrep; it requires that it
support grep -E.  In AC_LBL_LIBPCAP, use AC_PROG_EGREP to check for a
command that supports egrep-style expressions, and use $EGREP rather
than egrep in subsequent commands.

This squelches warnings on platforms where egrep prints a warning
suggesting that grep -E be used instead.

aclocal.m4

index 1a97a7253cf3799c142e27c5b2e14c73b910e9d3..ea5cffc8ca5a1e8b20d0164e5ca7ca1e66c7bfdf 100644 (file)
@@ -404,7 +404,9 @@ dnl $2 (incls appended)
 dnl    LIBS
 dnl
 AC_DEFUN(AC_LBL_LIBPCAP,
 dnl    LIBS
 dnl
 AC_DEFUN(AC_LBL_LIBPCAP,
-    [AC_REQUIRE([AC_LBL_LIBRARY_NET])
+[
+    AC_REQUIRE([AC_PROG_EGREP])
+    AC_REQUIRE([AC_LBL_LIBRARY_NET])
     libpcap=FAIL
     AC_MSG_CHECKING([whether to look for a local libpcap])
     AC_ARG_ENABLE(local-libpcap,
     libpcap=FAIL
     AC_MSG_CHECKING([whether to look for a local libpcap])
     AC_ARG_ENABLE(local-libpcap,
@@ -429,9 +431,9 @@ AC_DEFUN(AC_LBL_LIBPCAP,
         AC_MSG_CHECKING(for local pcap library)
         lastdir=FAIL
         places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
         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|rc.)?$'`
+            $EGREP '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT|rc.)?$'`
         places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
         places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
-            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT|rc.)?$'`
+            $EGREP '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT|rc.)?$'`
         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$//' `
         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$//' `
@@ -729,9 +731,9 @@ AC_DEFUN(AC_LBL_LIBPCAP,
             # Make sure it has a pcap.h file.
             #
             places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
             # Make sure it has a pcap.h file.
             #
             places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-                egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+                $EGREP '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
             places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
             places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
-                egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+                $EGREP '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
             pcapH=FAIL
             if test -r $local_pcap_dir/pcap.h; then
                 pcapH=$local_pcap_dir
             pcapH=FAIL
             if test -r $local_pcap_dir/pcap.h; then
                 pcapH=$local_pcap_dir