waf: more agressively expand subsystem syslib deps
authorAndrew Tridgell <tridge@samba.org>
Wed, 3 Nov 2010 01:23:43 +0000 (12:23 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 3 Nov 2010 02:17:30 +0000 (02:17 +0000)
this solves an openchange build problem with an indirect dependency on
talloc when talloc is a syslib

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov  3 02:17:30 UTC 2010 on sn-devel-104

buildtools/wafsamba/samba_deps.py

index 13b11ff09680c8ae3a8cf6bace4ab14fd89bca6d..60f2fa98cda613f2ca108539fb8b59046d0ed334 100644 (file)
@@ -90,7 +90,12 @@ def build_dependencies(self):
 
     if self.samba_type in ['SUBSYSTEM']:
         # this is needed for the ccflags of libs that come from pkg_config
-        self.uselib = list(self.direct_syslibs)
+        self.uselib = list(self.final_syslibs)
+        self.uselib.extend(list(self.direct_syslibs))
+        for lib in self.final_libs:
+            t = self.bld.name_to_obj(lib, self.bld.env)
+            self.uselib.extend(list(t.final_syslibs))
+        self.uselib = unique_list(self.uselib)
 
     if getattr(self, 'uselib', None):
         up_list = []
@@ -352,10 +357,10 @@ def show_final_deps(bld, tgt_list):
     targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
 
     for t in tgt_list:
-        if not targets[t.sname] in ['LIBRARY', 'BINARY', 'PYTHON']:
+        if not targets[t.sname] in ['LIBRARY', 'BINARY', 'PYTHON', 'SUBSYSTEM']:
             continue
         debug('deps: final dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
-              t.sname, t.uselib, t.uselib_local, t.add_objects)
+              t.sname, t.uselib, getattr(t, 'uselib_local', []), getattr(t, 'add_objects', []))
 
 
 def add_samba_attributes(bld, tgt_list):
@@ -860,7 +865,7 @@ def calculate_final_deps(bld, tgt_list, loops):
 
     # add in any syslib dependencies
     for t in tgt_list:
-        if not t.samba_type in ['BINARY','PYTHON','LIBRARY']:
+        if not t.samba_type in ['BINARY','PYTHON','LIBRARY','SUBSYSTEM']:
             continue
         syslibs = set()
         for d in t.final_objects: