summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-02 18:16:23 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:23 +1000
commit93a099c2de1939f86a8d2f56ec19c18db0b98a3a (patch)
tree7272c199f67e0554b69f9c62540c60ca300c6584 /buildtools/wafsamba
parent470c14cbf383631683355f723d219a12dc0998e8 (diff)
downloadsamba-93a099c2de1939f86a8d2f56ec19c18db0b98a3a.tar.gz
samba-93a099c2de1939f86a8d2f56ec19c18db0b98a3a.tar.bz2
samba-93a099c2de1939f86a8d2f56ec19c18db0b98a3a.zip
build: loop until all object reductions are complete
we will issue a warning if any object duplication remains
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/samba_deps.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index a05092f525..08a24db5bb 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -582,6 +582,8 @@ def reduce_objects(bld, tgt_list):
for t in tgt_list:
t.extended_objects = None
+ changed = False
+
for type in ['BINARY', 'PYTHON', 'LIBRARY']:
for t in tgt_list:
if t.samba_type != type: continue
@@ -601,11 +603,16 @@ def reduce_objects(bld, tgt_list):
rely_on[l] = rely_on[l].union(dup)
t.final_objects = new
+ if not changed:
+ return False
+
# add back in any objects that were relied upon by the reduction rules
for r in rely_on:
t = bld.name_to_obj(r, bld.env)
t.final_objects = t.final_objects.union(rely_on[r])
+ return True
+
def calculate_final_deps(bld, tgt_list, loops):
'''calculate the final library and object dependencies'''
@@ -655,8 +662,13 @@ def calculate_final_deps(bld, tgt_list, loops):
t.final_libs = t.final_libs.union(diff)
# remove objects that are also available in linked libs
- reduce_objects(bld, tgt_list)
- reduce_objects(bld, tgt_list)
+ count = 0
+ while reduce_objects(bld, tgt_list):
+ count += 1
+ if count > 100:
+ print("WARNING: Unable to remove all inter-target object duplicates")
+ break
+ debug('deps: Object reduction took %u iterations', count)
# add in any syslib dependencies
for t in tgt_list: