mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Refactor AC_INIT in configure.ac and PHP versions
Since Autoconf 2.53 the AC_INIT call with only a single argument has been made obsolete and now includes several other optional arguments to make installation experience a bit better by providing program version and links to the project in the `./configure -h` output. This patch also updates win build version. The phpize.m4 AC_INIT has been updated with the call without arguments.
This commit is contained in:
parent
3eae4f677a
commit
afd52f9d99
4 changed files with 21 additions and 23 deletions
|
@ -9,9 +9,9 @@ debug=0
|
|||
# Go to project root.
|
||||
cd $(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
|
||||
eval $(grep '^PHP_EXTRA_VERSION=' configure.ac)
|
||||
case "$PHP_EXTRA_VERSION" in
|
||||
*-dev)
|
||||
php_extra_version=$(grep '^AC_INIT(' configure.ac)
|
||||
case "$php_extra_version" in
|
||||
*-dev*)
|
||||
dev=1
|
||||
;;
|
||||
*)
|
||||
|
|
14
configure.ac
14
configure.ac
|
@ -8,7 +8,8 @@ dnl Basic autoconf initialization, generation of config.nice.
|
|||
dnl -------------------------------------------------------------------------
|
||||
|
||||
AC_PREREQ([2.68])
|
||||
AC_INIT([main/php_version.h])
|
||||
AC_INIT([PHP],[7.4.0-dev],[https://bugs.php.net],[php],[https://www.php.net])
|
||||
AC_CONFIG_SRCDIR([main/php_version.h])
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_PRESERVE_HELP_ORDER
|
||||
|
||||
|
@ -99,10 +100,13 @@ extern "C++" {
|
|||
#endif /* PHP_CONFIG_H */
|
||||
])
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
ac_IFS=$IFS; IFS="."
|
||||
set $(echo AC_PACKAGE_VERSION | $SED 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/')
|
||||
IFS=$ac_IFS
|
||||
PHP_MAJOR_VERSION=[$]1
|
||||
PHP_MINOR_VERSION=[$]2
|
||||
PHP_RELEASE_VERSION=[$]3
|
||||
PHP_EXTRA_VERSION=[$]4
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
dnl This file becomes configure.ac for self-contained extensions.
|
||||
|
||||
AC_PREREQ([2.68])
|
||||
AC_INIT(config.m4)
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([config.m4])
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_PRESERVE_HELP_ORDER
|
||||
|
||||
|
|
|
@ -105,24 +105,17 @@ var PHP_VERSION_STRING = "7.3.0";
|
|||
function get_version_numbers()
|
||||
{
|
||||
var cin = file_get_contents("configure.ac");
|
||||
var regex = /AC_INIT.+(\d+)\.(\d+)\.(\d+)([^\,^\]]*).+/g;
|
||||
|
||||
if (cin.match(new RegExp("PHP_MAJOR_VERSION=(\\d+)"))) {
|
||||
if (cin.match(new RegExp(regex))) {
|
||||
PHP_VERSION = RegExp.$1;
|
||||
PHP_MINOR_VERSION = RegExp.$2;
|
||||
PHP_RELEASE_VERSION = RegExp.$3;
|
||||
PHP_EXTRA_VERSION = RegExp.$4;
|
||||
}
|
||||
if (cin.match(new RegExp("PHP_MINOR_VERSION=(\\d+)"))) {
|
||||
PHP_MINOR_VERSION = RegExp.$1;
|
||||
}
|
||||
if (cin.match(new RegExp("PHP_RELEASE_VERSION=(\\d+)"))) {
|
||||
PHP_RELEASE_VERSION = RegExp.$1;
|
||||
}
|
||||
PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION;
|
||||
|
||||
if (cin.match(new RegExp("PHP_EXTRA_VERSION=\"([^\"]+)\""))) {
|
||||
PHP_EXTRA_VERSION = RegExp.$1;
|
||||
if (PHP_EXTRA_VERSION.length) {
|
||||
PHP_VERSION_STRING += PHP_EXTRA_VERSION;
|
||||
}
|
||||
}
|
||||
PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION + PHP_EXTRA_VERSION;
|
||||
|
||||
DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue