waf: cope with subsystems with no static modules
authorAndrew Tridgell <tridge@samba.org>
Sat, 30 Oct 2010 00:21:35 +0000 (11:21 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 30 Oct 2010 12:49:00 +0000 (23:49 +1100)
we still need the STATIC_xx_MODULES define when there are no static
modules. It contains just the sentinal.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

buildtools/wafsamba/samba_deps.py

index 56af446df316e744cd75e6a242dd2bd9e9a8688c..8dc1350c73250c3ec2c77977f29149185169f38a 100644 (file)
@@ -225,14 +225,16 @@ def add_init_functions(self):
     if m is not None:
         modules.append(m)
 
-    if modules == []:
-        return
-
     sentinal = getattr(self, 'init_function_sentinal', 'NULL')
 
     targets    = LOCAL_CACHE(bld, 'TARGET_TYPE')
-
     cflags = getattr(self, 'samba_cflags', [])[:]
+
+    if modules == []:
+        cflags.append('-DSTATIC_%s_MODULES=%s' % (sname.replace('-','_'), sentinal))
+        self.ccflags = cflags
+        return
+
     for m in modules:
         bld.ASSERT(m in subsystems,
                    "No init_function defined for module '%s' in target '%s'" % (m, self.sname))