Skip to content

Commit

Permalink
Bug 737006 - Use internal ply only if needed. r=khuey
Browse files Browse the repository at this point in the history
  • Loading branch information
t-matsuu committed Apr 6, 2012
1 parent 8e7f750 commit 16959e4
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 34 deletions.
5 changes: 5 additions & 0 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -837,3 +837,8 @@ EXPAND_LIBNAME = $(foreach lib,$(1),$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
endif
EXPAND_LIBNAME_PATH = $(foreach lib,$(1),$(2)/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
EXPAND_MOZLIBNAME = $(foreach lib,$(1),$(DIST)/lib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))

# Include internal ply only if needed
ifndef MOZ_SYSTEM_PLY
PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
endif
4 changes: 2 additions & 2 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ xpidl-preqs = \
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
@if test -n "$(findstring $*.h, $(EXPORTS))"; \
Expand All @@ -1456,7 +1456,7 @@ ifndef NO_GEN_XPT
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
-I$(topsrcdir)/xpcom/typelib/xpt/tools \
$(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
Expand Down
24 changes: 13 additions & 11 deletions dom/bindings/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# # License, v. 2.0. If a copy of the MPL was not distributed with this file,
# # You can obtain one at http://mozilla.org/MPL/2.0/.
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

DEPTH = ../..
topsrcdir = @top_srcdir@
Expand Down Expand Up @@ -75,18 +75,20 @@ bindinggen_dependencies := \
$(binding_header_files): %Binding.h: $(bindinggen_dependencies) \
$(webidl_base)/%.webidl \
$(NULL)
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply -I$(srcdir)/parser \
$(srcdir)/BindingGen.py $(ACCESSOR_OPT) header $(srcdir)/Bindings.conf $*Binding \
$(webidl_base)/$*.webidl
$(PYTHON_PATH) \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/BindingGen.py $(ACCESSOR_OPT) header \
$(srcdir)/Bindings.conf $*Binding \
$(webidl_base)/$*.webidl

$(binding_cpp_files): %Binding.cpp: $(bindinggen_dependencies) \
$(webidl_base)/%.webidl \
$(NULL)
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply -I$(srcdir)/parser \
$(srcdir)/BindingGen.py $(ACCESSOR_OPT) cpp $(srcdir)/Bindings.conf $*Binding \
$(webidl_base)/$*.webidl
$(PYTHON_PATH) \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/BindingGen.py $(ACCESSOR_OPT) cpp \
$(srcdir)/Bindings.conf $*Binding \
$(webidl_base)/$*.webidl

$(globalgen_targets): ParserResults.pkl

Expand All @@ -108,7 +110,7 @@ $(CACHE_DIR)/.done:
ParserResults.pkl: $(globalgen_dependencies) \
$(addprefix $(webidl_base)/, $(webidl_files))
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply -I$(srcdir)/parser \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/GlobalGen.py $(ACCESSOR_OPT) $(srcdir)/Bindings.conf $(webidl_base) \
--cachedir=$(CACHE_DIR) \
$(webidl_files)
Expand Down
12 changes: 6 additions & 6 deletions ipc/ipdl/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ include $(topsrcdir)/config/rules.mk
# NB: the IPDL compiler manages .ipdl-->.h/.cpp dependencies itself,
# which is why we don't have explicit .h/.cpp targets here
export:: $(ALL_IPDLSRCS)
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(srcdir)/ipdl.py \
--outheaders-dir=_ipdlheaders \
--outcpp-dir=. \
$(IPDLDIRS:%=-I$(topsrcdir)/%) \
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
$(srcdir)/ipdl.py \
--outheaders-dir=_ipdlheaders \
--outcpp-dir=. \
$(IPDLDIRS:%=-I$(topsrcdir)/%) \
$^

# We #include some things in the dom/plugins/ directory that rely on
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ check::
@$(PYTHON) $(srcdir)/runtests.py \
$(srcdir)/ok $(srcdir)/error \
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
$(topsrcdir)/ipc/ipdl/ipdl.py \
OKTESTS $(OKTESTS) \
ERRORTESTS $(ERRORTESTS)
5 changes: 5 additions & 0 deletions js/src/config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -837,3 +837,8 @@ EXPAND_LIBNAME = $(foreach lib,$(1),$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
endif
EXPAND_LIBNAME_PATH = $(foreach lib,$(1),$(2)/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
EXPAND_MOZLIBNAME = $(foreach lib,$(1),$(DIST)/lib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))

# Include internal ply only if needed
ifndef MOZ_SYSTEM_PLY
PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
endif
4 changes: 2 additions & 2 deletions js/src/config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ xpidl-preqs = \
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
@if test -n "$(findstring $*.h, $(EXPORTS))"; \
Expand All @@ -1456,7 +1456,7 @@ ifndef NO_GEN_XPT
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
-I$(topsrcdir)/xpcom/typelib/xpt/tools \
$(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
Expand Down
20 changes: 10 additions & 10 deletions js/xpconnect/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ dom_quickstubs.cpp: $(srcdir)/dom_quickstubs.qsconf \
$(topsrcdir)/xpcom/idl-parser/header.py \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(DEPTH)/js/src/js-confdefs.h
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(srcdir)/qsgen.py \
--idlpath=$(DEPTH)/dist/idl \
Expand All @@ -171,8 +171,8 @@ dombindings_gen.h: $(srcdir)/dombindings.conf \
$(topsrcdir)/xpcom/idl-parser/header.py \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(DEPTH)/js/src/js-confdefs.h
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(srcdir)/dombindingsgen.py \
--idlpath=$(DEPTH)/dist/idl \
Expand All @@ -188,8 +188,8 @@ dombindings_gen.cpp: $(srcdir)/dombindings.conf \
$(topsrcdir)/xpcom/idl-parser/header.py \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(DEPTH)/js/src/js-confdefs.h
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(srcdir)/dombindingsgen.py \
--idlpath=$(DEPTH)/dist/idl \
Expand All @@ -207,8 +207,8 @@ DictionaryHelpers.h: $(srcdir)/dictionary_helper_gen.conf \
$(topsrcdir)/xpcom/idl-parser/header.py \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(DEPTH)/js/src/js-confdefs.h
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(srcdir)/dictionary_helper_gen.py \
-I $(DEPTH)/dist/idl \
Expand All @@ -222,8 +222,8 @@ DictionaryHelpers.cpp: $(srcdir)/dictionary_helper_gen.conf \
$(topsrcdir)/xpcom/idl-parser/header.py \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(DEPTH)/js/src/js-confdefs.h
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/other-licenses/ply \
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(srcdir)/dictionary_helper_gen.py \
-I $(DEPTH)/dist/idl \
Expand Down
4 changes: 2 additions & 2 deletions xpcom/idl-parser/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ include $(topsrcdir)/config/rules.mk
# Generate the PLY lexer and parser.
export:: $(PARSER_SRCS) $(PLY_PROGS)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(topsrcdir)/xpcom/idl-parser/header.py --cachedir=. --regen

check::
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
$(PLY_INCLUDE) \
-I$(topsrcdir)/xpcom/idl-parser \
$(topsrcdir)/xpcom/idl-parser/runtests.py

Expand Down

0 comments on commit 16959e4

Please sign in to comment.