1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/sapi/apache2handler/config.m4
Peter Kokot 1bdf9aa38d Remove support for EOL Apache 2.0 and 2.2 in favor of 2.4+ (#14664)
Apache 2.2 has been marked as EOL in December 2017 and doesn't receive
security patches any longer. Also, most *nix distributions and packages
mostly support 2.4 as minimum by now.

On Windows, this removes the configure option --enable-apache2-2handler
and merges the --enable-apache2handler and --enable-apache2-4handler
into a single option with favoring the --enable-apache2handler.

- The upstream MODULE_MAGIC_NUMBER is deprecated in favor of
  MODULE_MAGIC_NUMBER_MAJOR in apache2/ap_mmn.h
- The initial upstream MODULE_MAGIC_NUMBER_MAJOR was 20111025 in Apache
  2.4.0
- The upstream APLOG_USE_MODULE is always available since Apache 2.3.6
- The upstream CORE_PRIVATE is unnecessary and ignored since Apache
  2.4.0

See:
https://forum.apachehaus.com/news-general-discussion/apache-2-2-users-your-time-is-running-out/

Discussion: https://news-web.php.net/php.internals/124067
2024-07-08 00:07:55 +02:00

111 lines
3.9 KiB
Plaintext

PHP_ARG_WITH([apxs2],
[whether to build Apache 2 handler module support via DSO through APXS],
[AS_HELP_STRING([[--with-apxs2[=FILE]]],
[Build shared Apache 2 handler module. FILE is the optional pathname to
the Apache apxs tool [apxs]])],
[no],
[no])
if test "$PHP_APXS2" != "no"; then
if test "$PHP_APXS2" = "yes"; then
APXS=apxs
$APXS -q CFLAGS >/dev/null 2>&1
if test "$?" != "0" && test -x /usr/sbin/apxs; then
APXS=/usr/sbin/apxs
fi
else
PHP_EXPAND_PATH($PHP_APXS2, APXS)
fi
$APXS -q CFLAGS >/dev/null 2>&1
if test "$?" != "0"; then
AC_MSG_RESULT()
AC_MSG_RESULT()
AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:])
AC_MSG_RESULT()
AC_MSG_RESULT([1. Perl is not installed])
AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs])
AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)])
AC_MSG_RESULT()
AC_MSG_RESULT([The output of $APXS follows:])
$APXS -q CFLAGS
AC_MSG_ERROR([Aborting])
fi
APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
APXS_CFLAGS=`$APXS -q CFLAGS`
APU_BINDIR=`$APXS -q APU_BINDIR`
APR_BINDIR=`$APXS -q APR_BINDIR`
dnl Pick up ap[ru]-N-config.
APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
echo $APR_BINDIR/apr-config`
APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
echo $APU_BINDIR/apu-config`
APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
APU_CFLAGS="`$APU_CONFIG --includes`"
for flag in $APXS_CFLAGS; do
case $flag in
-D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
esac
done
APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
dnl Check Apache version.
PHP_AP_EXTRACT_VERSION([$APXS_HTTPD])
AS_VERSION_COMPARE([$APACHE_VERSION], [2004000],
[AC_MSG_ERROR([Please note that Apache version >= 2.4 is required])])
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
if test -z `$APXS -q SYSCONFDIR`; then
INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-i -n php"
else
APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
\$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-S SYSCONFDIR='$APXS_SYSCONFDIR' \
-i -a -n php"
fi
LIBPHP_CFLAGS="-shared"
PHP_SUBST([LIBPHP_CFLAGS])
case $host_alias in
*aix*)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
PHP_SELECT_SAPI(apache2handler, shared, mod_php.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
;;
*darwin*)
dnl When using bundles on Darwin, we must resolve all symbols. However, the
dnl linker does not recursively look at the bundle loader and pull in its
dnl dependencies. Therefore, we must pull in the APR and APR-util libraries.
if test -x "$APR_CONFIG"; then
MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
fi
if test -x "$APU_CONFIG"; then
MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
fi
MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
PHP_SUBST([MH_BUNDLE_FLAGS])
PHP_SELECT_SAPI(apache2handler, bundle, mod_php.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
SAPI_SHARED=libs/libphp.so
INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
;;
*)
PHP_SELECT_SAPI(apache2handler, shared, mod_php.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
;;
esac
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
AS_VAR_SET_IF([APACHE_THREADED_MPM], [PHP_BUILD_THREAD_SAFE])
fi