summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-10-13 13:58:25 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-10-13 14:10:42 +0200
commit870de461cbc42f48ab67c4ba0e768e10580924c5 (patch)
treece7861b528b2e282ae69ee74a5d96c51f721dbb5
parentffb71f8ee3f21f56be66cd94aea054e7efcfcbaf (diff)
downloadsamba-870de461cbc42f48ab67c4ba0e768e10580924c5.tar.gz
samba-870de461cbc42f48ab67c4ba0e768e10580924c5.tar.bz2
samba-870de461cbc42f48ab67c4ba0e768e10580924c5.zip
wafsamba: Don't allow circular dependencies involving libraries by
default.
-rw-r--r--buildtools/wafsamba/samba_deps.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 8bd8ad31ce..553a91a81a 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -13,6 +13,12 @@ def ADD_GLOBAL_DEPENDENCY(ctx, dep):
ctx.env.GLOBAL_DEPENDENCIES.append(dep)
+@conf
+def BREAK_CIRCULAR_LIBRARY_DEPENDENCIES(ctx):
+ '''indicate that circular dependencies between libraries should be broken.'''
+ ctx.env.ALLOW_CIRCULAR_LIB_DEPENDENCIES = True
+
+
def TARGET_ALIAS(bld, target, alias):
'''define an alias for a target name'''
cache = LOCAL_CACHE(bld, 'TARGET_ALIAS')
@@ -706,13 +712,17 @@ def calculate_final_deps(bld, tgt_list, loops):
for l in t.final_libs.copy():
t2 = bld.name_to_obj(l, bld.env)
if t.sname in t2.final_libs:
- # we could break this in either direction. If one of the libraries
- # has a version number, and will this be distributed publicly, then
- # we should make it the lower level library in the DAG
- Logs.warn('deps: removing library loop %s from %s' % (t.sname, t2.sname))
- dependency_loop(loops, t, t2.sname)
- t2.final_libs.remove(t.sname)
-
+ if getattr(bld.env, "ALLOW_CIRCULAR_LIB_DEPENDENCIES", False):
+ # we could break this in either direction. If one of the libraries
+ # has a version number, and will this be distributed publicly, then
+ # we should make it the lower level library in the DAG
+ Logs.warn('deps: removing library loop %s from %s' % (t.sname, t2.sname))
+ dependency_loop(loops, t, t2.sname)
+ t2.final_libs.remove(t.sname)
+ else:
+ Logs.error('ERROR: circular library dependency between %s and %s'
+ % (t.sname, t2.sname))
+ sys.exit(1)
for loop in loops:
debug('deps: Found dependency loops for target %s : %s', loop, loops[loop])