Bug 528367 - generate ipdl_{lex,yacc}tab.py in the objdir, not the srcdir
--- a/ipc/ipdl/Makefile.in
+++ b/ipc/ipdl/Makefile.in
@@ -35,16 +35,20 @@
# ***** END LICENSE BLOCK *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
+
+GARBAGE_DIRS += _ipdlheaders
+GARBAGE += ipdl_lextab.py ipdl_yacctab.py
+
include $(topsrcdir)/config/rules.mk
IPDLDIRS = \
dom/plugins \
dom/ipc \
netwerk/ipc \
netwerk/protocol/http/src \
ipc/ipdl/test/cxx \
--- a/ipc/ipdl/ipdl/parser.py
+++ b/ipc/ipdl/ipdl/parser.py
@@ -35,20 +35,16 @@ from ply import lex, yacc
from ipdl.ast import *
def _getcallerpath():
'''Return the absolute path of the file containing the code that
**CALLED** this function.'''
return os.path.abspath(sys._getframe(1).f_code.co_filename)
-# we want PLY to generate its output in the module directory, not wherever
-# the user chooses to run ipdlc from
-_thisdir, _ = os.path.split(_getcallerpath())
-
##-----------------------------------------------------------------------------
class ParseError(Exception):
def __init__(self, loc, fmt, *args):
self.loc = loc
self.error = ('%s%s: error: %s'% (
Parser.includeStackString(), loc, fmt)) % args
def __str__(self):
@@ -87,22 +83,20 @@ class Parser:
def parse(self, input, filename, includedirs, errout):
assert os.path.isabs(filename)
if filename in Parser.parsed:
return Parser.parsed[filename].tu
self.lexer = lex.lex(debug=self.debug,
optimize=not self.debug,
- lextab="ipdl_lextab",
- outputdir=_thisdir)
+ lextab="ipdl_lextab")
self.parser = yacc.yacc(debug=self.debug,
optimize=not self.debug,
- tabmodule="ipdl_yacctab",
- outputdir=_thisdir)
+ tabmodule="ipdl_yacctab")
self.filename = filename
self.includedirs = includedirs
self.tu.filename = filename
self.errout = errout
Parser.parsed[filename] = self
Parser.parseStack.append(Parser.current)
Parser.current = self