com php-src: Fix re2c version detection: win32/build/confutils.js
| From: | Anatol Belski | Date: | Tue, 10 Oct 2017 08:52:52 +0000 |
| Subject: | com php-src: Fix re2c version detection: win32/build/confutils.js | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99679@lists.php.net to get a copy of this message | ||
Commit: d1fc9b425fb8fe8eddbb166a508a72d6fc4f6115
Author: Anatol Belski <ab@php.net> Tue, 10 Oct 2017 10:52:52 +0200
Parents: 51658bac3550761253144b316f8d9bf5e6b06487
Branches: PHP-7.0 PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d1fc9b425fb8fe8eddbb166a508a72d6fc4f6115
Log:
Fix re2c version detection
Changed paths:
M win32/build/confutils.js
Diff:
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 947e2ab..a8c1f33 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -2670,18 +2670,18 @@ function toolset_setup_project_tools()
RE2C = PATH_PROG('re2c');
if (RE2C) {
- var intvers, intmin;
- var pattern = /\./g;
-
- RE2CVERS = probe_binary(RE2C, "version");
+ var RE2CVERS = probe_binary(RE2C, "version");
STDOUT.WriteLine(' Detected re2c version ' + RE2CVERS);
if (RE2CVERS.match(/^\d+.\d+$/)) {
RE2CVERS += ".0";
}
- intvers = RE2CVERS.replace(pattern, '') - 0;
- intmin = MINRE2C.replace(pattern, '') - 0;
+ var hm = RE2CVERS.match(/(\d+)\.(\d+)\.(\d+)/);
+ var nm = MINRE2C.match(/(\d+)\.(\d+)\.(\d+)/);
+
+ var intvers = (hm[1]-0)*10000 + (hm[2]-0)*100 + (hm[3]-0);
+ var intmin = (nm[1]-0)*10000 + (nm[2]-0)*100 + (nm[3]-0);
if (intvers < intmin) {
STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);