From: nbk Date: Sat, 2 Jun 2007 13:49:58 +0000 (+0000) Subject: Fix gethostbyaddr_r() detection for FreeBSD. (closes: #454) X-Git-Tag: release_1_1_7~56 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=fa600e78c089deb85d7f6b321c2f1f1a5fb67484;p=freeradius.git Fix gethostbyaddr_r() detection for FreeBSD. (closes: #454) Patch from David Wood --- 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