summaryrefslogtreecommitdiff
path: root/win32/build/confutils.js
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2019-03-19 23:49:26 +0100
committerPeter Kokot <peterkokot@gmail.com>2019-04-07 05:52:14 +0200
commitafd52f9d9986d92dd0c63832a07ab1a16bf11d53 (patch)
tree1bc5cd2b4ab427dcd104500affba7bf7ba6973f8 /win32/build/confutils.js
parent3eae4f677a604a547a1847a4fb0ba54e813c90c9 (diff)
downloadphp-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.
Diffstat (limited to 'win32/build/confutils.js')
-rw-r--r--win32/build/confutils.js21
1 files changed, 7 insertions, 14 deletions
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);
}