diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-04 17:20:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:31:10 -0500 |
commit | 941544a9514aaae89268bc9d689705ad0724119e (patch) | |
tree | 1f75125cb1226f2d3fd0031e5dc1e056c6e896e7 /source3/configure.in | |
parent | 5a3dcd8dd602dd59f3bfb1c397f80a6be3755df3 (diff) | |
download | samba-941544a9514aaae89268bc9d689705ad0724119e.tar.gz samba-941544a9514aaae89268bc9d689705ad0724119e.tar.bz2 samba-941544a9514aaae89268bc9d689705ad0724119e.zip |
r25505: Add a replacement (IPv4 only) implementation of getaddrinfo/freeaddrinfo
under the 2 clause *BSD license for future use in IPv6 code. Original
code was from PostgreSQL and I've maintained their license even though
I've rewritten large parts of it (I probably should donate this back
to them).
Jeremy.
(This used to be commit 760d993340a966269d71acfb7a6b5e4d3776ac5d)
Diffstat (limited to 'source3/configure.in')
-rw-r--r-- | source3/configure.in | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/source3/configure.in b/source3/configure.in index 1a74583b3b..dd9d296f64 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1370,7 +1370,7 @@ AC_CHECK_FUNCS(syslog vsyslog timegm) AC_CHECK_FUNCS(setlocale nl_langinfo) AC_CHECK_FUNCS(nanosleep) AC_CHECK_FUNCS(mlock munlock mlockall munlockall) -AC_CHECK_FUNCS(memalign posix_memalign) +AC_CHECK_FUNCS(memalign posix_memalign hstrerror) AC_CHECK_HEADERS(sys/mman.h) # setbuffer, shmget, shm_open are needed for smbtorture AC_CHECK_FUNCS(setbuffer shmget shm_open) @@ -3195,18 +3195,55 @@ if test x"$samba_cv_HAVE_IPV6" = x"yes"; then fi dnl test for struct sockaddr_storage -AC_CACHE_CHECK([for ipv6 support],samba_cv_HAVE_SOCKADDR_STORAGE,[ +AC_CACHE_CHECK([for ipv6 support],samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE,[ AC_TRY_COMPILE([ #include <sys/socket.h> #include <sys/types.h>], [ struct sockaddr_storage sa_store; ], -samba_cv_HAVE_SOCKADDR_STORAGE=yes,samba_cv_HAVE_SOCKADDR_STORAGE=no)]) -if test x"$samba_cv_HAVE_SOCKADDR_STORAGE" = x"yes"; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[Whether the system has struct sockaddr_storage]) +samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE=yes,samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE=no)]) +if test x"$samba_cv_HAVE_STRUCT_SOCKADDR_STORAGE" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,1,[Whether the system has struct sockaddr_storage]) fi +dnl test for struct addrinfo +AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[ +AC_TRY_COMPILE([ +#include <sys/types.h> +#include <sys/socket.h> +#include <netdb.h>], +[ +struct addrinfo ai; +], +samba_cv_HAVE_STRUCT_ADDRINFO=yes,samba_cv_HAVE_STRUCT_ADDRINFO=no)]) +if test x"$samba_cv_HAVE_STRUCT_ADDRINFO" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,[Whether the system has struct addrinfo]) +fi + +dnl test for getaddrinfo/getnameinfo +AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[ +AC_TRY_COMPILE([ +#include <sys/socket.h> +#include <sys/types.h> +#include <netdb.h>], +[ +struct sockaddr sa; +struct addrinfo *ai = NULL; +int ret = getaddrinfo(NULL, NULL, NULL, &ai); +if (ret != 0) { + const char *es = gai_strerror(ret); +} +freeaddrinfo(ai); +ret = getnameinfo(&sa, sizeof(sa), + NULL, 0, + NULL, 0, 0); + +], +samba_cv_HAVE_GETADDRINFO=yes,samba_cv_HAVE_GETADDRINFO=no)]) +if test x"$samba_cv_HAVE_GETADDRINFO" = x"yes"; then + AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo and getnameinfo]) +fi ################################################ # look for a method of setting the effective uid |