summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2007-11-13 16:10:24 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2007-11-13 16:10:24 (GMT)
commit106bfb35165b65c6a2dc1920ad7d52b8bec71659 (patch)
tree48e04f4c3fa430bdd7674742dfd6a29579930817 /unix/tcl.m4
parenta11af924b2bb8efa1f392323ec9a5b6047687e7e (diff)
downloadtcl-106bfb35165b65c6a2dc1920ad7d52b8bec71659.zip
tcl-106bfb35165b65c6a2dc1920ad7d52b8bec71659.tar.gz
tcl-106bfb35165b65c6a2dc1920ad7d52b8bec71659.tar.bz2
Added autoconf goo to detect availability of getaddrinfo
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 73c1606..eb2c6b9 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -3006,6 +3006,37 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
])])
#--------------------------------------------------------------------
+# SC_TCL_GETADDRINFO
+#
+# Check if we have 'getaddrinfo'
+#
+# Arguments:
+# None
+#
+# Results:
+# Might define the following vars:
+# HAVE_GETADDRINFO
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETADDRINFO], [AC_CHECK_FUNC(getaddrinfo, [
+ AC_CACHE_CHECK([for getaddrinfo], tcl_cv_api_getaddrinfo, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ const char *name, *port;
+ struct addrinfo *aiPtr, hints;
+ (void)getaddrinfo(name,port, &hints, &aiPtr);
+ (void)freeaddrinfo(aiPtr);
+ ], tcl_cv_api_getaddrinfo=yes, tcl_cv_getaddrinfo=no)])
+ tcl_ok=$tcl_cv_api_getaddrinfo
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETADDRINFO, 1,
+ [Define to 1 if getaddrinfo is available.])
+ fi
+])])
+
+#--------------------------------------------------------------------
# SC_TCL_GETPWUID_R
#
# Check if we have MT-safe variant of getpwuid() and if yes,