source: branches/samba-3.2.x/source/lib/replace/getaddrinfo.m4

Last change on this file was 133, checked in by Paul Smedley, 17 years ago

Update trunk to 3.2.0pre3

File size: 945 bytes
Line 
1dnl test for getaddrinfo/getnameinfo
2AC_CACHE_CHECK([for getaddrinfo],libreplace_cv_HAVE_GETADDRINFO,[
3AC_TRY_LINK([
4#include <sys/types.h>
5#if STDC_HEADERS
6#include <stdlib.h>
7#include <stddef.h>
8#endif
9#include <sys/socket.h>
10#include <netdb.h>],
11[
12struct sockaddr sa;
13struct addrinfo *ai = NULL;
14int ret = getaddrinfo(NULL, NULL, NULL, &ai);
15if (ret != 0) {
16 const char *es = gai_strerror(ret);
17}
18freeaddrinfo(ai);
19ret = getnameinfo(&sa, sizeof(sa),
20 NULL, 0,
21 NULL, 0, 0);
22
23],
24libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
25if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
26 AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo])
27 AC_DEFINE(HAVE_GETNAMEINFO,1,[Whether the system has getnameinfo])
28 AC_DEFINE(HAVE_FREEADDRINFO,1,[Whether the system has freeaddrinfo])
29 AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
30else
31 LIBREPLACEOBJ="${LIBREPLACEOBJ} getaddrinfo.o"
32fi
Note: See TracBrowser for help on using the repository browser.