Require new Bison version on Windows, fallback to prebuilt files if not present

This commit is contained in:
rdb 2015-10-10 16:29:14 +02:00
parent e327c7e978
commit 1c9ff40236
3 changed files with 10 additions and 14 deletions

View File

@ -199,14 +199,10 @@ pop_struct() {
/* This is a bison-specific declaration to enable recursive calls to
yyparse(). It changes the calling sequence to yylex(), passing
pointers to the current yylval and yylloc. */
%pure_parser
/* Ideally we'd define this instead of the above, which gives us better
tracking of error locations, but we are still using a very old
version of Bison on Windows. */
//%define api.pure full
//%locations
pointers to the current yylval and yylloc. It also adds a pointer
to the current lloc to yyerror, which gives us better diagnostics. */
%define api.pure full
%locations
%token <u.real> REAL
%token <u.integer> INTEGER

View File

@ -419,9 +419,6 @@ if (RUNTIME):
# Unused packages for runtime.
PkgDisable(pkg)
if (GetHost() == 'windows'):
os.environ["BISON_SIMPLE"] = GetThirdpartyBase()+"/win-util/bison.simple"
if (INSTALLER and RTDIST):
exit("Cannot build an installer for the rtdist build!")

View File

@ -431,9 +431,12 @@ def GetBison():
if BISON is not None:
return BISON
win_util = os.path.join(GetThirdpartyBase(), 'win-util')
if GetHost() == 'windows' and os.path.isdir(win_util):
BISON = os.path.join(win_util, 'bison.exe')
# We now require a newer version of Bison than the one we previously
# shipped in the win-util dir. The new version has a 'data'
# subdirectory, so check for that.
win_util_data = os.path.join(GetThirdpartyBase(), 'win-util', 'data')
if GetHost() == 'windows' and os.path.isdir(win_util_data):
BISON = os.path.join(GetThirdpartyBase(), 'win-util', 'bison.exe')
elif LocateBinary('bison'):
BISON = 'bison'
else: