summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-01-22 02:04:35 -0800
committerGuy Harris <guy@alum.mit.edu>2018-01-22 02:04:49 -0800
commit7094894ebcbf3e7ea78a558c63045445488e346d (patch)
tree268ec8caa0ab43cc11b8c1c1b80346cd0bb4c204
parent6ca296fa71897ef62ab158e3e5c8703e4d0be9f9 (diff)
downloadtcpdump-7094894ebcbf3e7ea78a558c63045445488e346d.tar.gz
Don't check for netinet/if_ether.h unless we need it.
We only use it in addrtoname.c to declare ether_ntohost(), so there's no need to check for it unless we have ether_ntohost() and there's no other header that declares it.
-rw-r--r--CMakeLists.txt1
-rwxr-xr-xconfigure63
-rw-r--r--configure.ac26
3 files changed, 26 insertions, 64 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff0f54fe..2c22f8e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,7 +120,6 @@ if(HAVE_NET_PFVAR_H)
set(LOCALSRC print-pflog.c ${LOCALSRC})
endif(HAVE_NET_IF_PFLOG_H)
endif(HAVE_NET_PFVAR_H)
-check_include_file(netinet/if_ether.h HAVE_NETINET_IF_ETHER_H)
#
# You are in a twisty little maze of UN*Xes, all different.
diff --git a/configure b/configure
index 1587a589..452372d8 100755
--- a/configure
+++ b/configure
@@ -4074,50 +4074,6 @@ done
LOCALSRC="print-pflog.c $LOCALSRC"
fi
fi
-for ac_header in netinet/if_ether.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "#include <sys/types.h>
-#include <sys/socket.h>
-"
-if test "x$ac_cv_header_netinet_if_ether_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NETINET_IF_ETHER_H 1
-_ACEOF
-
-fi
-
-done
-
-if test "$ac_cv_header_netinet_if_ether_h" != yes; then
- #
- # The simple test didn't work.
- # Do we need to include <net/if.h> first?
- # Unset ac_cv_header_netinet_if_ether_h so we don't
- # treat the previous failure as a cached value and
- # suppress the next test.
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rechecking with some additional includes" >&5
-$as_echo "$as_me: Rechecking with some additional includes" >&6;}
- unset ac_cv_header_netinet_if_ether_h
- for ac_header in netinet/if_ether.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-struct mbuf;
-struct rtentry;
-#include <net/if.h>
-"
-if test "x$ac_cv_header_netinet_if_ether_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_NETINET_IF_ETHER_H 1
-_ACEOF
-
-fi
-
-done
-
-fi
case "$host_os" in
@@ -5827,6 +5783,25 @@ if test "$ac_cv_func_ether_ntohost" = yes -a \
#
# OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
#
+ for ac_header in netinet/if_ether.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+struct mbuf;
+struct rtentry;
+#include <net/if.h>
+"
+if test "x$ac_cv_header_netinet_if_ether_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINET_IF_ETHER_H 1
+_ACEOF
+
+fi
+
+done
+
if test "$ac_cv_header_netinet_if_ether_h" = yes; then
#
# Yes. Does it declare ether_ntohost()?
diff --git a/configure.ac b/configure.ac
index f33f2da6..d47b2fdc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,25 +37,6 @@ if test "$ac_cv_header_net_pfvar_h" = yes; then
LOCALSRC="print-pflog.c $LOCALSRC"
fi
fi
-AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
-#include <sys/socket.h>])
-if test "$ac_cv_header_netinet_if_ether_h" != yes; then
- #
- # The simple test didn't work.
- # Do we need to include <net/if.h> first?
- # Unset ac_cv_header_netinet_if_ether_h so we don't
- # treat the previous failure as a cached value and
- # suppress the next test.
- #
- AC_MSG_NOTICE([Rechecking with some additional includes])
- unset ac_cv_header_netinet_if_ether_h
- AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-struct mbuf;
-struct rtentry;
-#include <net/if.h>])
-fi
case "$host_os" in
@@ -491,6 +472,13 @@ if test "$ac_cv_func_ether_ntohost" = yes -a \
#
# OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
#
+ AC_CHECK_HEADERS(netinet/if_ether.h, , , [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+struct mbuf;
+struct rtentry;
+#include <net/if.h>])
if test "$ac_cv_header_netinet_if_ether_h" = yes; then
#
# Yes. Does it declare ether_ntohost()?