Skip to content

Commit 94478aa

Browse files
committed
Detect out of date flex in MSVC builds.
Per recent discussion, following a report from Quan Zongliang. The same logic is used as in pgbison.pl.
1 parent 8a3d33c commit 94478aa

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/tools/msvc/pgflex.pl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212

1313
require 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl';
1414

15-
system('flex -V > NUL');
16-
if ($? != 0)
15+
my ($flexver) = `flex -V`; # grab first line
16+
$flexver=(split(/\s+/,$flexver))[1];
17+
$flexver =~ s/[^0-9.]//g;
18+
my @verparts = split(/\./,$flexver);
19+
unless ($verparts[0] == 2 && $verparts[1] == 5 && $verparts[2] >= 31)
1720
{
18-
print "WARNING! flex install not found, attempting to build without\n";
21+
print "WARNING! Flex install not found, or unsupported Flex version.\n";
22+
print "echo Attempting to build without.\n";
1923
exit 0;
2024
}
2125

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy