waf: added automatic prototyping of static module init functions
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 03:57:57 +0000 (14:57 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 07:55:19 +0000 (18:55 +1100)
this avoids the need to manually list all our static init functions in
the code

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

buildtools/wafsamba/samba_deps.py

index 7471118722405bc1fb8bead1cf205fc2b8fb8757..bf196564969d4c80b69cdd5d42f136e63d6db931 100644 (file)
@@ -210,6 +210,8 @@ def add_init_functions(self):
 
     if modules == []:
         cflags.append('-DSTATIC_%s_MODULES=%s' % (sname.replace('-','_'), sentinal))
+        if sentinal == 'NULL':
+            cflags.append('-DSTATIC_%s_MODULES_PROTO' % sname.replace('-','_'))
         self.ccflags = cflags
         return
 
@@ -222,8 +224,14 @@ def add_init_functions(self):
                 init_fn_list.append(d['INIT_FUNCTION'])
         if init_fn_list == []:
             cflags.append('-DSTATIC_%s_MODULES=%s' % (m, sentinal))
+            if sentinal == 'NULL':
+                cflags.append('-DSTATIC_%s_MODULES_PROTO' % m)
         else:
             cflags.append('-DSTATIC_%s_MODULES=%s' % (m, ','.join(init_fn_list) + ',' + sentinal))
+            proto=''
+            for f in init_fn_list:
+                proto = proto + '_MODULE_PROTO(%s)' % f
+            cflags.append('-DSTATIC_%s_MODULES_PROTO=%s' % (m, proto))
     self.ccflags = cflags