summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2011-11-01 00:22:25 +0000
committerThomas Habets <thomas@habets.se>2011-11-01 00:22:25 +0000
commita03413aa161cace9733a0a3c3c98420c761484ee (patch)
treef663b25e3bcf27885786c54baa43d1ed0c5168b6 /configure.ac
parent2183af6365b58288830f8ce99d9661ae4cc4e8e2 (diff)
downloadarping-a03413aa161cace9733a0a3c3c98420c761484ee.tar.gz
Added getifaddrs() and native BSD versions of findif.
Native BSD version based off of: http://www.freebsd.org/cgi/query-pr.cgi?pr=122333
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 20 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 97e9397..a30c45a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,19 +60,27 @@ AC_PROG_GCC_TRADITIONAL
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([gettimeofday memset select strchr strdup strerror strstr])
+AC_CHECK_FUNCS([gettimeofday memset select strchr strdup strerror strstr \
+getifaddrs])
-case "$target_os" in
- *linux*)
- AC_LIBOBJ([findif_linux])
- ;;
- *freebsd*|*openbsd*|*solaris*|*darwin*)
- AC_LIBOBJ([findif_bsd])
- ;;
- *)
- AC_LIBOBJ([findif_other])
- ;;
-esac
+if test x$ac_cv_func_getifaddrs = xyes; then
+ AC_LIBOBJ([findif_getifaddrs])
+else
+ case "$target_os" in
+ *linux*)
+ AC_LIBOBJ([findif_linux])
+ ;;
+ *freebsd*|*openbsd*|*darwin*)
+ AC_LIBOBJ([findif_sysctl])
+ ;;
+ *solaris*)
+ AC_LIBOBJ([findif_bsdroute])
+ ;;
+ *)
+ AC_LIBOBJ([findif_other])
+ ;;
+ esac
+fi