Skip to content

Commit 58a3ab9

Browse files
authored
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
1 parent 2463576 commit 58a3ab9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sapi/apache2handler/config.m4

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ if test "$PHP_APXS2" != "no"; then
110110
;;
111111
esac
112112

113-
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
114-
AS_VAR_IF([APACHE_THREADED_MPM],,, [PHP_BUILD_THREAD_SAFE])
113+
AS_IF([$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes' >/dev/null 2>&1], [
114+
APACHE_THREADED_MPM=yes
115+
PHP_BUILD_THREAD_SAFE
116+
], [APACHE_THREADED_MPM=no])
115117

116118
AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
117-
[AS_VAR_IF([APACHE_THREADED_MPM],,
119+
[AS_VAR_IF([APACHE_THREADED_MPM], [no],
118120
[AC_MSG_WARN([
119121
+--------------------------------------------------------------------+
120122
| *** WARNING *** |
@@ -124,5 +126,5 @@ AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
124126
| PHP with --enable-zts |
125127
+--------------------------------------------------------------------+
126128
])])])],
127-
[APACHE_THREADED_MPM=$APACHE_THREADED_MPM; enable_zts=$enable_zts])
129+
[APACHE_THREADED_MPM="$APACHE_THREADED_MPM"; enable_zts="$enable_zts"])
128130
fi

0 commit comments

Comments
 (0)