mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Wrap Zend max execution timers check in M4 macro (#14696)
- 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
This commit is contained in:
parent
b1c34a9163
commit
a5b7850d6c
@ -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).
|
||||
|
53
Zend/Zend.m4
53
Zend/Zend.m4
@ -199,28 +199,7 @@ fi
|
||||
|
||||
ZEND_CHECK_ALIGNMENT
|
||||
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
|
||||
@ -425,3 +404,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])
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user