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

View File

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

View File

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