Skip to content

Commit

Permalink
Bug 1043869 - Derive build dependencies for programs and libraries fr…
Browse files Browse the repository at this point in the history
…om make backend data instead of getting them from expandlibs. r=mshal
  • Loading branch information
glandium committed Jul 28, 2014
1 parent c48f53e commit 99fdc4c
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 105 deletions.
4 changes: 2 additions & 2 deletions config/config.mk
Expand Up @@ -758,8 +758,8 @@ CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(topsrcdir)/config/createprecomple
# MDDEPDIR is the subdirectory where dependency files are stored
MDDEPDIR := .deps

EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$@.pp --target $@)
EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$@.pp)
EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py
EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py
EXPAND_AR = $(EXPAND_LIBS_EXEC) --extract -- $(AR)
EXPAND_CC = $(EXPAND_LIBS_EXEC) --uselist -- $(CC)
EXPAND_CCC = $(EXPAND_LIBS_EXEC) --uselist -- $(CCC)
Expand Down
8 changes: 0 additions & 8 deletions config/expandlibs.py
Expand Up @@ -133,13 +133,5 @@ def _expand_desc(self, arg):
return objs
return [arg]

class ExpandLibsDeps(ExpandArgs):
'''Same as ExpandArgs, but also adds the library descriptor to the list'''
def _expand_desc(self, arg):
objs = super(ExpandLibsDeps, self)._expand_desc(arg)
if os.path.exists(arg + conf.LIBS_DESC_SUFFIX):
objs += [relativize(arg + conf.LIBS_DESC_SUFFIX)]
return objs

if __name__ == '__main__':
print " ".join(ExpandArgs(sys.argv[1:]))
28 changes: 0 additions & 28 deletions config/expandlibs_exec.py
Expand Up @@ -28,8 +28,6 @@
relativize,
isDynamicLib,
isObject,
ensureParentDir,
ExpandLibsDeps,
)
import expandlibs_config as conf
from optparse import OptionParser
Expand Down Expand Up @@ -315,10 +313,6 @@ def print_command(out, args):

def main():
parser = OptionParser()
parser.add_option("--depend", dest="depend", metavar="FILE",
help="generate dependencies for the given execution and store it in the given file")
parser.add_option("--target", dest="target", metavar="FILE",
help="designate the target for dependencies")
parser.add_option("--extract", action="store_true", dest="extract",
help="when a library has no descriptor file, extract it first, when possible")
parser.add_option("--uselist", action="store_true", dest="uselist",
Expand All @@ -330,15 +324,6 @@ def main():

(options, args) = parser.parse_args()

if not options.target:
options.depend = False
if options.depend:
deps = ExpandLibsDeps(args)
# Filter out common command wrappers
while os.path.basename(deps[0]) in ['ccache', 'distcc']:
deps.pop(0)
# Remove command
deps.pop(0)
with ExpandArgsMore(args) as args:
if options.extract:
args.extract()
Expand All @@ -361,19 +346,6 @@ def main():
sys.stderr.flush()
if proc.returncode:
exit(proc.returncode)
if not options.depend:
return
ensureParentDir(options.depend)
mk = Makefile()
deps = [dep for dep in deps if os.path.isfile(dep) and dep != options.target
and os.path.abspath(dep) != os.path.abspath(options.depend)]
no_dynamic_lib = [dep for dep in deps if not isDynamicLib(dep)]
mk.create_rule([options.target]).add_dependencies(no_dynamic_lib)
if len(deps) != len(no_dynamic_lib):
mk.create_rule(['%s_order_only' % options.target]).add_dependencies(dep for dep in deps if isDynamicLib(dep))

with open(options.depend, 'w') as depfile:
mk.dump(depfile, removal_guard=True)

if __name__ == '__main__':
main()
11 changes: 1 addition & 10 deletions config/expandlibs_gen.py
Expand Up @@ -9,7 +9,7 @@
import sys
import os
import expandlibs_config as conf
from expandlibs import LibDescriptor, isObject, ensureParentDir, ExpandLibsDeps
from expandlibs import LibDescriptor, isObject, ensureParentDir
from optparse import OptionParser

def generate(args):
Expand All @@ -29,8 +29,6 @@ def generate(args):

if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--depend", dest="depend", metavar="FILE",
help="generate dependencies for the given execution and store it in the given file")
parser.add_option("-o", dest="output", metavar="FILE",
help="send output to the given file")

Expand All @@ -41,10 +39,3 @@ def generate(args):
ensureParentDir(options.output)
with open(options.output, 'w') as outfile:
print >>outfile, generate(args)
if options.depend:
ensureParentDir(options.depend)
with open(options.depend, 'w') as depfile:
deps = ExpandLibsDeps(args)
depfile.write("%s : %s\n" % (options.output, ' '.join(deps)))
for dep in deps:
depfile.write("%s :\n" % dep)
2 changes: 1 addition & 1 deletion config/makefiles/debugmake.mk
Expand Up @@ -51,11 +51,11 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $
SIMPLE_PROGRAMS \
LIBRARY \
SHARED_LIBRARY \
SHARED_LIBRARY_LIBS \
LIBS \
DEF_FILE \
IMPORT_LIBRARY \
STATIC_LIBS \
SHARED_LIBS \
EXTRA_DSO_LDOPTS \
DEPENDENT_LIBS \
)
Expand Down
40 changes: 18 additions & 22 deletions config/rules.mk
Expand Up @@ -82,7 +82,7 @@ ifdef COMPILE_ENVIRONMENT
# which stuff links.
SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS)
INCLUDES += -I$(DIST)/include/testing
LIBS += $(NSPR_LIBS)
EXTRA_LIBS += $(NSPR_LIBS)

ifndef MOZ_PROFILE_GENERATE
CPP_UNIT_TESTS_FILES = $(CPP_UNIT_TESTS)
Expand Down Expand Up @@ -565,11 +565,7 @@ everything::
$(MAKE) clean
$(MAKE) all

ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
$(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
endif

HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX),$(HOST_LIBS))
STATIC_LIBS_DEPS := $(addsuffix .$(LIBS_DESC_SUFFIX),$(STATIC_LIBS))

# Dependencies which, if modified, should cause everything to rebuild
GLOBAL_DEPS += Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk
Expand Down Expand Up @@ -676,11 +672,11 @@ alltags:
# PROGRAM = Foo
# creates OBJS, links with LIBS to create Foo
#
$(PROGRAM): $(PROGOBJS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
$(REPORT_BUILD)
@$(RM) $@.manifest
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
$(EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
$(EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f '$(srcdir)/$@.manifest'; then \
Expand All @@ -701,7 +697,7 @@ ifdef MOZ_PROFILE_GENERATE
touch -t `date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
endif
else # !WINNT || GNU_CC
$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE) $(STLPORT_LIBS)
$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE) $(STLPORT_LIBS)
$(call CHECK_BINARY,$@)
endif # WINNT && !GNU_CC

Expand All @@ -712,7 +708,7 @@ ifdef MOZ_POST_PROGRAM_COMMAND
$(MOZ_POST_PROGRAM_COMMAND) $@
endif

$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
$(EXPAND_LIBS_EXEC) -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
Expand Down Expand Up @@ -746,18 +742,18 @@ endif
# SIMPLE_PROGRAMS = Foo Bar
# creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
#
$(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
$(EXPAND_LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
$(EXPAND_LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
rm -f $@.manifest; \
fi
endif # MSVC with manifest tool
else
$(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(STLPORT_LIBS)
$(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(STLPORT_LIBS)
$(call CHECK_BINARY,$@)
endif # WINNT && !GNU_CC

Expand All @@ -768,7 +764,7 @@ ifdef MOZ_POST_PROGRAM_COMMAND
$(MOZ_POST_PROGRAM_COMMAND) $@
endif

$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
$(EXPAND_LIBS_EXEC) -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
Expand All @@ -785,16 +781,16 @@ EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
OBJS += $(DTRACE_PROBE_OBJ)
endif

$(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(STATIC_LIBS_DEPS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS)) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
$(RM) $(LIBRARY)
$(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(SHARED_LIBRARY_LIBS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS))
$(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(STATIC_LIBS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS))

$(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(STATIC_LIBS_DEPS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS)) $(EXTRA_DEPS) $(GLOBAL_DEPS)
# When we only build a library descriptor, blow out any existing library
$(REPORT_BUILD)
$(if $(filter %.$(LIB_SUFFIX),$(LIBRARY)),,$(RM) $(REAL_LIBRARY))
$(EXPAND_LIBS_GEN) -o $@ $(OBJS) $(SHARED_LIBRARY_LIBS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS))
$(EXPAND_LIBS_GEN) -o $@ $(OBJS) $(STATIC_LIBS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS))

ifeq ($(OS_ARCH),WINNT)
# Import libraries are created by the rules creating shared libraries.
Expand Down Expand Up @@ -829,7 +825,7 @@ endif
# symlinks back to the originals. The symlinks are a no-op for stabs debugging,
# so no need to conditionalize on OS version or debugging format.

$(SHARED_LIBRARY): $(OBJS) $(RESFILE) $(LIBRARY) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(SHARED_LIBRARY): $(OBJS) $(RESFILE) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifndef INCREMENTAL_LINKER
$(RM) $@
Expand All @@ -838,10 +834,10 @@ ifdef DTRACE_LIB_DEPENDENT
ifndef XP_MACOSX
dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
endif
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS))
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS))
@$(RM) $(DTRACE_PROBE_OBJ)
else # ! DTRACE_LIB_DEPENDENT
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS))
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS))
endif # DTRACE_LIB_DEPENDENT
$(call CHECK_BINARY,$@)

Expand Down Expand Up @@ -1383,7 +1379,7 @@ endif
# it.

ifneq (,$(filter-out all chrome default export realchrome clean clobber clobber_all distclean realclean,$(MAKECMDGOALS)))
MDDEPEND_FILES := $(strip $(wildcard $(addprefix $(MDDEPDIR)/,$(EXTRA_MDDEPEND_FILES) $(addsuffix .pp,$(notdir $(sort $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS))) $(TARGETS)))))
MDDEPEND_FILES := $(strip $(wildcard $(addprefix $(MDDEPDIR)/,$(EXTRA_MDDEPEND_FILES) $(addsuffix .pp,$(notdir $(sort $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS)))))))

ifneq (,$(MDDEPEND_FILES))
$(call include_deps,$(MDDEPEND_FILES))
Expand Down
20 changes: 1 addition & 19 deletions config/tests/unit-expandlibs.py
Expand Up @@ -36,7 +36,7 @@

config = sys.modules['expandlibs_config'] = imp.new_module('expandlibs_config')

from expandlibs import LibDescriptor, ExpandArgs, relativize, ExpandLibsDeps
from expandlibs import LibDescriptor, ExpandArgs, relativize
from expandlibs_gen import generate
from expandlibs_exec import ExpandArgsMore, SectionFinder

Expand Down Expand Up @@ -196,24 +196,6 @@ def test_expand(self):
args = ExpandArgs(['foo', '-bar'] + self.arg_files + [self.tmpfile('liby', Lib('y'))])
self.assertRelEqual(args, ['foo', '-bar'] + self.files + [self.tmpfile('liby', Lib('y'))])

class TestExpandLibsDeps(TestExpandInit):
def test_expandlibsdeps(self):
'''Test library expansion for dependencies'''
# Dependency list for a library with a descriptor is equivalent to
# the arguments expansion, to which we add each descriptor
args = self.arg_files + [self.tmpfile('liby', Lib('y'))]
self.assertRelEqual(ExpandLibsDeps(args), ExpandArgs(args) + [self.tmpfile('libx', Lib('x') + config.LIBS_DESC_SUFFIX), self.tmpfile('liby', Lib('y') + config.LIBS_DESC_SUFFIX)])

# When a library exists at the same time as a descriptor, the
# descriptor is not a dependency
self.touch([self.tmpfile('libx', Lib('x'))])
args = self.arg_files + [self.tmpfile('liby', Lib('y'))]
self.assertRelEqual(ExpandLibsDeps(args), ExpandArgs(args) + [self.tmpfile('liby', Lib('y') + config.LIBS_DESC_SUFFIX)])

self.touch([self.tmpfile('liby', Lib('y'))])
args = self.arg_files + [self.tmpfile('liby', Lib('y'))]
self.assertRelEqual(ExpandLibsDeps(args), ExpandArgs(args))

class TestExpandArgsMore(TestExpandInit):
def test_makelist(self):
'''Test grouping object files in lists'''
Expand Down
31 changes: 16 additions & 15 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Expand Up @@ -1155,10 +1155,10 @@ def _build_target_for_obj(obj):
return '%s/%s' % (obj.relobjdir, obj.KIND)

def _process_linked_libraries(self, obj, backend_file):
def recurse_lib(lib):
def recursive_get_shared_libs(lib):
for l in lib.linked_libraries:
if isinstance(l, StaticLibrary):
for q in recurse_lib(l):
for q in recursive_get_shared_libs(l):
yield q
else:
yield l
Expand Down Expand Up @@ -1199,30 +1199,31 @@ def pretty_relpath(lib):
relpath = pretty_relpath(lib)
if isinstance(obj, Library):
if isinstance(lib, StaticLibrary):
backend_file.write_once('SHARED_LIBRARY_LIBS += %s/%s\n'
% (relpath, lib.lib_name))
for l in recurse_lib(lib):
backend_file.write_once('EXTRA_DSO_LDOPTS += %s/%s\n'
backend_file.write_once('STATIC_LIBS += %s/%s\n'
% (relpath, lib.import_name))
if isinstance(obj, SharedLibrary):
for l in recursive_get_shared_libs(lib):
backend_file.write_once('SHARED_LIBS += %s/%s\n'
% (pretty_relpath(l), l.import_name))
elif isinstance(obj, SharedLibrary):
assert lib.variant != lib.COMPONENT
backend_file.write_once('EXTRA_DSO_LDOPTS += %s/%s\n'
% (relpath, lib.import_name))
backend_file.write_once('SHARED_LIBS += %s/%s\n'
% (relpath, lib.import_name))
elif isinstance(obj, (Program, SimpleProgram)):
if isinstance(lib, StaticLibrary):
backend_file.write_once('LIBS += %s/%s\n'
% (relpath, lib.lib_name))
for l in recurse_lib(lib):
backend_file.write_once('EXTRA_LIBS += %s/%s\n'
backend_file.write_once('STATIC_LIBS += %s/%s\n'
% (relpath, lib.import_name))
for l in recursive_get_shared_libs(lib):
backend_file.write_once('SHARED_LIBS += %s/%s\n'
% (pretty_relpath(l), l.import_name))
else:
assert lib.variant != lib.COMPONENT
backend_file.write_once('EXTRA_LIBS += %s/%s\n'
% (relpath, lib.import_name))
backend_file.write_once('SHARED_LIBS += %s/%s\n'
% (relpath, lib.import_name))
elif isinstance(obj, (HostLibrary, HostProgram, HostSimpleProgram)):
assert isinstance(lib, HostLibrary)
backend_file.write_once('HOST_LIBS += %s/%s\n'
% (relpath, lib.lib_name))
% (relpath, lib.import_name))

def _write_manifests(self, dest, manifests):
man_dir = mozpath.join(self.environment.topobjdir, '_build_manifests',
Expand Down

0 comments on commit 99fdc4c

Please sign in to comment.