mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Autotools: Check Apache version with apxs and HTTPD_VERSION variable (#15476)
The apxs -q HTTPD_VERSION variable is available since Apache 2.4.17. This change obsoletes the PHP_AP_EXTRACT_VERSION macro and checks the version in the config.m4 file directly. Version is checked against the dotted format instead of the version number.
This commit is contained in:
parent
edcd6cc564
commit
b97a60c9a3
3 changed files with 17 additions and 4 deletions
|
@ -189,6 +189,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
|
||||||
symbol anymore and requires at least libxml2 2.9.4.
|
symbol anymore and requires at least libxml2 2.9.4.
|
||||||
- Autoconf macro PHP_SETUP_ICONV doesn't define the HAVE_ICONV symbol
|
- Autoconf macro PHP_SETUP_ICONV doesn't define the HAVE_ICONV symbol
|
||||||
anymore.
|
anymore.
|
||||||
|
- Autoconf macro PHP_AP_EXTRACT_VERSION is obsolete (use the
|
||||||
|
'apxs -q HTTPD_VERSION').
|
||||||
- Autoconf macro PHP_OUTPUT is obsolete (use AC_CONFIG_FILES).
|
- Autoconf macro PHP_OUTPUT is obsolete (use AC_CONFIG_FILES).
|
||||||
- Autoconf macro PHP_PROG_SETUP now accepts an argument to set the minimum
|
- Autoconf macro PHP_PROG_SETUP now accepts an argument to set the minimum
|
||||||
required PHP version during the build.
|
required PHP version during the build.
|
||||||
|
|
|
@ -2030,7 +2030,8 @@ dnl PHP_AP_EXTRACT_VERSION(/path/httpd)
|
||||||
dnl
|
dnl
|
||||||
dnl This macro is used to get a comparable version for Apache.
|
dnl This macro is used to get a comparable version for Apache.
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([PHP_AP_EXTRACT_VERSION],[
|
AC_DEFUN([PHP_AP_EXTRACT_VERSION], [m4_warn([obsolete],
|
||||||
|
[The macro 'PHP_AP_EXTRACT_VERSION' is obsolete. Use 'apxs -q HTTPD_VERSION'])
|
||||||
AS_IF([test -x "$1"], [
|
AS_IF([test -x "$1"], [
|
||||||
ac_output=$($1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//')
|
ac_output=$($1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//')
|
||||||
ac_IFS=$IFS
|
ac_IFS=$IFS
|
||||||
|
|
|
@ -53,9 +53,19 @@ if test "$PHP_APXS2" != "no"; then
|
||||||
AS_CASE([$flag], [-D*], [APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag"])
|
AS_CASE([$flag], [-D*], [APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag"])
|
||||||
done
|
done
|
||||||
|
|
||||||
dnl Check Apache version.
|
dnl Check Apache version. The HTTPD_VERSION was added in Apache 2.4.17.
|
||||||
PHP_AP_EXTRACT_VERSION([$APXS_HTTPD])
|
dnl Earlier versions can use the Apache HTTP Server command-line utility.
|
||||||
AS_VERSION_COMPARE([$APACHE_VERSION], [2004000],
|
APACHE_VERSION=$($APXS -q HTTPD_VERSION 2>/dev/null)
|
||||||
|
AS_VAR_IF([APACHE_VERSION],, [
|
||||||
|
ac_output=$($APXS_HTTPD -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//')
|
||||||
|
ac_IFS=$IFS
|
||||||
|
IFS="- /.
|
||||||
|
"
|
||||||
|
set $ac_output
|
||||||
|
IFS=$ac_IFS
|
||||||
|
APACHE_VERSION="$4.$5.$6"
|
||||||
|
])
|
||||||
|
AS_VERSION_COMPARE([$APACHE_VERSION], [2.4.0],
|
||||||
[AC_MSG_ERROR([Please note that Apache version >= 2.4 is required])])
|
[AC_MSG_ERROR([Please note that Apache version >= 2.4 is required])])
|
||||||
|
|
||||||
APXS_LIBEXECDIR='$(INSTALL_ROOT)'$($APXS -q LIBEXECDIR)
|
APXS_LIBEXECDIR='$(INSTALL_ROOT)'$($APXS -q LIBEXECDIR)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue