build: check the type of implied dependencies
authorAndrew Tridgell <tridge@samba.org>
Tue, 13 Apr 2010 01:41:13 +0000 (11:41 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 13 Apr 2010 01:41:20 +0000 (11:41 +1000)
an implied dependency needs to be a library or module

buildtools/wafsamba/samba_deps.py

index cca2febda9e5792491976cb7e4b1a5f78c43d8b5..fbc322383f6648692680d4fb02c9377f95cadff3 100644 (file)
@@ -339,8 +339,14 @@ def build_direct_deps(bld, tgt_list):
                     for implied in TO_LIST(syslib_deps[d]):
                         if BUILTIN_LIBRARY(bld, implied):
                             t.direct_objects.add(implied)
-                        else:
+                        elif targets[implied] == 'SYSLIB':
+                            t.direct_syslibs.add(implied)
+                        elif targets[implied] in ['LIBRARY', 'MODULE']:
                             t.direct_libs.add(implied)
+                        else:
+                            Logs.error('Implied dependency %s in %s is of type %s' % (
+                                implied, t.sname, targets[implied]))
+                            sys.exit(1)
                 continue
             t2 = bld.name_to_obj(d, bld.env)
             if t2 is None:
@@ -486,6 +492,11 @@ def includes_objects(bld, t, chain, inc_loops):
             continue
         chain.add(lib)
         t2 = bld.name_to_obj(lib, bld.env)
+        if t2 is None:
+            targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+            Logs.error('Target %s of type %s not found in direct_libs for %s' % (
+                lib, targets[lib], t.sname))
+            sys.exit(1)
         r2 = includes_objects(bld, t2, chain, inc_loops)
         chain.remove(lib)
         ret = ret.union(t2.direct_objects)