Skip to content

Commit 3199af6

Browse files
committed
Refactor Zend signal handling check
This uses AS_VAR_IF, AS_VAR_APPEND for CFLAGS variable and fixes CS.
1 parent e7cc819 commit 3199af6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Zend/Zend.m4

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,18 @@ AC_MSG_RESULT(done)
291291
292292
AC_ARG_ENABLE([zend-signals],
293293
[AS_HELP_STRING([--disable-zend-signals],
294-
[whether to enable zend signal handling])],
294+
[whether to enable Zend signal handling])],
295295
[ZEND_SIGNALS=$enableval],
296296
[ZEND_SIGNALS=yes])
297297
298-
AC_CHECK_FUNCS([sigaction], [], [
299-
ZEND_SIGNALS=no
300-
])
301-
if test "$ZEND_SIGNALS" = "yes"; then
302-
AC_DEFINE(ZEND_SIGNALS, 1, [Use zend signal handling])
303-
CFLAGS="$CFLAGS -DZEND_SIGNALS"
304-
fi
298+
AC_CHECK_FUNCS([sigaction],, [ZEND_SIGNALS=no])
299+
AS_VAR_IF([ZEND_SIGNALS], [yes],
300+
[AC_DEFINE([ZEND_SIGNALS], [1],
301+
[Define to 1 if Zend signal handling is enabled.])
302+
AS_VAR_APPEND([CFLAGS], [" -DZEND_SIGNALS"])])
305303
306-
AC_MSG_CHECKING(whether to enable zend signal handling)
307-
AC_MSG_RESULT($ZEND_SIGNALS)
304+
AC_MSG_CHECKING([whether to enable Zend signal handling])
305+
AC_MSG_RESULT([$ZEND_SIGNALS])
308306
309307
dnl Don't enable Zend Max Execution Timers by default until PHP 8.3 to not break the ABI
310308
AC_ARG_ENABLE([zend-max-execution-timers],

0 commit comments

Comments
 (0)