s4-waf: fixed some of the group ordering
authorAndrew Tridgell <tridge@samba.org>
Tue, 30 Mar 2010 09:21:21 +0000 (20:21 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:18 +0000 (20:27 +1000)
We need to try to keep targets in the right groups

buildtools/wafsamba/samba_utils.py
buildtools/wafsamba/wafsamba.py
lib/replace/wscript
source4/heimdal_build/wscript_build

index 4230d8066f5b67c816be94e4bf9031c9ec2a954d..5bff769400d3f8b5b10ed805172fd087f50a4c9e 100644 (file)
@@ -241,22 +241,36 @@ def ENFORCE_GROUP_ORDERING(bld):
     if Options.options.compile_targets:
         @feature('*')
         def force_previous_groups(self):
-            my_id = id(self)
+            if getattr(self.bld, 'enforced_group_ordering', False) == True:
+                return
+            self.bld.enforced_group_ordering = True
+
+            def group_name(g):
+                tm = self.bld.task_manager
+                return [x for x in tm.groups_names if id(tm.groups_names[x]) == id(g)][0]
 
+            my_id = id(self)
             bld = self.bld
             stop = None
             for g in bld.task_manager.groups:
                 for t in g.tasks_gen:
                     if id(t) == my_id:
                         stop = id(g)
+                        debug('group: Forcing up to group %s', group_name(g))
                         break
-                if stop is None:
-                    return
+                if stop != None:
+                    break
+            if stop is None:
+                return
 
-                for g in bld.task_manager.groups:
-                    if id(g) == stop:
-                        break
-                    for t in g.tasks_gen:
+            for g in bld.task_manager.groups:
+                if id(g) == stop:
+                    break
+                debug('group: Forcing group %s', group_name(g))
+                for t in g.tasks_gen:
+                    if getattr(t, 'forced_groups', False) != True:
+                        debug('group: Posting %s', t.name or t.target)
+                        t.forced_groups = True
                         t.post()
 Build.BuildContext.ENFORCE_GROUP_ORDERING = ENFORCE_GROUP_ORDERING
 
index 2f3120d6e9cefeef4929334e64170d98e48e8051..3f48de4ca68120940d795166b3d5308bfab8c32f 100644 (file)
@@ -252,8 +252,6 @@ def SAMBA_BINARY(bld, binname, source,
     if needs_python:
         features += ' pyembed'
 
-    bld.SET_BUILD_GROUP(group)
-
     obj_target = binname + '.objlist'
 
     source = bld.EXPAND_VARIABLES(source, vars=vars)
@@ -272,6 +270,8 @@ def SAMBA_BINARY(bld, binname, source,
                         needs_python   = needs_python,
                         local_include  = local_include)
 
+    bld.SET_BUILD_GROUP(group)
+
     # the library itself will depend on that object target
     deps = TO_LIST(deps)
     deps.append(obj_target)
@@ -484,7 +484,7 @@ Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
 
 
 def SAMBA_GENERATOR(bld, name, rule, source, target,
-                    group='build_source', enabled=True,
+                    group='generators', enabled=True,
                     public_headers=None,
                     header_path=None,
                     vars=None):
@@ -535,6 +535,9 @@ def SETUP_BUILD_GROUPS(bld):
     bld.add_group('setup')
     bld.add_group('build_compiler_source')
     bld.add_group('base_libraries')
+    bld.add_group('generators')
+    bld.add_group('compiler_prototypes')
+    bld.add_group('compiler_libraries')
     bld.add_group('build_compilers')
     bld.add_group('build_source')
     bld.add_group('prototypes')
index bdfea8712f80202c0a87827ed19cdde66e46b127..cc718939e1338cf3f1aaa4bfc7afeb844814b932 100644 (file)
@@ -316,15 +316,20 @@ def build(bld):
     if not bld.CONFIG_SET('HAVE_SOCKETPAIR'): NET_SOURCES.append('socketpair.c')
     if not bld.CONFIG_SET('HAVE_GETADDRINFO'):NET_SOURCES.append('getaddrinfo.c')
 
-    bld.SAMBA_SUBSYSTEM('LIBREPLACE_NETWORK', NET_SOURCES, deps='replace')
+    bld.SAMBA_SUBSYSTEM('LIBREPLACE_NETWORK', NET_SOURCES,
+                        group='base_libraries',
+                        deps='replace')
 
 
     CRYPT_SOURCES = []
     if not 'HAVE_CRYPT' in bld.env: CRYPT_SOURCES.append('crypt.c')
 
-    bld.SAMBA_SUBSYSTEM('LIBREPLACE_EXT', CRYPT_SOURCES)
+    bld.SAMBA_SUBSYSTEM('LIBREPLACE_EXT',
+                        CRYPT_SOURCES,
+                        group='base_libraries')
 
     bld.SAMBA_SUBSYSTEM('LIBREPLACE_GETPASS', 'getpass.c',
+                        group='base_libraries',
                         enabled=bld.CONFIG_SET('REPLACE_GETPASS'))
 
     # build replacements for stdint.h and stdbool.h if needed
index c70e719e433faddc4c386527168cc48ce30382de..70c57f2b0ac2e8945b0ade92128d2e5d04aad79f 100644 (file)
@@ -369,6 +369,7 @@ bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_PROGNAME_H',
         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
         includes='../heimdal/lib/roken',
        deps='replace',
+        group='compiler_libraries',
         enabled=not bld.CONFIG_SET('HAVE_GETPROGNAME')
        )
 
@@ -378,6 +379,7 @@ bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_CLOSEFROM_H',
         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
         includes='../heimdal/lib/roken',
        deps='replace',
+        group='compiler_libraries',
         enabled=not bld.CONFIG_SET('HAVE_CLOSEFROM')
        )
 
@@ -386,6 +388,7 @@ bld.SAMBA_SUBSYSTEM('HEIMDAL_ROKEN_H',
        '../heimdal/lib/roken/base64.c ../heimdal/lib/roken/ct.c ../heimdal/lib/roken/hex.c ../heimdal/lib/roken/bswap.c ../heimdal/lib/roken/dumpdata.c ../heimdal/lib/roken/emalloc.c ../heimdal/lib/roken/ecalloc.c ../heimdal/lib/roken/getarg.c ../heimdal/lib/roken/get_window_size.c ../heimdal/lib/roken/getdtablesize.c ../heimdal/lib/roken/h_errno.c ../heimdal/lib/roken/issuid.c ../heimdal/lib/roken/net_read.c ../heimdal/lib/roken/net_write.c ../heimdal/lib/roken/socket.c ../heimdal/lib/roken/parse_time.c ../heimdal/lib/roken/parse_units.c ../heimdal/lib/roken/resolve.c ../heimdal/lib/roken/roken_gethostby.c ../heimdal/lib/roken/signal.c ../heimdal/lib/roken/vis.c ../heimdal/lib/roken/strlwr.c ../heimdal/lib/roken/strsep_copy.c ../heimdal/lib/roken/strsep.c ../heimdal/lib/roken/strupr.c ../heimdal/lib/roken/strpool.c ../heimdal/lib/roken/estrdup.c ../heimdal/lib/roken/erealloc.c ../heimdal/lib/roken/simple_exec.c ../heimdal/lib/roken/strcollect.c ../heimdal/lib/roken/strerror_r.c ../heimdal/lib/roken/rtbl.c ../heimdal/lib/roken/cloexec.c ../heimdal/lib/roken/xfree.c replace.c',
        includes='../heimdal/lib/roken',
         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1',
+        group='compiler_libraries',
        deps='HEIMDAL_ROKEN_PROGNAME_H HEIMDAL_ROKEN_CLOSEFROM_H resolv LIBREPLACE_NETWORK'
        )
 
@@ -559,12 +562,12 @@ HEIMDAL_HEIM_ASN1_DER_SOURCE = '''
 
 bld.HEIMDAL_AUTOPROTO('../heimdal/lib/asn1/der-protos.h',
                       HEIMDAL_HEIM_ASN1_DER_SOURCE,
-                      group = 'build_compilers',
+                      group = 'compiler_prototypes',
                       options="-q -P comment -o")
 
 
 bld.HEIMDAL_AUTOPROTO('../heimdal/lib/asn1/der-private.h',
                       HEIMDAL_HEIM_ASN1_DER_SOURCE,
-                      group = 'build_compilers',
+                      group = 'compiler_prototypes',
                       options="-q -P comment -p")