summaryrefslogtreecommitdiff
path: root/source3/lib/replace/libreplace.m4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-10-06 23:07:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:13 -0500
commitd154a0d74b23b4a1fbd921f17dec3e0e3506eeab (patch)
tree3ed018130022385c08bef59fc5e00339af5b336c /source3/lib/replace/libreplace.m4
parentb92212575d370275bf1609cac6bc13c71de472d4 (diff)
downloadsamba-d154a0d74b23b4a1fbd921f17dec3e0e3506eeab.tar.gz
samba-d154a0d74b23b4a1fbd921f17dec3e0e3506eeab.tar.bz2
samba-d154a0d74b23b4a1fbd921f17dec3e0e3506eeab.zip
r25557: merge libreplace fixes from samba4
(This used to be commit 8c1669997c53f0f7bfb9a794083afd01b131f676)
Diffstat (limited to 'source3/lib/replace/libreplace.m4')
-rw-r--r--source3/lib/replace/libreplace.m439
1 files changed, 39 insertions, 0 deletions
diff --git a/source3/lib/replace/libreplace.m4 b/source3/lib/replace/libreplace.m4
index 354349187e..29ec2acdab 100644
--- a/source3/lib/replace/libreplace.m4
+++ b/source3/lib/replace/libreplace.m4
@@ -137,6 +137,45 @@ if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
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
+
+
dnl Provided by replace.c:
AC_TRY_COMPILE([
#include <sys/types.h>