Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / build / scripts / rule_bison.py
index 97a0541..870f3b5 100644 (file)
@@ -50,6 +50,13 @@ bisonExe = 'bison'
 if len(sys.argv) > 3:
     bisonExe = sys.argv[3]
 
+pathToBison = os.path.split(bisonExe)[0]
+if pathToBison:
+    # Make sure this path is in the path so that it can find its auxiliary
+    # binaries (in particular, m4). To avoid other 'm4's being found, insert
+    # at head, rather than tail.
+    os.environ['PATH'] = pathToBison + os.pathsep + os.environ['PATH']
+
 inputName = os.path.basename(inputFile)
 assert inputName == 'CSSGrammar.y' or inputName == 'XPathGrammar.y'
 prefix = {'CSSGrammar.y': 'cssyy', 'XPathGrammar.y': 'xpathyy'}[inputName]