From 43648ae6200153dd978db65df4d4eb99f379247f Mon Sep 17 00:00:00 2001 From: das Date: Wed, 14 Nov 2007 03:51:32 +0000 Subject: sync with tcl/unix/tcl.m4 FossilOrigin-Name: 6722898defdc938fe5cfcafaded80c2d0d32e41c --- unix/tcl.m4 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 73c1606..b240d0b 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 working getaddrinfo], tcl_cv_api_getaddrinfo, [ + AC_TRY_COMPILE([ + #include + ], [ + 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, -- cgit v0.12