From fa600e78c089deb85d7f6b321c2f1f1a5fb67484 Mon Sep 17 00:00:00 2001 From: nbk Date: Sat, 2 Jun 2007 13:49:58 +0000 Subject: [PATCH] Fix gethostbyaddr_r() detection for FreeBSD. (closes: #454) Patch from David Wood --- configure.in | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 30d5f11..d776f94 100644 --- a/configure.in +++ b/configure.in @@ -845,9 +845,20 @@ gethostbyaddrrstyle="" AC_MSG_CHECKING([gethostbyaddr_r() syntax]) case "$host" in *-freebsd*) - AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE) - gethostbyaddrrstyle=BSD - AC_MSG_WARN([FreeBSD overridden to BSD-style]) +dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r. +dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we +dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU +dnl style support. + AC_CHECK_DECLS([gethostbyaddr_r], [], [ + AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, + [style of gethostbyaddr_r functions ]) + gethostbyaddrrstyle=BSD + AC_MSG_WARN([FreeBSD overridden to BSD-style]) + ], [ +#ifdef HAVE_NETDB_H +#include +#endif +]) ;; esac if test "x$gethostbyaddrrstyle" = "x"; then -- 2.1.4