Bug 921816 - Handle idls in --with-libxul-sdk builds. r=gps

This commit is contained in:
Mike Hommey 2013-11-07 10:37:44 +09:00
parent d9f4c2ee4b
commit 47f95a5be2
7 changed files with 24 additions and 5 deletions

View File

@ -622,8 +622,13 @@ endif
endif
# Default location of include files
ifndef LIBXUL_SDK
IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser
IDL_PARSER_CACHE_DIR = $(DEPTH)/xpcom/idl-parser
else
IDL_PARSER_DIR = $(LIBXUL_SDK)/sdk/bin
IDL_PARSER_CACHE_DIR = $(LIBXUL_SDK)/sdk/bin
endif
SDK_LIB_DIR = $(DIST)/sdk/lib
SDK_BIN_DIR = $(DIST)/sdk/bin

View File

@ -49,6 +49,10 @@ idlprocess := $(PYTHON_PATH) $(PLY_INCLUDE) -I$(IDL_PARSER_DIR) -I$(IDL_PARSER_C
$(process_py) --cache-dir $(IDL_PARSER_CACHE_DIR) $(dist_idl_dir) \
$(dist_include_dir) $(idl_xpt_dir) $(idl_deps_dir)
ifdef LIBXUL_SDK
idlprocess += -I$(LIBXUL_SDK)/idl
endif
xpidl_modules := @xpidl_modules@
@xpidl_rules@

View File

@ -622,8 +622,13 @@ endif
endif
# Default location of include files
ifndef LIBXUL_SDK
IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser
IDL_PARSER_CACHE_DIR = $(DEPTH)/xpcom/idl-parser
else
IDL_PARSER_DIR = $(LIBXUL_SDK)/sdk/bin
IDL_PARSER_CACHE_DIR = $(LIBXUL_SDK)/sdk/bin
endif
SDK_LIB_DIR = $(DIST)/sdk/lib
SDK_BIN_DIR = $(DIST)/sdk/bin

View File

@ -26,6 +26,8 @@ if not CONFIG['LIBXUL_SDK']:
add_tier_dir('base', ['mozglue', 'memory/mozalloc'])
add_tier_dir('precompile', 'xpcom/xpidl')
# Bring in the configuration for the configured application.
if CONFIG['COMPILE_ENVIRONMENT']:
include('/' + CONFIG['MOZ_BUILD_APP'] + '/app.mozbuild')

View File

@ -24,7 +24,7 @@ from mozbuild.pythonutil import iter_modules_in_path
from mozbuild.util import FileAvoidWrite
def process(input_dir, cache_dir, header_dir, xpt_dir, deps_dir, module, stems):
def process(input_dir, inc_paths, cache_dir, header_dir, xpt_dir, deps_dir, module, stems):
p = IDLParser(outputdir=cache_dir)
xpts = {}
@ -40,7 +40,7 @@ def process(input_dir, cache_dir, header_dir, xpt_dir, deps_dir, module, stems):
idl_data = open(path).read()
idl = p.parse(idl_data, filename=path)
idl.resolve([input_dir], p)
idl.resolve([input_dir] + inc_paths, p)
header_path = os.path.join(header_dir, '%s.h' % stem)
deps_path = os.path.join(deps_dir, '%s.pp' % stem)
@ -81,10 +81,12 @@ def main(argv):
help='Final module name to use for linked output xpt file.')
parser.add_argument('idls', nargs='+',
help='Source .idl file(s). Specified as stems only.')
parser.add_argument('-I', dest='incpath', action='append', default=[],
help='Extra directories where to look for included .idl files.')
args = parser.parse_args(argv)
process(args.inputdir, args.cache_dir, args.headerdir, args.xptdir,
args.depsdir, args.module, args.idls)
process(args.inputdir, args.incpath, args.cache_dir, args.headerdir,
args.xptdir, args.depsdir, args.module, args.idls)
if __name__ == '__main__':
main(sys.argv[1:])

View File

@ -6,7 +6,6 @@
PARALLEL_DIRS += [
'idl-parser',
'xpidl',
]
DIRS += [

View File

@ -3,7 +3,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
export::
ifndef LIBXUL_SDK
$(call SUBMAKE,xpidl-parser,$(DEPTH)/xpcom/idl-parser)
endif
$(call py_action,process_install_manifest,$(DIST)/idl $(DEPTH)/_build_manifests/install/dist_idl)
$(call SUBMAKE,xpidl,$(DEPTH)/config/makefiles/xpidl)