Skip to content

Autotools: Simplify POSIX Threads check #14855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions TSRM/tsrm.m4

This file was deleted.

7 changes: 1 addition & 6 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,7 @@ dnl ----------------------------------------------------------------------------
dnl
dnl PHP_BUILD_THREAD_SAFE
dnl
AC_DEFUN([PHP_BUILD_THREAD_SAFE],[
enable_zts=yes
if test "$pthreads_working" != "yes"; then
AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.])
fi
])
AC_DEFUN([PHP_BUILD_THREAD_SAFE], [enable_zts=yes])

dnl
dnl PHP_REQUIRE_CXX
Expand Down
17 changes: 11 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ m4_include([build/php_cxx_compile_stdcxx.m4])
m4_include([build/php.m4])
m4_include([build/pkg.m4])
m4_include([TSRM/threads.m4])
m4_include([TSRM/tsrm.m4])
m4_include([Zend/Zend.m4])

dnl Basic autoconf initialization, generation of config.nice.
Expand Down Expand Up @@ -871,6 +870,17 @@ else
PHP_THREAD_SAFETY=no
fi

AS_VAR_IF([PHP_THREAD_SAFETY], [yes], [
AS_VAR_IF([pthreads_working], [yes], [],
[AC_MSG_ERROR([m4_normalize([
Unable to verify system support for POSIX Threads, which are required for
PHP thread safety (ZTS) build.
])])])

AC_MSG_CHECKING([for POSIX threads])
AC_MSG_RESULT([yes])
])

PHP_ARG_ENABLE([rtld-now],
[whether to dlopen extensions with RTLD_NOW instead of RTLD_LAZY],
[AS_HELP_STRING([--enable-rtld-now],
Expand Down Expand Up @@ -1337,11 +1347,6 @@ PHP_ADD_INCLUDE([$abs_srcdir/TSRM])
ZEND_EXTRA_LIBS="$LIBS"
unset LIBS

PHP_CONFIGURE_PART(Configuring TSRM)
if test "$PHP_THREAD_SAFETY" = "yes"; then
TSRM_CHECK_PTHREADS
fi

EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
Expand Down
Loading