Autotools: Move Apache warning to SAPI's config.m4 (#14872)

This uses AC_CONFIG_COMMANDS macro to conditionally output the warning
message at the end of configure phase if non-threaded Apache
installation has been found and PHP is built without --enable-zts.

Variables set in the 2nd argument (init-cmds) are for the command
invocation scope as the first argument doesn't have any knowledge of
configure variables as described in the Autoconf docs.

This is moved as it is related only to apache2handler SAPI and also
now warning is displayed a bit nicer at the end of the configure phase
after files are generated. This also enables outputting warning when
using config.status script.
This commit is contained in:
Peter Kokot 2024-07-08 17:17:33 +02:00 committed by GitHub
parent 1f847a0bdf
commit 7fda12218a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 13 deletions

View File

@ -1845,19 +1845,6 @@ if test -n "\$REDO_ALL"; then
echo "creating main/internal_functions_cli.c"
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
if test "$PHP_SAPI" = "apache2handler"; then
if test -z "$APACHE_THREADED_MPM"; then
cat <<X
+--------------------------------------------------------------------+
| *** WARNING *** |
| |
| You have built PHP for Apache's current non-threaded MPM. |
| If you change Apache to use a threaded MPM you must reconfigure |
| PHP with --enable-zts |
X
fi
fi
fi
])
AC_OUTPUT

View File

@ -112,4 +112,17 @@ if test "$PHP_APXS2" != "no"; then
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
AS_VAR_IF([APACHE_THREADED_MPM],,, [PHP_BUILD_THREAD_SAFE])
AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
[AS_VAR_IF([APACHE_THREADED_MPM],,
[AC_MSG_WARN([
+--------------------------------------------------------------------+
| *** WARNING *** |
| |
| You have built PHP for Apache's current non-threaded MPM. |
| If you change Apache to use a threaded MPM you must reconfigure |
| PHP with --enable-zts |
+--------------------------------------------------------------------+
])])])],
[APACHE_THREADED_MPM=$APACHE_THREADED_MPM; enable_zts=$enable_zts])
fi