aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-01 17:22:35 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-01 17:22:35 +0000
commitda1f08cd9a6b2d4f2c5957f1b2484e3c20d044ba (patch)
tree7d55b9b343fd5e7944f265f253c4ca795ecbc84f /configure.ac
parentf6aab71cc9c0b6d795c24b37456d173dffc736e2 (diff)
Extend autoconf logic to determine which version of gethostbyname_r is on the system.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77863 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index ec0ec155e..a886ae627 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,7 +262,23 @@ AC_FUNC_VPRINTF
AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
# some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
-AC_CHECK_FUNCS([gethostbyname_r])
+AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([#include <netdb.h>],
+ [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
+ AC_MSG_RESULT(no)
+)
+
+AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([#include <netdb.h>],
+ [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
+ AC_MSG_RESULT(no)
+)
AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
AC_LINK_IFELSE(