|
Last change
on this file since 198 was 133, checked in by Paul Smedley, 18 years ago |
|
Update trunk to 3.2.0pre3
|
|
File size:
945 bytes
|
| Line | |
|---|
| 1 | dnl test for getaddrinfo/getnameinfo
|
|---|
| 2 | AC_CACHE_CHECK([for getaddrinfo],libreplace_cv_HAVE_GETADDRINFO,[
|
|---|
| 3 | AC_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 | [
|
|---|
| 12 | struct sockaddr sa;
|
|---|
| 13 | struct addrinfo *ai = NULL;
|
|---|
| 14 | int ret = getaddrinfo(NULL, NULL, NULL, &ai);
|
|---|
| 15 | if (ret != 0) {
|
|---|
| 16 | const char *es = gai_strerror(ret);
|
|---|
| 17 | }
|
|---|
| 18 | freeaddrinfo(ai);
|
|---|
| 19 | ret = getnameinfo(&sa, sizeof(sa),
|
|---|
| 20 | NULL, 0,
|
|---|
| 21 | NULL, 0, 0);
|
|---|
| 22 |
|
|---|
| 23 | ],
|
|---|
| 24 | libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
|
|---|
| 25 | if 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])
|
|---|
| 30 | else
|
|---|
| 31 | LIBREPLACEOBJ="${LIBREPLACEOBJ} getaddrinfo.o"
|
|---|
| 32 | fi
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.