Autotools: Refactor thread safety checks (#15214)

- The ZTS is defined on only one place
- Added help text for ZTS preprocessor macro
- The 'enable_zts' variable replaced with PHP_THREAD_SAFETY in
  configure.ac.
- Nits fixed.
This commit is contained in:
Peter Kokot 2024-08-05 22:30:10 +02:00 committed by GitHub
parent bb299a03e9
commit 62f75a7812
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 32 deletions

View file

@ -91,19 +91,17 @@ php_debug_is_enabled
CPPFLAGS=$old_CPPFLAGS
AC_MSG_RESULT([$PHP_DEBUG])
AC_MSG_CHECKING([if zts is enabled])
AC_MSG_CHECKING([if PHP is built with thread safety (ZTS)])
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-I$phpincludedir"
AC_EGREP_CPP(php_zts_is_enabled,[
AC_EGREP_CPP([php_zts_is_enabled], [
#include <main/php_config.h>
#ifdef ZTS
php_zts_is_enabled
#endif
],[
PHP_THREAD_SAFETY=yes
],[
PHP_THREAD_SAFETY=no
])
],
[PHP_THREAD_SAFETY=yes],
[PHP_THREAD_SAFETY=no])
CPPFLAGS=$old_CPPFLAGS
AC_MSG_RESULT([$PHP_THREAD_SAFETY])