diff --git a/README.md b/README.md index 3e60e633bd..600ace9f28 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ depending on whether you are on a 32-bit or 64-bit system, or you can [click here](https://github.com/rdb/panda3d-thirdparty) for instructions on building them from source. -- https://www.panda3d.org/download/panda3d-1.10.8/panda3d-1.10.8-tools-win64.zip -- https://www.panda3d.org/download/panda3d-1.10.8/panda3d-1.10.8-tools-win32.zip +- https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-win64.zip +- https://www.panda3d.org/download/panda3d-1.10.9/panda3d-1.10.9-tools-win32.zip After acquiring these dependencies, you can build Panda3D from the command prompt using the following command. Change the `--msvc-version` option based diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index bbb8e3bc7a..fe7558c049 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1453,6 +1453,19 @@ def CompileFlex(wobj,wsrc,opts): pre = GetValueOption(opts, "BISONPREFIX_") dashi = opts.count("FLEXDASHI") flex = GetFlex() + want_version = GetValueOption(opts, "FLEXVERSION:") + if flex and want_version: + # Is flex at the required version for this file? + want_version = tuple(map(int, want_version.split('.'))) + have_version = GetFlexVersion() + if want_version > have_version: + Warn("Skipping flex %s for file %s, need at least %s" % ( + '.'.join(map(str, have_version)), + ifile, + '.'.join(map(str, want_version)), + )) + flex = None + if flex is None: # We don't have flex. See if there is a prebuilt file. base, ext = os.path.splitext(wsrc) @@ -4383,7 +4396,7 @@ if GetTarget() == 'windows' and not PkgSkip("DX9"): # if not PkgSkip("EGG"): - OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI'] + OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9'] CreateFile(GetOutputDir()+"/include/parser.h") TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx') TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY']) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index ca801948c4..200f24dbdb 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -552,6 +552,23 @@ def GetFlex(): return FLEX +def GetFlexVersion(): + flex = GetFlex() + if not flex: + return (0, 0, 0) + + try: + handle = subprocess.Popen(["flex", "--version"], executable=flex, stdout=subprocess.PIPE) + words = handle.communicate()[0].strip().splitlines()[0].split(b' ') + if words[1] != "version": + version = words[1] + else: + version = words[2] + return tuple(map(int, version.split(b'.'))) + except: + Warn("Unable to detect flex version") + return (0, 0, 0) + ######################################################################## ## ## LocateBinary diff --git a/panda/src/egg/eggNode_ext.h b/panda/src/egg/eggNode_ext.h index aa94aa41cd..41127667a6 100644 --- a/panda/src/egg/eggNode_ext.h +++ b/panda/src/egg/eggNode_ext.h @@ -19,6 +19,7 @@ #ifdef HAVE_PYTHON #include "extension.h" +#include "eggData.h" #include "eggNode.h" #include "py_panda.h" diff --git a/panda/src/egg/lexer.cxx.prebuilt b/panda/src/egg/lexer.cxx.prebuilt index 178bb5c152..16ca6eff9d 100644 --- a/panda/src/egg/lexer.cxx.prebuilt +++ b/panda/src/egg/lexer.cxx.prebuilt @@ -1195,12 +1195,12 @@ scan_quoted_string() { int c; c = read_char(line, col); - while (c != '"' && c != EOF) { + while (c != '"' && c != 0 && c != EOF) { result += c; c = read_char(line, col); } - if (c == EOF) { + if (c == 0 || c == EOF) { eggyyerror("This quotation mark is unterminated."); } @@ -1224,7 +1224,7 @@ eat_c_comment() { last_c = '\0'; c = read_char(line, col); - while (c != EOF && !(last_c == '*' && c == '/')) { + while (c != 0 && c != EOF && !(last_c == '*' && c == '/')) { if (last_c == '/' && c == '*') { std::ostringstream errmsg; errmsg << "This comment contains a nested /* symbol at line " @@ -1236,7 +1236,7 @@ eat_c_comment() { c = read_char(line, col); } - if (c == EOF) { + if (c == 0 || c == EOF) { eggyyerror("This comment marker is unclosed."); } diff --git a/panda/src/egg/lexer.lxx b/panda/src/egg/lexer.lxx index 88aed62e46..c4b6f88028 100644 --- a/panda/src/egg/lexer.lxx +++ b/panda/src/egg/lexer.lxx @@ -250,12 +250,12 @@ scan_quoted_string() { int c; c = read_char(line, col); - while (c != '"' && c != EOF) { + while (c != '"' && c != 0 && c != EOF) { result += c; c = read_char(line, col); } - if (c == EOF) { + if (c == 0 || c == EOF) { eggyyerror("This quotation mark is unterminated."); } @@ -279,7 +279,7 @@ eat_c_comment() { last_c = '\0'; c = read_char(line, col); - while (c != EOF && !(last_c == '*' && c == '/')) { + while (c != 0 && c != EOF && !(last_c == '*' && c == '/')) { if (last_c == '/' && c == '*') { std::ostringstream errmsg; errmsg << "This comment contains a nested /* symbol at line " @@ -291,7 +291,7 @@ eat_c_comment() { c = read_char(line, col); } - if (c == EOF) { + if (c == 0 || c == EOF) { eggyyerror("This comment marker is unclosed."); }