test for getaddrinfo's that doesn't like numeric services
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10493 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
24
cf/broken-getaddrinfo.m4
Normal file
24
cf/broken-getaddrinfo.m4
Normal file
@@ -0,0 +1,24 @@
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl test if getaddrinfo can handle numeric services
|
||||
|
||||
AC_DEFUN(rk_BROKEN_GETADDRINFO,[
|
||||
AC_CACHE_CHECK([if getaddrinfo handles numeric services], ac_cv_func_getaddrinfo_numserv,
|
||||
AC_TRY_RUN([[#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct addrinfo hints, *ai;
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
hints.ai_socktype = SOCK_STEAM;
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
if(getaddrinfo(NULL, "17", &hints, &ai) == EAI_SERVICE)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
]], ac_cv_func_getaddrinfo_numserv=yes, ac_cv_func_getaddrinfo_numserv=no))])
|
@@ -404,6 +404,13 @@ if test "$ac_cv_func_getnameinfo" = "yes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ac_cv_func_getaddrinfo" = "yes"; then
|
||||
rk_BROKEN_GETADDRINFO
|
||||
if test "$ac_cv_func_getaddrinfo_numserv" = no; then
|
||||
LIBOBJS="$LIBOBJS getaddrinfo.o"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_NEED_PROTO([#include <stdlib.h>], setenv)
|
||||
AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
|
||||
AC_NEED_PROTO([#include <unistd.h>], gethostname)
|
||||
|
Reference in New Issue
Block a user