Skip to content

Commit e1180f0

Browse files
committed
Autotools: Move Apache warning to SAPI's config.m4
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 083493b commit e1180f0

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
@@ -1847,19 +1847,6 @@ if test -n "\$REDO_ALL"; then
18471847
18481848
echo "creating main/internal_functions_cli.c"
18491849
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
1850-
1851-
if test "$PHP_SAPI" = "apache2handler"; then
1852-
if test -z "$APACHE_THREADED_MPM"; then
1853-
cat <<X
1854-
+--------------------------------------------------------------------+
1855-
| *** WARNING *** |
1856-
| |
1857-
| You have built PHP for Apache's current non-threaded MPM. |
1858-
| If you change Apache to use a threaded MPM you must reconfigure |
1859-
| PHP with --enable-zts |
1860-
X
1861-
fi
1862-
fi
18631850
fi
18641851
])
18651852
AC_OUTPUT

sapi/apache2handler/config.m4

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

108108
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
109109
AS_VAR_IF([APACHE_THREADED_MPM],,, [PHP_BUILD_THREAD_SAFE])
110+
111+
AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
112+
[AS_VAR_IF([APACHE_THREADED_MPM],,
113+
[AC_MSG_WARN([
114+
+--------------------------------------------------------------------+
115+
| *** WARNING *** |
116+
| |
117+
| You have built PHP for Apache's current non-threaded MPM. |
118+
| If you change Apache to use a threaded MPM you must reconfigure |
119+
| PHP with --enable-zts |
120+
+--------------------------------------------------------------------+
121+
])])])],
122+
[APACHE_THREADED_MPM=$APACHE_THREADED_MPM; enable_zts=$enable_zts])
110123
fi

0 commit comments

Comments
 (0)