Bug 908977 - Generate XPIDL-derived headers directly into dist/include; r=glandium

This commit is contained in:
Gregory Szorc 2013-09-04 16:52:56 -07:00
parent c0095d92cc
commit 2a957a50ed
3 changed files with 5 additions and 23 deletions

View File

@ -18,4 +18,4 @@
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 627487 - random test failures caused by bookmark JSON changes
Bug 908977 - Generate XPIDL headers directly into dist/include

View File

@ -44,9 +44,6 @@ include $(topsrcdir)/config/rules.mk
# For dependency files.
idl_deps_dir := .deps
# Where generated headers go.
idl_headers_dir := headers
# Where we put our final, linked .xpt files.
idl_xpt_dir := xpt
@ -58,23 +55,18 @@ process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
# in the virtualenv.
idlprocess := $(PYTHON_PATH) $(PLY_INCLUDE) -I$(IDL_PARSER_DIR) -I$(IDL_PARSER_CACHE_DIR) \
$(process_py) --cache-dir $(IDL_PARSER_CACHE_DIR) $(dist_idl_dir) \
$(idl_headers_dir) $(idl_xpt_dir) $(idl_deps_dir)
$(dist_include_dir) $(idl_xpt_dir) $(idl_deps_dir)
xpidl_headers := @xpidl_headers@
xpidl_modules := @xpidl_modules@
@xpidl_rules@
dist_headers := $(addprefix $(dist_include_dir)/,$(xpidl_headers))
linked_xpt_files := $(addprefix $(idl_xpt_dir)/,$(addsuffix .xpt,$(xpidl_modules)))
depends_files := $(foreach root,$(xpidl_modules),$(idl_deps_dir)/$(root).pp)
$(dist_headers): $(dist_include_dir)/%.h: $(idl_headers_dir)/%.h
$(INSTALL) $< $(dist_include_dir)
xpidl:: $(linked_xpt_files)
xpidl:: $(linked_xpt_files) $(dist_headers)
$(linked_xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(idl_headers_dir) $(idl_xpt_dir))
$(linked_xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir) $(idl_xpt_dir))
$(call include_deps,$(depends_files))

View File

@ -392,7 +392,7 @@ class RecursiveMakeBackend(CommonBackend):
build_files = self._purge_manifests['xpidl']
for p in ('Makefile', 'backend.mk', '.deps/.mkdir.done',
'headers/.mkdir.done', 'xpt/.mkdir.done'):
'xpt/.mkdir.done'):
build_files.add(p)
for idl in manager.idls.values():
@ -400,13 +400,11 @@ class RecursiveMakeBackend(CommonBackend):
idl['basename'])
self._install_manifests['dist_include'].add_optional_exists('%s.h'
% idl['root'])
build_files.add(mozpath.join('headers', '%s.h' % idl['root']))
for module in manager.modules:
build_files.add(mozpath.join('xpt', '%s.xpt' % module))
build_files.add(mozpath.join('.deps', '%s.pp' % module))
headers = sorted('%s.h' % idl['root'] for idl in manager.idls.values())
modules = manager.modules
xpt_modules = sorted(modules.keys())
rules = []
@ -431,13 +429,6 @@ class RecursiveMakeBackend(CommonBackend):
'',
])
# Set up linkage so make knows headers come from $(idlprocess).
h = ['$(idl_headers_dir)/%s.h' % dep for dep in deps]
rules.extend([
'%s: $(idl_xpt_dir)/%s.xpt' % (' '.join(h), module),
'',
])
# Create dependency for output header so we force regeneration if the
# header was deleted. This ideally should not be necessary. However,
# some processes (such as PGO at the time this was implemented) wipe
@ -448,7 +439,6 @@ class RecursiveMakeBackend(CommonBackend):
result = self.environment.create_config_file(out_path, extra=dict(
xpidl_rules='\n'.join(rules),
xpidl_modules=' '.join(xpt_modules),
xpidl_headers=' '.join(headers),
))
self._update_from_avoid_write(result)
self.summary.managed_count += 1