[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Mon May 3 09:18:21 MDT 2010


The branch, master has been updated
       via  6d1e8c5... build: use the waf patterns for RPATH
       via  0003bb4... s4-waf: fixed target group for SOCKET_WRAPPER
       via  b3d8a71... build: added a check for group ordering within target dependencies
       via  8bc5194... build: fix for combined configure/build in one command
      from  4affc58... s3-lanman: before trying to call spoolss_ClosePrinter make sure we have a connection.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6d1e8c58350803f2c380a332c13edc4528faa417
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon May 3 16:37:33 2010 +0200

    build: use the waf patterns for RPATH
    
    Use the self.env.RPATH variable to set the RPATH for each target. This
    gives consistent ordering of the link command, ensuring that we don't
    get rebuilds if we ask for a --targets= build after a normal build.
    
    This also means we are now using the RPATH_ST pattern, which means we
    can potentially support compilers that don't use -Wl,xxx as the
    command line for rpath support

commit 0003bb460bf25b894ddb0f864f22feaa25eb49e5
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon May 3 16:05:19 2010 +0200

    s4-waf: fixed target group for SOCKET_WRAPPER

commit b3d8a7136a4c71fa73baa745f7e2ef137d82ce46
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon May 3 16:04:56 2010 +0200

    build: added a check for group ordering within target dependencies
    
    If target A depends on target B, then target B must not be in a later
    build group from target A
    
    Pair-Programmed-With: Thomas Nagy

commit 8bc5194b048d050b2d3ff30a5636f1567ec19e1e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon May 3 15:12:29 2010 +0200

    build: fix for combined configure/build in one command
    
    This is a fix from ita for "waf distclean configure build". Running
    it as one command failed with missing config.h

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_deps.py         |   47 +++++++++++++++++++++++++++++
 buildtools/wafsamba/samba_install.py      |   14 ++++----
 buildtools/wafsamba/samba_optimisation.py |   13 ++++++--
 buildtools/wafsamba/samba_utils.py        |    6 +--
 lib/socket_wrapper/wscript_build          |    1 +
 5 files changed, 67 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index e0c76e4..d00fe7f 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -282,6 +282,49 @@ def check_orpaned_targets(bld, tgt_list):
                 Logs.warn("Target %s of type %s is unused by any other target" % (t.sname, type))
 
 
+def check_group_ordering(bld, tgt_list):
+    '''see if we have any dependencies that violate the group ordering
+
+    It is an error for a target to depend on a target from a later
+    build group
+    '''
+
+    def group_name(g):
+        tm = bld.task_manager
+        return [x for x in tm.groups_names if id(tm.groups_names[x]) == id(g)][0]
+
+    for g in bld.task_manager.groups:
+        gname = group_name(g)
+        for t in g.tasks_gen:
+            t.samba_group = gname
+
+    grp_map = {}
+    idx = 0
+    for g in bld.task_manager.groups:
+        name = group_name(g)
+        grp_map[name] = idx
+        idx += 1
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    ret = True
+    for t in tgt_list:
+        tdeps = getattr(t, 'add_objects', []) + getattr(t, 'uselib_local', [])
+        for d in tdeps:
+            t2 = bld.name_to_obj(d, bld.env)
+            if t2 is None:
+                continue
+            map1 = grp_map[t.samba_group]
+            map2 = grp_map[t2.samba_group]
+
+            if map2 > map1:
+                Logs.error("Target %r in build group %r depends on target %r from later build group %r" % (
+                           t.sname, t.samba_group, t2.sname, t2.samba_group))
+                ret = False
+
+    return ret
+
+
 def show_final_deps(bld, tgt_list):
     '''show the final dependencies for all targets'''
 
@@ -914,6 +957,10 @@ def check_project_rules(bld):
         Logs.error("Duplicate sources present - aborting")
         sys.exit(1)
 
+    if not check_group_ordering(bld, tgt_list):
+        Logs.error("Bad group ordering - aborting")
+        sys.exit(1)
+
     show_final_deps(bld, tgt_list)
 
     debug('deps: project rules checking completed - %u targets checked',
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index 55aab26..9030c19 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -11,7 +11,7 @@ O755 = 493
 
 @feature('install_bin')
 @after('apply_core')
- at before('apply_link')
+ at before('apply_link', 'apply_obj_vars')
 def install_binary(self):
     '''install a binary, taking account of the different rpath varients'''
     bld = self.bld
@@ -22,7 +22,7 @@ def install_binary(self):
 
     if not Options.is_install or not self.samba_install:
         # just need to set rpath if we are not installing
-        self.env.append_value('LINKFLAGS', build_ldflags)
+        self.env.RPATH = build_ldflags
         return
 
     # work out the install path, expanding variables
@@ -38,7 +38,7 @@ def install_binary(self):
         self.target += '.inst'
 
     # setup the right rpath link flags for the install
-    self.env.append_value('LINKFLAGS', install_ldflags)
+    self.env.RPATH = install_ldflags
 
     # tell waf to install the right binary
     bld.install_as(os.path.join(install_path, orig_target),
@@ -49,7 +49,7 @@ def install_binary(self):
 
 @feature('install_lib')
 @after('apply_core')
- at before('apply_link')
+ at before('apply_link', 'apply_obj_vars')
 def install_library(self):
     '''install a library, taking account of the different rpath varients'''
     if getattr(self, 'done_install_library', False):
@@ -62,7 +62,7 @@ def install_library(self):
 
     if not Options.is_install or not self.samba_install:
         # just need to set the build rpath if we are not installing
-        self.env.append_value('LINKFLAGS', build_ldflags)
+        self.env.RPATH = build_ldflags
         return
 
     # setup the install path, expanding variables
@@ -76,11 +76,11 @@ def install_library(self):
         self.done_install_library = True
         t = self.clone('default')
         t.target += '.inst'
-        self.env.append_value('LINKFLAGS', build_ldflags)
+        self.env.RPATH = build_ldflags
     else:
         t = self
 
-    t.env.append_value('LINKFLAGS', install_ldflags)
+    t.env.RPATH = install_ldflags
 
     dev_link     = None
 
diff --git a/buildtools/wafsamba/samba_optimisation.py b/buildtools/wafsamba/samba_optimisation.py
index 8e8012c..1c3478c 100644
--- a/buildtools/wafsamba/samba_optimisation.py
+++ b/buildtools/wafsamba/samba_optimisation.py
@@ -9,11 +9,16 @@
 from TaskGen import feature, after
 import preproc
 
-kak = {}
 @feature('cc', 'cxx')
 @after('apply_type_vars', 'apply_lib_vars', 'apply_core')
 def apply_incpaths(self):
 	lst = []
+
+	try:
+		kak = self.bld.kak
+	except AttributeError:
+		kak = self.bld.kak = {}
+
 	# TODO move the uselib processing out of here
 	for lib in self.to_list(self.uselib):
 		for path in self.env['CPPPATH_' + lib]:
@@ -52,7 +57,6 @@ def apply_incpaths(self):
 		if node:
 			self.env.append_value('INC_PATHS', node)
 
-cac = {}
 @feature('cc')
 @after('apply_incpaths')
 def apply_obj_vars_cc(self):
@@ -63,7 +67,10 @@ def apply_obj_vars_cc(self):
 
     lss = env['_CCINCFLAGS']
 
-    global cac
+    try:
+         cac = self.bld.cac
+    except AttributeError:
+         cac = self.bld.cac = {}
 
     # local flags come first
     # set the user-defined includes paths
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index b989f91..335313e 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -64,9 +64,8 @@ def ADD_LD_LIBRARY_PATH(path):
 def install_rpath(bld):
     '''the rpath value for installation'''
     bld.env['RPATH'] = []
-    bld.env['RPATH_ST'] = []
     if bld.env.RPATH_ON_INSTALL:
-        return ['-Wl,-rpath=%s/lib' % bld.env.PREFIX]
+        return ['%s/lib' % bld.env.PREFIX]
     return []
 
 
@@ -74,9 +73,8 @@ def build_rpath(bld):
     '''the rpath value for build'''
     rpath = os.path.normpath('%s/%s' % (bld.env.BUILD_DIRECTORY, LIB_PATH))
     bld.env['RPATH'] = []
-    bld.env['RPATH_ST'] = []
     if bld.env.RPATH_ON_BUILD:
-        return ['-Wl,-rpath=%s' % rpath]
+        return [rpath]
     ADD_LD_LIBRARY_PATH(rpath)
     return []
 
diff --git a/lib/socket_wrapper/wscript_build b/lib/socket_wrapper/wscript_build
index 9fc05e5..b860fbe 100644
--- a/lib/socket_wrapper/wscript_build
+++ b/lib/socket_wrapper/wscript_build
@@ -2,5 +2,6 @@
 
 bld.SAMBA_SUBSYSTEM('SOCKET_WRAPPER',
                     source='socket_wrapper.c',
+                    group='base_libraries',
                     deps='replace')
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list