From f512f6d8d5b94d39b6b66c6f361ba026ba439e96 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 1 Oct 2019 21:29:09 +0000 Subject: Correct typo's in tcl.m4. Found by Kamil Rytarowski --- unix/tcl.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 38f1377..6660255 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2971,10 +2971,10 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [ # Results: # # Might define the following vars: -# HAVE_GETHOSTBYADDR_R -# HAVE_GETHOSTBYADDR_R_3 -# HAVE_GETHOSTBYADDR_R_5 -# HAVE_GETHOSTBYADDR_R_6 +# HAVE_GETHOSTBYNAME_R +# HAVE_GETHOSTBYNAME_R_3 +# HAVE_GETHOSTBYNAME_R_5 +# HAVE_GETHOSTBYNAME_R_6 # #-------------------------------------------------------------------- -- cgit v0.12 From dc81b2efafb3f33e0da6dc17a3e1a4746da91fd6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Oct 2019 11:22:40 +0000 Subject: Fix [16768d65f0]: Fix gethostbyname_r and gethostbyaddr_r detection on NetBSD. Patch by Kamil Rytarowski. --- unix/configure | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ unix/tcl.m4 | 30 ++++++++++- 2 files changed, 190 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index aedf8ff..3ac5145 100755 --- a/unix/configure +++ b/unix/configure @@ -12110,6 +12110,85 @@ _ACEOF else + + # Avoids picking hidden internal symbol from libc + echo "$as_me:$LINENO: checking whether gethostbyname_r is declared" >&5 +echo $ECHO_N "checking whether gethostbyname_r is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_gethostbyname_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef gethostbyname_r + char *p = (char *) gethostbyname_r; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_gethostbyname_r=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_gethostbyname_r=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_gethostbyname_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_gethostbyname_r" >&6 +if test $ac_cv_have_decl_gethostbyname_r = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETHOSTBYNAME_R 1 +_ACEOF + + + tcl_cv_api_gethostbyname_r=yes +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETHOSTBYNAME_R 0 +_ACEOF + +tcl_cv_api_gethostbyname_r=no +fi + + + + + if test "$tcl_cv_api_gethostbyname_r" = yes; then echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname_r+set}" = set; then @@ -12428,6 +12507,87 @@ _ACEOF fi + fi + + + # Avoids picking hidden internal symbol from libc + echo "$as_me:$LINENO: checking whether gethostbyaddr_r is declared" >&5 +echo $ECHO_N "checking whether gethostbyaddr_r is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_gethostbyaddr_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef gethostbyaddr_r + char *p = (char *) gethostbyaddr_r; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_gethostbyaddr_r=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_gethostbyaddr_r=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_gethostbyaddr_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_gethostbyaddr_r" >&6 +if test $ac_cv_have_decl_gethostbyaddr_r = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETHOSTBYADDR_R 1 +_ACEOF + + + tcl_cv_api_gethostbyaddr_r=yes +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETHOSTBYADDR_R 0 +_ACEOF + +tcl_cv_api_gethostbyaddr_r=no +fi + + + + + if test "$tcl_cv_api_gethostbyaddr_r" = yes; then echo "$as_me:$LINENO: checking for gethostbyaddr_r" >&5 echo $ECHO_N "checking for gethostbyaddr_r... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyaddr_r+set}" = set; then @@ -12682,6 +12842,8 @@ _ACEOF fi fi + + fi fi #--------------------------------------------------------------------------- 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 ]) +]) + +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 @@ -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 ]) +]) + +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 -- cgit v0.12