Newer
Older
cares_cv_getservbyport_r="yes"
AC_MSG_RESULT([no])
cares_cv_getservbyport_r="no"
#
if test "$cares_cv_getservbyport_r" != "yes"; then
AC_MSG_CHECKING([deeper for getservbyport_r])
AC_LINK_IFELSE([
getservbyport_r();
AC_MSG_RESULT([yes])
cares_cv_getservbyport_r="yes"
],[
AC_MSG_RESULT([but still no])
cares_cv_getservbyport_r="no"
#
if test "$cares_cv_getservbyport_r" = "yes"; then
AC_MSG_CHECKING([how many arguments getservbyport_r takes])
cares_cv_getservbyport_r_nargs="unknown"
#
AC_COMPILE_IFELSE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
int p1, p5;
char *p2, p4[4096];
struct servent *p3, *p6;
getservbyport_r(p1, p2, p3, p4, p5, &p6);
cares_cv_getservbyport_r_nargs="6"
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
#
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
]],[[
int p1, p5;
char *p2, p4[4096];
struct servent *p3;
getservbyport_r(p1, p2, p3, p4, p5);
]])
],[
cares_cv_getservbyport_r_nargs="5"
])
fi
#
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
]],[[
int p1;
char *p2;
struct servent *p3;
struct servent_data p4;
getservbyport_r(p1, p2, p3, &p4);
]])
],[
cares_cv_getservbyport_r_nargs="4"
])
fi
#
AC_MSG_RESULT([$cares_cv_getservbyport_r_nargs])
#
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
AC_MSG_WARN([HAVE_GETSERVBYPORT_R will not be defined])
AC_DEFINE(HAVE_GETSERVBYPORT_R, 1,
[Specifies whether getservbyport_r is present])
AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $cares_cv_getservbyport_r_nargs,
[Specifies the number of arguments to getservbyport_r])
if test "$cares_cv_getservbyport_r_nargs" = "4" ; then
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
[Specifies the size of the buffer to pass to getservbyport_r])
else
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
[Specifies the size of the buffer to pass to getservbyport_r])
fi