diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-02 11:22:40 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-02 11:22:40 (GMT) |
commit | dc81b2efafb3f33e0da6dc17a3e1a4746da91fd6 (patch) | |
tree | df018372c15ff97c102d01257bfd8d8aca45fb81 /unix/configure | |
parent | f512f6d8d5b94d39b6b66c6f361ba026ba439e96 (diff) | |
download | tcl-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/configure')
-rwxr-xr-x | unix/configure | 162 |
1 files changed, 162 insertions, 0 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 <netdb.h> + +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 <netdb.h> + +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 #--------------------------------------------------------------------------- |