1
dnl Available from the GNU Autoconf Macro Archive at:
2
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_caolan_func_which_gethostbyname_r.html
4
AC_DEFUN([AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R],
5
[AC_CACHE_CHECK(for which type of gethostbyname_r, ac_cv_func_which_gethostname_r, [
6
AC_CHECK_FUNC(gethostbyname_r, [
13
struct hostent_data data;
14
(void) gethostbyname_r(name, he, &data);
16
],ac_cv_func_which_gethostname_r=three,
18
dnl ac_cv_func_which_gethostname_r=no
23
struct hostent *he, *res;
27
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
28
],ac_cv_func_which_gethostname_r=six,
31
dnl ac_cv_func_which_gethostname_r=no
40
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
41
],ac_cv_func_which_gethostname_r=five,ac_cv_func_which_gethostname_r=no)
48
,ac_cv_func_which_gethostname_r=no)])
50
if test $ac_cv_func_which_gethostname_r = six; then
51
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6)
52
elif test $ac_cv_func_which_gethostname_r = five; then
53
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5)
54
elif test $ac_cv_func_which_gethostname_r = three; then
55
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3)