Browse Source

[link-detect] Improve BSD support.
2008-01-11 Ingo Flaschberger <if@xip.at>

* configure.ac: Improve HAVE_BSD_LINK_DETECT test.

Andrew J. Schorr 14 years ago
parent
commit
6418bedf29
2 changed files with 16 additions and 3 deletions
  1. 4 0
      ChangeLog
  2. 12 3
      configure.ac

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+2008-01-11 Ingo Flaschberger <if@xip.at>
+
+	* configure.ac: Improve HAVE_BSD_LINK_DETECT test.
+
 2008-01-10 Ingo Flaschberger <if@xip.at>
 
 	* configure.ac: Define HAVE_BSD_LINK_DETECT if <net/if_media.h> is

+ 12 - 3
configure.ac

@@ -893,9 +893,18 @@ AC_MSG_RESULT(no))
 dnl ---------------------------------------------------------------
 dnl figure out how to check link-state
 dnl ---------------------------------------------------------------
-AC_CHECK_HEADER([net/if_media.h],
-  [AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect])],
-  [], QUAGGA_INCLUDES)
+AC_CHECK_HEADER([net/if.h],
+  [AC_CHECK_HEADER( [net/if_media.h],
+    [m4_define([LINK_DETECT_INCLUDES],
+      QUAGGA_INCLUDES
+      [#include <net/if_media.h>
+    ])
+    AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
+      AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
+      [], LINK_DETECT_INCLUDES)], 
+    [],
+    QUAGGA_INCLUDES)], 
+  [], QUAGGA_INCLUDES )
 
 dnl -----------------------
 dnl check proc file system.