diff options
author | Peter Kokot <peterkokot@gmail.com> | 2019-03-19 23:49:26 +0100 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-04-07 05:52:14 +0200 |
commit | afd52f9d9986d92dd0c63832a07ab1a16bf11d53 (patch) | |
tree | 1bc5cd2b4ab427dcd104500affba7bf7ba6973f8 | |
parent | 3eae4f677a604a547a1847a4fb0ba54e813c90c9 (diff) | |
download | php-git-afd52f9d9986d92dd0c63832a07ab1a16bf11d53.tar.gz |
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.
-rwxr-xr-x | buildconf | 6 | ||||
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | scripts/phpize.m4 | 3 | ||||
-rw-r--r-- | win32/build/confutils.js | 21 |
4 files changed, 21 insertions, 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 ;; *) diff --git a/configure.ac b/configure.ac index 3e51518195..6cce236364 100644 --- a/configure.ac +++ b/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` diff --git a/scripts/phpize.m4 b/scripts/phpize.m4 index 9b89d1b9cd..d3b471b5cd 100644 --- a/scripts/phpize.m4 +++ b/scripts/phpize.m4 @@ -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 diff --git a/win32/build/confutils.js b/win32/build/confutils.js index f43572c9dd..19a2504fa9 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -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); } |