Browse Source

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

rdb 10 years ago
parent
commit
1c9ff40236
3 changed files with 10 additions and 14 deletions
  1. 4 8
      dtool/src/cppparser/cppBison.yxx
  2. 0 3
      makepanda/makepanda.py
  3. 6 3
      makepanda/makepandacore.py

+ 4 - 8
dtool/src/cppparser/cppBison.yxx

@@ -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. */
-%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.real> REAL
 %token <u.integer> INTEGER
 %token <u.integer> INTEGER

+ 0 - 3
makepanda/makepanda.py

@@ -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!")
 
 

+ 6 - 3
makepanda/makepandacore.py

@@ -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')
-    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'):
     elif LocateBinary('bison'):
         BISON = 'bison'
         BISON = 'bison'
     else:
     else: