summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-02 11:22:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-02 11:22:40 (GMT)
commitdc81b2efafb3f33e0da6dc17a3e1a4746da91fd6 (patch)
treedf018372c15ff97c102d01257bfd8d8aca45fb81 /unix/tcl.m4
parentf512f6d8d5b94d39b6b66c6f361ba026ba439e96 (diff)
downloadtcl-dc81b2efafb3f33e0da6dc17a3e1a4746da91fd6.zip
tcl-dc81b2efafb3f33e0da6dc17a3e1a4746da91fd6.tar.gz
tcl-dc81b2efafb3f33e0da6dc17a3e1a4746da91fd6.tar.bz2
Fix [16768d65f0]: Fix gethostbyname_r and gethostbyaddr_r detection on NetBSD. Patch by Kamil Rytarowski.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m430
1 files changed, 28 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 6660255..7936470 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2910,7 +2910,20 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
#
#--------------------------------------------------------------------
-AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [
+ # Avoids picking hidden internal symbol from libc
+ SC_TCL_GETHOSTBYADDR_R_DECL
+
+ if test "$tcl_cv_api_gethostbyaddr_r" = yes; then
+ SC_TCL_GETHOSTBYADDR_R_TYPE
+ fi
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_DECL], [AC_CHECK_DECLS(gethostbyaddr_r, [
+ tcl_cv_api_gethostbyaddr_r=yes],[tcl_cv_api_gethostbyaddr_r=no],[#include <netdb.h>])
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [
AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [
AC_TRY_COMPILE([
#include <netdb.h>
@@ -2978,7 +2991,20 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
#
#--------------------------------------------------------------------
-AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [
+ # Avoids picking hidden internal symbol from libc
+ SC_TCL_GETHOSTBYNAME_R_DECL
+
+ if test "$tcl_cv_api_gethostbyname_r" = yes; then
+ SC_TCL_GETHOSTBYNAME_R_TYPE
+ fi
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_DECL], [AC_CHECK_DECLS(gethostbyname_r, [
+ tcl_cv_api_gethostbyname_r=yes],[tcl_cv_api_gethostbyname_r=no],[#include <netdb.h>])
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [
AC_TRY_COMPILE([
#include <netdb.h>