]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Autoconf: Fix formatting of IPv6 results. [skip appveyor]
authorDenis Ovsienko <[email protected]>
Sun, 12 Feb 2023 11:55:02 +0000 (11:55 +0000)
committerDenis Ovsienko <[email protected]>
Sun, 12 Feb 2023 11:55:02 +0000 (11:55 +0000)
Output of the IPv6 part of ./configure used to look OK on Linux:

checking whether the operating system supports IPv6... yes
checking ipv6 stack type... linux-glibc

But it was not OK on most other systems, for example, on FreeBSD:

checking whether the operating system supports IPv6... yes
checking ipv6 stack type... checking how to run the C preprocessor... cc
  -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
kame
You do not have inet6 library, using libc

Get the sequence of these messages right.  Now on Linux this is:

checking whether the operating system supports IPv6... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... (cached) /usr/bin/grep -E
checking ipv6 stack type... linux-glibc

And on FreeBSD it is:

checking whether the operating system supports IPv6... yes
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking ipv6 stack type... kame
You do not have inet6 library, using libc

configure.ac

index 6d6936f2c57e0cf7f8fabd2c1e8d1e811713fd26..96f3f980986bc55cb2705bf6ac723a7784acbe39 100644 (file)
@@ -310,6 +310,15 @@ ipv6lib=none
 ipv6trylibc=no
 
 if test "$ipv6" = "yes"; then
+       # Apparently, only on Linux by this point the configure script knows
+       # what the C preprocessor and the extended regexp grep commands are.
+       # On other OSes the first call to AC_EGREP_CPP() induces a search for
+       # these tools, which prints three lines in the middle of the IPv6
+       # detection message and distorts it.  Resolve these dependencies
+       # beforehand to prevent that.
+       AC_PROG_CPP
+       AC_PROG_EGREP
+
        AC_MSG_CHECKING([ipv6 stack type])
        for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
                case $i in