gh-91962: Fix `hstrerror` detection issues on Solaris (GH-91963)

This commit is contained in:
Jakub Kulík 2024-10-30 13:19:44 +01:00 committed by GitHub
parent dcad8fecbd
commit 1064141967
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 88 additions and 9 deletions

85
configure generated vendored
View File

@ -20478,12 +20478,91 @@ fi
printf "%s\n" "$ac_cv_lib_resolv_inet_aton" >&6; } printf "%s\n" "$ac_cv_lib_resolv_inet_aton" >&6; }
if test "x$ac_cv_lib_resolv_inet_aton" = xyes if test "x$ac_cv_lib_resolv_inet_aton" = xyes
then : then :
printf "%s\n" "#define HAVE_LIBRESOLV 1" >>confdefs.h SOCKET_LIBS="-lresolv"
fi
LIBS="-lresolv $LIBS"
fi fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hstrerror in -lc" >&5
printf %s "checking for hstrerror in -lc... " >&6; }
if test ${ac_cv_lib_c_hstrerror+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char hstrerror ();
int
main (void)
{
return hstrerror ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_c_hstrerror=yes
else $as_nop
ac_cv_lib_c_hstrerror=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_hstrerror" >&5
printf "%s\n" "$ac_cv_lib_c_hstrerror" >&6; }
if test "x$ac_cv_lib_c_hstrerror" = xyes
then :
$ac_cv_prog_TRUE
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hstrerror in -lresolv" >&5
printf %s "checking for hstrerror in -lresolv... " >&6; }
if test ${ac_cv_lib_resolv_hstrerror+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lresolv $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char hstrerror ();
int
main (void)
{
return hstrerror ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_resolv_hstrerror=yes
else $as_nop
ac_cv_lib_resolv_hstrerror=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_hstrerror" >&5
printf "%s\n" "$ac_cv_lib_resolv_hstrerror" >&6; }
if test "x$ac_cv_lib_resolv_hstrerror" = xyes
then :
SOCKET_LIBS="-lresolv"
fi
fi fi
@ -29988,7 +30067,7 @@ fi
then : then :
as_fn_append MODULE_BLOCK "MODULE__SOCKET_LDFLAGS=$SOCKET_LIBS$as_nl"
fi fi
if test "$py_cv_module__socket" = yes; then if test "$py_cv_module__socket" = yes; then

View File

@ -5311,10 +5311,13 @@ AS_VAR_IF([ac_cv_broken_unsetenv], [yes], [
dnl check for true dnl check for true
AC_CHECK_PROGS([TRUE], [true], [/bin/true]) AC_CHECK_PROGS([TRUE], [true], [/bin/true])
dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv dnl On some systems (e.g. Solaris), hstrerror and inet_aton are in -lresolv
dnl On others, they are in the C library, so we to take no action dnl On others, they are in the C library, so we to take no action
AC_CHECK_LIB([c], [inet_aton], [$ac_cv_prog_TRUE], AC_CHECK_LIB([c], [inet_aton], [$ac_cv_prog_TRUE],
AC_CHECK_LIB([resolv], [inet_aton]) AC_CHECK_LIB([resolv], [inet_aton], [SOCKET_LIBS="-lresolv"])
)
AC_CHECK_LIB([c], [hstrerror], [$ac_cv_prog_TRUE],
AC_CHECK_LIB([resolv], [hstrerror], [SOCKET_LIBS="-lresolv"])
) )
# On Tru64, chflags seems to be present, but calling it will # On Tru64, chflags seems to be present, but calling it will
@ -7789,7 +7792,7 @@ PY_STDLIB_MOD([mmap],
PY_STDLIB_MOD([_socket], PY_STDLIB_MOD([_socket],
[], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes" [], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes"
-a "$ac_cv_header_sys_types_h" = "yes" -a "$ac_cv_header_sys_types_h" = "yes"
-a "$ac_cv_header_netinet_in_h" = "yes"])) -a "$ac_cv_header_netinet_in_h" = "yes"]), [], [$SOCKET_LIBS])
dnl platform specific extensions dnl platform specific extensions
PY_STDLIB_MOD([grp], [], PY_STDLIB_MOD([grp], [],

View File

@ -691,9 +691,6 @@
/* Define to 1 if you have the <libintl.h> header file. */ /* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H #undef HAVE_LIBINTL_H
/* Define to 1 if you have the `resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV
/* Define to 1 if you have the `sendfile' library (-lsendfile). */ /* Define to 1 if you have the `sendfile' library (-lsendfile). */
#undef HAVE_LIBSENDFILE #undef HAVE_LIBSENDFILE