mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix re2c version detection
This commit is contained in:
parent
51658bac35
commit
d1fc9b425f
1 changed files with 6 additions and 6 deletions
|
@ -2670,18 +2670,18 @@ function toolset_setup_project_tools()
|
||||||
|
|
||||||
RE2C = PATH_PROG('re2c');
|
RE2C = PATH_PROG('re2c');
|
||||||
if (RE2C) {
|
if (RE2C) {
|
||||||
var intvers, intmin;
|
var RE2CVERS = probe_binary(RE2C, "version");
|
||||||
var pattern = /\./g;
|
|
||||||
|
|
||||||
RE2CVERS = probe_binary(RE2C, "version");
|
|
||||||
STDOUT.WriteLine(' Detected re2c version ' + RE2CVERS);
|
STDOUT.WriteLine(' Detected re2c version ' + RE2CVERS);
|
||||||
|
|
||||||
if (RE2CVERS.match(/^\d+.\d+$/)) {
|
if (RE2CVERS.match(/^\d+.\d+$/)) {
|
||||||
RE2CVERS += ".0";
|
RE2CVERS += ".0";
|
||||||
}
|
}
|
||||||
|
|
||||||
intvers = RE2CVERS.replace(pattern, '') - 0;
|
var hm = RE2CVERS.match(/(\d+)\.(\d+)\.(\d+)/);
|
||||||
intmin = MINRE2C.replace(pattern, '') - 0;
|
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) {
|
if (intvers < intmin) {
|
||||||
STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);
|
STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue