Skip to content

Commit 7fda122

Browse files
authored
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.
1 parent 1f847a0 commit 7fda122

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

configure.ac

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,19 +1845,6 @@ if test -n "\$REDO_ALL"; then
18451845
18461846
echo "creating main/internal_functions_cli.c"
18471847
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
1848-
1849-
if test "$PHP_SAPI" = "apache2handler"; then
1850-
if test -z "$APACHE_THREADED_MPM"; then
1851-
cat <<X
1852-
+--------------------------------------------------------------------+
1853-
| *** WARNING *** |
1854-
| |
1855-
| You have built PHP for Apache's current non-threaded MPM. |
1856-
| If you change Apache to use a threaded MPM you must reconfigure |
1857-
| PHP with --enable-zts |
1858-
X
1859-
fi
1860-
fi
18611848
fi
18621849
])
18631850
AC_OUTPUT

sapi/apache2handler/config.m4

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,17 @@ if test "$PHP_APXS2" != "no"; then
112112

113113
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
114114
AS_VAR_IF([APACHE_THREADED_MPM],,, [PHP_BUILD_THREAD_SAFE])
115+
116+
AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
117+
[AS_VAR_IF([APACHE_THREADED_MPM],,
118+
[AC_MSG_WARN([
119+
+--------------------------------------------------------------------+
120+
| *** WARNING *** |
121+
| |
122+
| You have built PHP for Apache's current non-threaded MPM. |
123+
| If you change Apache to use a threaded MPM you must reconfigure |
124+
| PHP with --enable-zts |
125+
+--------------------------------------------------------------------+
126+
])])])],
127+
[APACHE_THREADED_MPM=$APACHE_THREADED_MPM; enable_zts=$enable_zts])
115128
fi

0 commit comments

Comments
 (0)