Skip to content

Commit 64001f5

Browse files
committed
Wrap Zend max execution timers check in M4 macro
- PHP_CHECK_FUNC -> AC_SEARCH_LIBS - Redundant symbols HAVE_LIBRT and HAVE_TIMER_CREATE removed - The rt library for some older systems (Solaris <= 10, older Linux) appended as needed - This uses AC_ and AS_* macros and relies more on Autoconf shell code handling - Help texts updated and synced
1 parent a2cecd2 commit 64001f5

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
135135
- Symbol HAVE_PDO_SQLITELIB has been removed.
136136
- Symbol HAVE_WAITPID has been removed.
137137
- Symbol HAVE_LIBPQ has been removed.
138+
- Symbols HAVE_LIBRT and HAVE_TIMER_CREATE removed.
138139
- M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h).
139140
- M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH).
140141
- M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES).

Zend/Zend.m4

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -303,27 +303,7 @@ fi
303303
AC_MSG_CHECKING(whether to enable zend signal handling)
304304
AC_MSG_RESULT($ZEND_SIGNALS)
305305
306-
dnl Don't enable Zend Max Execution Timers by default until PHP 8.3 to not break the ABI
307-
AC_ARG_ENABLE([zend-max-execution-timers],
308-
[AS_HELP_STRING([--enable-zend-max-execution-timers],
309-
[whether to enable zend max execution timers])],
310-
[ZEND_MAX_EXECUTION_TIMERS=$enableval],
311-
[ZEND_MAX_EXECUTION_TIMERS=$ZEND_ZTS])
312-
313-
AS_CASE(["$host_alias"], [*linux*|*freebsd*], [], [ZEND_MAX_EXECUTION_TIMERS='no'])
314-
315-
PHP_CHECK_FUNC(timer_create, rt)
316-
if test "$ac_cv_func_timer_create" != "yes"; then
317-
ZEND_MAX_EXECUTION_TIMERS='no'
318-
fi
319-
320-
if test "$ZEND_MAX_EXECUTION_TIMERS" = "yes"; then
321-
AC_DEFINE(ZEND_MAX_EXECUTION_TIMERS, 1, [Use zend max execution timers])
322-
CFLAGS="$CFLAGS -DZEND_MAX_EXECUTION_TIMERS"
323-
fi
324-
325-
AC_MSG_CHECKING(whether to enable zend max execution timers)
326-
AC_MSG_RESULT($ZEND_MAX_EXECUTION_TIMERS)
306+
ZEND_CHECK_MAX_EXECUTION_TIMERS
327307
])
328308

329309
dnl
@@ -410,3 +390,33 @@ AS_VAR_IF([php_cv_have___cpuid_count], [yes],
410390
[AC_DEFINE([HAVE_CPUID_COUNT], [1],
411391
[Define to 1 if '__cpuid_count' is available.])])
412392
])
393+
394+
dnl
395+
dnl ZEND_CHECK_MAX_EXECUTION_TIMERS
396+
dnl
397+
dnl Check whether to enable Zend max execution timers.
398+
dnl
399+
AC_DEFUN([ZEND_CHECK_MAX_EXECUTION_TIMERS], [dnl
400+
AC_ARG_ENABLE([zend-max-execution-timers],
401+
[AS_HELP_STRING([--enable-zend-max-execution-timers],
402+
[Enable Zend max execution timers; when building with thread safety
403+
(--enable-zts), they are automatically enabled by default based on the
404+
system support])],
405+
[ZEND_MAX_EXECUTION_TIMERS=$enableval],
406+
[ZEND_MAX_EXECUTION_TIMERS=$ZEND_ZTS])
407+
408+
AS_CASE([$host_alias], [*linux*|*freebsd*],,
409+
[ZEND_MAX_EXECUTION_TIMERS=no])
410+
411+
AS_VAR_IF([ZEND_MAX_EXECUTION_TIMERS], [yes],
412+
[AC_SEARCH_LIBS([timer_create], [rt],,
413+
[ZEND_MAX_EXECUTION_TIMERS=no])])
414+
415+
AS_VAR_IF([ZEND_MAX_EXECUTION_TIMERS], [yes],
416+
[AC_DEFINE([ZEND_MAX_EXECUTION_TIMERS], [1],
417+
[Define to 1 if Zend max execution timers are supported and enabled.])
418+
AS_VAR_APPEND([CFLAGS], [" -DZEND_MAX_EXECUTION_TIMERS"])])
419+
420+
AC_MSG_CHECKING([whether to enable Zend max execution timers])
421+
AC_MSG_RESULT([$ZEND_MAX_EXECUTION_TIMERS])
422+
])

0 commit comments

Comments
 (0)