From 1c9ff40236983079754d41f6cb4de7a88fbbcf22 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 10 Oct 2015 16:29:14 +0200 Subject: [PATCH] Require new Bison version on Windows, fallback to prebuilt files if not present --- dtool/src/cppparser/cppBison.yxx | 12 ++++-------- makepanda/makepanda.py | 3 --- makepanda/makepandacore.py | 9 ++++++--- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 8b918d5de3..b94a21b749 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -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 REAL %token INTEGER diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 07bdd7e538..180e8bd3e2 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -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!") diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 7d921ee9d2..dd6c06c191 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -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: