diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index ccba368a77bf..13e07c86661d 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -135,6 +135,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES - Symbol HAVE_PDO_SQLITELIB has been removed. - Symbol HAVE_WAITPID has been removed. - Symbol HAVE_LIBPQ has been removed. + - Symbols HAVE_LIBRT and HAVE_TIMER_CREATE removed. - M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h). - M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH). - M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES). diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 464f2f25d60e..7be0beca91da 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -251,28 +251,7 @@ int main(void) AC_MSG_RESULT(done) ZEND_CHECK_SIGNALS - -dnl Don't enable Zend Max Execution Timers by default until PHP 8.3 to not break the ABI -AC_ARG_ENABLE([zend-max-execution-timers], - [AS_HELP_STRING([--enable-zend-max-execution-timers], - [whether to enable zend max execution timers])], - [ZEND_MAX_EXECUTION_TIMERS=$enableval], - [ZEND_MAX_EXECUTION_TIMERS=$ZEND_ZTS]) - -AS_CASE(["$host_alias"], [*linux*|*freebsd*], [], [ZEND_MAX_EXECUTION_TIMERS='no']) - -PHP_CHECK_FUNC(timer_create, rt) -if test "$ac_cv_func_timer_create" != "yes"; then - ZEND_MAX_EXECUTION_TIMERS='no' -fi - -if test "$ZEND_MAX_EXECUTION_TIMERS" = "yes"; then - AC_DEFINE(ZEND_MAX_EXECUTION_TIMERS, 1, [Use zend max execution timers]) - CFLAGS="$CFLAGS -DZEND_MAX_EXECUTION_TIMERS" -fi - -AC_MSG_CHECKING(whether to enable zend max execution timers) -AC_MSG_RESULT($ZEND_MAX_EXECUTION_TIMERS) +ZEND_CHECK_MAX_EXECUTION_TIMERS ]) dnl @@ -413,3 +392,33 @@ AS_VAR_IF([ZEND_SIGNALS], [yes], AC_MSG_CHECKING([whether to enable Zend signal handling]) AC_MSG_RESULT([$ZEND_SIGNALS]) ]) + +dnl +dnl ZEND_CHECK_MAX_EXECUTION_TIMERS +dnl +dnl Check whether to enable Zend max execution timers. +dnl +AC_DEFUN([ZEND_CHECK_MAX_EXECUTION_TIMERS], [dnl +AC_ARG_ENABLE([zend-max-execution-timers], + [AS_HELP_STRING([--enable-zend-max-execution-timers], + [Enable Zend max execution timers; when building with thread safety + (--enable-zts), they are automatically enabled by default based on the + system support])], + [ZEND_MAX_EXECUTION_TIMERS=$enableval], + [ZEND_MAX_EXECUTION_TIMERS=$ZEND_ZTS]) + +AS_CASE([$host_alias], [*linux*|*freebsd*],, + [ZEND_MAX_EXECUTION_TIMERS=no]) + +AS_VAR_IF([ZEND_MAX_EXECUTION_TIMERS], [yes], + [AC_SEARCH_LIBS([timer_create], [rt],, + [ZEND_MAX_EXECUTION_TIMERS=no])]) + +AS_VAR_IF([ZEND_MAX_EXECUTION_TIMERS], [yes], + [AC_DEFINE([ZEND_MAX_EXECUTION_TIMERS], [1], + [Define to 1 if Zend max execution timers are supported and enabled.]) + AS_VAR_APPEND([CFLAGS], [" -DZEND_MAX_EXECUTION_TIMERS"])]) + +AC_MSG_CHECKING([whether to enable Zend max execution timers]) +AC_MSG_RESULT([$ZEND_MAX_EXECUTION_TIMERS]) +])