Fix pthread detection on Solaris 11.4 (#1479)

AX_PTHREAD requires _REENTRANT to confirm that pthread support is enabled.
Solaris 11.4 headers no longer use the macro, and GCC 16 therefore no
longer defines it for -pthread.

Detect XPG7 support in the target headers and require _REENTRANT only on
older Solaris releases. The existing pthread compile and link test remains
the final capability check.

This follows the canonical Autoconf Archive change:
https://github.com/autoconf-archive/autoconf-archive/pull/341

Regenerate configure with Autoconf 2.71.

Tested on Solaris 11.4 with GCC 15.2 and GCC 16.1. The Autoconf Archive
change was also tested on Solaris 11.3.

Co-authored-by: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
This commit is contained in:
Petr Sumbera
2026-07-24 15:34:18 +02:00
committed by GitHub
co-authored by Rainer Orth
parent 7cc7a43ff6
commit 8a38bed262
2 changed files with 42 additions and 3 deletions
+17 -2
View File
@@ -87,7 +87,7 @@
# modified version of the Autoconf Macro, you may extend this special # modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well. # exception to the GPL to apply to your modified version as well.
#serial 31 #serial 32
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [ AC_DEFUN([AX_PTHREAD], [
@@ -249,7 +249,22 @@ AS_IF([test "x$ax_pthread_clang" = "xyes"],
# correctly enabled # correctly enabled
case $host_os in case $host_os in
darwin* | hpux* | linux* | osf* | solaris*) solaris*)
# Solaris 11.4 introduced XPG7 support and did away with the need for
# _REENTRANT.
AC_EGREP_CPP([AX_PTHREAD_SOLARIS__REENTRANT],
[
# undef _XOPEN_SOURCE
# include <sys/feature_tests.h>
# if _XOPEN_VERSION < 700
AX_PTHREAD_SOLARIS__REENTRANT
# endif
],
[ax_pthread_check_macro="_REENTRANT"],
[ax_pthread_check_macro="--"])
;;
darwin* | hpux* | linux* | osf*)
ax_pthread_check_macro="_REENTRANT" ax_pthread_check_macro="_REENTRANT"
;; ;;
Vendored
+25 -1
View File
@@ -18415,7 +18415,31 @@ fi
# correctly enabled # correctly enabled
case $host_os in case $host_os in
darwin* | hpux* | linux* | osf* | solaris*) solaris*)
# Solaris 11.4 introduced XPG7 support and did away with the need for
# _REENTRANT.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# undef _XOPEN_SOURCE
# include <sys/feature_tests.h>
# if _XOPEN_VERSION < 700
AX_PTHREAD_SOLARIS__REENTRANT
# endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "AX_PTHREAD_SOLARIS__REENTRANT" >/dev/null 2>&1
then :
ax_pthread_check_macro="_REENTRANT"
else $as_nop
ax_pthread_check_macro="--"
fi
rm -rf conftest*
;;
darwin* | hpux* | linux* | osf*)
ax_pthread_check_macro="_REENTRANT" ax_pthread_check_macro="_REENTRANT"
;; ;;