Add checks for gethostbyaddr_r

2002-04-16  Jeffrey Stedfast  <fejj@ximian.com>

	* configure.in: Add checks for gethostbyaddr_r

svn path=/trunk/; revision=16482
This commit is contained in:
Jeffrey Stedfast
2002-04-17 01:16:20 +00:00
committed by Jeffrey Stedfast
parent 710bf52288
commit 37a6a67b83
3 changed files with 42 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2002-04-16 Jeffrey Stedfast <fejj@ximian.com>
* configure.in: Add checks for gethostbyaddr_r
2002-04-14 Jeffrey Stedfast <fejj@ximian.com>
* configure.in: Check for socklen_t and if it doesn't exist,

View File

@ -43,5 +43,8 @@
/* Define if gethostbyname_r takes five arguments */
#undef GETHOSTBYNAME_R_FIVE_ARGS
/* Define if gethostbyaddr_r takes seven arguments */
#undef GETHOSTBYADDR_R_SEVEN_ARGS
/* Define to `int' if your system doesn't have `socklen_t'. */
#undef socklen_t

View File

@ -265,7 +265,7 @@ AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_
int bufsize=BUFSIZE;
int h_errno;
(void)gethostbyname_r( "www.ximian.com", &hent, buffer, bufsize, &h_errno);
(void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno);
],[
ac_cv_gethostbyname_r_five_args=yes
],[
@ -273,10 +273,43 @@ AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_
])
])])
if test x"$ac_cv_gethostbyname_r_five_args" = xyes ; then
if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS)
fi
dnl **************************************************
dnl gethostbyaddr_r prototype
dnl **************************************************
AC_CHECK_FUNCS(gethostbyaddr_r,[
AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r_seven_args,
[
AC_TRY_COMPILE([
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)
],[
struct hostent hent;
char buffer[BUFSIZE];
int bufsize=BUFSIZE;
int h_errno;
(void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno);
],[
ac_cv_gethostbyaddr_r_seven_args=yes
],[
ac_cv_gethostbyaddr_r_seven_args=no
])
])])
if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS)
fi
dnl ***********
dnl * db3 stuff
dnl ***********