[link-detect] Improve BSD support.
2008-01-11 Ingo Flaschberger <if@xip.at>
* configure.ac: Improve HAVE_BSD_LINK_DETECT test.
diff --git a/configure.ac b/configure.ac
index 7f061bb..5e1fc96 100755
--- a/configure.ac
+++ b/configure.ac
@@ -893,9 +893,18 @@
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.