Skip to content

Sloppy header file testing in configure [with patch] #243

@Rhialto

Description

@Rhialto

When compiling the version as of today on NetBSD 7, configure complains that IPv6 headers are not found, even though they are there. (NetBSD was one of the first OSes to support IPv6). It turns out the header file testing is sloppy; headers are attempted to be included even if they may not exists and are unneeded. Here's a diff. Attaching the file fails.

The first change, for net/if_var.h looks like a typo (the variable that is set does not match the file name). But it seems unused anyway.

diff --git a/configure.ac b/configure.ac
index d07f8e79..dc935598 100644
--- a/configure.ac
+++ b/configure.ac
@@ -737,7 +737,7 @@ AC_CHECK_HEADERS( linux/ipv6.h,   [hc_cv_have_linux_ipv6_h=yes],   [hc_cv_have_l
       #include <sys/socket.h>
     #endif
 ] )
-AC_CHECK_HEADERS( net/if_var.h,   [hc_cv_have_net_in_var_h=yes],   [hc_cv_have_net_in_var_h=no],
+AC_CHECK_HEADERS( net/if_var.h,   [hc_cv_have_net_if_var_h=yes],   [hc_cv_have_net_if_var_h=no],
 [
     #include <sys/types.h>
     #ifdef HAVE_SYS_SOCKET_H
@@ -753,8 +753,10 @@ AC_CHECK_HEADERS( netinet/in_var.h,  [hc_cv_have_netinet_in_var_h=yes],  [hc_cv_
     #ifdef HAVE_SYS_SOCKET_H
       #include <sys/socket.h>
     #endif
-    #ifdef HAVE_NET_IF_VAR_H
+    #ifdef HAVE_NET_IF_H
       #include <net/if.h>
+    #endif
+    #ifdef HAVE_NET_IF_VAR_H
       #include <net/if_var.h>
     #endif
     #ifdef HAVE_NETINET_IN_H
@@ -767,8 +769,10 @@ AC_CHECK_HEADERS( netinet6/in6_var.h,  [hc_cv_have_netinet6_in6_var_h=yes],  [hc
     #ifdef HAVE_SYS_SOCKET_H
       #include <sys/socket.h>
     #endif
-    #ifdef HAVE_NET_IF_VAR_H
+    #ifdef HAVE_NET_IF_H
       #include <net/if.h>
+    #endif
+    #ifdef HAVE_NET_IF_VAR_H
       #include <net/if_var.h>
     #endif
     #ifdef HAVE_NETINET_IN_VAR_H
@@ -1222,10 +1226,16 @@ AC_CHECK_MEMBERS( [struct in6_ifreq.ifr_ifru.ifru_flags],
     #ifdef HAVE_LINUX_IPV6_H
       #include <linux/ipv6.h>
     #endif
-    #ifdef HAVE_NETINET6_IN6_VAR_H
+    #ifdef HAVE_NET_IF_H
       #include <net/if.h>
+    #endif
+    #ifdef HAVE_NET_IF_VAR_H
       #include <net/if_var.h>
+    #endif
+    #ifdef HAVE_NETINET_IN_H
       #include <netinet/in.h>
+    #endif
+    #ifdef HAVE_NETINET6_IN6_VAR_H
       #include <netinet/in_var.h>  // Not the ipv6 file, please
     #endif
 ] )

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions