aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-01 17:27:09 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-01 17:27:09 +0000
commit7ed3cf54d1efee3f31b671017bc2833ba3120c25 (patch)
tree9a7a4dc2a09f2799f149891b9d1842f709aac968 /configure.ac
parentb3ceaa6a9ef31d084b0eb8cfa4717cebfe9298ed (diff)
Merged revisions 77863 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77863 | file | 2007-08-01 14:22:35 -0300 (Wed, 01 Aug 2007) | 2 lines Extend autoconf logic to determine which version of gethostbyname_r is on the system. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77864 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 7deedc9c8..66e1cf76b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -284,7 +284,23 @@ AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd getho
AC_CHECK_FUNCS([funopen fopencookie])
# 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_CHECK_HEADER([byteswap.h], [AC_DEFINE_UNQUOTED([HAVE_BYTESWAP_H], 1, [Define to 1 if byteswap.h macros are available.])])