summaryrefslogtreecommitdiff
path: root/source3/lib/replace/getaddrinfo.m4
diff options
context:
space:
mode:
authormetze <metze@0c0555d6-39d7-0310-84fc-f1cc0bd64818>2007-10-25 08:43:00 +0000
committerStefan Metzmacher <metze@samba.org>2007-10-25 15:55:19 +0200
commitaae2ebab2d305bc35fef7d1ee435896801379f97 (patch)
tree6dfd5f5aa14cfb77ffe7491d7e5d226f7d6fbcf5 /source3/lib/replace/getaddrinfo.m4
parent899f921c722bb99c04598caa227edb4e4a1093e8 (diff)
downloadsamba-aae2ebab2d305bc35fef7d1ee435896801379f97.tar.gz
samba-aae2ebab2d305bc35fef7d1ee435896801379f97.tar.bz2
samba-aae2ebab2d305bc35fef7d1ee435896801379f97.zip
[libreplace] move and fix getaddrinfo configure checks
- move getaddrinfo check into getaddrinfo.m4 - add getaddrinfo.o to LIBREPLACEOBJ so that we really build the replacements metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25726 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit de01c503f4d16b8c3c0ad75225cf0b1822fd8c7f)
Diffstat (limited to 'source3/lib/replace/getaddrinfo.m4')
-rw-r--r--source3/lib/replace/getaddrinfo.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/lib/replace/getaddrinfo.m4 b/source3/lib/replace/getaddrinfo.m4
new file mode 100644
index 0000000000..92620aa3d0
--- /dev/null
+++ b/source3/lib/replace/getaddrinfo.m4
@@ -0,0 +1,32 @@
+dnl test for getaddrinfo/getnameinfo
+AC_CACHE_CHECK([for getaddrinfo],libreplace_cv_HAVE_GETADDRINFO,[
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <sys/socket.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);
+
+],
+libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
+if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
+ AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo])
+ AC_DEFINE(HAVE_GETNAMEINFO,1,[Whether the system has getnameinfo])
+ AC_DEFINE(HAVE_FREEADDRINFO,1,[Whether the system has freeaddrinfo])
+ AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror])
+else
+ LIBREPLACEOBJ="${LIBREPLACEOBJ} getaddrinfo.o"
+fi