|
Revision 1147
(checked in by pvanhoof, 2 years ago)
|
Build environment improvements
|
| Line | |
|---|
| 1 |
AC_DEFUN([AC_TNY_GETHOSTBYNAME_CHECK], |
|---|
| 2 |
[ |
|---|
| 3 |
|
|---|
| 4 |
AC_CHECK_FUNCS(gethostbyname_r,[ |
|---|
| 5 |
AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_five_args, |
|---|
| 6 |
[ |
|---|
| 7 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
|---|
| 8 |
#include "confdefs.h" |
|---|
| 9 |
#include <sys/types.h> |
|---|
| 10 |
#include <sys/socket.h> |
|---|
| 11 |
#include <netinet/in.h> |
|---|
| 12 |
#include <netdb.h> |
|---|
| 13 |
|
|---|
| 14 |
#define BUFSIZE (sizeof(struct hostent)+10) |
|---|
| 15 |
]], [[ |
|---|
| 16 |
struct hostent hent; |
|---|
| 17 |
char buffer[BUFSIZE]; |
|---|
| 18 |
int bufsize=BUFSIZE; |
|---|
| 19 |
int h_errno; |
|---|
| 20 |
|
|---|
| 21 |
(void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno); |
|---|
| 22 |
]])],[ |
|---|
| 23 |
ac_cv_gethostbyname_r_five_args=yes |
|---|
| 24 |
],[ |
|---|
| 25 |
ac_cv_gethostbyname_r_five_args=no |
|---|
| 26 |
]) |
|---|
| 27 |
])]) |
|---|
| 28 |
|
|---|
| 29 |
if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then |
|---|
| 30 |
AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r]) |
|---|
| 31 |
fi |
|---|
| 32 |
|
|---|
| 33 |
]) |
|---|
| 34 |
|
|---|