diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-03-26 13:02:39 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-06 20:27:07 +1000 |
commit | 5e94bca62e646fb4cc84a375f0c741dab4916abe (patch) | |
tree | a4fbf1c2b53cf133448d6a15c6cb8748236a18bd | |
parent | ecafbd3ec8b03f773d04a5e7b305a91aa08e18a5 (diff) | |
download | samba-5e94bca62e646fb4cc84a375f0c741dab4916abe.tar.gz samba-5e94bca62e646fb4cc84a375f0c741dab4916abe.tar.bz2 samba-5e94bca62e646fb4cc84a375f0c741dab4916abe.zip |
build: a better way of calculating syslib dependencies
-rw-r--r-- | buildtools/wafsamba/samba_deps.py | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index 3d3af21259..e3955f3582 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -82,7 +82,6 @@ def build_dependencies(self): # extra link flags from pkg_config libs = self.final_syslibs.copy() - libs = libs.union(self.indirect_libs) (ccflags, ldflags) = library_flags(self, list(libs)) new_ldflags = getattr(self, 'ldflags', []) @@ -410,32 +409,6 @@ def indirect_libs(bld, t, chain, loops): return ret -def indirect_syslibs(bld, t, chain, loops): - '''recursively calculate the indirect system library dependencies for a target - - An indirect syslib results from a subsystem dependency - ''' - - ret = getattr(t, 'indirect_syslibs', None) - if ret is not None: - return ret - - ret = set() - for obj in t.direct_objects: - if obj in chain: - dependency_loop(loops, t, obj) - continue - chain.add(obj) - t2 = bld.name_to_obj(obj, bld.env) - r2 = indirect_syslibs(bld, t2, chain, loops) - chain.remove(obj) - ret = ret.union(t2.direct_syslibs) - ret = ret.union(r2) - - t.indirect_syslibs = ret - return ret - - def indirect_objects(bld, t, chain, loops): '''recursively calculate the indirect object dependencies for a target @@ -586,16 +559,10 @@ def break_dependency_loops(bld, tgt_list): debug('deps: setting %s %s to %s', t.sname, attr, objs) setattr(t, attr, objs) - # now calculate the indirect syslibs, which can change from the loop expansion - for t in tgt_list: - indirect_syslibs(bld, t, set(), loops) - - def calculate_final_deps(bld, tgt_list, loops): '''calculate the final library and object dependencies''' for t in tgt_list: # start with the maximum possible list - t.final_syslibs = t.direct_syslibs.union(indirect_syslibs(bld, t, set(), loops)) t.final_libs = t.direct_libs.union(indirect_libs(bld, t, set(), loops)) t.final_objects = t.direct_objects.union(indirect_objects(bld, t, set(), loops)) @@ -653,6 +620,21 @@ def calculate_final_deps(bld, tgt_list, loops): debug('deps: Expanded target %s by loop %s libraries %s', t.sname, loop, diff) t.final_libs = t.final_libs.union(diff) + # add in any syslib dependencies + for t in tgt_list: + if not t.samba_type in ['BINARY','PYTHON','LIBRARY']: + continue + syslibs = set() + for d in t.final_objects: + t2 = bld.name_to_obj(d, bld.env) + syslibs = syslibs.union(t2.direct_syslibs) + # this adds the indirect syslibs as well, which may not be needed + # depending on the linker flags + for d in t.final_libs: + t2 = bld.name_to_obj(d, bld.env) + syslibs = syslibs.union(t2.direct_syslibs) + t.final_syslibs = syslibs + debug('deps: removed duplicate dependencies') |