1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Autotools: Fix config.status script syntax (#14929)

The init-cmds argument is appended to the config.status script with cat
command and variables $var are replaced during the cat step to their
values, so quoting these values fixes the syntax errors.

* Simplify threaded Apache build detection

Instead of checking for entire "grepped" string, this only checks for
yes|no values instead.

* Redirect the standard output and standard error

The "grep -q" is not portable according to docs so this redirects the
output and checks the exit status.

Fixes report in GH-14872
This commit is contained in:
Peter Kokot
2024-07-12 02:16:49 +02:00
committed by GitHub
parent 246357607c
commit 58a3ab92c3

View File

@@ -110,11 +110,13 @@ if test "$PHP_APXS2" != "no"; then
;;
esac
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
AS_VAR_IF([APACHE_THREADED_MPM],,, [PHP_BUILD_THREAD_SAFE])
AS_IF([$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes' >/dev/null 2>&1], [
APACHE_THREADED_MPM=yes
PHP_BUILD_THREAD_SAFE
], [APACHE_THREADED_MPM=no])
AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
[AS_VAR_IF([APACHE_THREADED_MPM],,
[AS_VAR_IF([APACHE_THREADED_MPM], [no],
[AC_MSG_WARN([
+--------------------------------------------------------------------+
| *** WARNING *** |
@@ -124,5 +126,5 @@ AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
| PHP with --enable-zts |
+--------------------------------------------------------------------+
])])])],
[APACHE_THREADED_MPM=$APACHE_THREADED_MPM; enable_zts=$enable_zts])
[APACHE_THREADED_MPM="$APACHE_THREADED_MPM"; enable_zts="$enable_zts"])
fi